Patch level : 12.0 400

Files correlati     : tf
Commento            : Sistemato il calcolo del totale dei movimenti passivi con l'aggiunta dell'esclusione dei movimenti in rev charge e liquidazione differita

git-svn-id: svn://10.65.10.50/branches/R_10_00@23824 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
mtollari 2017-05-18 13:23:01 +00:00
parent b956d15022
commit 4988d9d489

View File

@ -510,6 +510,35 @@ void ComLiqPerIva_mask::extractinator() // Per gli amici GTFO
}
/* Il reverse charge va sottratto dal totale delle operazioni attive!
* Creo un cursore su MOV e RMOVIVA e sottraggo
*/
TString queryMov = "USE RMOVIVA\n";
queryMov << "SELECT BETWEEN(23.DATAREG,#DADATAREG,#ADATAREG)\n";
queryMov << "JOIN MOV INTO NUMREG==NUMREG\n";
TISAM_recordset cmov(queryMov);
cmov.set_var("#DADATAREG", TDate(01,start, anno));
cmov.set_var("#ADATAREG", TDate(31, start, anno));
for (bool ok = cmov.move_first(); ok; ok = cmov.move_next())
{
// Vado a prendere la prima riga in RMOV
TString key = cmov.get("23.NUMREG").as_string();
key << "|1";
TRectype rmov = cache().get(LF_RMOV, key);
// Controllo di essere sul registro vendite
bool regVen = TRegistro(cmov.get("23.REG").as_string()).tipo() == reg_att;
// Salto se il registro non è di tipo vendite o ci sono delle righe in RMOV
if(!regVen || !rmov.empty()) continue;
totopatt -= cmov.get("25.IMPONIBILE").as_real();
}
// Aggiungo gli indeducibili per articolo 19, e indeducibili su ricavi esenti
static TRelation rpom(LF_TAB);
TRectype pomFrom(rpom.curr()); pomFrom.put("COD", "POM");pomFrom.put("CODTAB", anno);