From 7aa71d376770db92c61c5d02f3bd0514ffda1883 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 28 May 2010 08:29:53 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : pi0002 Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@20514 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ps/pi0002100.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/ps/pi0002100.cpp b/ps/pi0002100.cpp index 4c2379ab4..e5fd9aa60 100755 --- a/ps/pi0002100.cpp +++ b/ps/pi0002100.cpp @@ -56,6 +56,7 @@ bool TPF_mask::on_sheet_event(TOperable_field& o, TField_event e, long jolly) case F_SHEET: switch(e) { + case se_query_del: case se_query_add: return false; case se_notify_modify: @@ -193,18 +194,26 @@ bool TPF_mask::calc_residual(const TRiga_scadenze& scad, real& impres, void TPF_mask::update_total() { - TSheet_field& s = sfield(F_SHEET); - const int postoa = s.cid2index(F_IMPORTOANT); + const TSheet_field& s = sfield(F_SHEET); const int postop = s.cid2index(F_PAGATO); - real tota; - real totp; + const int postoa = s.cid2index(F_IMPORTOANT); + real tota, totp; FOR_EACH_SHEET_ROW_BACK(s, r, row) { - tota += real(row->get(postoa)); - totp += real(row->get(postop)); + if (r == s.selected()) + { + const TMask& rm = s.sheet_row_mask(r); + totp += rm.get_real(F_PAGATO); + tota += rm.get_real(F_IMPORTOANT); + } + else + { + totp += real(row->get(postop)); + tota += real(row->get(postoa)); + } } - set(F_TOTALEANT, tota); set(F_TOTALEPAG, totp); + set(F_TOTALEANT, tota); enable(DLG_SAVEREC, !tota.is_zero()||!totp.is_zero()); }