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