Skip to content

Commit 8c97683

Browse files
authored
MDEE-479: Add order level discount and grand total to sales order (#294)
MDEE-479: Add order level discount and grand total to sales order
1 parent 5fe4d52 commit 8c97683

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

SalesOrdersDataExporter/Test/Integration/CreateOrderTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,9 @@ private function getExpectedOrderData(OrderInterface $order): array
549549
'state' => $this->mapOrderState($order->getState()),
550550
'status' => $order->getStatus(),
551551
'totalInvoiced' => $order->getBaseTotalInvoiced(),
552-
'grandTotal' => $order->getSubtotal(),
552+
'subtotal' => $order->getBaseSubtotal(),
553+
'grandTotal' => $order->getBaseGrandTotal(),
554+
'discountAmount' => $order->getBaseDiscountAmount(),
553555
'currency' => $order->getOrderCurrencyCode(),
554556
'amountPaid' => $order->getPayment()->getBaseAmountPaid(),
555557
'storeViewCode' => $order->getStore()->getCode(),

SalesOrdersDataExporter/etc/et_schema.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
<field name="totalInvoiced" type="Float" />
4141
<field name="totalQtyOrdered" type="Float" />
4242
<field name="isVirtual" type="Boolean" />
43+
<field name="subtotal" type="Float" />
4344
<field name="grandTotal" type="Float" />
45+
<field name="discountAmount" type="Float" />
4446
<field name="currency" type="String" />
4547
<field name="amountCapturedOnline" type="Float" />
4648
<field name="amountRefundedOnline" type="Float" />

SalesOrdersDataExporter/etc/query.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
<attribute name="base_total_invoiced" alias="totalInvoiced" />
1919
<attribute name="total_qty_ordered" alias="totalQtyOrdered" />
2020
<attribute name="is_virtual" alias="isVirtual" />
21-
<attribute name="subtotal" alias="grandTotal" />
21+
<attribute name="base_subtotal" alias="subtotal" />
22+
<attribute name="base_grand_total" alias="grandTotal" />
23+
<attribute name="base_discount_amount" alias="discountAmount" />
2224
<attribute name="order_currency_code" alias="currency" />
2325
<attribute name="store_id" alias="storeId" />
2426
<attribute name="customer_email" alias="customerEmail" />

0 commit comments

Comments
 (0)