From 0a1ba17eb99cf7efc513c88134e5fb7baed9b8db Mon Sep 17 00:00:00 2001 From: mtollari Date: Mon, 29 May 2017 09:42:32 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=2012.?= =?UTF-8?q?0=20402=20Files=20correlati=20=20=20=20=20:=20tf=20Commento=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20:=20-=20Eliminata=20gestione?= =?UTF-8?q?=20crediti=20precedenti,=20alla=20fine=20bisogna=20mettere=20tu?= =?UTF-8?q?tto=20in=20credito=20periodo=20precedente.=20-=20Sistemata=20cr?= =?UTF-8?q?eazione=20data=5Fa,=20adesso=20prima=20viene=20generata=20con?= =?UTF-8?q?=20giorno=20=3D=201=20poi=20spostata=20con=20set=5Fend=5Fmonth(?= =?UTF-8?q?)=20-=20Tolto=20controllo=20tipo=20movimento=20!=3D=20tm=5Fness?= =?UTF-8?q?uno=20per=20due=20motivi:=201)=20=C3=A8=20valorizzato=20solo=20?= =?UTF-8?q?se=20si=20ha=20il=20saldaconto,=202)=20le=20righe=20movimento?= =?UTF-8?q?=20iva=20sono=20tutte=20da=20prendere=20-=20Tolta=20somma=20deg?= =?UTF-8?q?li=20indeducibili,=20vengono=20gi=C3=A0=20presi=20da=20RMOVIVA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/branches/R_10_00@23845 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/tf/tf0200.cpp | 50 ++++++++--------------------------------------- 1 file changed, 8 insertions(+), 42 deletions(-) diff --git a/src/tf/tf0200.cpp b/src/tf/tf0200.cpp index dc026a67d..50cb2d467 100644 --- a/src/tf/tf0200.cpp +++ b/src/tf/tf0200.cpp @@ -166,8 +166,7 @@ void calcolaCreditoPrec(real& creprec, real& creaprec, bool mensile, int anno, i { // Credito anno precedente /* Per calcolare il credito dell'anno precedente inizio a leggere i record precedenti su IVALIQ - * fino a quando ne trovo uno >= 0. - * Questi geni hanno messo la possibilità di mettere un valore <0 se voglio utilizzare del credito precedente */ + * fino a quando ne trovo uno >= 0. */ TRectype rowLia = getLIA(anno); if(mensile || (!mensile && ((mese - 1) % 3) == 0)) @@ -185,29 +184,8 @@ void calcolaCreditoPrec(real& creprec, real& creaprec, bool mensile, int anno, i if(rowLiq.get_int("MESE") >= mese) break; // Perchè li prende lo stesso? trovato = trovato || rowLiq.get_real("CREAPREC") > ZERO; + creprec = rowLiq.get_real("IVAVERC"); - // Non ho iva da versare, quindi ho dei crediti - if(rowLiq.get_real("IVAVER") == ZERO) - { - // Innanzitutto controllo il consumo del credito dell'anno precedente - real debito = rowLiq.get_real("IVADOV") + rowLiq.get_real("DEBPREC") + rowLiq.get_real("INTLIQTRI"); - - if(rowLiq.get_real("CREAPREC") >= ZERO) - creaprec = rowLiq.get_real("CREAPREC") - debito; - else // Sto utilizzando del credito dell'anno precedente! - creaprec += rowLiq.get_real("CREAPREC") - debito; - - // Se ho esaurito il credito dell'anno precedente consumo anche il credito precedente - if(creaprec < ZERO) - creaprec = ZERO; - // Sottraggo dal credito totale quello dell'anno precedente per calcolare il rimanente - creprec = rowLiq.get_real("IVAVERC") - creaprec; - } - else - { - creprec = ZERO; - creaprec = ZERO; - } } /* Se non ho trovato nessun valore positivo (i negativi senza nessun positivo prima non sono validi) * vado a leggere la liquidazione di quest'anno */ @@ -437,7 +415,7 @@ void ComLiqPerIva_mask::extractinator() // Per gli amici GTFO for(; start <= end; start++) { TDate data_da(1, start, anno); - TDate data_a(31, start, anno); + TDate data_a(1, start, anno); data_a.set_end_month(); bool hasIXC = gestione_IVAxCassa(data_da); /**************************************************************************************************************** @@ -496,9 +474,10 @@ void ComLiqPerIva_mask::extractinator() // Per gli amici GTFO for(bool ok = curIva.move_first(); ok; ok = curIva.move_next()) { + TString totat, totpas, i; // Controllo che sia un movimento con codice non "non soggetto" TCodiceIVA codiva(curIva.get("25.CODIVA").as_string()); - if(codiva.tipo() == "NS" || curIva.get("23.TIPOMOV").as_int() == tm_nessuno) continue; + if(codiva.tipo() == "NS") continue; // Prendo il tipo di registro int tiporeg = TRegistro(curIva.get("23.REG").as_string()).tipo(); @@ -528,32 +507,19 @@ void ComLiqPerIva_mask::extractinator() // Per gli amici GTFO } } - // 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); - TRectype pomTo(rpom.curr()); pomTo.put("COD" , "POM");pomTo.put("CODTAB", anno); - TCursor curPom(&rpom, "", 1, &pomFrom, &pomTo); - for(curPom = 0; curPom.pos() < curPom.items(); ++curPom) - { - TRectype rowPom = curPom.curr(); - if(atoi(rowPom.get("CODTAB").right(2)) != start) continue; - totoppas = totoppas + rowPom.get_real("R1"); // Art. 19 - totoppas = totoppas + rowPom.get_real("R9"); // Ricavi esenti - } - // Se ha attiva l'IVA x cassa calcolo le imposte (imponibili per comodità già calcolati sopra) if(hasIXC) { // IVA esigibile - real imponibile_diff, imposta_diff, imponibile_xcas, imposta_xcas; - imponibile_diff = imposta_diff = imponibile_xcas = imposta_xcas = ZERO; + real imposta_diff, imposta_xcas; + imposta_diff = imposta_xcas = ZERO; // 1 = Vendite calc_inc_diff(anno, start, REG_ATT, imposta_diff, imposta_xcas); ivaesxc = ivaesxc + imposta_xcas; ivaesdiff = ivaesdiff + imposta_diff; // IVA detraibile - imponibile_diff = imposta_diff = imponibile_xcas = imposta_xcas = ZERO; + imposta_diff = imposta_xcas = ZERO; // 2 = Acquisti calc_inc_diff(anno, start, REG_PAS, imposta_diff, imposta_xcas); ivadetxc = ivadetxc + imposta_xcas;