From 3538c1072fa8e11f357b9ed8728cb465bb3693c9 Mon Sep 17 00:00:00 2001 From: villa Date: Tue, 16 Jan 1996 11:01:04 +0000 Subject: [PATCH] Arrotondamenti valuta / set n. rate dopo modifica git-svn-id: svn://10.65.10.50/trunk@2460 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg2104.cpp | 5 ++++- cg/pagament.cpp | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cg/cg2104.cpp b/cg/cg2104.cpp index bead16917..d5fced43b 100755 --- a/cg/cg2104.cpp +++ b/cg/cg2104.cpp @@ -5,6 +5,7 @@ #include "pagament.h" #include "saldacon.h" +#include "utility.h" #include "cg2102.h" #include "cg2100.h" @@ -252,6 +253,7 @@ bool TPrimanota_application::pag_sheet_handler(TMask_field& f, KEY key) imp = ZERO; for (int r = pag.n_rate()-1; r >= 0; r--) imp += pag.tlit_rata(r); + imp.round(0); if (imp != totlit) { const TString is(imp.string(".")); @@ -495,7 +497,8 @@ bool TPrimanota_application::nrate_handler(TMask_field& f, KEY key) TSheet_field& ps = (TSheet_field&)m.field(FS_RATESHEET); pag.set_sheet(ps); app().pag_rows() = ps.rows_array(); - } + } + f.set(format("%d", pag.n_rate())); } return TRUE; } diff --git a/cg/pagament.cpp b/cg/pagament.cpp index 025cc8244..6ef2c1719 100755 --- a/cg/pagament.cpp +++ b/cg/pagament.cpp @@ -680,6 +680,8 @@ word TPagamento::validate() const res |= P_ZERO; tot += tpay; } + + tot.round(_round); if (tot != _firstr+_secndr) res |= P_TOTNC;