Browse Source

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

master
keun 7 years ago
parent
commit
6a98f41eb2
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      common/models/CommandeAuto.php

+ 10
- 0
common/models/CommandeAuto.php View File



use common\models\Etablissement ; use common\models\Etablissement ;
use common\models\PointVente ; use common\models\PointVente ;
use common\models\PointVenteUser ;
use common\models\Commande ; use common\models\Commande ;
use common\models\CommandeProduit ; use common\models\CommandeProduit ;


$commande->type = Commande::TYPE_AUTO ; $commande->type = Commande::TYPE_AUTO ;
$commande->id_point_vente = $this->id_point_vente ; $commande->id_point_vente = $this->id_point_vente ;
$commande->id_production = $production->id ; $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() ; $commande->save() ;
// produits // produits

Loading…
Cancel
Save