Browse Source

Merge branch 'dev'

prodstable
Guillaume 2 years ago
parent
commit
130e34848b
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      common/models/Subscription.php

+ 10
- 4
common/models/Subscription.php View File

@@ -39,14 +39,14 @@
namespace common\models;

use common\helpers\GlobalParam;
use common\models\PointSale;
use common\models\User;
use Yii;
use common\components\ActiveRecordCommon;
use common\models\Producer;
use common\models\PointSale;
use common\models\UserPointSale;
use common\models\Order;
use common\models\ProductOrder;
use common\models\User;

/**
* This is the model class for table "commande_auto".
@@ -187,6 +187,12 @@ class Subscription extends ActiveRecordCommon
} else {
$order->id_user = $this->id_user;
}

$user = false;
if($this->id_user) {
$user = User::findOne($this->id_user);
}

$order->date = date('Y-m-d H:i:s');
$order->origin = Order::ORIGIN_AUTO;
$order->id_point_sale = $this->id_point_sale;
@@ -248,8 +254,8 @@ class Subscription extends ActiveRecordCommon
$productOrder->id_product = $productSubscription->product->id;
$productOrder->quantity = $productSubscription->quantity;
$productOrder->price = $productSubscription->product->getPrice([
'id_user' => $this->id_user,
'id_point_sale' => $this->id_point_sale
'user' => $user,
'point_sale' => $pointSale
]);
$productOrder->unit = $productSubscription->product->unit;
$productOrder->step = $productSubscription->product->step;

Loading…
Cancel
Save