Closed aartse closed 4 months ago
Hi there @aartse ,
Thank you for opening this issue with detailed steps. We seem to be unable to reproduce this issue. Could you please describe what kinds of taxes and/or discounts are in play here? And do you have any extensions in place that add order totals (payment fees, extra discounts, etc)? Feel free to share this here or contact us directly.
@Frank-Magmodules i can give you admin access to the staging server with this problem so you can check the tax settings?
Yes please @aartse , that would be great, please share directly.
I have the exact same issue. After some debugging it appears that in mollie/magento2/Model/OrderLines.php on orders with a discount a discount percentage is applied to the order line. This leads to a different price for the order line than what magento is expecting.
If I remove the $orderHasDiscount check, the order is shipped fine.
The discount code that is applied is a cart-wide percentage discount.
Thanks, @patricksteenks ! I've just received your email providing additional context. It seems we may have identified the problem and are currently investigating both the issue and the potential solution. We aim to implement these changes in the upcoming release.
We have resolved this issue and provided the fix to both @aartse and @patricksteenks . It will be merged into the upcoming release. Thank you for bringing this to our attention; I will keep the issue open until the release.
@Frank-Magmodules Could you clarify what was done in order to fix this issue in the new release? We are struggling with the same issue and would like to review the change as well.
Hello @Celoain , of course! I'll share it in the upcoming days once we've finalized the testing phase on our end.
Hello @Celoain , as requested, here is the .diff file ahead of our upcoming release of the new version.
Hello @Celoain and @aartse and @patricksteenks , I'm pleased to inform you that we have successfully implemented a solution for the issue you reported in our latest release. Thank you for providing the details and for your patience; it is greatly appreciated. Please feel free to share any comments or reopen the issue if necessary.
Describe the bug When i create a partial shipment, i get the following error:
Used versions
To Reproduce Set method for payment method
Set magento tax settings
Create order and create partial shipment
Expected behavior Can create a partial shipment.
Actual behavior Error and no shipment is created in magento or mollie
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Bug is caused at this line: https://github.com/mollie/magento2/blob/master/Model/OrderLines.php#L222
When the setting 'Apply Discount On Prices' is set to 'Excluding Tax', the amount in the field 'base_discount_amount' is also excluding tax. so when you do
$rowTotal = $orderItem->getBaseRowTotalInclTax() - $orderItem->getBaseDiscountAmount();
the$rowTotal
misses the tax on the discount and causes the error.