|
|
@@ -6,6 +6,7 @@ use Yii; |
|
|
|
|
|
|
|
use common\models\Etablissement ; |
|
|
|
use common\models\PointVente ; |
|
|
|
use common\models\PointVenteUser ; |
|
|
|
use common\models\Commande ; |
|
|
|
use common\models\CommandeProduit ; |
|
|
|
|
|
|
@@ -188,6 +189,15 @@ class CommandeAuto extends \yii\db\ActiveRecord |
|
|
|
$commande->type = Commande::TYPE_AUTO ; |
|
|
|
$commande->id_point_vente = $this->id_point_vente ; |
|
|
|
$commande->id_production = $production->id ; |
|
|
|
|
|
|
|
$point_vente_user = PointVenteUser::find() |
|
|
|
->where(['id_point_vente' => $this->id_point_vente, 'id_user' => $this->id_user]) |
|
|
|
->one() ; |
|
|
|
|
|
|
|
if($point_vente_user && strlen($point_vente_user->commentaire)) { |
|
|
|
$commande->commentaire_point_vente = $point_vente_user->commentaire ; |
|
|
|
} |
|
|
|
|
|
|
|
$commande->save() ; |
|
|
|
|
|
|
|
// produits |