-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix negative credit memo #19899 #19900
Fix negative credit memo #19899 #19900
Conversation
Hi @wojtekn. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi @VladimirZaets, thank you for the review. |
Hi @wojtekn, thank you for your contribution! |
Hi @wojtekn. Thank you for your contribution. |
1 similar comment
Hi @wojtekn. Thank you for your contribution. |
Description
This fixes negative credit memo problem described in #19899. The problem looks as introduced in \Magento\Sales\Model\Order\Creditmemo\Total\Discount which calculates base_shipping_amount based on tax related variables if base_shipping_amount is zero:
I fixed this by setting base_shipping_incl_tax to 0 in \Magento\Sales\Model\Order\CreditmemoFactory::initData too:
Fixed Issues (if relevant)
Manual testing scenarios
Expected behavior is to have $0 credit memo created. Instead it creates credit memo with negative, -$5.0 total.
Contribution checklist