Przeglądaj źródła

Correctifs

refactoring
Guillaume Bourgeois 1 rok temu
rodzic
commit
0eddb4ec55
4 zmienionych plików z 11 dodań i 3 usunięć
  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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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 Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz