diff --git a/src/cg/cg4301.cpp b/src/cg/cg4301.cpp index 2517e1d81..cfb5718c2 100755 --- a/src/cg/cg4301.cpp +++ b/src/cg/cg4301.cpp @@ -1459,7 +1459,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & #ifdef DBG const long nr = _mov->get_long(MOV_NUMREG); - if (nr == 30559 || nr == 29171 ) + if (nr == 30559) int i = 1 ; #endif @@ -1483,10 +1483,12 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & TDate datafat; - if (bRowIsMovDiff && tm == tm_fattura) + if (bRowIsMovDiff && tm == tm_fattura) { const TDate datareg = _mov->get(MOV_DATAREG); + if (is_detr_diff == 1 && datareg.month() != month) + continue; datafat = datareg; sezfat = tipomov == vendita ? 'D' : 'A'; id.put(RMI_NUMREG, _rmoviva->get(RMI_NUMREG)); @@ -1875,6 +1877,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & real imponibile = is_detraibile == 0 ? impon_det : impon_ind; real imposta = is_detraibile == 0? impos_det : impos_ind; + if (bRowIsMovDiff && is_detraibile == 1 && month != _mov->get_date(MOV_DATAREG).month()) + continue; if (bRowIsMovDiff && is_detraibile == 0) { imponibile = ZERO;