Bläddra i källkod

Bug commentaires point de vente non ajouté lors des commandes automatiques

master
keun 7 år sedan
förälder
incheckning
6a98f41eb2
1 ändrade filer med 10 tillägg och 0 borttagningar
  1. +10
    -0
      common/models/CommandeAuto.php

+ 10
- 0
common/models/CommandeAuto.php Visa fil

@@ -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

Laddar…
Avbryt
Spara