diff --git a/cg/cg0400.cpp b/cg/cg0400.cpp index 27083e936..0127b49a3 100755 --- a/cg/cg0400.cpp +++ b/cg/cg0400.cpp @@ -371,6 +371,18 @@ void TProgressivi_iva::look_pim() _iva1_array.add_riga(tipo,imponibile,imposta,detr); } break; + case acq_beni_riv: + tabiva.put("CODTAB",codiva); + if (tabiva.read() == NOERR) + // I non soggetti non vanno considerati nel totale acq. beni rivendita + if (tabiva.get("S1") != "NS") + { + if (_mese != 13) + _iva_array.add_riga(tipo,imponibile,imposta,ZERO); + if ((_st_inizio_anno && mese == _mese) || _mese == 13) + _iva1_array.add_riga(tipo,imponibile,imposta,ZERO); + } + break; default: if (_mese != 13) _iva_array.add_riga(tipo,imponibile,imposta,ZERO); @@ -400,6 +412,7 @@ void TProgressivi_iva::look_pim() void TProgressivi_iva::cerca_i_pim() { TTable pim("PIM"); + TTable tabiva("%IVA"); TTable reg("REG"); TString80 codtab; TString16 codatt,codiva,tipoiva,codreg; @@ -526,11 +539,15 @@ void TProgressivi_iva::cerca_i_pim() break; case acq_beni_riv: if (_tipoprog == 1) break; - if (_tipo_attiv == 1) - { - impo += imponibile; - impos += imposta; - } + tabiva.put("CODTAB",codiva); + if (tabiva.read() == NOERR) + // I non soggetti non vanno considerati nel totale acq. beni rivendita + if (tabiva.get("S1") != "NS") + if (_tipo_attiv == 1) + { + impo += imponibile; + impos += imposta; + } break; case acq_beni_ammort: if (_tipoprog == 1) break;