diff --git a/src/cg/cg4301.cpp b/src/cg/cg4301.cpp index cfb5718c2..5eea42c79 100755 --- a/src/cg/cg4301.cpp +++ b/src/cg/cg4301.cpp @@ -1184,7 +1184,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) + if (nr == 30579 || nr == 30582) int i = 1 ; #endif @@ -1200,7 +1200,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & const long numreg = _mov->get_long(MOV_NUMREG); TDate datainc; real tot_incassato, tot_da_incassare; - int flag_pg_nc = 0; // Ci sono pagamenti (0x1) e/o note di credito(0x2) ? + int flag_pg_nc = 0; // Ci sono pagamenti (0x1) e/o note di credito(0x2) ? bool game_found = false; if (has_sc) @@ -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) + if (nr == 30579 || nr == 30582) int i = 1 ; #endif @@ -1486,8 +1486,12 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & if (bRowIsMovDiff && tm == tm_fattura) { const TDate datareg = _mov->get(MOV_DATAREG); + const int m = datareg.month(); + const bool ok = is_month_ok(month, m); - if (is_detr_diff == 1 && datareg.month() != month) + if (!ok && civa.senza_imposta()) + continue; + if (is_detr_diff == 1 && !ok) continue; datafat = datareg; sezfat = tipomov == vendita ? 'D' : 'A'; @@ -1876,8 +1880,12 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & const int tipodet = is_detraibile == 0 ? 0 : tipoind; real imponibile = is_detraibile == 0 ? impon_det : impon_ind; real imposta = is_detraibile == 0? impos_det : impos_ind; + const int m = _mov->get_date(MOV_DATAREG).month(); + const bool ok = is_month_ok(month, m); - if (bRowIsMovDiff && is_detraibile == 1 && month != _mov->get_date(MOV_DATAREG).month()) + if (civa.senza_imposta() && !ok) + continue; + if (bRowIsMovDiff && is_detraibile == 1 && !ok) continue; if (bRowIsMovDiff && is_detraibile == 0) {