diff --git a/cg/cg7200.cpp b/cg/cg7200.cpp index 7213cd11f..14d0f8660 100755 --- a/cg/cg7200.cpp +++ b/cg/cg7200.cpp @@ -593,6 +593,10 @@ bool TInvioP::i_proforma_righe(TCursor& cur, TInvioP_file* trasfilerighe) //assoc array contenente tutti i diversi conti che incontrera' nello scanning delle righe iva TAssoc_array conti; + //causale del movimento: serve per conoscere il tipo di detraibilita' dell'iva (piu' sotto) + const TCausale caus(pn.curr().get(MOV_CODCAUS)); + const int anno = pn.curr().get_date(MOV_DATAREG).year(); + real imp_detr, iva_detr, imp_indetr, iva_indetr; //scanning delle righe iva alla ricerca dei conti che compaiono for (int l = 0; l < pn.iva_items(); l++) @@ -628,7 +632,12 @@ bool TInvioP::i_proforma_righe(TCursor& cur, TInvioP_file* trasfilerighe) } //accresce l'importo tot_imp relativo alla coppia codiva+codconto corrente - *tot_imp += pn.iva(l).get_real(RMI_IMPONIBILE); + const real imponibile = pn.iva(l).get_real(RMI_IMPONIBILE); + const real imposta = pn.iva(l).get_real(RMI_IMPOSTA); + const TString4 tipodet = pn.iva(l).get(RMI_TIPODET); + pn.analizza_riga_IVA(imponibile, imposta, caus, anno, codiva, tipodet, imp_detr, + iva_detr, imp_indetr, iva_indetr); + *tot_imp += imp_detr + imp_indetr + iva_indetr; //aggiungere qui eventuale imposta }