Просмотр исходного кода

Suppression de la vérif concernant l'activation du produit lors de la création des commandes via les commandes récurrentes

dev
keun 6 лет назад
Родитель
Сommit
dcfe315912
1 измененных файлов: 7 добавлений и 9 удалений
  1. +7
    -9
      common/models/CommandeAuto.php

+ 7
- 9
common/models/CommandeAuto.php Просмотреть файл

@@ -196,15 +196,13 @@ class CommandeAuto extends \yii\db\ActiveRecord {
$montant_total = 0;
$produits_add = false;
foreach ($this->commandeAutoProduit as $commande_auto_produit) {
if ($production->produitActif($commande_auto_produit->produit->id)) {
$commande_produit = new CommandeProduit;
$commande_produit->id_commande = $commande->id;
$commande_produit->id_produit = $commande_auto_produit->produit->id;
$commande_produit->quantite = $commande_auto_produit->quantite;
$commande_produit->prix = $commande_auto_produit->produit->prix;
$commande_produit->save();
$produits_add = true;
}
$commande_produit = new CommandeProduit;
$commande_produit->id_commande = $commande->id;
$commande_produit->id_produit = $commande_auto_produit->produit->id;
$commande_produit->quantite = $commande_auto_produit->quantite;
$commande_produit->prix = $commande_auto_produit->produit->prix;
$commande_produit->save();
$produits_add = true;
}

if (!$produits_add) {

Загрузка…
Отмена
Сохранить