From c038b8ba9cde9ccb7832676df1f8b7cefb34167f Mon Sep 17 00:00:00 2001 From: bonazzi Date: Wed, 8 Feb 2017 16:05:06 +0000 Subject: [PATCH] Patch level : 12.0 342 Files correlati : cg4.exe Corretto il calcolo pro-rata durante l'anno (non in 13a) nel caso non sia reperibile la percentuale annuale. git-svn-id: svn://10.65.10.50/branches/R_10_00@23588 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/cg/cg4301.cpp | 15 +++++++++++++-- src/cg/cg4304.cpp | 6 +++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/cg/cg4301.cpp b/src/cg/cg4301.cpp index 6e8644bda..e5d08a035 100755 --- a/src/cg/cg4301.cpp +++ b/src/cg/cg4301.cpp @@ -1783,8 +1783,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) const int tipodet = is_detraibile ? 0 : tipoind; const real imponibile = is_detraibile ? impon_det : impon_ind; const real imposta = is_detraibile ? impos_det : impos_ind; - - //qui da verificare if ((imponibile.is_zero() && imposta.is_zero()) && (bIsMovDiff && @@ -2646,6 +2644,19 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) if (percentuale2 != INVALID_PRORATA && percentuale2 != INVALID_PRORATA_ASSERT) aaa -= rr2 ? *rr2 : ZERO; prorata = _prorata.calc_prorata(aaa, _year); + yy.format("%d", year_int); + if (_prorata.percentuale(yy) == INVALID_PRORATA) + _prorata.perc_array().add(yy, prorata); + if (percentuale1 == INVALID_PRORATA) + { + yy.format("%d", year_int - 1); + _prorata.perc_array().add(yy, prorata_precedente1); + } + if (percentuale2 == INVALID_PRORATA) + { + yy.format("%d", year_int - 2); + _prorata.perc_array().add(yy, prorata_precedente2); + } const real prorata_diff = _prorata.calc_prorata(fdiffinc_iva_acq, _year); diff --git a/src/cg/cg4304.cpp b/src/cg/cg4304.cpp index adb749608..b25f7d8ce 100755 --- a/src/cg/cg4304.cpp +++ b/src/cg/cg4304.cpp @@ -1051,9 +1051,9 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool if (!annual) // Se non siamo in annuale prende il prorata su doc. acq. anno precedente { t->_r12 += _plm->get_real("R14"); - t->_r13 = _plm->get_real("R4"); // percentuale prorata anno precedente + t->_r13 = _plm->get_real("R4"); // percentuale prorata anno precedente t->_r14 += _plm->get_real("R15"); - t->_r15 = _plm->get_real("R16"); // percentuale prorata 2 anni addietro + t->_r15 = _plm->get_real("R16"); // percentuale prorata 2 anni addietro } // pro-rata indetraibile sui doc. acq. anno attuale @@ -1065,7 +1065,7 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool ad2 = real(ttm.get(2)); ad1 += _pom->get_real("R11"); ad2 += _pom->get_real("R12"); - ttm.add(_plm->get("R12"), 0); // % pro-rata anno corrente + ttm.add(_plm->get_real("R12"), 0); // % pro-rata anno corrente ttm.add(ad1.string(),1); // imp. acq. amm. indetr. ttm.add(ad2.string(),2); // IVA acq. amm. indetr t->_s0 = ttm;