From 3da47503abfe82bdfbbd5ff37ac85d4b945f71f0 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 12 Jul 2012 15:23:11 +0000 Subject: [PATCH] Corretta gestione insoluti nel nuovo saldaconto per Nuova Bienne git-svn-id: svn://10.65.10.50/branches/R_10_00@22704 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg2107.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/cg/cg2107.cpp b/cg/cg2107.cpp index e32bb37e2..df0da3350 100755 --- a/cg/cg2107.cpp +++ b/cg/cg2107.cpp @@ -43,7 +43,7 @@ bool TNew_game_mask::on_field_event(TOperable_field& o, TField_event e, long jol ok = p.last() <= 0; } if (!ok) - error_box("La partita %d/%s esiste già", anno, (const char*)part); + error_box(FR("La partita %d/%s esiste già"), anno, (const char*)part); } break; default: @@ -511,18 +511,21 @@ bool TEasySolder_mask::on_field_event(TOperable_field& o, TField_event e, long j real residuo = m.get(S_RESIDUO); if (residuo.is_zero()) { - const int anno = m.get_int(S_ANNO); - const TString8 num = m.get(S_PARTITA); - const int nriga = m.get_int(S_RIGAF); - const int nrata = m.get_int(S_RATA); - TPartita& game = app().partite().partita(_conto, anno, num); + const int anno = m.get_int(S_ANNO); + const TString8 num = m.get(S_PARTITA); + const int nriga = m.get_int(S_RIGAF); + const int nrata = m.get_int(S_RATA); + const TPartita& game = app().partite().partita(_conto, anno, num); + + if (game.esiste(nriga, nrata)) residuo = game.rata(nriga, nrata).residuo(true).valore(); } if (!residuo.is_zero()) { m.set(S_IMPORTO, residuo); - m.set(S_SALDO, true); + if (_tipomov != tm_insoluto && _tipomov != tm_nota_credito) + m.set(S_SALDO, true); if (in_valuta()) { const real residuo_eur = val2eur(residuo); @@ -938,7 +941,7 @@ void TEasySolder_mask::fill_sheet() const TString& codval = get(G_VALUTA); const real cambio = get(G_CAMBIO); - s.enable_column(S_SALDO, _tipomov != tm_insoluto); + s.enable_column(S_SALDO, _tipomov != tm_insoluto && _tipomov != tm_nota_credito); const bool in_val = in_valuta(); s.enable_column(S_IMPORTO_EUR, in_val);