From 7cfec25d28a8a2203cd5059462c16aac4307ef44 Mon Sep 17 00:00:00 2001 From: bonazzi Date: Tue, 23 Jan 2018 09:22:13 +0000 Subject: [PATCH] Patch level : 12.0 510 Files correlati : cg4.exe Nuova versione delle fatture in ritardo (18-01-2017) git-svn-id: svn://10.65.10.50/branches/R_10_00@24295 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/cg/cg4301.cpp | 4 ++-- src/cg/cg4400.cpp | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/cg/cg4301.cpp b/src/cg/cg4301.cpp index bf6a253af..160a44d62 100755 --- a/src/cg/cg4301.cpp +++ b/src/cg/cg4301.cpp @@ -1153,8 +1153,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & const int year_diff = datareg.year() - datadoc.year(); const bool dataritind = ((tipomov == acquisto) && fatt_rit_2018) && ((year_diff > 2) || ((year_diff >= 1) && datareg.month() >= 5)); - const bool fattrit = ((tipomov == acquisto) && !dataritind) && (year_diff >= 1); - const bool fattritind = (rcs.get_bool(CAU_RITFATT) && atoi(_year) < 2018) || dataritind; + const bool fattrit = ((tipomov == acquisto) && !dataritind && fatt_rit_2018) && (year_diff >= 1); + const bool fattritind = (atoi(_year) < 2018 && rcs.get_bool(CAU_RITFATT)) || dataritind; const bool cau_intra = rcs.get_bool(CAU_INTRACOM); const bool cau_valintra = rcs.get_bool(CAU_VALINTRA); diff --git a/src/cg/cg4400.cpp b/src/cg/cg4400.cpp index 966ce1eca..4e408eeb4 100755 --- a/src/cg/cg4400.cpp +++ b/src/cg/cg4400.cpp @@ -2353,11 +2353,13 @@ bool TStampa_registri_app::preprocess_page(int file, int counter) TString4 codval = mov.get(MOV_CODVALI); real corrval = mov.get_real(MOV_CORRVALUTA); const bool autof = caus.get_bool(CAU_AUTOFATT); - const bool dataritind = ((_tipo_reg == acquisto) && (_annoIVA >= 2018)) && ((_datareg.year() - datadoc.year()) > 1 ) || - (((_datareg.year() - datadoc.year()) == 1) && _datareg.month() >= 5); - const bool datarit = ((_tipo_reg == acquisto) && !dataritind) && ((_datareg.year() - datadoc.year()) == 1); - const bool fattritind = (_annoIVA >= 2018) && (caus.get_bool(CAU_RITFATTIND) || dataritind); - const bool fattrit = caus.get_bool(CAU_RITFATT) || datarit; + const tiporeg tipomov = (tiporeg)_tabreg->get_int("I0"); // 1=Vendite; 2=Acquisti + const bool fatt_rit_2018 = _annoIVA >= 2018 && mov.get_bool(MOV_RITFATT); + const int year_diff = _datareg.year() - datadoc.year(); + const bool dataritind = ((tipomov == acquisto) && fatt_rit_2018) && + ((year_diff > 2) || ((year_diff >= 1) && _datareg.month() >= 5)); + const bool fattrit = ((tipomov == acquisto) && !dataritind && fatt_rit_2018) && (year_diff >= 1); + const bool fattritind = (_annoIVA < 2018 && caus.get_bool(CAU_RITFATT)) || dataritind; const bool splitpay = tipocf == 'C' && is_split_payment(mov.curr()); const bool liqdiff = !splitpay && mov.get_bool(MOV_LIQDIFF) && is_IVA_diff(mov.curr());