From 35abcc4a6cdaa8073c274d4176f7161701d07ca1 Mon Sep 17 00:00:00 2001 From: mtollari Date: Mon, 8 May 2017 14:14:18 +0000 Subject: [PATCH] Patch level : 12.0 384 Files correlati : cg4.exe Commento : Corretto in funzionamento per fatture per cassa pagate in anticipo e calcolo pro-rata per le fatture per cassa. git-svn-id: svn://10.65.10.50/branches/R_10_00@23792 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/cg/cg4301.cpp | 23 +++++++++++------------ src/cg/cg4302.cpp | 4 ++-- src/cg/cgsaldac.cpp | 5 ----- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/cg/cg4301.cpp b/src/cg/cg4301.cpp index 5eea42c79..a4849b9be 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 == 30579 || nr == 30582) + if (nr == 29252) int i = 1 ; #endif @@ -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 == 30579 || nr == 30582) + if (nr == 29252) int i = 1 ; #endif @@ -1485,10 +1485,10 @@ 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); - + const TDate datareg = _mov->get_date(MOV_DATAREG); + int mesereg = datareg.month(); + const bool ok = is_month_ok(month, mesereg) && (atoi(_year) == datareg.year()); + if (!ok && civa.senza_imposta()) continue; if (is_detr_diff == 1 && !ok) @@ -1503,7 +1503,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & id.put("TIPOATT", rmi_tipoatt); id.put("ANNOLIQ", datareg.year()); - int mesereg = datareg.month(); if (_freqviva[0] == 'T') { const int resto = mesereg % 3; @@ -1880,8 +1879,8 @@ 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); + const TDate datareg = _mov->get_date(MOV_DATAREG); + const bool ok = is_month_ok(month, datareg.month()) && (atoi(_year) == datareg.year()); if (civa.senza_imposta() && !ok) continue; @@ -3199,7 +3198,7 @@ void TLiquidazione_app::iva11_set_arr_phase_1(const TString& codatt) { const bool t1 = tipoagr == 1; const bool t1_3 = tipoagr == 1 || tipoagr == 3; - if (ali == 2.00) + if (ali == DUE) { if (t1) { @@ -3529,8 +3528,8 @@ void TLiquidazione_app::iva11_set_arr_phase_2(const TString& codatt) // Calcola le maledette aliquote medie... real alv,ala; - if (vtot != 0.0) { alv = ivav/vtot; alv *= CENTO; alv.round(2); } - if (atot != 0.0) { ala = ivaa/atot; ala *= CENTO; ala.round(2); } + if (vtot != ZERO) { alv = ivav/vtot; alv *= CENTO; alv.round(2); } + if (atot != ZERO) { ala = ivaa/atot; ala *= CENTO; ala.round(2); } array.add(ala,TAB11_R1,LF_TAB1100B); array.add(alv,TAB11_R2,LF_TAB1100B); diff --git a/src/cg/cg4302.cpp b/src/cg/cg4302.cpp index a7f657c88..6494e6ac9 100755 --- a/src/cg/cg4302.cpp +++ b/src/cg/cg4302.cpp @@ -221,7 +221,7 @@ void TLiquidazione_app::lordo2netto(const real& totale, real& imponibile, real& const int dec = TCurrency::get_firm_dec(); if (dec == 0) // Lire { - imposta = (abs(totale) * aliquota)/(aliquota + 1.00); + imposta = (abs(totale) * aliquota)/(aliquota + UNO); imposta.ceil(); if (totale.sign() < 0) imposta = -imposta; imponibile = totale - imposta; @@ -232,7 +232,7 @@ void TLiquidazione_app::lordo2netto(const real& totale, real& imponibile, real& } else // Euro { - imposta = (totale * aliquota)/(aliquota + 1.00); + imposta = (totale * aliquota)/(aliquota + UNO); imposta.round(dec); imponibile = totale - imposta; } diff --git a/src/cg/cgsaldac.cpp b/src/cg/cgsaldac.cpp index 2f76d97b7..ce570b4f5 100755 --- a/src/cg/cgsaldac.cpp +++ b/src/cg/cgsaldac.cpp @@ -1123,11 +1123,6 @@ int TRiga_partite::calcola_pagato_periodo(const TDate& dal, const TDate& al, TIm if (!is_fattura()) return flag; -#ifdef DBG - if (get_long(PART_NREG) == 15985) - int cazzone = 2; -#endif - TPointer_array pags; const int lastr = rate();