Patch level : 12.0 428
Files correlati : tf Commento : - Aggiunto controllo per bolla doganale, dal 01/01/2018 fallirà sempre - Aggiunto punto di test in tf0400 abilitato solo in debug - In tf0400f nel caso esista solo un nome/cognome dell'azienda viene automaticamente alzato il flag rsoc, prima dava errore - Aggiunta ivaXCassa insieme all'IVA differita in esigibilità IVA - Sistemata eliminazione record custom derivante da prima nota: oltre a eliminarlo adesso chiede se si vuole ricaricare il movimento originale - Aggiunta richiesta di modifica per l'imposta ogni volta che viene modificato l'imponibile o l'aliquota git-svn-id: svn://10.65.10.50/branches/R_10_00@24003 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
1d9ca81943
commit
c52c0945f4
@ -311,6 +311,12 @@ inline const char * noSpecial(char a)
|
||||
return "";
|
||||
}
|
||||
|
||||
bool bd2017()
|
||||
{
|
||||
static TDate today = TDate(TODAY), lastDay = TDate(31,12,2017);
|
||||
return today <= lastDay;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// TTrFa_record
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -1105,6 +1111,11 @@ bool TTrFa_app::tff0400(TSheet_field& sheet)
|
||||
|
||||
TVariant vtipocf = strarr->get(_tipocf), vcodcf = strarr->get(_codcf), voccas = strarr->get(_occas);
|
||||
|
||||
#ifdef DBG
|
||||
if(vtipocf.as_string() == "F" && vcodcf.as_string() == "358")
|
||||
bool tolla = true;
|
||||
#endif
|
||||
|
||||
TRectype r_cedeprest = getCli(vtipocf.as_string(), vcodcf.as_string(), voccas.as_string());
|
||||
TAnagrafica cedeprest;
|
||||
|
||||
@ -1149,7 +1160,8 @@ bool TTrFa_app::tff0400(TSheet_field& sheet)
|
||||
{
|
||||
// Ovviamente tutte le bolle doganali fatte prima del rilascio
|
||||
// non avranno questo campo compilato e quindi dovrò passare la partita IVA "OO99999999999"
|
||||
if(strcmp(strarr->get(_codnum),"BD") == 0)
|
||||
// Controllo anche di essere in una data entro il 31/12/2017, dopo tale data sto ragionamento non è valido
|
||||
if(strcmp(strarr->get(_codnum),"BD") == 0 && bd2017())
|
||||
{
|
||||
tff0400f.set("P4_FISCIVAPAESE", "OO");
|
||||
tff0400f.set("P4_FISCIVACOD", "99999999999");
|
||||
@ -1192,8 +1204,13 @@ bool TTrFa_app::tff0400(TSheet_field& sheet)
|
||||
{
|
||||
// Devo indovinare quale è il nome e il cognome
|
||||
TToken_string nomeCog(cedeprest.cognome(), ' '); // Notare il separatore spazio
|
||||
// Se ho solo un nominativo è una ditta per Diana
|
||||
if(nomeCog.items() == 1)
|
||||
{
|
||||
rsoc = true;
|
||||
}
|
||||
// Controllo se ho solo un nome e un cognome
|
||||
if(nomeCog.items() <= 2)
|
||||
else if(nomeCog.items() == 2)
|
||||
{
|
||||
tff0400f.set("P4_ANANOME", nomeCog.get(1));
|
||||
tff0400f.set("P4_ANACOGNOME", nomeCog.get(0));
|
||||
@ -1339,7 +1356,7 @@ bool TTrFa_app::tff2200(TToken_string* strarr, int nriga)
|
||||
real aliquota = cache().get("%IVA", strarr->get(_aliquota), "R0");
|
||||
tff2200f.set("PL_ALIQUOTAIVA", aliquota);
|
||||
TRectype thisMov = cache().get(LF_MOV, strarr->get(_numero));
|
||||
tff2200f.set("PL_ESIGIVA", is_split_payment(thisMov) ? "S" : is_IVA_diff(thisMov) ? "D" : "I");
|
||||
tff2200f.set("PL_ESIGIVA", is_split_payment(thisMov) ? "S" : is_IVA_diff(thisMov) || is_IVAxCassa(thisMov) ? "D" : "I");
|
||||
tff2200f.set("PL_NATURA", strarr->get(_natura));
|
||||
real det(strarr->get(_detraibile));
|
||||
// Nella conversione la vigola viene persa e 100,00 diventa 10.000 quindi divido
|
||||
|
@ -373,14 +373,14 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
CURRENCY A_IMPONIBILE 12
|
||||
NUMBER A_IMPONIBILE 12 2
|
||||
BEGIN
|
||||
PROMPT 42 8 "Imponibile"
|
||||
FIELD IMPORTO
|
||||
CHEKTYPE REQUIRED
|
||||
END
|
||||
|
||||
CURRENCY A_IMPOSTA 12
|
||||
NUMBER A_IMPOSTA 12 2
|
||||
BEGIN
|
||||
PROMPT 42 9 "Imposta "
|
||||
FIELD IMPOSTA
|
||||
|
@ -115,6 +115,8 @@ inline TDate toDate(const char * date) { return TDate(date).string(); }
|
||||
#define IF_IS_ENABLED(strarr) if(strcmp(strarr->get(_invio), FLAG_INVIO) != 0 && strcmp(strarr->get(_invio), FLAG_FORZATO) != 0) continue;
|
||||
// Ritorno il carattere senza accento maiuscolo
|
||||
inline const char * noSpecial(char a);
|
||||
// Ritorno se è ancora valida la bolla doganale senza informazioni fornitore
|
||||
bool bd2017();
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// TTrFa_record
|
||||
|
@ -123,7 +123,8 @@ bool TTrFa_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
if(imponibile > 0)
|
||||
{
|
||||
imposta = imponibile * real(cache().get("%IVA", o.get(), "R0")) / 100;
|
||||
o.mask().set(A_IMPOSTA, imposta.round(2).string());
|
||||
if(imposta != o.mask().get_real(A_IMPOSTA) && yesno_box("Aggiornare l'imposta?"))
|
||||
o.mask().set(A_IMPOSTA, imposta.round(2).string());
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -136,7 +137,8 @@ bool TTrFa_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
if(codiva != "")
|
||||
{
|
||||
imposta = imponibile * real(cache().get("%IVA", codiva, "R0")) / 100;
|
||||
o.mask().set(A_IMPOSTA, imposta.round(2).string());
|
||||
if(imposta != o.mask().get_real(A_IMPOSTA) && yesno_box("Aggiornare l'imposta?"))
|
||||
o.mask().set(A_IMPOSTA, imposta.round(2).string());
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -251,32 +253,38 @@ bool TTrFa_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
const long progr = o.mask().get_long(A_NUMERO);
|
||||
TString codalq = o.mask().get(A_ALIQUOTA);
|
||||
TString key; key << progr << "|" << codalq;
|
||||
if (progr >= MOV_CUSTOM)
|
||||
{
|
||||
if(cache().get(LF_TRASFATT, key).full())
|
||||
{
|
||||
TLocalisamfile trasfat(LF_TRASFATT);
|
||||
trasfat.put("NUMREG", progr);
|
||||
trasfat.put("CODIVA", codalq);
|
||||
const int err = trasfat.remove();
|
||||
if (err != NOERR)
|
||||
return error_box(FR("Errore di cancellazione: %d"), err);
|
||||
}
|
||||
// In qualsiasi caso elimino sta riga
|
||||
TSheet_field& sheet = sfield(F_RIGHE);
|
||||
// Vado a cercare la riga
|
||||
FOR_EACH_SHEET_ROW(sheet, r, strarr)
|
||||
{
|
||||
long thisProg;
|
||||
TString thisAlq;
|
||||
strarr->get(_numero, thisProg);
|
||||
strarr->get(_aliquota, thisAlq);
|
||||
if(thisProg == progr && thisAlq == codalq) break;
|
||||
}
|
||||
sheet.destroy(r); // Aggiorna in automatico
|
||||
}
|
||||
else
|
||||
if(cache().get(LF_TRASFATT, key).full())
|
||||
{
|
||||
TLocalisamfile trasfat(LF_TRASFATT);
|
||||
trasfat.put("NUMREG", progr);
|
||||
trasfat.put("CODIVA", codalq);
|
||||
const int err = trasfat.remove();
|
||||
if (err != NOERR)
|
||||
return error_box(FR("Errore di cancellazione: %d"), err);
|
||||
}
|
||||
else
|
||||
return error_box(TR("Riga non cancellabile"));
|
||||
|
||||
// Elimino la riga
|
||||
TSheet_field& sheet = sfield(F_RIGHE);
|
||||
// Vado a cercare la riga
|
||||
FOR_EACH_SHEET_ROW(sheet, r, strarr)
|
||||
{
|
||||
long thisProg;
|
||||
TString thisAlq;
|
||||
strarr->get(_numero, thisProg);
|
||||
strarr->get(_aliquota, thisAlq);
|
||||
if(thisProg == progr && thisAlq == codalq) break;
|
||||
}
|
||||
sheet.destroy(r); // Aggiorna in automatico
|
||||
|
||||
// Se ha cancellato un movimento custom che deriva dalla prima nota propongo di andarlo a ripescare
|
||||
if(progr < MOV_CUSTOM && yesno_box("Hai cancellato una riga custom di un movimento in prima nota, vuoi ricaricare la tabella?\n(Tutti i record verranno salvati per non perdere le modifiche!)"))
|
||||
{
|
||||
saveAll();
|
||||
load_sheet();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DLG_EMAIL:
|
||||
|
Loading…
x
Reference in New Issue
Block a user