358536 PHP Rounding Deleted ASAP
N/A
Betalt ved levering
I have a web shop and the order total is rounded when VAT is calculated for sending to my customer.
I need the rounding taken out so that they get the figure unrounded.
So the total instead of being 13,528 would be 13,528.98
Here is the code that needs changing.
# Find total costs of order
$order['costs']['subtotal'] = 0;
$products_copy = $order['products'];
foreach ($order['products'] as $product) {
$order['costs']['subtotal'] += $product['quantity'] * $product['data']['products_price'];
}
$order['costs']['gift'] = $order['totals']['giftwrap'];
$order['costs']['cod'] = $order['totals']['nittsu_cod_fee'];
$order['costs']['shipping'] = $order['totals']['shipping'];
$order['costs']['total'] = $order['costs']['subtotal'] + $order['costs']['gift'] + $order['costs']['cod'] + $order['costs']['shipping'];
$order['costs']['calculated_tax'] = round(0.05 * $order['costs']['total']);
# This should actually multiply by 0.0476, as 4.76 % of the amount VAT included is equal to 5 % of the amount VAT excluded.
$order['costs']['total_no_tax'] = $order['costs']['total'] - $order['costs']['calculated_tax'];
$orders[] = $order;
if ($this->auto_mode) {
$this->mysql->updateRows("orders", array("csv_backup" => 1), array("orders_id" => $order['id']));
}
}
return $orders;
Projekt ID: #2104370