Incorrect Journal Balance (sales invoice) when many decimals in tax and price.
authorJoe <joe.hunt.consulting@gmail.com>
Wed, 7 Sep 2022 16:34:17 +0000 (18:34 +0200)
committerJoe <joe.hunt.consulting@gmail.com>
Wed, 7 Sep 2022 16:34:17 +0000 (18:34 +0200)
gl/includes/db/gl_db_trans.inc

index c614c092aee38a8cc05084ce3388ad66b4773349..a899f7b4e6f272ff57ef425aa5d776e5431879c5 100644 (file)
@@ -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, "",