瀏覽代碼

Correctif

refactoring
Guillaume Bourgeois 1 年之前
父節點
當前提交
0a8864abe7
共有 3 個檔案被更改,包括 5 行新增3 行删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存