Ver código fonte

Refactoring/traduction vues 'order'

dev
Guillaume Bourgeois 6 anos atrás
pai
commit
89133dd43f
4 arquivos alterados com 110 adições e 118 exclusões
  1. +4
    -5
      backend/controllers/OrderController.php
  2. +23
    -21
      backend/views/order/_total_orders.php
  3. +83
    -92
      backend/views/order/index.php
  4. +0
    -0
      backend/views/order/report.php

+ 4
- 5
backend/controllers/OrderController.php Ver arquivo

} }
$datas = [ $datas = [
'products' => $arrayProducts,
'pointsSale' => $arrayPointsSale,
'orders' => $arrayOrders,
'arrayProducts' => $arrayProducts,
'arrayPointsSale' => $arrayPointsSale,
'arrayOrders' => $arrayOrders,
'date' => $date, 'date' => $date,
'distribution' => $distribution, 'distribution' => $distribution,
'distributionDays' => $arrayDistributionDays,
'arrayDistributionDays' => $arrayDistributionDays,
'selectedProducts' => $arrayProductsSelected, 'selectedProducts' => $arrayProductsSelected,
'users' => $arrayUsers, 'users' => $arrayUsers,
'revenues' => $revenues, 'revenues' => $revenues,
'totalWeight' => $totalWeight, 'totalWeight' => $totalWeight,
'subscriptionForm' => $subscriptionForm, 'subscriptionForm' => $subscriptionForm,
'pointSaleDistribution' => $pointSaleDistribution, 'pointSaleDistribution' => $pointSaleDistribution,
'arrayPointSaleDistribution' => $arrayPointsSaleDistribution,
'arrayPointsSaleDistribution' => $arrayPointsSaleDistribution, 'arrayPointsSaleDistribution' => $arrayPointsSaleDistribution,
'oneDistributionWeekActive' => $oneDistributionWeekActive 'oneDistributionWeekActive' => $oneDistributionWeekActive
]; ];

backend/views/commande/_total_commandes.php → backend/views/order/_total_orders.php Ver arquivo

termes. termes.
*/ */


use common\models\Commande ;
use common\models\Order ;
use yii\helpers\Html ; use yii\helpers\Html ;


?> ?>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="alert alert-warning"> <div class="alert alert-warning">
<strong>Potentiel :</strong> <?= number_format($ca_potentiel,2); ?> € (<?= $poids_total ?> kg) &bull;
<strong>Commandé :</strong> <?= number_format($recettes,2); ?> € (<?= $poids ?> kg)
<strong>Potentiel :</strong> <?= number_format($potentialTurnover,2); ?> € (<?= $totalWeight ?> kg) &bull;
<strong>Commandé :</strong> <?= number_format($revenues,2); ?> € (<?= $weight ?> kg)
</div> </div>


<table class="table table-bordered tab-content table-produits table-header-rotated"> <table class="table table-bordered tab-content table-produits table-header-rotated">
<tbody> <tbody>
<tr> <tr>
<?php <?php
foreach ($produits as $p) {
if ((isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) ||
(!$produits_selec[$p->id]['actif'] && Commande::getQuantiteProduit($p->id, $commandes)))
foreach ($arrayProducts as $p) {
if ((isset($arrayProductsSelected[$p->id]['active']) && $arrayProductsSelected[$p->id]['active']) ||
(!$arrayProductsSelected[$p->id]['active'] && Commande::getQuantiteProduit($p->id, $arrayOrders)))
{ {
(!$produits_selec[$p->id]['actif']) ? $class_disabled = 'disabled' : $class_disabled = '' ;
(!$arrayProductsSelected[$p->id]['active']) ? $class_disabled = 'disabled' : $class_disabled = '' ;
echo '<th class="rotate-45 '.$class_disabled.'"><div><span>'.Html::encode($p->getLibelleAdmin()).'</span></div></th>' ; echo '<th class="rotate-45 '.$class_disabled.'"><div><span>'.Html::encode($p->getLibelleAdmin()).'</span></div></th>' ;
} }
</tr> </tr>
<tr> <tr>
<?php <?php
foreach ($produits as $p) {
$quantite = Commande::getQuantiteProduit($p->id, $commandes);
if ((isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) || $quantite)
foreach ($arrayProducts as $p) {
$quantity = Commande::getQuantiteProduit($p->id, $arrayOrders);
if ((isset($arrayProductsSelected[$p->id]['active']) && $arrayProductsSelected[$p->id]['active']) || $quantity)
{ {
$str_quantite = '';
if ($quantite)
$str_quantite = $quantite;

$classe = 'total';
if ($str_quantite > $produits_selec[$p->id]['quantite_max'] && !$produits_selec[$p->id]['vrac'])
$strQuantity = '';
if ($quantity) {
$strQuantity = $quantity ;
}
$class = 'total';
if ($strQuantity > $arrayProductsSelected[$p->id]['quantity_max'] && !$arrayProductsSelected[$p->id]['vrac'])
{ {
$classe .= ' depasse';
$class .= ' depasse';
} }
echo '<td class="' . $classe . '"><strong>' . $str_quantite . '</strong> ';
echo '<td class="' . $class . '"><strong>' . $strQuantity . '</strong> ';


if ($produits_selec[$p->id]['quantite_max'] && $str_quantite)
echo '<br /><span>' . $produits_selec[$p->id]['quantite_max'] . '</span>';
if ($arrayProductsSelected[$p->id]['quantity_max'] && $strQuantity) {
echo '<br /><span>' . $arrayProductsSelected[$p->id]['quantity_max'] . '</span>';
}
echo '</td>' ; echo '</td>' ;
} }

backend/views/commande/index.php → backend/views/order/index.php Ver arquivo

*/ */


use yii\helpers\Html; use yii\helpers\Html;
use common\models\Commande;
use common\models\Order;
use common\models\User ; use common\models\User ;
use yii\helpers\ArrayHelper ; use yii\helpers\ArrayHelper ;
use yii\widgets\ActiveForm; use yii\widgets\ActiveForm;


$this->title = 'Commande'; $this->title = 'Commande';


$cpt_non_vrac = 0;
foreach ($produits as $p) {
if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
if (!$p->vrac) {
$cpt_non_vrac ++;
}
}
}
?> ?>


<div id="page-commande">
<div id="page-order">
<div class="col-md-3" id="col-left"> <div class="col-md-3" id="col-left">
<div class="panel panel-default"> <div class="panel panel-default">
éditer un jour de production. éditer un jour de production.
</div> </div>
<?php else: ?> <?php else: ?>
<a class="btn btn-sm btn-default btn-active-week" href="<?= Yii::$app->urlManager->createUrl(['commande/change-state-semaine', 'date' => $date, 'actif' => !$production_semaine_active, ]); ?>"><span class="glyphicon glyphicon-<?= $production_semaine_active ? 'remove' : 'ok' ?>"></span> <?= $production_semaine_active ? 'Désactiver' : 'Activer' ?> cette semaine de production</a>
<a class="btn btn-sm btn-default btn-active-week" href="<?= Yii::$app->urlManager->createUrl(['order/change-state-week', 'date' => $date, 'active' => !$oneDistributionWeekActive, ]); ?>"><span class="glyphicon glyphicon-<?= $oneDistributionWeekActive ? 'remove' : 'ok' ?>"></span> <?= $oneDistributionWeekActive ? 'Désactiver' : 'Activer' ?> cette semaine de production</a>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
<?php if ($date != ''): ?> <?php if ($date != ''): ?>
<div id="bloc-production"> <div id="bloc-production">
<input type="hidden" id="date-production" value="<?= $date ?>" />
<input type="hidden" id="id-production" value="<?= $production->id ?>" />
<input type="hidden" id="date-distribution" value="<?= $date ?>" />
<input type="hidden" id="id-distribution" value="<?= $distribution->id ?>" />
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">Production du <strong><?php echo date('d/m/Y', strtotime($date)); ?></strong></h3>
<h3 class="panel-title">Distribution du <strong><?php echo date('d/m/Y', strtotime($date)); ?></strong></h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<strong>Production</strong><br />
<strong>Distribution</strong><br />
<div class="btn-group" role="group"> <div class="btn-group" role="group">
<a class="btn btn-default<?php if ($production->actif): ?> btn-success<?php endif; ?>" href="<?php echo Yii::$app->urlManager->createUrl(['commande/change-state', 'date' => $date, 'actif' => 1]); ?>">Activé</a>
<a class="btn btn-default<?php if (!$production->actif): ?> btn-danger<?php endif; ?>" href="<?php echo Yii::$app->urlManager->createUrl(['commande/change-state', 'date' => $date, 'actif' => 0]); ?>">Désactivé</a>
<a class="btn btn-default<?php if ($distribution->active): ?> btn-success<?php endif; ?>" href="<?php echo Yii::$app->urlManager->createUrl(['order/change-state', 'date' => $date, 'active' => 1]); ?>">Activé</a>
<a class="btn btn-default<?php if (!$distribution->active): ?> btn-danger<?php endif; ?>" href="<?php echo Yii::$app->urlManager->createUrl(['order/change-state', 'date' => $date, 'active' => 0]); ?>">Désactivé</a>
</div> </div>
<br /> <br />
<br /> <br />
<?php if (!$production->actif): ?>
<?php if (!$distribution->active): ?>
<div class="alert alert-info"> <div class="alert alert-info">
<span class="glyphicon glyphicon-share-alt"></span> Activez ici la production pour qu'elle soit visible au client.
<span class="glyphicon glyphicon-share-alt"></span> Activez ici la distribution pour qu'elle soit visible au client.
</div> </div>
<?php endif; ?> <?php endif; ?>


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

<?php if ($distribution): ?>
<div id="block-products">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">Produits</h3> <h3 class="panel-title">Produits</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<!-- produits sélectionnés --> <!-- produits sélectionnés -->
<form id="produits-production" action="<?php echo Yii::$app->urlManager->createUrl(['commande/index', 'date' => $date]); ?>" method="post">
<form id="products-distribution" action="<?php echo Yii::$app->urlManager->createUrl(['order/index', 'date' => $date]); ?>" method="post">
<div class="overflow"> <div class="overflow">
<table class="table table-condensed"> <table class="table table-condensed">
<thead> <thead>
<tr> <tr>
<th class="td-actif">Actif</th>
<th class="td-produit">Produit</th>
<th class="td-active">Actif</th>
<th class="td-product">Produit</th>
<th class="td-max">Max. <span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="top" data-original-title="Quantité disponible à la commande. Laisser vide si vous ne souhaitez pas avoir de limite de commande. La valeur par défaut est configurable dans vos produits."></span></th> <th class="td-max">Max. <span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="top" data-original-title="Quantité disponible à la commande. Laisser vide si vous ne souhaitez pas avoir de limite de commande. La valeur par défaut est configurable dans vos produits."></span></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($produits as $p): ?>
<tr<?php if ($p->vrac): ?> style="display:none;"<?php endif; ?> <?php if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']): ?>class="active"<?php endif; ?>>
<td class="td-actif"><input id="produit-<?php echo $p->id; ?>" name="Produit[<?php echo $p->id; ?>][actif]" type="checkbox" <?php if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']): ?>checked="checked"<?php endif; ?> /></td>
<td class="td-produit"><label for="produit-<?php echo $p->id; ?>"><?= Html::encode($p->nom) ?></label></td>
<td class="td-max"><input class="quantite-max" name="Produit[<?php echo $p->id; ?>][quantite_max]" type="text" value="<?php if (isset($produits_selec[$p->id])) echo $produits_selec[$p->id]['quantite_max']; ?>" /></td>
<?php foreach ($arrayProducts as $p): ?>
<tr<?php if ($p->vrac): ?> style="display:none;"<?php endif; ?> <?php if (isset($arrayProductsSelected[$p->id]['active']) && $arrayProductsSelected[$p->id]['active']): ?>class="active"<?php endif; ?>>
<td class="td-active"><input id="product-<?php echo $p->id; ?>" name="Product[<?php echo $p->id; ?>][active]" type="checkbox" <?php if (isset($arrayProductsSelected[$p->id]['active']) && $arrayProductsSelected[$p->id]['active']): ?>checked="checked"<?php endif; ?> /></td>
<td class="td-product"><label for="product-<?php echo $p->id; ?>"><?= Html::encode($p->name) ?></label></td>
<td class="td-max"><input class="quantity-max" name="Product[<?php echo $p->id; ?>][quantity_max]" type="text" value="<?php if (isset($arrayProductsSelected[$p->id])) echo $arrayProductsSelected[$p->id]['quantity_max']; ?>" /></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
</div> </div>
<input type="submit" name="valider_produit_selec" class="btn btn-default" value="Valider" />
<input type="submit" name="valider_product_selec" class="btn btn-default" value="Valider" />
</form> </form>
</div> </div>
</div> </div>
<div class="col-md-9" id="col-right"> <div class="col-md-9" id="col-right">
<input type="hidden" value="<?php echo $date; ?>" id="current-date" /> <input type="hidden" value="<?php echo $date; ?>" id="current-date" />
<ul id="jours-production">
<?php foreach ($jours_production as $j) : ?>
<li><?php echo $j->date; ?></li>
<ul id="distribution-days">
<?php foreach ($arrayDistributionDays as $distributionDay) : ?>
<li><?php echo $distributionDay->date; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php if ($date != ''): ?> <?php if ($date != ''): ?>
<div id="bloc-totaux"> <div id="bloc-totaux">
<?= $this->render('_total_commandes.php',[
'produits' => $produits,
'commandes' => $commandes,
'produits_selec' => $produits_selec,
'recettes' => $recettes,
'poids' => $poids,
'ca_potentiel' => $ca_potentiel,
'poids_total' => $poids_total,
<?= $this->render('_total_orders.php',[
'arrayPoducts' => $arrayProducts,
'arrayOrders' => $arrayOrders,
'arraySelectedProducts' => $arrayProductsSelected,
'revenues' => $revenues,
'weight' => $weight,
'potentialTurnover' => $potentialTurnover,
'totalWeight' => $totalWeight,
]); ?> ]); ?>
</div> </div>
$champs_horaires_point_vente = 'horaires_' . $arr_jour_semaine[$num_jour_semaine]; $champs_horaires_point_vente = 'horaires_' . $arr_jour_semaine[$num_jour_semaine];
?> ?>
<div class="panel panel-default" id="panel-commandes">
<div class="panel panel-default" id="panel-orders">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">
Commandes Commandes
<?php if (!count($commandes)): ?><span class="label label-danger">0</span>
<?php else: ?><span class="label label-success"><?= count($commandes) ?></span>
<?php if (!count($arrayOrders)): ?><span class="label label-danger">0</span>
<?php else: ?><span class="label label-success"><?= count($arrayOrders) ?></span>
<?php endif; ?> <?php endif; ?>
<?php if (count($commandes)): ?>
<a id="btn-export-commandes" class="btn btn-primary" href="<?php echo Yii::$app->urlManager->createUrl(['commande/report', 'date' => $date, 'id_point_vente' => 0, 'global' => 1]); ?>"><span class="glyphicon glyphicon-download-alt"></span> Exporter</a>
<?php if (count($arrayOrders)): ?>
<a id="btn-export-orders" class="btn btn-primary" href="<?php echo Yii::$app->urlManager->createUrl(['order/report', 'date' => $date, 'idPointSale' => 0, 'global' => 1]); ?>"><span class="glyphicon glyphicon-download-alt"></span> Exporter</a>
<?php endif; ?> <?php endif; ?>
<div id="btn-commandes-auto" class="btn-group">
<div id="btn-subscription" class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-repeat"></span> Commandes récurrentes <span class="caret"></span>
<span class="glyphicon glyphicon-repeat"></span> Abonnements <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="<?= Yii::$app->urlManager->createUrl(['commande/add-commandes-auto', 'date' => $date]); ?>">Importer toutes les commandes</a></li>
<li><a href="<?= Yii::$app->urlManager->createUrl(['order/add-subscriptions', 'date' => $date]); ?>">Importer toutes les commandes</a></li>
</ul> </ul>
</div> </div>
<!-- Nav tabs --> <!-- Nav tabs -->
<ul id="tabs-points-vente" class="nav nav-tabs" role="tablist"> <ul id="tabs-points-vente" class="nav nav-tabs" role="tablist">
<?php foreach($points_vente as $pv): ?>
<li role="presentation" class="<?php if($pv->point_fabrication): ?>active<?php endif; ?>">
<a href="#point-vente-<?= $pv->id ?>" id="btn-point-vente-<?= $pv->id ?>" aria-controls="point-vente-<?= $pv->id ?>" role="tab" data-toggle="tab"><?= Html::encode($pv->nom) ?> <span class="badge badge-<?php if(count($pv->commandes)): ?>success<?php else: ?>danger<?php endif; ?>"><?php echo count($pv->commandes); ?></span></a>
<?php foreach($arrayPointsSaleDistribution as $pointSale): ?>
<li role="presentation" class="<?php if($pointSale->point_production): ?>active<?php endif; ?>">
<a href="#point-vente-<?= $pointSale->id ?>" id="btn-point-sale-<?= $pointSale->id ?>" aria-controls="point-sale-<?= $pointSale->id ?>" role="tab" data-toggle="tab"><?= Html::encode($pointSale->name) ?> <span class="badge badge-<?php if(count($pointSale->orders)): ?>success<?php else: ?>danger<?php endif; ?>"><?php echo count($pointSale->orders); ?></span></a>
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>


<!-- Tab panes --> <!-- Tab panes -->
<div class="tab-content" id="commandes-points-vente">
<?php foreach($points_vente as $pv): ?>
<div role="tabpanel" data-id-pv="<?= $pv->id ?>" class="bloc-point-vente tab-pane <?php if($pv->point_fabrication): ?> active<?php endif; ?>" id="point-vente-<?= $pv->id ?>">
<div class="tab-content" id="orders-points-sale">
<?php foreach($arrayPointsSale as $pointSale): ?>
<div role="tabpanel" data-id-pv="<?= $pointSale->id ?>" class="bloc-point-sale tab-pane <?php if($pointSale->point_production): ?> active<?php endif; ?>" id="point-sale-<?= $pointSale->id ?>">
<div class="col-md-12"> <div class="col-md-12">
<div class="alert alert-warning recap-pv <?php if(!count($pv->commandes)): ?>no-commande<?php endif; ?>">
<?php if(count($pv->commandes)): ?>
<strong class="commandes"><?= count($pv->commandes) ?> commande<?php if(count($pv->commandes) > 1): ?>s<?php endif; ?></strong>
<span class="recettes"><?= number_format($pv->recettes, 2) ?> €</span>
<div class="alert alert-warning recap-point-sale <?php if(!count($pointSale->orders)): ?>no-order<?php endif; ?>">
<?php if(count($pointSale->orders)): ?>
<strong class="orders"><?= count($pointSale->orders) ?> commande<?php if(count($pointSale->orders) > 1): ?>s<?php endif; ?></strong>
<span class="revenues"><?= number_format($pointSale->revenues, 2) ?> €</span>
<?php else: ?> <?php else: ?>
<strong class="commandes">Aucune commande</strong>
<span class="recettes"></span>
<strong class="orders">Aucune commande</strong>
<span class="revenues"></span>
<?php endif; ?> <?php endif; ?>
</div> </div>
<ul class="liste-commandes btn-group-vertical<?php if(!count($pv->commandes)): ?> no-commande<?php endif; ?>">
<?php foreach($pv->commandes as $c): ?>
<ul class="liste-orders btn-group-vertical<?php if(!count($pointSale->orders)): ?> no-order<?php endif; ?>">
<?php foreach($pointSale->orders as $order): ?>
<li> <li>
<a href="javascript:void(0);" class="btn btn-default" data-pv-id="<?= $pv->id ?>" data-id-commande="<?= $c->id ?>" data-commande='<?= $pv->data_options_commandes[$c->id]['data-commande'] ?>' data-commentaire="<?= Html::encode($c->commentaire) ?>" data-date="<?= date('d/m à H:i',strtotime($c->date)); ?>">
<span class="montant <?php if(number_format($c->montant_paye,2) >= number_format($c->montant,2)): ?>paye<?php endif; ?>">
<?= Html::encode(number_format($c->montant, 2)); ?> €
<?php if($c->montant_paye - $c->montant > 0.01): ?><span class="glyphicon glyphicon-warning-sign"></span><?php endif; ?>
<a href="javascript:void(0);" class="btn btn-default" data-point-sale-id="<?= $pointSale->id ?>" data-id-order="<?= $order->id ?>" data-order='<?= $pointSale->data_options_orders[$order->id]['data-order'] ?>' data-comment="<?= Html::encode($order->comment) ?>" data-date="<?= date('d/m à H:i',strtotime($order->date)); ?>">
<span class="amount <?php if(number_format($order->paid_amount,2) >= number_format($order->amount,2)): ?>paid<?php endif; ?>">
<?= Html::encode(number_format($order->amount, 2)); ?> €
<?php if($order->paid_amount - $order->amount > 0.01): ?><span class="glyphicon glyphicon-warning-sign"></span><?php endif; ?>
</span> </span>
<span class="user"> <span class="user">
<?php if($c->type): ?>
<?php if($c->type == Commande::TYPE_ADMIN): ?>
<?php if($order->type): ?>
<?php if($order->type == Order::ORIGIN_ADMIN): ?>
<span class="label label-warning">vous</span> <span class="label label-warning">vous</span>
<?php elseif($c->type == Commande::TYPE_AUTO): ?>
<?php elseif($order->type == Order::ORIGIN_AUTO): ?>
<span class="label label-default">auto</span> <span class="label label-default">auto</span>
<?php elseif($c->type == Commande::TYPE_USER): ?>
<?php elseif($order->type == Order::ORIGIN_USER): ?>
<span class="label label-success">client</span> <span class="label label-success">client</span>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
<?php if(isset($c->user)): ?>
<?= Html::encode($c->user->nom.' '.$c->user->prenom); ?>
<?php if(isset($order->user)): ?>
<?= Html::encode($order->user->lastname.' '.$order->user->name); ?>
<?php else: ?> <?php else: ?>
<?= Html::encode($c->username); ?>
<?= Html::encode($order->username); ?>
<?php endif; ?> <?php endif; ?>
<?php if(!is_null($c->date_delete)): ?>
<?php if(!is_null($order->date_delete)): ?>
(<span class="glyphicon glyphicon-remove"></span> Annulée) (<span class="glyphicon glyphicon-remove"></span> Annulée)
<?php endif; ?> <?php endif; ?>
</span> </span>
<?php if (strlen($c->commentaire)): ?>
<?php if (strlen($order->comment)): ?>
<span class="glyphicon glyphicon-comment"></span> <span class="glyphicon glyphicon-comment"></span>
<?php endif; ?> <?php endif; ?>
</a> </a>
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?= Html::a('<span class="glyphicon glyphicon-plus"></span> Créer une commande', 'javascript:void(0);', ['class' => 'btn btn-default creer-commande', 'data-pv-id' => $pv->id]) ?>
<?= Html::a('<span class="glyphicon glyphicon-plus"></span> Créer une commande', 'javascript:void(0);', ['class' => 'btn btn-default create-corder', 'data-point-sale-id' => $pointSale->id]) ?>
</div> </div>
<div class="col-md-12 bloc-commande">
<div class="col-md-12 block-order">
<h2 class="title-user"> <h2 class="title-user">
<span class="buttons-edit-remove"> <span class="buttons-edit-remove">
<?= Html::a('<span class="glyphicon glyphicon-trash"></span> Supprimer', 'javascript:void(0);', ['class' => 'btn btn-default btn-remove']) ?> <?= Html::a('<span class="glyphicon glyphicon-trash"></span> Supprimer', 'javascript:void(0);', ['class' => 'btn btn-default btn-remove']) ?>
</span> </span>
<span class="the-title"></span> <span class="the-title"></span>
<span class="choix-user"> <span class="choix-user">
<?= Html::activeDropDownList(new User, 'id', ArrayHelper::map(User::find()->joinWith('userEtablissement')->where('user_etablissement.id_etablissement = '.Yii::$app->user->identity->id_etablissement)->andWhere('user_etablissement.actif = 1')->orderBy('user.nom ASC, user.prenom ASC')->all(), 'id', function($model, $defaultValue) {
return $model['nom'].' '.$model['prenom'];
<?= Html::activeDropDownList(new User, 'id', ArrayHelper::map(User::find()->joinWith('userProducer')->where('user_producer.id_producer = '.Producer::getId())->andWhere('user_producer.active = 1')->orderBy('user.lastname ASC, user.name ASC')->all(), 'id', function($model, $defaultValue) {
return $model['lastname'].' '.$model['name'];
}), ['prompt' => '--','class' => 'form-control user-id']) ?> }), ['prompt' => '--','class' => 'form-control user-id']) ?>
OU <input type="text" class="form-control username" placeholder="Choisissez un nom" /> OU <input type="text" class="form-control username" placeholder="Choisissez un nom" />
</span> </span>
</h2> </h2>
<div class="commentaire alert alert-info"> <div class="commentaire alert alert-info">
</div> </div>
<textarea name="commentaire" class="form-control textarea-commentaire" placeholder="Commentaire"></textarea>
<table class="table table-bordered table-condensed tab-content table-produits">
<textarea name="comment" class="form-control textarea-comment" placeholder="Commentaire"></textarea>
<table class="table table-bordered table-condensed tab-content table-products">
<tbody> <tbody>
<?php foreach ($produits as $p): ?>
<tr class="produit-<?= $p->id ?> <?php if(!$produits_selec[$p->id]['actif']): ?> disabled<?php endif; ?>" data-id-produit="<?= $p->id ?>">
<td class="td-commande"></td>
<td class="td-produit"><?php echo Html::encode($p->getLibelleAdmin()); ?></td>
<?php foreach ($arrayProducts as $p): ?>
<tr class="product-<?= $p->id ?> <?php if(!$arrayProductsSelected[$p->id]['active']): ?> disabled<?php endif; ?>" data-id-product="<?= $p->id ?>">
<td class="td-order"></td>
<td class="td-product"><?php echo Html::encode($p->getLibelleAdmin()); ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
<tr class="tr-total"> <tr class="tr-total">

backend/views/commande/report.php → backend/views/order/report.php Ver arquivo


Carregando…
Cancelar
Salvar