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