$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'],
// 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
}
$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;
}