round shipment quote net value to 2 decimal digits

this should help us prevent rounding errors downstream when converting
back to net in odoo (SYS#6033)
master
Harald Welte 7 months ago
parent 7064ff40db
commit 1c17795687
  1. 2
      composer.json
  2. 2
      src/Core/Checkout/Cart/Delivery/SmcDeliveryProcessor.php

@ -1,7 +1,7 @@
{
"name": "sysmocom/shopware6-shipcloud-live",
"description": "shipcloud live quote pluging",
"version": "0.0.3",
"version": "0.0.4",
"type": "shopware-platform-plugin",
"license": "AGPL-3.0-or-later",
"authors": [

@ -202,7 +202,7 @@ class SmcDeliveryProcessor implements CartProcessorInterface, CartDataCollectorI
$transport_insurance = (0.0035 * $value);
/* convert into a gross price, as API returns net */
$quote_eur_gross = ($quote_eur + $margin + $transport_insurance);
$quote_eur_gross = round($quote_eur + $margin + $transport_insurance), 2);
if ($context->getTaxState() === CartPrice::TAX_STATE_GROSS) {
/* FIXME: don't use static 19% but destination country specific rate */
$quote_eur_gross = $quote_eur_gross * 1.19;

Loading…
Cancel
Save