bug 5429: balance sheet report sometimes prints lines with zero amounts. Fixed.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 2 May 2021 21:37:48 +0000 (23:37 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 2 May 2021 21:37:48 +0000 (23:37 +0200)
gl/includes/db/gl_db_trans.inc

index eed9438408ee4c2d9b1ffc5551e1f8ca4d8a6900..ebea4c1d879900d22923e64afe5548dc12d0acf7 100644 (file)
@@ -289,7 +289,7 @@ function get_gl_balance_from_to($from_date, $to_date, $account, $dimension=0, $d
        $result = db_query($sql, "The starting balance for account $account could not be calculated");
 
        $row = db_fetch_row($result);
-       return $row[0];
+       return round2($row[0], user_price_dec());
 }
 
 //--------------------------------------------------------------------------------
@@ -313,7 +313,7 @@ function get_gl_trans_from_to($from_date, $to_date, $account, $dimension=0, $dim
        $result = db_query($sql, "Transactions for account $account could not be calculated");
 
        $row = db_fetch_row($result);
-       return (float)$row[0];
+       return round2($row[0], user_price_dec());
 }
 
 //----------------------------------------------------------------------------------------------------