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