From 2e123105ffa774ba2009a85ec6c8390c0df69f72 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 10 Nov 2009 14:30:36 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=2010.?= =?UTF-8?q?0=20508=20Files=20correlati=20=20=20=20=20:=20cg3.exe=20Ricompi?= =?UTF-8?q?lazione=20Demo=20:=20[=20]=20Commento=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20:=200001434:=20Visualizzazione=20mastrini=20Dalla?= =?UTF-8?q?=20visualizzazione=20mastrini=20,=20mi=20collego=20ad=20una=20r?= =?UTF-8?q?egistrazione=20senza=20modificarla=20:=20premo=20il=20tasto=20a?= =?UTF-8?q?nnulla=20per=20tirnare=20alla=20visualizzazione=20e=20da=20li?= =?UTF-8?q?=20non=20riesco=20piu'=20ad=20uscire,=20ne=20premere=20altro=20?= =?UTF-8?q?tasto=20funzionale.=20Si=20=C3=A8=20di=20fatto=20bloccati=20su?= =?UTF-8?q?=20quella=20videata.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/trunk@19601 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg3600.cpp | 10 +++++----- cg/cglib02.cpp | 10 ++++++++-- cg/cglib03.cpp | 30 +++++++++++++++++------------- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/cg/cg3600.cpp b/cg/cg3600.cpp index 7428f7049..e25a40522 100755 --- a/cg/cg3600.cpp +++ b/cg/cg3600.cpp @@ -2121,7 +2121,7 @@ class TGrid_mask : public TMask protected: // TMask virtual TMask_field* parse_field(TScanner& sc); virtual bool on_key(KEY k); - virtual void handler(WINDOW win, EVENT* ep); + virtual long handler(WINDOW win, EVENT* ep); static bool link_handler(TMask_field& f, KEY k); static bool new_handler(TMask_field& f, KEY k); @@ -2244,7 +2244,7 @@ bool TGrid_mask::on_key(KEY k) return TMask::on_key(k); } -void TGrid_mask::handler(WINDOW win, EVENT* ep) +long TGrid_mask::handler(WINDOW win, EVENT* ep) { static TGrid_field* _last_grid = NULL; @@ -2267,7 +2267,7 @@ void TGrid_mask::handler(WINDOW win, EVENT* ep) xvt_menu_popup(menu->child, win, p, XVT_POPUP_CENTER, 0); xvt_res_free_menu_tree(menu); } - return; + return 0L; } } if (ep->type == E_COMMAND) @@ -2281,10 +2281,10 @@ void TGrid_mask::handler(WINDOW win, EVENT* ep) case BROWSE_BAR+3: _last_grid->on_key(K_F11); break; default: break; } - return; + return 0L; } } - TMask::handler(win, ep); + return TMask::handler(win, ep); } diff --git a/cg/cglib02.cpp b/cg/cglib02.cpp index 209a219ca..0dcb8b963 100755 --- a/cg/cglib02.cpp +++ b/cg/cglib02.cpp @@ -1018,8 +1018,14 @@ int TBalance::indicatore_bilancio(const TBill& b) const TString16 str; str.format("%d|%d", b.gruppo(), b.conto()); const int ib = atoi(cache().get(LF_PCON, str, PCN_INDBIL)); - if (ib == 0) - NFCHECK("Impossibile stabilire l'indicatore di bilancio"); +#ifdef DBG + if (ib < 1 || ib > 5) + { + TString msg; + msg << "Impossibile stabilire l'indicatore di bilancio del conto " << b.gruppo() << ' ' << b.conto(); + NFCHECK(msg); + } +#endif return ib; } diff --git a/cg/cglib03.cpp b/cg/cglib03.cpp index 55baa61f3..64d3893e9 100755 --- a/cg/cglib03.cpp +++ b/cg/cglib03.cpp @@ -34,20 +34,24 @@ static int codind2tipodet(const TString & codind, real& perc) real indetraibile_al(const TString& codind, const TCausale& caus, int annodoc, int & tipodet) { real perc; - tipodet = 0; - if (caus.iva() == iva_acquisti || caus.iva() == nessuna_iva || caus.iva() == iva_errata) // Vendite sempre detraibili - { - // Se prorata = 100% e' indetraibile - const bool prorata100 = caus.reg().prorata100(annodoc); - if (prorata100) - { - perc = CENTO; - tipodet = 9; - } - else - tipodet = codind2tipodet(codind, perc); - } + switch (caus.iva()) + { + case iva_acquisti: + case nessuna_iva: + case iva_errata: + if (caus.reg().prorata100(annodoc)) // Se prorata = 100% e' indetraibile + { + perc = CENTO; + tipodet = 9; + } + else + tipodet = codind2tipodet(codind, perc); + break; + default: + tipodet = 0; // Vendite sempre detraibili + break; + } return perc; }