From 9b5937540381c4f6e2f9f72785f4b6f561e5cc57 Mon Sep 17 00:00:00 2001 From: villa Date: Wed, 20 Dec 1995 10:16:55 +0000 Subject: [PATCH] Gabriellismi git-svn-id: svn://10.65.10.50/trunk@2323 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg2104.cpp | 4 +++- cg/cg21rata.uml | 11 +++++++++-- cg/pagament.cpp | 14 ++++++-------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/cg/cg2104.cpp b/cg/cg2104.cpp index b9027f13d..0b7973ff2 100755 --- a/cg/cg2104.cpp +++ b/cg/cg2104.cpp @@ -14,6 +14,7 @@ #include #include #include +#include TPagamento& TPrimanota_application::pagamento() const { @@ -300,7 +301,8 @@ bool TPrimanota_application::recalc_handler(TMask_field& f, KEY key) const bool on = f.get().not_empty(); const TMask& m = f.mask(); TSheet_field& ps = (TSheet_field&)m.field(FS_RATESHEET); - ps.enable_column(3, on); + ps.enable_column(3, on); + ps.sheet_mask().enable(DLG_DELREC, !on); TPagamento& pag = app().pagamento(); if (pag.tipo_prima_rata() >= 4) { diff --git a/cg/cg21rata.uml b/cg/cg21rata.uml index 992956a15..bd2d14f08 100755 --- a/cg/cg21rata.uml +++ b/cg/cg21rata.uml @@ -138,15 +138,22 @@ BEGIN COPY OUTPUT 110 CHECKTYPE NORMAL END + +BUTTON DLG_DELREC 10 2 +BEGIN + PROMPT -13 -1 "" + FLAGS "D" + MESSAGE EXIT,K_DEL +END BUTTON DLG_CANCEL 10 2 BEGIN - PROMPT -12 -1 "" + PROMPT -23 -1 "" END BUTTON DLG_OK 10 2 BEGIN - PROMPT -22 -1 "" + PROMPT -33 -1 "" END ENDPAGE diff --git a/cg/pagament.cpp b/cg/pagament.cpp index 9b91b84be..25db3ab3c 100755 --- a/cg/pagament.cpp +++ b/cg/pagament.cpp @@ -214,14 +214,14 @@ void TPagamento::set_numero_rate(int n, int sscad, int rdiff) // e' selezionato UGUALI: devo: lasciare la prima // rata com'e' (a meno che non ce ne sia una sola) e // suddividere il resto dell'importo tra le altre - real rfirst = _inited ? tpay_rata(first) : perc_rata(first); + real rfirst = _inited ? tpay_rata(0) : perc_rata(0); if (_inited && _tpr > 0 && _tpr < 4) rfirst -= _secndr; - real rest = tot - rfirst; - const real div = rest / real(nact - 1); + real rest = tot - _tpr >= 4 ? ZERO : rfirst; + const real div = rest / real(nact); real perc = real(100.0)*(div/tot); - for (i = first+1; i < n; i++) + for (i = 1; i < n; i++) { if (i >= nr) add_rata(perc, (sscad == -1 ? (i < nr ? scad_rata(i) : scad_rata(nr-1)) : sscad), @@ -860,7 +860,7 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified, // HERE real tot = is_perc_modified ? real(100.0) : (_tpr < 4 ? _firstr : _secndr); real delta = is_perc_modified ? ZERO : - ((_tpr > 0 && _tpr) < 4 ? _secndr : ZERO); + ((_tpr > 0 && _tpr < 4) ? _secndr : ZERO); real nimp(new_value); // se ho modificato la prima, divido il resto nelle successive @@ -951,7 +951,7 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified, nscd = atoi(trt.get(0)); if (type == 0) type = 1; if (j > 0 && nscd == 0) nscd = oldscad; - if (_inited && dd == lastdate && j > 0) + if (_inited && dd == lastdate && j > frs) next_scad(dd,nscd,mcomm,j); } else if (_inited) @@ -1058,8 +1058,6 @@ word TPagamento::recalc_rate(int row, bool is_perc_modified, TToken_string& tr = rata(j); real rvl = dt.get(); - if (!is_perc_modified) - rvl *= real(100.0); if (j == first) {