File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
app/code/Magento/Sales/Model/Order/Invoice/Total Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -71,11 +71,9 @@ public function collect(Invoice $invoice)
71
71
$ invoice ->setDiscountAmount (-$ totalDiscountAmount );
72
72
$ invoice ->setBaseDiscountAmount (-$ baseTotalDiscountAmount );
73
73
74
- $ grandTotalWithoutDiscount = $ invoice ->getGrandTotal () - $ totalDiscountAmount ;
75
- $ grandTotal = $ grandTotalWithoutDiscount > 0 && $ grandTotalWithoutDiscount < 0.0001
74
+ $ grandTotal = abs ($ invoice ->getGrandTotal () - $ totalDiscountAmount ) < 0.0001
76
75
? 0 : $ invoice ->getGrandTotal () - $ totalDiscountAmount ;
77
- $ baseGrandTotalWithoutDiscount = $ invoice ->getBaseGrandTotal () - $ baseTotalDiscountAmount ;
78
- $ baseGrandTotal = $ baseGrandTotalWithoutDiscount > 0 && $ baseGrandTotalWithoutDiscount < 0.0001
76
+ $ baseGrandTotal = abs ($ invoice ->getBaseGrandTotal () - $ baseTotalDiscountAmount ) < 0.0001
79
77
? 0 : $ invoice ->getBaseGrandTotal () - $ baseTotalDiscountAmount ;
80
78
$ invoice ->setGrandTotal ($ grandTotal );
81
79
$ invoice ->setBaseGrandTotal ($ baseGrandTotal );
You can’t perform that action at this time.
0 commit comments