From 48589f9ce6c51bb25e2fa8ed83c57d9dfa485e44 Mon Sep 17 00:00:00 2001 From: Joe Date: Wed, 7 Sep 2022 18:34:17 +0200 Subject: [PATCH] Incorrect Journal Balance (sales invoice) when many decimals in tax and price. --- gl/includes/db/gl_db_trans.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gl/includes/db/gl_db_trans.inc b/gl/includes/db/gl_db_trans.inc index c614c092..a899f7b4 100644 --- a/gl/includes/db/gl_db_trans.inc +++ b/gl/includes/db/gl_db_trans.inc @@ -92,7 +92,7 @@ function add_gl_balance($type, $trans_id, $date_, $amount, $person_type_id=null, { $amount = round2($amount, user_price_dec()); - if (floatcmp($amount, 0)) + if ($amount != 0.0) { error_log(sprintf( _("Rounding error %s encountered for trans_type:%s,trans_no:%s"), $amount, $type, $trans_id)); return add_gl_trans($type, $trans_id, $date_, get_company_pref('exchange_diff_act'), 0, 0, "", -- 2.30.2