瀏覽代碼

Correctif

refactoring
Guillaume Bourgeois 1 年之前
父節點
當前提交
5696eab031
共有 2 個檔案被更改,包括 17 行新增19 行删除
  1. +16
    -18
      common/logic/Order/Order/Service/OrderBuilder.php
  2. +1
    -1
      producer/web/js/vuejs/order-order.js

+ 16
- 18
common/logic/Order/Order/Service/OrderBuilder.php 查看文件

@@ -226,7 +226,7 @@ class OrderBuilder extends AbstractBuilder

$this->deleteOrder($order, true);

$countOrdersDeleted ++;
$countOrdersDeleted++;
}
}

@@ -252,7 +252,7 @@ class OrderBuilder extends AbstractBuilder
$productsAdd = true;
}

if(!$productsAdd) {
if (!$productsAdd) {
$this->deleteOrder($order);
}

@@ -290,7 +290,7 @@ class OrderBuilder extends AbstractBuilder
public function initOrderAutoPaymentFromSubscription(Order $order, Subscription $subscription): void
{
$pointSale = $subscription->pointSale;
if($pointSale) {
if ($pointSale) {
$creditFunctioning = $this->producerRepository->getPointSaleCreditFunctioning($pointSale);

$order->auto_payment = 0;
@@ -322,7 +322,7 @@ class OrderBuilder extends AbstractBuilder
// addUserPointSale
public function createUserPointSale(Order $order): void
{
if($order->user) {
if ($order->user) {
$this->pointSaleBuilder->addUser($order->user, $order->pointSale);
}
}
@@ -330,7 +330,7 @@ class OrderBuilder extends AbstractBuilder
// initCommentPointSale
public function initOrderCommentPointSale(Order $order): void
{
if($order->user && $order->pointSale) {
if ($order->user && $order->pointSale) {
$userPointSale = $this->userPointSaleRepository->findOneUserPointSale($order->user, $order->pointSale);

if ($userPointSale && strlen($userPointSale->comment)) {
@@ -399,11 +399,11 @@ class OrderBuilder extends AbstractBuilder

// addVat
public function addProductOrderVat(
Order $order,
string $typeTotal,
float $priceTotalWithoutTax,
Order $order,
string $typeTotal,
float $priceTotalWithoutTax,
TaxRate $taxRate,
string $taxCalculationMethod): void
string $taxCalculationMethod): void
{
$fieldName = $this->orderSolver->getFieldNameAmount($typeTotal, 'vat');

@@ -466,8 +466,7 @@ class OrderBuilder extends AbstractBuilder
$this->productOrderBuilder->deleteProductOrdersByOrder($order);

return $this->delete($order);
}
// status 'delete'
} // status 'delete'
elseif ($this->producerRepository->getConfig('option_behavior_cancel_order') == Producer::BEHAVIOR_DELETE_ORDER_STATUS) {
$order->date_delete = date('Y-m-d H:i:s');

@@ -511,10 +510,9 @@ class OrderBuilder extends AbstractBuilder
// updateTillerSynchronization
public function updateOrderTillerSynchronization(Order $order, int $synchroTiller = null): void
{
if(!is_null($synchroTiller)) {
if (!is_null($synchroTiller)) {
$order->tiller_synchronization = $synchroTiller;
}
else {
} else {
$paymentStatus = $this->orderSolver->getPaymentStatus($order);

if ($paymentStatus == Order::PAYMENT_PAID) {
@@ -538,7 +536,7 @@ class OrderBuilder extends AbstractBuilder

switch ($newStatus) {
case 'new-order' :
$this->orderStatusHistoryBuilder->createOrderStatusHistory($order, $userCurrent, $newStatus, $origin);
//$this->orderStatusHistoryBuilder->createOrderStatusHistory($order, $userCurrent, $newStatus, $origin);
$order->status = $newStatus;
$order->save();
break;
@@ -550,7 +548,7 @@ class OrderBuilder extends AbstractBuilder
case 'refunded':
case 'cancel':
if (in_array($newStatus, $orderStatusArray[$order->status]['nextStatusAllow'])) {
$this->orderStatusHistoryBuilder->createOrderStatusHistory($order, $userCurrent, $newStatus, $origin);
//$this->orderStatusHistoryBuilder->createOrderStatusHistory($order, $userCurrent, $newStatus, $origin);
$order->status = $newStatus;
$order->save();
}
@@ -614,8 +612,8 @@ class OrderBuilder extends AbstractBuilder
$pointSale->orders[] = $order;

if (is_null($order->date_delete)) {
$pointSale->revenues += (float) $order->amount;
$pointSale->revenues_with_tax += (float) $order->amount_with_tax;
$pointSale->revenues += (float)$order->amount;
$pointSale->revenues_with_tax += (float)$order->amount_with_tax;
}
}
}

+ 1
- 1
producer/web/js/vuejs/order-order.js 查看文件

@@ -574,7 +574,7 @@ var app = new Vue({
window.location.href = response.data.redirect ;
}
else {
window.location.href = opendistrib_base_url(true)+'order/confirm?idOrder='+response.data.idOrder ;
//window.location.href = opendistrib_base_url(true)+'order/confirm?idOrder='+response.data.idOrder ;
}
}
else {

Loading…
取消
儲存