diff --git a/ve/sconti.cpp b/ve/sconti.cpp index 9b346c184..b3179de5f 100755 --- a/ve/sconti.cpp +++ b/ve/sconti.cpp @@ -565,9 +565,15 @@ void TCond_vendita::update_omaggi(bool full) TConfig cnf(CONFIG_STUDIO, "ve"); tipo_riga = cnf.get("TROMAGGI"); } - qta /= _rcondv.get_real("QBASE"); - qta.floor(); - qta *= _rcondv.get_real("QOM"); + const real qbase = _rcondv.get_real("QBASE"); + if (qbase == ZERO) + qta = ZERO; + else + { + qta /= _rcondv.get_real("QBASE"); + qta.floor(); + qta *= _rcondv.get_real("QOM"); + } creata = codart_omaggio.not_empty() && tipo_riga.not_empty() && qta != ZERO; if (creata)