Browse Source

Merge branch 'feature/gestion_commandes_production_desactivee' into dev

refactoring
keun 6 years ago
parent
commit
673e438d12
2 changed files with 13 additions and 15 deletions
  1. +3
    -3
      backend/controllers/CommandeController.php
  2. +10
    -12
      backend/views/commande/index.php

+ 3
- 3
backend/controllers/CommandeController.php View File

} }


// production_point_vente à définir s'ils ne sont pas initialisés // production_point_vente à définir s'ils ne sont pas initialisés
if ($production && $production->actif) {
if ($production) {
$count_productions_point_vente = ProductionPointVente::find()-> $count_productions_point_vente = ProductionPointVente::find()->
where([ where([
'id_production' => $production->id 'id_production' => $production->id
} }


$arr_productions_point_vente = []; $arr_productions_point_vente = [];
foreach ($productions_point_vente as $ppv) { foreach ($productions_point_vente as $ppv) {
$key = $ppv->id_production . '-' . $ppv->id_point_vente; $key = $ppv->id_production . '-' . $ppv->id_point_vente;
if ($ppv->livraison == 1) if ($ppv->livraison == 1)
$arr_productions_point_vente[$key] = Html::encode($ppv->pointVente->nom); $arr_productions_point_vente[$key] = Html::encode($ppv->pointVente->nom);
} }
} }
$datas = [ $datas = [
'produits' => $produits, 'produits' => $produits,
'points_vente' => $points_vente, 'points_vente' => $points_vente,

+ 10
- 12
backend/views/commande/index.php View File

</div> </div>
<?php endif; ?> <?php endif; ?>


<?php if ($production->actif): ?>
<?php if($production->livraison && count($arr_productions_point_vente)): ?>
<div id="productions-point-vente">
<strong>Points de vente : </strong>
<div class="checkbox-list">
<?= Html::activeCheckboxList(
$production_point_vente,
'productions_point_vente',
$arr_productions_point_vente ,
['encode' => false, 'class' => '']) ?>
</div>
<?php if($production->livraison && count($arr_productions_point_vente)): ?>
<div id="productions-point-vente">
<strong>Points de vente : </strong>
<div class="checkbox-list">
<?= Html::activeCheckboxList(
$production_point_vente,
'productions_point_vente',
$arr_productions_point_vente ,
['encode' => false, 'class' => '']) ?>
</div> </div>
<?php endif; ?>
</div>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>

Loading…
Cancel
Save