Open ts-mothership opened 1 year ago
To compare already rounded values I'd suggest a change in https://github.com/mollie/Shopware6/blob/master/src/Service/MollieApi/Builder/MollieLineItemBuilder.php#L119:
if ($fixRoundingDifferences) {
$mollieOrderLines = $this->roundingDiffFixer->fixAmountDiff(
- $order->getAmountTotal(),
+ round($order->getAmountTotal(), MollieOrderPriceBuilder::MOLLIE_PRICE_PRECISION),
$mollieOrderLines,
$fixRoundingTitle,
$fixRoundingSKU
);
}
Similar to issue #439 the high precision rounding does not seem to work on some cases. We tested the plugin version 3.4.0 and 3.6.0 in Shopware 6.4.17.2.
From the log:
It seems \Kiener\MolliePayments\Service\MollieApi\Fixer\RoundingDifferenceFixer::fixAmountDiff is rounding incorrectly. It compares the order value of '30.025' with the sum of already rounded line items '30.03'. This creates a diff of 0.005 which creates a new line item with a rounding position of -0.01 €.
So I guess you should either use the rounded order grand total or use the unrounded line items when comparing both values.