@@ -42,38 +42,17 @@ public function resolve(
42
42
/** @var Invoice $invoiceModel */
43
43
$ invoiceModel = $ value ['model ' ];
44
44
$ currency = $ orderModel ->getOrderCurrencyCode ();
45
- $ totals = [
45
+ return [
46
46
'base_grand_total ' => ['value ' => $ invoiceModel ->getBaseGrandTotal (), 'currency ' => $ currency ],
47
47
'grand_total ' => ['value ' => $ invoiceModel ->getGrandTotal (), 'currency ' => $ currency ],
48
48
'subtotal ' => ['value ' => $ invoiceModel ->getSubtotal (), 'currency ' => $ currency ],
49
49
'total_tax ' => ['value ' => $ invoiceModel ->getTaxAmount (), 'currency ' => $ currency ],
50
- 'taxes ' => $ this ->getAppliedTaxes ($ invoiceModel , $ currency ),
51
50
'total_shipping ' => ['value ' => $ invoiceModel ->getShippingAmount (), 'currency ' => $ currency ],
52
51
'shipping_handling ' => [
53
- 'amount_exc_tax ' => ['value ' => $ invoiceModel ->getShippingTaxAmount (), 'currency ' => $ currency ],
54
- 'amount_inc_tax ' => ['value ' => $ invoiceModel ->getShippingInclTax (), 'currency ' => $ currency ],
55
- 'total_amount ' => ['value ' => $ invoiceModel ->getBaseShippingTaxAmount (), 'currency ' => $ currency ],
56
- 'taxes ' => $ this ->getAppliedTaxes ($ invoiceModel , $ currency )
52
+ 'amount_excluding_tax ' => ['value ' => $ invoiceModel ->getShippingAmount (), 'currency ' => $ currency ],
53
+ 'amount_including_tax ' => ['value ' => $ invoiceModel ->getShippingInclTax (), 'currency ' => $ currency ],
54
+ 'total_amount ' => ['value ' => $ invoiceModel ->getBaseShippingAmount (), 'currency ' => $ currency ],
57
55
]
58
56
];
59
- return $ totals ;
60
- }
61
-
62
- /**
63
- * Returns taxes applied to the current invoice
64
- *
65
- * @param Invoice $invoiceModel
66
- * @param string $currency
67
- * @return array
68
- */
69
- private function getAppliedTaxes (Invoice $ invoiceModel , string $ currency ): array
70
- {
71
- $ taxes [] = [
72
- 'rate ' => $ invoiceModel ->getStoreToOrderRate (),
73
- 'title ' => $ invoiceModel ->getCustomerName (),
74
- 'amount ' => [ 'value ' => $ invoiceModel ->getTaxAmount (), 'currency ' => $ currency
75
- ]
76
- ];
77
- return $ taxes ;
78
57
}
79
58
}
0 commit comments