From 77e655d56466986b5ce272b7bab42b863f707323 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 9 Feb 2007 15:00:38 +0000 Subject: [PATCH] Patch level : 4.0 616 Files correlati : cg4.exe Ricompilazione Demo : [ ] Commento : MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corretta liquidazione per indetraibilità git-svn-id: svn://10.65.10.50/trunk@14888 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg4301.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/cg/cg4301.cpp b/cg/cg4301.cpp index 3eaab105d..a8e841cba 100755 --- a/cg/cg4301.cpp +++ b/cg/cg4301.cpp @@ -841,11 +841,26 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) const real imposta_orig = _rmoviva->get_real(RMI_IMPOSTA); const int decimals = TCurrency::get_firm_dec(); - real impon_ind = imponibile_orig * percind / CENTO; impon_ind.round(decimals); - real impon_det = imponibile_orig - impon_ind; + real impon_ind, impon_det, impos_ind, impos_det; - real impos_ind = impon_ind * perciva; impos_ind.round(decimals); - real impos_det = imposta_orig - impos_ind; + if (percind <= ZERO) + { + impon_det = imponibile_orig; + impos_det = imposta_orig; + } + else + if (percind >= CENTO) + { + impon_ind = imponibile_orig; + impos_ind = imposta_orig; + } + else + { + impon_ind = imponibile_orig * percind / CENTO; impon_ind.round(decimals); + impon_det = imponibile_orig - impon_ind; + impos_ind = impon_ind * perciva; impos_ind.round(decimals); + impos_det = imposta_orig - impos_ind; + } for (int is_detraibile = 0; is_detraibile < 2; is_detraibile++) {