@@ -682,23 +682,17 @@ public function getCalculatedTaxes($source)
682
682
* 'tax_amount' => $taxAmount,
683
683
* 'base_tax_amount' => $baseTaxAmount,
684
684
* 'title' => $title,
685
- * 'percent' => $percent,
686
- * 'type' => $type
685
+ * 'percent' => $percent
687
686
* )
688
687
* )
689
688
*
690
689
* @param array $taxClassAmount
691
690
* @param OrderTaxDetailsItemInterface $itemTaxDetail
692
691
* @param float $ratio
693
- * @param string $type
694
692
* @return array
695
693
*/
696
- private function _aggregateTaxes (
697
- $ taxClassAmount ,
698
- OrderTaxDetailsItemInterface $ itemTaxDetail ,
699
- $ ratio ,
700
- $ type = 'product '
701
- ) {
694
+ private function _aggregateTaxes ($ taxClassAmount , OrderTaxDetailsItemInterface $ itemTaxDetail , $ ratio )
695
+ {
702
696
$ itemAppliedTaxes = $ itemTaxDetail ->getAppliedTaxes ();
703
697
foreach ($ itemAppliedTaxes as $ itemAppliedTax ) {
704
698
$ taxAmount = $ itemAppliedTax ->getAmount () * $ ratio ;
@@ -711,7 +705,6 @@ private function _aggregateTaxes(
711
705
if (!isset ($ taxClassAmount [$ taxCode ])) {
712
706
$ taxClassAmount [$ taxCode ]['title ' ] = $ itemAppliedTax ->getTitle ();
713
707
$ taxClassAmount [$ taxCode ]['percent ' ] = $ itemAppliedTax ->getPercent ();
714
- $ taxClassAmount [$ taxCode ]['type ' ] = $ type ;
715
708
$ taxClassAmount [$ taxCode ]['tax_amount ' ] = $ taxAmount ;
716
709
$ taxClassAmount [$ taxCode ]['base_tax_amount ' ] = $ baseTaxAmount ;
717
710
} else {
@@ -835,7 +828,6 @@ protected function calculateTaxForItems(EntityInterface $order, EntityInterface
835
828
}
836
829
837
830
// Apply any taxes for shipping
838
- $ shippingType = \Magento \Sales \Model \Quote \Address::TYPE_SHIPPING ;
839
831
$ shippingTaxAmount = $ salesItem ->getShippingTaxAmount ();
840
832
$ originalShippingTaxAmount = $ order ->getShippingTaxAmount ();
841
833
if ($ shippingTaxAmount && $ originalShippingTaxAmount &&
@@ -846,9 +838,9 @@ protected function calculateTaxForItems(EntityInterface $order, EntityInterface
846
838
$ itemTaxDetails = $ orderTaxDetails ->getItems ();
847
839
foreach ($ itemTaxDetails as $ itemTaxDetail ) {
848
840
//Aggregate taxable items associated with shipping
849
- if ($ itemTaxDetail ->getType () == $ shippingType ) {
841
+ if ($ itemTaxDetail ->getType () == \ Magento \ Sales \ Model \ Quote \Address:: TYPE_SHIPPING ) {
850
842
$ taxClassAmount =
851
- $ this ->_aggregateTaxes ($ taxClassAmount , $ itemTaxDetail , $ shippingRatio, $ shippingType );
843
+ $ this ->_aggregateTaxes ($ taxClassAmount , $ itemTaxDetail , $ shippingRatio );
852
844
}
853
845
}
854
846
}
0 commit comments