Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
multi_tax_rule_two_row_calculate_subtotal_yes_row.php
Go to the documentation of this file.
1 <?php
10 
16 $taxCalculationData['multi_tax_rule_two_row_calculate_subtotal_yes_row'] = [
17  'config_data' => [
18  SetupUtil::CONFIG_OVERRIDES => [
19  Config::CONFIG_XML_PATH_APPLY_AFTER_DISCOUNT => 1,
20  Config::XML_PATH_ALGORITHM => Calculation::CALC_ROW_BASE,
21  ],
22  SetupUtil::TAX_RATE_OVERRIDES => [
23  SetupUtil::TAX_RATE_TX => 9,
24  SetupUtil::TAX_RATE_AUSTIN => 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' => 1,
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' => 10.05,
56  'qty' => 1,
57  ],
58  [
59  'sku' => 'simple2',
60  'price' => 10.45,
61  'qty' => 1,
62  ],
63  ],
64  ],
65  'expected_results' => [
66  'address_data' => [
67  'subtotal' => 20.5,
68  'base_subtotal' => 20.5,
69  'subtotal_incl_tax' => 23.36,
70  'base_subtotal_incl_tax' => 23.36,
71  'tax_amount' => 2.86,
72  'base_tax_amount' => 2.86,
73  'shipping_amount' => 0,
74  'base_shipping_amount' => 0,
75  'shipping_incl_tax' => 0,
76  'base_shipping_incl_tax' => 0,
77  'shipping_taxable' => 0,
78  'base_shipping_taxable' => 0,
79  'shipping_tax_amount' => 0,
80  'base_shipping_tax_amount' => 0,
81  'discount_amount' => 0,
82  'base_discount_amount' => 0,
83  'discount_tax_compensation_amount' => 0,
84  'base_discount_tax_compensation_amount' => 0,
85  'shipping_discount_tax_compensation_amount' => 0,
86  'base_shipping_discount_tax_compensation_amount' => 0,
87  'grand_total' => 23.36,
88  'base_grand_total' => 23.36,
89  'applied_taxes' => [
90  SetupUtil::TAX_RATE_TX => [
91  'percent' => 9,
92  'amount' => 1.84,
93  'base_amount' => 1.84,
94  'rates' => [
95  [
96  'code' => SetupUtil::TAX_RATE_TX,
97  'title' => SetupUtil::TAX_RATE_TX,
98  'percent' => 9,
99  ],
100  ],
101  ],
102  SetupUtil::TAX_RATE_AUSTIN => [
103  'percent' => 5,
104  'amount' => 1.02,
105  'base_amount' => 1.02,
106  'rates' => [
107  [
108  'code' => SetupUtil::TAX_RATE_AUSTIN,
109  'title' => SetupUtil::TAX_RATE_AUSTIN,
110  'percent' => 5,
111  ],
112  ],
113  ],
114  ],
115  ],
116  'items_data' => [
117  'simple1' => [
118  'row_total' => 10.05,
119  'base_row_total' => 10.05,
120  'tax_percent' => 14,
121  'price' => 10.05,
122  'base_price' => 10.05,
123  'price_incl_tax' => 11.45,
124  'base_price_incl_tax' => 11.45,
125  'row_total_incl_tax' => 11.45,
126  'base_row_total_incl_tax' => 11.45,
127  'tax_amount' => 1.4,
128  'base_tax_amount' => 1.4,
129  'discount_amount' => 0,
130  'base_discount_amount' => 0,
131  'discount_percent' => 0,
132  'discount_tax_compensation_amount' => 0,
133  'base_discount_tax_compensation_amount' => 0,
134  'applied_taxes' => [
135  [
136  'amount' => 0.9,
137  'base_amount' => 0.9,
138  'percent' => 9,
139  'id' => SetupUtil::TAX_RATE_TX,
140  'rates' => [
141  [
142  'percent' => 9,
143  'code' => SetupUtil::TAX_RATE_TX,
144  'title' => SetupUtil::TAX_RATE_TX,
145  ],
146  ],
147  'item_id' => null,
148  'item_type' => 'product',
149  'associated_item_id' => null,
150  ],
151  [
152  'amount' => 0.5,
153  'base_amount' => 0.5,
154  'percent' => 5,
155  'id' => SetupUtil::TAX_RATE_AUSTIN,
156  'rates' => [
157  [
158  'percent' => 5,
159  'code' => SetupUtil::TAX_RATE_AUSTIN,
160  'title' => SetupUtil::TAX_RATE_AUSTIN,
161  ],
162  ],
163  'item_id' => null,
164  'item_type' => 'product',
165  'associated_item_id' => null,
166  ],
167  ],
168  ],
169  'simple2' => [
170  'row_total' => 10.45,
171  'base_row_total' => 10.45,
172  'tax_percent' => 14,
173  'price' => 10.45,
174  'base_price' => 10.45,
175  'price_incl_tax' => 11.91,
176  'base_price_incl_tax' => 11.91,
177  'row_total_incl_tax' => 11.91,
178  'base_row_total_incl_tax' => 11.91,
179  'tax_amount' => 1.46,
180  'base_tax_amount' => 1.46,
181  'discount_amount' => 0,
182  'base_discount_amount' => 0,
183  'discount_percent' => 0,
184  'discount_tax_compensation_amount' => 0,
185  'base_discount_tax_compensation_amount' => 0,
186  'applied_taxes' => [
187  [
188  'amount' => 0.94,
189  'base_amount' => 0.94,
190  'percent' => 9,
191  'id' => SetupUtil::TAX_RATE_TX,
192  'rates' => [
193  [
194  'percent' => 9,
195  'code' => SetupUtil::TAX_RATE_TX,
196  'title' => SetupUtil::TAX_RATE_TX,
197  ],
198  ],
199  'item_id' => null,
200  'item_type' => 'product',
201  'associated_item_id' => null,
202  ],
203  [
204  'amount' => 0.52,
205  'base_amount' => 0.52,
206  'percent' => 5,
207  'id' => SetupUtil::TAX_RATE_AUSTIN,
208  'rates' => [
209  [
210  'percent' => 5,
211  'code' => SetupUtil::TAX_RATE_AUSTIN,
212  'title' => SetupUtil::TAX_RATE_AUSTIN,
213  ],
214  ],
215  'item_id' => null,
216  'item_type' => 'product',
217  'associated_item_id' => null,
218  ],
219  ],
220  ],
221  ],
222  ],
223 ];
$taxCalculationData['multi_tax_rule_two_row_calculate_subtotal_yes_row']