File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
app/code/Magento/Sales/Model/Order/Creditmemo/Total Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,15 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo)
58
58
$ orderBaseShippingInclTax = $ order ->getBaseShippingInclTax ();
59
59
$ allowedTaxAmount = $ order ->getShippingTaxAmount () - $ order ->getShippingTaxRefunded ();
60
60
$ allowedAmountInclTax = $ allowedAmount + $ allowedTaxAmount ;
61
- $ baseAllowedAmountInclTax = $ orderBaseShippingInclTax
62
- - $ order ->getBaseShippingRefunded ()
63
- - $ order ->getBaseShippingTaxRefunded ();
61
+ $ baseAllowedAmountInclTaxDiff = $ orderBaseShippingInclTax
62
+ - $ order ->getBaseShippingRefunded ();
63
+ if ($ baseAllowedAmountInclTaxDiff < $ order ->getBaseShippingTaxRefunded ()) {
64
+ $ baseAllowedAmountInclTax = $ order ->getBaseShippingTaxRefunded ()
65
+ - $ baseAllowedAmountInclTaxDiff ;
66
+ } else {
67
+ $ baseAllowedAmountInclTax = $ baseAllowedAmountInclTaxDiff
68
+ - $ order ->getBaseShippingTaxRefunded ();
69
+ }
64
70
65
71
// Check if the desired shipping amount to refund was specified (from invoice or another source).
66
72
if ($ creditmemo ->hasBaseShippingAmount ()) {
You can’t perform that action at this time.
0 commit comments