瀏覽代碼

Correctifs

refactoring
Guillaume Bourgeois 1 年之前
父節點
當前提交
0eddb4ec55
共有 4 個檔案被更改,包括 11 行新增3 行删除
  1. +1
    -0
      backend/controllers/DistributionController.php
  2. +4
    -1
      common/helpers/Tiller.php
  3. +1
    -1
      common/logic/Distribution/Distribution/Repository/DistributionRepository.php
  4. +5
    -1
      common/logic/Order/Order/Repository/OrderRepository.php

+ 1
- 0
backend/controllers/DistributionController.php 查看文件

@@ -167,6 +167,7 @@ class DistributionController extends BackendController

if ($dateObject && $dateObject->format($format) === $date) {
$distribution = $distributionManager->createDistributionIfNotExist($date);

$json['distribution'] = [
'id' => $distribution->id,
'active' => $distribution->active,

+ 4
- 1
common/helpers/Tiller.php 查看文件

@@ -39,6 +39,7 @@
namespace common\helpers;

use common\logic\Order\Order\Model\Order;
use common\logic\Order\Order\Wrapper\OrderManager;
use common\logic\Producer\Producer\Wrapper\ProducerManager;
use linslin\yii2\curl;

@@ -81,6 +82,8 @@ class Tiller

public function isSynchro($date)
{
$orderManager = OrderManager::getInstance();

if ($this->producer_tiller) {
$ordersTiller = $this->getOrders($date);
$ordersOpendistrib = Order::searchAll([
@@ -99,7 +102,7 @@ class Tiller
foreach ($ordersTiller->orders as $orderTiller) {
if ($orderOpendistrib->tiller_external_id == $orderTiller->id) {
$amountTotalOrderOpendistrib = (int)round(
$orderOpendistrib->getAmountWithTax(Order::AMOUNT_TOTAL) * 100
$orderManager->getOrderAmountWithTax($orderOpendistrib, Order::AMOUNT_TOTAL) * 100
);
if ($amountTotalOrderOpendistrib >= (int)$orderTiller->currentPayedAmount
|| $amountTotalOrderOpendistrib >= (int)$orderTiller->currentBill) {

+ 1
- 1
common/logic/Distribution/Distribution/Repository/DistributionRepository.php 查看文件

@@ -44,7 +44,7 @@ class DistributionRepository extends AbstractRepository
{
$paramsDistribution = [
'date' => $date,
'distribution.id_producer' => $this->getProducerContext()
'distribution.id_producer' => $this->getProducerContext()->id
];

if(!is_null($active)) {

+ 5
- 1
common/logic/Order/Order/Repository/OrderRepository.php 查看文件

@@ -47,7 +47,11 @@ class OrderRepository extends AbstractRepository
'creditHistory.userAction',
'pointSale'
],
'join_with' => ['distribution', 'user', 'user.userProducer'],
'join_with' => [
'distribution',
'user',
'user.userProducer'
],
'orderby' => 'order.date ASC',
'attribute_id_producer' => 'distribution.id_producer'
];

Loading…
取消
儲存