Patch level : 12.0 344
Files correlati : Commento : Sistemato log e controllo sulle fatture git-svn-id: svn://10.65.10.50/branches/R_10_00@23603 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
388880bbba
commit
da36c82ed8
@ -66,11 +66,9 @@ const real TLi_manager::getPlaRes()
|
||||
|
||||
// Trovo tutti i documenti che mi interessano e sottraggo l'imponibile al plafond
|
||||
din.read('D', tipocf, codcli, year, tipi, stati, iniDicInt, ad);
|
||||
int i = 0;
|
||||
for(; i < din.items(); i++)
|
||||
{
|
||||
int j = 1; // Le righe partono da 1?
|
||||
|
||||
for(int i = 0; i < din.items(); i++)
|
||||
{
|
||||
TAssoc_array tabIva = din[i].tabella_iva(true);
|
||||
TString numerazione = din[i].numerazione();
|
||||
int numdoc = din[i].numero();
|
||||
@ -88,15 +86,15 @@ const real TLi_manager::getPlaRes()
|
||||
|
||||
bool TLi_manager::testPlafond(TLista_documenti dout, TLog_report& lerr)
|
||||
{
|
||||
bool ok = true;
|
||||
bool err = false;
|
||||
real resPlafond = getPlaRes();
|
||||
real testPlafond = getPlaRes();
|
||||
real totFatt;
|
||||
int i = 0;
|
||||
|
||||
// Faccio un ragionamento identico a getPlaRes, ma in input ho la lista di documenti appena elaborati
|
||||
for(; i < dout.items(); i++)
|
||||
for(int i = 0; i < dout.items(); i++)
|
||||
{
|
||||
int j = 1; // Le righe partono da 1?
|
||||
|
||||
TAssoc_array tabIva = dout[i].tabella_iva(true);
|
||||
TString numerazione = dout[i].numerazione();
|
||||
int numdoc = dout[i].numero();
|
||||
@ -105,25 +103,19 @@ bool TLi_manager::testPlafond(TLista_documenti dout, TLog_report& lerr)
|
||||
if(totali->cod_iva() == codiva)
|
||||
{
|
||||
resPlafond -= totali->imp_orig();
|
||||
totFatt += totali->imp_orig();
|
||||
}
|
||||
}
|
||||
if(resPlafond < 0)
|
||||
{
|
||||
ok = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(i < dout.items())
|
||||
{
|
||||
TString msgerr; msgerr << "\nSforato plafond cliente N." << dout[i].codcf();
|
||||
lerr.log(2, msgerr);
|
||||
}
|
||||
for(; i < dout.items(); i++)
|
||||
{
|
||||
TString msgerr; msgerr << "Errore doc. tipo: " << dout[i].tipo() << " N." << dout[i].numero() << " data: " << dout[i].data();
|
||||
lerr.log(2, msgerr); // 2 -> Errore
|
||||
err = true; // Alzo il flag dell'errore
|
||||
|
||||
TString msgerr;
|
||||
msgerr << "Sforato plafond cliente N." << dout[i].codcf() << "\nPlafond rimanente: " << resPlafond + totFatt << "\nTotale fatture generate: " << totFatt << "\nSforato di: " << resPlafond << "\n";
|
||||
lerr.log(2, msgerr); // 2 <- Errore
|
||||
}
|
||||
|
||||
return ok;
|
||||
return err;
|
||||
}
|
||||
|
||||
// TIPOCF, CODCLI, ANNO
|
||||
|
@ -398,7 +398,7 @@ bool TFatturazione_bolle_app::test_dicint(const TMask& m)
|
||||
TString msg(80);
|
||||
iw.set_max(tot_cli);
|
||||
|
||||
TLog_report lerr(TR("Errori controllo plafond"));
|
||||
TLog_report lerr(TR("Errori controllo plafond\n"));
|
||||
bool err = false;
|
||||
|
||||
for (int c = 0; c < tot_cli; c++)
|
||||
@ -420,7 +420,7 @@ bool TFatturazione_bolle_app::test_dicint(const TMask& m)
|
||||
TLista_documenti dout;
|
||||
if (eld.elabora(din, dout, data_elab))
|
||||
{
|
||||
err = currentCli.testPlafond(dout, lerr);
|
||||
err |= currentCli.testPlafond(dout, lerr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user