diff --git a/cg/cg2102.cpp b/cg/cg2102.cpp index 70cac9e9a..914bf2ea6 100755 --- a/cg/cg2102.cpp +++ b/cg/cg2102.cpp @@ -2591,12 +2591,16 @@ bool TPrimanota_application::IVA2bill(const TCodiceIVA& iva, TBill& bill) // Certified 99% bool TPrimanota_application::main_codiva_handler(TMask_field& f, KEY key) { - if (key == K_TAB && !f.empty()) + static bool __in_handler = false; + + if (key == K_TAB && !f.empty() && !__in_handler) { if (!suspended_handler(f, key)) return false; + + __in_handler = true; - TPrimanota_application& a = app(); + TPrimanota_application& a = app(); const real imp(a.ivas().row(1).get(0)); if (a.iva() == iva_acquisti && a.causale().intra()) @@ -2607,7 +2611,7 @@ bool TPrimanota_application::main_codiva_handler(TMask_field& f, KEY key) TCodiceIVA codiva(f.get()); const real totale = f.mask().get_real(F_TOTALE); const real imposta = codiva.imposta(totale); - f.mask().set(F_RITFIS, imposta.string()); + f.mask().set(F_RITFIS, imposta, true); } } if (imp.is_zero()) // Se il totale documento non e' stato spezzato @@ -2644,6 +2648,7 @@ bool TPrimanota_application::main_codiva_handler(TMask_field& f, KEY key) iva_notify(a.ivas(), 0, K_ENTER); } + __in_handler = false; } return true; }