From 8779085e37c249b74a4171799add3459035bca93 Mon Sep 17 00:00:00 2001 From: villa Date: Tue, 6 Feb 1996 09:55:56 +0000 Subject: [PATCH] Corretti arrotondamenti valuta alla registrazione git-svn-id: svn://10.65.10.50/trunk@2563 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg2104.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cg/cg2104.cpp b/cg/cg2104.cpp index 4bc34cf86..638444d36 100755 --- a/cg/cg2104.cpp +++ b/cg/cg2104.cpp @@ -239,9 +239,13 @@ bool TPrimanota_application::pag_sheet_handler(TMask_field& f, KEY key) if (key == K_ENTER && m.edit_mode()) { - const real tot = m.get(in_valuta ? SK_TOTDOCVAL : F_TOTALE); + real tot = m.get(in_valuta ? SK_TOTDOCVAL : F_TOTALE); for (int r = pag.n_rate()-1; r >= 0; r--) - imp += pag.tval_rata(r); + imp += in_valuta ? pag.tval_rata(r) : pag.tlit_rata(r); + + imp.round(pag.round(in_valuta)); + tot.round(pag.round(in_valuta)); + if (imp != tot) { const char* const pic = in_valuta ? ".3" : "."; @@ -259,8 +263,10 @@ bool TPrimanota_application::pag_sheet_handler(TMask_field& f, KEY key) const real totlit = m.get(F_TOTALE); imp = ZERO; for (int r = pag.n_rate()-1; r >= 0; r--) - imp += pag.tlit_rata(r); - imp.round(0); + imp += pag.tlit_rata(r); + + imp.round(pag.round(FALSE)); + if (imp != totlit) { const TString is(imp.string("."));