|
|
|
|
|
|
|
|
$this->gestionFormCommandes($production, $date, $points_vente, $produits, $users); |
|
|
$this->gestionFormCommandes($production, $date, $points_vente, $produits, $users); |
|
|
|
|
|
|
|
|
// commandes |
|
|
// 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 = 0; |
|
|
$recettes_pain = 0; |
|
|
$recettes_pain = 0; |
|
|
|
|
|
|
|
|
$pp->id_produit = $p->id; |
|
|
$pp->id_produit = $p->id; |
|
|
|
|
|
|
|
|
$pp->actif = 0; |
|
|
$pp->actif = 0; |
|
|
if ($day_production == 1 && $p->lundi) |
|
|
|
|
|
|
|
|
if ($p->actif && $day_production == 1 && $p->lundi) |
|
|
$pp->actif = 1; |
|
|
$pp->actif = 1; |
|
|
if ($day_production == 2 && $p->mardi) |
|
|
|
|
|
|
|
|
if ($p->actif && $day_production == 2 && $p->mardi) |
|
|
$pp->actif = 1; |
|
|
$pp->actif = 1; |
|
|
if ($day_production == 3 && $p->mercredi) |
|
|
|
|
|
|
|
|
if ($p->actif && $day_production == 3 && $p->mercredi) |
|
|
$pp->actif = 1; |
|
|
$pp->actif = 1; |
|
|
if ($day_production == 4 && $p->jeudi) |
|
|
|
|
|
|
|
|
if ($p->actif && $day_production == 4 && $p->jeudi) |
|
|
$pp->actif = 1; |
|
|
$pp->actif = 1; |
|
|
if ($day_production == 5 && $p->vendredi) |
|
|
|
|
|
|
|
|
if ($p->actif && $day_production == 5 && $p->vendredi) |
|
|
$pp->actif = 1; |
|
|
$pp->actif = 1; |
|
|
if ($day_production == 6 && $p->samedi) |
|
|
|
|
|
|
|
|
if ($p->actif && $day_production == 6 && $p->samedi) |
|
|
$pp->actif = 1; |
|
|
$pp->actif = 1; |
|
|
if ($day_production == 7 && $p->dimanche) |
|
|
|
|
|
|
|
|
if ($p->actif && $day_production == 7 && $p->dimanche) |
|
|
$pp->actif = 1; |
|
|
$pp->actif = 1; |
|
|
|
|
|
|
|
|
$pp->quantite_max = $p->quantite_max; |
|
|
$pp->quantite_max = $p->quantite_max; |