@@ -40,14 +40,14 @@ public function collect(Creditmemo $creditmemo)
40
40
41
41
if ($ orderItemQty ) {
42
42
/** Check item tax amount */
43
- $ tax = ( $ orderItemTax - $ orderItem ->getTaxRefunded () );
44
- $ baseTax = ( $ baseOrderItemTax - $ orderItem ->getBaseTaxRefunded () );
45
- $ discountTaxCompensation = ( $ orderItem ->getDiscountTaxCompensationInvoiced ()
46
- - $ orderItem ->getDiscountTaxCompensationRefunded ()) ;
47
- $ baseDiscountTaxCompensation = ( $ orderItem ->getBaseDiscountTaxCompensationInvoiced ()
48
- - $ orderItem ->getBaseDiscountTaxCompensationRefunded ()) ;
43
+ $ tax = $ orderItemTax - $ orderItem ->getTaxRefunded ();
44
+ $ baseTax = $ baseOrderItemTax - $ orderItem ->getBaseTaxRefunded ();
45
+ $ discountTaxCompensation = $ orderItem ->getDiscountTaxCompensationInvoiced ()
46
+ - $ orderItem ->getDiscountTaxCompensationRefunded ();
47
+ $ baseDiscountTaxCompensation = $ orderItem ->getBaseDiscountTaxCompensationInvoiced ()
48
+ - $ orderItem ->getBaseDiscountTaxCompensationRefunded ();
49
49
if (!$ item ->isLast ()) {
50
- $ availableQty = ( $ orderItemQty - $ orderItem ->getQtyRefunded () );
50
+ $ availableQty = $ orderItemQty - $ orderItem ->getQtyRefunded ();
51
51
$ tax = $ creditmemo ->roundPrice ($ tax / $ availableQty * $ item ->getQty ());
52
52
$ baseTax = $ creditmemo ->roundPrice (($ baseTax / $ availableQty * $ item ->getQty ()), 'base ' );
53
53
$ discountTaxCompensation = $ creditmemo ->roundPrice (
@@ -76,10 +76,10 @@ public function collect(Creditmemo $creditmemo)
76
76
if ($ invoice = $ creditmemo ->getInvoice ()) {
77
77
// recalculate tax amounts in case if refund shipping value was changed
78
78
if ($ baseOrderShippingAmount && $ creditmemo ->getBaseShippingAmount () !== null ) {
79
- $ taxFactor = ( $ creditmemo ->getBaseShippingAmount () / $ baseOrderShippingAmount) ;
80
- $ shippingTaxAmount = ( $ invoice ->getShippingTaxAmount () * $ taxFactor) ;
81
- $ baseShippingTaxAmount = ( $ invoice ->getBaseShippingTaxAmount () * $ taxFactor) ;
82
- $ totalDiscountTaxCompensation += ( $ invoice ->getShippingDiscountTaxCompensationAmount () * $ taxFactor) ;
79
+ $ taxFactor = $ creditmemo ->getBaseShippingAmount () / $ baseOrderShippingAmount ;
80
+ $ shippingTaxAmount = $ invoice ->getShippingTaxAmount () * $ taxFactor ;
81
+ $ baseShippingTaxAmount = $ invoice ->getBaseShippingTaxAmount () * $ taxFactor ;
82
+ $ totalDiscountTaxCompensation += $ invoice ->getShippingDiscountTaxCompensationAmount () * $ taxFactor ;
83
83
$ baseTotalDiscountTaxCompensation += $ invoice ->getBaseShippingDiscountTaxCompensationAmnt ()
84
84
* $ taxFactor ;
85
85
$ shippingTaxAmount = $ creditmemo ->roundPrice ($ shippingTaxAmount );
@@ -102,10 +102,10 @@ public function collect(Creditmemo $creditmemo)
102
102
$ shippingDelta = ($ baseOrderShippingAmount - $ baseOrderShippingRefundedAmount );
103
103
104
104
if ($ shippingDelta > $ creditmemo ->getBaseShippingAmount ()) {
105
- $ part = ( $ creditmemo ->getShippingAmount () / $ orderShippingAmount) ;
106
- $ basePart = ( $ creditmemo ->getBaseShippingAmount () / $ baseOrderShippingAmount) ;
107
- $ shippingTaxAmount = ( $ order ->getShippingTaxAmount () * $ part) ;
108
- $ baseShippingTaxAmount = ( $ order ->getBaseShippingTaxAmount () * $ basePart) ;
105
+ $ part = $ creditmemo ->getShippingAmount () / $ orderShippingAmount ;
106
+ $ basePart = $ creditmemo ->getBaseShippingAmount () / $ baseOrderShippingAmount ;
107
+ $ shippingTaxAmount = $ order ->getShippingTaxAmount () * $ part ;
108
+ $ baseShippingTaxAmount = $ order ->getBaseShippingTaxAmount () * $ basePart ;
109
109
$ shippingDiscountTaxCompensationAmount = $ order ->getShippingDiscountTaxCompensationAmount () * $ part ;
110
110
$ baseShippingDiscountTaxCompensationAmount = $ order ->getBaseShippingDiscountTaxCompensationAmnt ()
111
111
* $ basePart ;
0 commit comments