Skip to content

Commit b8c0260

Browse files
committed
MC-20639: MyAccount :: Order Details :: Refund (creditMemo) Details by Order Number
- fix base currency
1 parent b39f0d8 commit b8c0260

File tree

4 files changed

+53
-38
lines changed

4 files changed

+53
-38
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/CreditmemoTest.php

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,19 @@ public function testCreditMemoForLoggedInCustomerQuery(): void
114114
'value' => 20
115115
],
116116
'grand_total' => [
117-
'value' => 20
117+
'value' => 20,
118+
'currency' => 'USD'
118119
],
119120
'base_grand_total' => [
120-
'value' => 10
121+
'value' => 10,
122+
'currency' => 'EUR'
121123
],
122124
'total_shipping' => [
123125
'value' => 0
124126
],
125-
'total_tax' => [],
127+
'total_tax' => [
128+
'value' => 0
129+
],
126130
'shipping_handling' => [
127131
'amount_including_tax' => [
128132
'value' => 0
@@ -134,7 +138,7 @@ public function testCreditMemoForLoggedInCustomerQuery(): void
134138
'value' => 0
135139
],
136140
'taxes' => [],
137-
'discounts' => [],
141+
// 'discounts' => [],
138142
],
139143
'adjustment' => [
140144
'value' => 1.23
@@ -211,15 +215,19 @@ public function testCreditMemoForBundledProductsWithPartialRefund()
211215
'value' => 15
212216
],
213217
'grand_total' => [
214-
'value' => 23
218+
'value' => 23,
219+
'currency' => 'USD'
215220
],
216221
'base_grand_total' => [
217-
'value' => 23
222+
'value' => 23,
223+
'currency' => 'USD'
218224
],
219225
'total_shipping' => [
220226
'value' => 10
221227
],
222-
'total_tax' => [],
228+
'total_tax' => [
229+
'value' => 0
230+
],
223231
'shipping_handling' => [
224232
'amount_including_tax' => [
225233
'value' => 10
@@ -231,7 +239,7 @@ public function testCreditMemoForBundledProductsWithPartialRefund()
231239
'value' => 10
232240
],
233241
'taxes' => [],
234-
'discounts' => [],
242+
// 'discounts' => [],
235243
],
236244
'adjustment' => [
237245
'value' => 2
@@ -322,10 +330,12 @@ public function testCreditMemoForBundleProductWithTaxesAndDiscounts()
322330
'value' => 15
323331
],
324332
'grand_total' => [
325-
'value' => 24.19
333+
'value' => 24.19,
334+
'currency' => 'USD'
326335
],
327336
'base_grand_total' => [
328-
'value' => 24.19
337+
'value' => 24.19,
338+
'currency' => 'USD'
329339
],
330340
'total_shipping' => [
331341
'value' => 10
@@ -345,16 +355,16 @@ public function testCreditMemoForBundleProductWithTaxesAndDiscounts()
345355
],
346356
'taxes'=> [
347357
0 => [
348-
'amount'=>['value' => 1.69],
358+
'amount'=>['value' => 0.67],
349359
'title' => 'US-TEST-*-Rate-1',
350360
'rate' => 7.5
351361
]
352362
],
353-
'discounts' => [
354-
0 => ['amount'=>['value'=> 2.5],
355-
'label' => 'Discount Label for 10% off'
356-
]
357-
],
363+
// 'discounts' => [
364+
// 0 => ['amount'=>['value'=> 1],
365+
// 'label' => 'Discount Label for 10% off'
366+
// ]
367+
// ],
358368
],
359369
'adjustment' => [
360370
'value' => 0
@@ -751,9 +761,11 @@ private function getCustomerOrderWithCreditMemoQuery(): array
751761
}
752762
base_grand_total {
753763
value
764+
currency
754765
}
755766
grand_total {
756767
value
768+
currency
757769
}
758770
total_shipping {
759771
value
@@ -766,7 +778,7 @@ private function getCustomerOrderWithCreditMemoQuery(): array
766778
amount_excluding_tax{value}
767779
total_amount{value}
768780
taxes {amount{value} title rate}
769-
discounts {amount{value} label}
781+
# discounts {amount{value} label}
770782
}
771783
adjustment {
772784
value

dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/InvoiceTest.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ public function testSingleInvoiceForLoggedInCustomerQuery()
9494
'currency' => 'USD'
9595
],
9696
'taxes' => [],
97-
'discounts' => []
97+
// 'discounts' => []
9898
],
9999
'taxes' => [],
100100
'discounts' => [],
101101
'base_grand_total' => [
102102
'value' => 100,
103-
'currency' => 'USD'
103+
'currency' => 'EUR'
104104
],
105105
'total_tax' => [
106106
'value' => 0,
@@ -154,7 +154,7 @@ public function testMultipleInvoiceForLoggedInCustomerQuery()
154154
],
155155
'base_grand_total' => [
156156
'value' => 50,
157-
'currency' => 'USD'
157+
'currency' => 'EUR'
158158
],
159159
'total_tax' => [
160160
'value' => 0,
@@ -174,7 +174,7 @@ public function testMultipleInvoiceForLoggedInCustomerQuery()
174174
'currency' => 'USD'
175175
],
176176
'taxes' => [],
177-
'discounts' => [],
177+
// 'discounts' => [],
178178
],
179179
'taxes' => [],
180180
'discounts' => [],
@@ -204,7 +204,7 @@ public function testMultipleInvoiceForLoggedInCustomerQuery()
204204
],
205205
'base_grand_total' => [
206206
'value' => 0,
207-
'currency' => 'USD'
207+
'currency' => 'EUR'
208208
],
209209
'total_tax' => [
210210
'value' => 0,
@@ -228,7 +228,7 @@ public function testMultipleInvoiceForLoggedInCustomerQuery()
228228
'currency' => 'USD'
229229
],
230230
'taxes' => [],
231-
'discounts' => [],
231+
// 'discounts' => [],
232232
],
233233
'taxes' => [],
234234
'discounts' => [],
@@ -466,12 +466,12 @@ private function assertTotalsAndShippingWithTaxesAndDiscounts(array $customerOrd
466466
'rate' => 7.5
467467
]
468468
],
469-
'discounts'=> [
470-
0 => [
471-
'amount'=>['value' => 0.07, 'currency'=> 'USD'],
472-
'label' => 'Discount Label for 10% off'
473-
]
474-
],
469+
// 'discounts'=> [
470+
// 0 => [
471+
// 'amount'=>['value' => 0.07, 'currency'=> 'USD'],
472+
// 'label' => 'Discount Label for 10% off'
473+
// ]
474+
// ],
475475
]
476476
];
477477
$this->assertResponseFields($customerOrderItemTotal, $assertionMap);
@@ -509,12 +509,12 @@ private function assertTotalsAndShippingWithTaxesAndDiscountsForOneQty(array $cu
509509
'rate' => 7.5
510510
]
511511
],
512-
'discounts'=> [
513-
0 => [
514-
'amount'=>['value' => 0.07, 'currency'=> 'USD'],
515-
'label' => 'Discount Label for 10% off'
516-
]
517-
],
512+
// 'discounts'=> [
513+
// 0 => [
514+
// 'amount'=>['value' => 0.07, 'currency'=> 'USD'],
515+
// 'label' => 'Discount Label for 10% off'
516+
// ]
517+
// ],
518518
]
519519
];
520520
$this->assertResponseFields($customerOrderItemTotal, $assertionMap);
@@ -827,7 +827,7 @@ private function getCustomerInvoicesBasedOnOrderNumber($orderNumber): array
827827
amount_excluding_tax{value currency}
828828
total_amount{value currency}
829829
taxes {amount{value} title rate}
830-
discounts {amount{value currency} label}
830+
# discounts {amount{value currency} label}
831831
}
832832
}
833833
}

dev/tests/integration/testsuite/Magento/Sales/_files/customer_invoice_with_two_products_and_custom_options.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
use Magento\TestFramework\Workaround\Override\Fixture\Resolver;
8+
use Magento\Sales\Api\InvoiceManagementInterface;
89

910
Resolver::getInstance()->requireDataFixture('Magento/Customer/_files/customer.php');
1011
Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/products_in_category.php');
@@ -97,12 +98,13 @@
9798
$order->setBaseGrandTotal(100);
9899
$order->setGrandTotal(100);
99100
$order->setOrderCurrencyCode('USD');
101+
$order->setBaseCurrencyCode('EUR');
100102
$order->setCustomerId(1)
101103
->setCustomerIsGuest(false)
102104
->save();
103-
105+
/** @var InvoiceManagementInterface $orderService */
104106
$orderService = $objectManager->create(
105-
\Magento\Sales\Api\InvoiceManagementInterface::class
107+
InvoiceManagementInterface::class
106108
);
107109
$invoice = $orderService->prepareInvoice($order);
108110
$invoice->register();

dev/tests/integration/testsuite/Magento/Sales/_files/customer_multiple_invoices_with_two_products_and_custom_options.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
$order->setBaseGrandTotal(60);
9898
$order->setGrandTotal(60);
9999
$order->setOrderCurrencyCode('USD');
100+
$order->setBaseCurrencyCode('EUR');
100101
$order->setCustomerId(1)
101102
->setCustomerIsGuest(false)
102103
->save();

0 commit comments

Comments
 (0)