From 194923a00544cd46ea97c2748493ff9c50ededcb Mon Sep 17 00:00:00 2001 From: angelo Date: Tue, 11 Feb 1997 16:02:03 +0000 Subject: [PATCH] Correzioni per evitare CHECK sul pagamento NULLO. git-svn-id: svn://10.65.10.50/trunk@4128 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg2104.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cg/cg2104.cpp b/cg/cg2104.cpp index 738c73a42..1b83b9b52 100755 --- a/cg/cg2104.cpp +++ b/cg/cg2104.cpp @@ -26,8 +26,10 @@ TPagamento& TPrimanota_application::pagamento() const bool TPrimanota_application::pag_notify(TSheet_field& ps, int r, KEY k) { - TPagamento& pag = app().pagamento(); TMask* msk = &(ps.mask()); + if (!msk->is_running()) return TRUE; // Necessario per evitare il CHECK sul pagamento nullo + + TPagamento& pag = app().pagamento(); TString_array& rws = app().pag_rows(); const int rdiff = msk->get_int(FS_RDIFFER); @@ -612,12 +614,13 @@ bool TPrimanota_application::codcab_handler(TMask_field& f, KEY key) bool TPrimanota_application::ratalit_handler(TMask_field& f, KEY key) { - if (key == K_F8 || (key == K_TAB && f.get().empty())) + TMask& m = app().curr_mask(); + if (key == K_F8 || (key == K_TAB && f.get().empty() && m.is_running())) { const TPagamento& pag = app().pagamento(); if (pag.in_valuta()) { - const TValuta v(app().curr_mask(), FS_VALUTA, FS_DATACAMBIO, FS_CAMBIO); + const TValuta v(m, FS_VALUTA, FS_DATACAMBIO, FS_CAMBIO); const real other(f.mask().get(103)); const char* s = v.val2lit(other).string(); f.set(s);