Bladeren bron

Correctif

refactoring
Guillaume Bourgeois 1 jaar geleden
bovenliggende
commit
0a8864abe7
3 gewijzigde bestanden met toevoegingen van 5 en 3 verwijderingen
  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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

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

Laden…
Annuleren
Opslaan