Skip to content

Commit e9d102b

Browse files
author
Manasa Potluri
committed
MAGETWO-34068: Incorrect tax details and amounts in frontend and backend order
- CR changes
1 parent 3c24dc9 commit e9d102b

File tree

3 files changed

+5
-29
lines changed

3 files changed

+5
-29
lines changed

app/code/Magento/Tax/Model/Observer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ public function salesEventOrderAfterSave(\Magento\Framework\Event\Observer $obse
161161
'real_base_amount' => $rates['base_amount'],
162162
];
163163
} else {
164-
$percentDelta = $rates['percent'];
165164
$percentSum = 0;
166165
foreach ($rates['rates'] as $rate) {
167166
$real_amount = $rates['amount'] * $rate['percent'] / $rates['percent'];

app/code/Magento/Tax/Model/Quote/ToOrderConverter.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,21 @@ public function afterConvert(QuoteAddressToOrder $subject, OrderInterface $order
3939
{
4040
/** @var \Magento\Sales\Model\Order $order */
4141
$taxes = $this->quoteAddress->getAppliedTaxes();
42-
$customAttributes = $order->getCustomAttributes();
4342
if (is_array($taxes)) {
4443
if (is_array($order->getAppliedTaxes())) {
4544
$taxes = array_merge($order->getAppliedTaxes(), $taxes);
4645
}
47-
$customAttributes = array_merge($customAttributes, ['applied_taxes' => $taxes], ['converting_from_quote' => true]);
46+
$order->setCustomAttribute('applied_taxes', $taxes);
47+
$order->setCustomAttribute('converting_from_quote', true);
4848
}
4949

5050
$itemAppliedTaxes = $this->quoteAddress->getItemsAppliedTaxes();
5151
if (is_array($itemAppliedTaxes)) {
5252
if (is_array($order->getItemAppliedTaxes())) {
5353
$itemAppliedTaxes = array_merge($order->getItemAppliedTaxes(), $itemAppliedTaxes);
5454
}
55-
$customAttributes = array_merge($customAttributes, ['item_applied_taxes' => $itemAppliedTaxes]);
55+
$order->setCustomAttribute('item_applied_taxes', $itemAppliedTaxes);
5656
}
57-
$order->setData('custom_attributes', $customAttributes);
5857
return $order;
5958
}
6059
}

app/code/Magento/Tax/etc/fieldset.xml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Object/etc/fieldset.xsd">
1010
<scope id="global">
11-
<fieldset id="sales_convert_quote_address">
11+
<fieldset id="quote_convert_address">
1212
<field name="subtotal_incl_tax">
1313
<aspect name="to_order" />
1414
</field>
1515
<field name="base_subtotal_incl_tax">
1616
<aspect name="to_order" />
1717
</field>
1818
</fieldset>
19-
<fieldset id="sales_convert_quote_item">
19+
<fieldset id="quote_convert_item">
2020
<field name="price_incl_tax">
2121
<aspect name="to_order_item" />
2222
</field>
@@ -42,27 +42,5 @@
4242
<aspect name="to_cm_item" />
4343
</field>
4444
</fieldset>
45-
<fieldset id="quote_convert_address">
46-
<field name="subtotal_incl_tax">
47-
<aspect name="to_order" />
48-
</field>
49-
<field name="base_subtotal_incl_tax">
50-
<aspect name="to_order" />
51-
</field>
52-
</fieldset>
53-
<fieldset id="quote_convert_item">
54-
<field name="price_incl_tax">
55-
<aspect name="to_order_item" />
56-
</field>
57-
<field name="base_price_incl_tax">
58-
<aspect name="to_order_item" />
59-
</field>
60-
<field name="row_total_incl_tax">
61-
<aspect name="to_order_item" />
62-
</field>
63-
<field name="base_row_total_incl_tax">
64-
<aspect name="to_order_item" />
65-
</field>
66-
</fieldset>
6745
</scope>
6846
</config>

0 commit comments

Comments
 (0)