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…
Откажи
Сачувај