Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
including_tax_unit.php
Go to the documentation of this file.
1 <?php
10 
11 $taxCalculationData['including_tax_unit'] = [
12  'config_data' => [
13  SetupUtil::CONFIG_OVERRIDES => [
14  Config::CONFIG_XML_PATH_APPLY_AFTER_DISCOUNT => 1,
15  Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX => 1,
16  Config::XML_PATH_ALGORITHM => Calculation::CALC_UNIT_BASE,
17  ],
18  SetupUtil::TAX_RATE_OVERRIDES => [
19  SetupUtil::TAX_RATE_TX => 20,
20  SetupUtil::TAX_STORE_RATE => 20,
21  ],
22  SetupUtil::TAX_RULE_OVERRIDES => [
23  ],
24  ],
25  'quote_data' => [
26  'billing_address' => [
27  'region_id' => SetupUtil::REGION_TX,
28  ],
29  'shipping_address' => [
30  'region_id' => SetupUtil::REGION_TX,
31  ],
32  'items' => [
33  [
34  'sku' => 'simple1',
35  'price' => 9.99,
36  'qty' => 2,
37  ],
38  ],
39  ],
40  'expected_results' => [
41  'address_data' => [
42  'subtotal' => 16.64,
43  'base_subtotal' => 16.64,
44  'subtotal_incl_tax' => 19.98,
45  'base_subtotal_incl_tax' => 19.98,
46  'tax_amount' => 3.34,
47  'base_tax_amount' => 3.34,
48  'shipping_amount' => 0,
49  'base_shipping_amount' => 0,
50  'shipping_incl_tax' => 0,
51  'base_shipping_incl_tax' => 0,
52  'shipping_taxable' => 0,
53  'base_shipping_taxable' => 0,
54  'shipping_tax_amount' => 0,
55  'base_shipping_tax_amount' => 0,
56  'discount_amount' => 0,
57  'base_discount_amount' => 0,
58  'discount_tax_compensation_amount' => 0,
59  'base_discount_tax_compensation_amount' => 0,
60  'shipping_discount_tax_compensation_amount' => 0,
61  'base_shipping_discount_tax_compensation_amount' => 0,
62  'grand_total' => 19.98,
63  'base_grand_total' => 19.98,
64  ],
65  'items_data' => [
66  'simple1' => [
67  'row_total' => 16.64,
68  'base_row_total' => 16.64,
69  'tax_percent' => 20,
70  'price' => 8.32,
71  'base_price' => 8.32,
72  'price_incl_tax' => 9.99,
73  'base_price_incl_tax' => 9.99,
74  'row_total_incl_tax' => 19.98,
75  'base_row_total_incl_tax' => 19.98,
76  'tax_amount' => 3.34,
77  'base_tax_amount' => 3.34,
78  'discount_amount' => 0,
79  'base_discount_amount' => 0,
80  'discount_percent' => 0,
81  'discount_tax_compensation_amount' => 0,
82  'base_discount_tax_compensation_amount' => 0,
83  ],
84  ],
85  ],
86 ];
$taxCalculationData['including_tax_unit']