From 24058e5772e9b764b0ca943cc06eef2da20bb521 Mon Sep 17 00:00:00 2001 From: Alexandre Segura Date: Thu, 28 Nov 2024 14:04:39 +0100 Subject: [PATCH] Fix error when exporting Edenred transactions. Fixes #4762. --- src/Controller/Utils/RestaurantTrait.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Controller/Utils/RestaurantTrait.php b/src/Controller/Utils/RestaurantTrait.php index 647d929cb1..5c60c2c5dc 100644 --- a/src/Controller/Utils/RestaurantTrait.php +++ b/src/Controller/Utils/RestaurantTrait.php @@ -1635,15 +1635,15 @@ public function edenredTransactionsAction( ]; $records = []; - foreach ($hash[$exported] as $payment) { + foreach ($hash[$exported] as $order) { - $order = $payment->getOrder(); + $edenredPayment = $order->getLastPaymentByMethod('EDENRED', PaymentInterface::STATE_COMPLETED); $records[] = [ $order->getNumber(), $order->getShippingTimeRange()->getLower()->format('Y-m-d'), $numberFormatter->format($order->getTotal() / 100), - $numberFormatter->format($payment->getAmountForMethod('EDENRED') / 100), + $numberFormatter->format($edenredPayment->getAmount() / 100), $numberFormatter->format($order->getFeeTotal() / 100), ]; }