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()); }