Payments & Deposits(Rounding Problem). Fixed.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 5 May 2021 13:11:32 +0000 (15:11 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 5 May 2021 13:11:32 +0000 (15:11 +0200)
fixed_assets/includes/fixed_assets_db.inc
includes/ui/items_cart.inc

index 39c3f44eac7af63dcfaab2494163e5acaae867e0..3881adadab8079f97880a4b0e670c0c4ec4aff15 100644 (file)
@@ -32,7 +32,7 @@ function process_fixed_asset_depreciation($stock_id, $gl_rows, $refline, $memo_)
 
   $value_of_change = 0;
   foreach ($gl_rows as $row) {
-    $value_of_change += round($row['value'], 2);
+    $value_of_change += round2($row['value'], user_price_dec());
 
     $cart->add_gl_item($stock_gl_code["adjustment_account"],
         $stock_gl_code["dimension_id"], $stock_gl_code["dimension2_id"], -$row['value'],
index 9387558966a576980620164e85250fc6d8b4cb2d..7de50277ff2d9fcc40104c0d0365064c8451f800 100644 (file)
@@ -299,7 +299,7 @@ class items_cart
                                        // we can have both input and output tax postings in some cases like intra-EU trade.
                                        // so just calculate net_amount from the higher in/out tax
                                        $tax_info['net_amount'][$tax_id]
-                                               = $sign*round2(max(abs(@$tax_info['tax_in'][$tax_id]), abs(@$tax_info['tax_out'][$tax_id]))/$tax_type['rate']*100, 2)/$factor;
+                                               = $sign*round2(max(abs(@$tax_info['tax_in'][$tax_id]), abs(@$tax_info['tax_out'][$tax_id]))/$tax_type['rate']*100, user_price_dec())/$factor;
 
                                }
                        } else
@@ -531,7 +531,7 @@ class gl_item
                }
                $this->dimension_id = $dimension_id;
                $this->dimension2_id = $dimension2_id;
-               $this->amount = round($amount, 2);
+               $this->amount = round2($amount, user_price_dec());
                $this->reference = $memo;
                $this->date = $date;
        }