Selaa lähdekoodia

Correctif

refactoring
Guillaume Bourgeois 1 vuosi sitten
vanhempi
commit
0a8864abe7
3 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  1. +0
    -2
      backend/controllers/OrderController.php
  2. +4
    -1
      common/logic/Order/Order/Service/OrderBuilder.php
  3. +1
    -0
      producer/controllers/OrderController.php

+ 0
- 2
backend/controllers/OrderController.php Näytä tiedosto

@@ -734,7 +734,6 @@ class OrderController extends BackendController
$orderManager = $this->getOrderManager();

$order = $orderManager->findOneOrderById($idOrder);
$orderManager->initOrder($order);
if ($order) {
$orderManager->deleteOrder($order);
}
@@ -749,7 +748,6 @@ class OrderController extends BackendController
public function actionDelete(string $date, int $idOrder)
{
$orderManager = $this->getOrderManager();

$order = $orderManager->findOneOrderById($idOrder);
if ($order) {
$orderManager->deleteOrder($order);

+ 4
- 1
common/logic/Order/Order/Service/OrderBuilder.php Näytä tiedosto

@@ -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);


+ 1
- 0
producer/controllers/OrderController.php Näytä tiedosto

@@ -540,6 +540,7 @@ class OrderController extends ProducerBaseController
{
$orderManager = $this->getOrderManager();
$order = $this->getOrderManager()->findOneOrderById($id);
$orderManager->initOrder($order);

if (!$order) {
throw new \yii\web\NotFoundHttpException('Commande introuvable');

Loading…
Peruuta
Tallenna