Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
multi_tax_rule_unit_calculate_subtotal_no.php
Go to the documentation of this file.
1 <?php
10 
16 $taxCalculationData['multi_tax_rule_unit_calculate_subtotal_no'] = [
17  'config_data' => [
18  SetupUtil::CONFIG_OVERRIDES => [
19  Config::CONFIG_XML_PATH_APPLY_AFTER_DISCOUNT => 1,
20  Config::XML_PATH_ALGORITHM => Calculation::CALC_UNIT_BASE,
21  ],
22  SetupUtil::TAX_RATE_OVERRIDES => [
23  SetupUtil::TAX_RATE_TX => 7.5,
24  SetupUtil::TAX_RATE_AUSTIN => 5.5,
25  ],
26  SetupUtil::TAX_RULE_OVERRIDES => [
27  [
28  //tax rule 1 for product
29  'code' => 'Product Tax Rule TX',
30  'product_tax_class_ids' => [SetupUtil::PRODUCT_TAX_CLASS_1],
31  'tax_rate_ids' => [SetupUtil::TAX_RATE_TX],
32  'priority' => 1,
33  ],
34  [
35  //tax rule 2 for product
36  'code' => 'Product Tax Rule AUSTIN',
37  'product_tax_class_ids' => [SetupUtil::PRODUCT_TAX_CLASS_1],
38  'tax_rate_ids' => [SetupUtil::TAX_RATE_AUSTIN],
39  'priority' => 2,
40  'calculate_subtotal' => 0,
41  ],
42  ],
43  ],
44  'quote_data' => [
45  'billing_address' => [
46  'region_id' => SetupUtil::REGION_TX,
47  ],
48  'shipping_address' => [
49  'region_id' => SetupUtil::REGION_TX,
50  'tax_postcode' => SetupUtil::AUSTIN_POST_CODE,
51  ],
52  'items' => [
53  [
54  'sku' => 'simple1',
55  'price' => 1,
56  'qty' => 10,
57  ],
58  ],
59  ],
60  'expected_results' => [
61  'address_data' => [
62  'subtotal' => 10,
63  'base_subtotal' => 10,
64  'subtotal_incl_tax' => 11.4,
65  'base_subtotal_incl_tax' => 11.4,
66  'tax_amount' => 1.4,
67  'base_tax_amount' => 1.4,
68  'shipping_amount' => 0,
69  'base_shipping_amount' => 0,
70  'shipping_incl_tax' => 0,
71  'base_shipping_incl_tax' => 0,
72  'shipping_taxable' => 0,
73  'base_shipping_taxable' => 0,
74  'shipping_tax_amount' => 0,
75  'base_shipping_tax_amount' => 0,
76  'discount_amount' => 0,
77  'base_discount_amount' => 0,
78  'discount_tax_compensation_amount' => 0,
79  'base_discount_tax_compensation_amount' => 0,
80  'shipping_discount_tax_compensation_amount' => 0,
81  'base_shipping_discount_tax_compensation_amount' => 0,
82  'grand_total' => 11.4,
83  'base_grand_total' => 11.4,
84  'applied_taxes' => [
85  SetupUtil::TAX_RATE_TX => [
86  'percent' => 7.5,
87  'amount' => 0.8,
88  'base_amount' => 0.8,
89  'rates' => [
90  [
91  'code' => SetupUtil::TAX_RATE_TX,
92  'title' => SetupUtil::TAX_RATE_TX,
93  'percent' => 7.5,
94  ],
95  ],
96  ],
97  SetupUtil::TAX_RATE_AUSTIN => [
98  'percent' => 5.9125,
99  'amount' => 0.6,
100  'base_amount' => 0.6,
101  'rates' => [
102  [
103  'code' => SetupUtil::TAX_RATE_AUSTIN,
104  'title' => SetupUtil::TAX_RATE_AUSTIN,
105  'percent' => 5.5,
106  ],
107  ],
108  ],
109  ],
110  ],
111  'items_data' => [
112  'simple1' => [
113  'row_total' => 10,
114  'base_row_total' => 10,
115  'tax_percent' => 13.4125,
116  'price' => 1,
117  'base_price' => 1,
118  'price_incl_tax' => 1.14,
119  'base_price_incl_tax' => 1.14,
120  'row_total_incl_tax' => 11.4,
121  'base_row_total_incl_tax' => 11.4,
122  'tax_amount' => 1.4,
123  'base_tax_amount' => 1.4,
124  'discount_amount' => 0,
125  'base_discount_amount' => 0,
126  'discount_percent' => 0,
127  'discount_tax_compensation_amount' => 0,
128  'base_discount_tax_compensation_amount' => 0,
129  ],
130  ],
131  ],
132 ];
$taxCalculationData['multi_tax_rule_unit_calculate_subtotal_no']