Kaynağa Gözat

Correctif : bug produits non actifs initialisés en tant qu'actif dans la production

prodstable
keun 7 yıl önce
ebeveyn
işleme
91b6f88723
1 değiştirilmiş dosya ile 10 ekleme ve 14 silme
  1. +10
    -14
      backend/controllers/CommandeController.php

+ 10
- 14
backend/controllers/CommandeController.php Dosyayı Görüntüle

@@ -304,13 +304,9 @@ class CommandeController extends BackendController {
$this->gestionFormCommandes($production, $date, $points_vente, $produits, $users);

// commandes
$commandes = Commande::find()
->with('commandeProduits', 'user', 'creditHistorique')
->joinWith('production')
->where(['production.date' => $date])
->andWhere(['production.id_etablissement' => Yii::$app->user->identity->id_etablissement])
->orderBy('date ASC')
->all();
$commandes = Commande::findBy([
'date' => $date
]) ;

$recettes = 0;
$recettes_pain = 0;
@@ -425,19 +421,19 @@ class CommandeController extends BackendController {
$pp->id_produit = $p->id;

$pp->actif = 0;
if ($day_production == 1 && $p->lundi)
if ($p->actif && $day_production == 1 && $p->lundi)
$pp->actif = 1;
if ($day_production == 2 && $p->mardi)
if ($p->actif && $day_production == 2 && $p->mardi)
$pp->actif = 1;
if ($day_production == 3 && $p->mercredi)
if ($p->actif && $day_production == 3 && $p->mercredi)
$pp->actif = 1;
if ($day_production == 4 && $p->jeudi)
if ($p->actif && $day_production == 4 && $p->jeudi)
$pp->actif = 1;
if ($day_production == 5 && $p->vendredi)
if ($p->actif && $day_production == 5 && $p->vendredi)
$pp->actif = 1;
if ($day_production == 6 && $p->samedi)
if ($p->actif && $day_production == 6 && $p->samedi)
$pp->actif = 1;
if ($day_production == 7 && $p->dimanche)
if ($p->actif && $day_production == 7 && $p->dimanche)
$pp->actif = 1;

$pp->quantite_max = $p->quantite_max;

Yükleniyor…
İptal
Kaydet