File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Model/Order/Creditmemo/Total
Test/Unit/Model/Order/Creditmemo/Total Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Sales \Model \Order \Creditmemo \Total ;
7
7
8
+ /**
9
+ * Order credit memo tax total calculation model
10
+ */
8
11
class Tax extends AbstractTotal
9
12
{
10
13
/**
14
+ * Collect credit memo tax total
15
+ *
11
16
* @param \Magento\Sales\Model\Order\Creditmemo $creditmemo
12
17
* @return $this
13
18
*
@@ -72,7 +77,7 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo)
72
77
$ isPartialShippingRefunded = false ;
73
78
if ($ invoice = $ creditmemo ->getInvoice ()) {
74
79
//recalculate tax amounts in case if refund shipping value was changed
75
- if ($ order ->getBaseShippingAmount () && $ creditmemo ->getBaseShippingAmount ()) {
80
+ if ($ order ->getBaseShippingAmount () && $ creditmemo ->getBaseShippingAmount () !== null ) {
76
81
$ taxFactor = $ creditmemo ->getBaseShippingAmount () / $ order ->getBaseShippingAmount ();
77
82
$ shippingTaxAmount = $ invoice ->getShippingTaxAmount () * $ taxFactor ;
78
83
$ baseShippingTaxAmount = $ invoice ->getBaseShippingTaxAmount () * $ taxFactor ;
Original file line number Diff line number Diff line change @@ -447,10 +447,10 @@ public function collectDataProvider()
447
447
],
448
448
],
449
449
'creditmemo_data ' => [
450
- 'grand_total ' => 64.95 ,
451
- 'base_grand_total ' => 64.95 ,
452
- 'tax_amount ' => 4.95 ,
453
- 'base_tax_amount ' => 4.95 ,
450
+ 'grand_total ' => 64.94 ,
451
+ 'base_grand_total ' => 64.94 ,
452
+ 'tax_amount ' => 4.94 ,
453
+ 'base_tax_amount ' => 4.94 ,
454
454
],
455
455
],
456
456
];
You can’t perform that action at this time.
0 commit comments