|
|
@@ -210,13 +210,14 @@ class OrderBuilder extends AbstractBuilder |
|
|
|
foreach ($ordersArray as $order) { |
|
|
|
|
|
|
|
$theOrder = $this->orderRepository->findOneOrderById($order->id); |
|
|
|
$this->initOrder($theOrder); |
|
|
|
|
|
|
|
// remboursement de la commande |
|
|
|
if ($theOrder->id_user && $this->orderSolver->getOrderAmount($theOrder, Order::AMOUNT_PAID) && $configCredit) { |
|
|
|
|
|
|
|
$this->creditHistoryBuilder->createCreditHistory( |
|
|
|
CreditHistory::TYPE_REFUND, |
|
|
|
$this->orderSolver->getAmount($theOrder, Order::AMOUNT_PAID), |
|
|
|
$this->orderSolver->getOrderAmount($theOrder, Order::AMOUNT_PAID), |
|
|
|
$theOrder->distribution->producer, |
|
|
|
$theOrder->user, |
|
|
|
GlobalParam::getCurrentUser() |
|
|
@@ -440,6 +441,8 @@ class OrderBuilder extends AbstractBuilder |
|
|
|
// delete |
|
|
|
public function deleteOrder(Order $order, bool $force = false): bool |
|
|
|
{ |
|
|
|
$this->initOrder($order); |
|
|
|
|
|
|
|
// remboursement si l'utilisateur a payé pour cette commande |
|
|
|
$amountPaid = $this->orderSolver->getOrderAmount($order, Order::AMOUNT_PAID); |
|
|
|
|