Selaa lähdekoodia

Améliorer l'ergonomie de la page des commandes du backend

prodstable
keun 8 vuotta sitten
vanhempi
commit
02072d37f9
6 muutettua tiedostoa jossa 539 lisäystä ja 406 poistoa
  1. +340
    -367
      backend/views/commande/index.php
  2. +3
    -1
      backend/views/layouts/main.php
  3. BIN
      backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc
  4. +109
    -32
      backend/web/css/screen.css
  5. +84
    -1
      backend/web/sass/screen.scss
  6. +3
    -5
      common/models/Produit.php

+ 340
- 367
backend/views/commande/index.php Näytä tiedosto

@@ -1,374 +1,347 @@
<?php

use yii\helpers\Html ;
use common\models\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 ++ ;
}
}
}
use yii\helpers\Html;
use common\models\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 class="col-md-3">
<?php
// chargement assets
common\components\fullcalendar\FullcalendarWidget::widget() ;
// --> lancement du js en manuel (via lechatdesnoisettes.js)
?>
<div id="calendar"></div>
<?php if($production): ?>
<!-- produits sélectionnés -->
<br />
<form id="produits-production" action="<?php echo Yii::$app->urlManager->createUrl(['commande/index','date'=>$date]); ?>" method="post">
<table class="table table-bordered">
<tbody>
<?php foreach($produits as $p): ?>
<tr<?php if($p->vrac): ?> style="display:none;"<?php endif;?>>
<td><label for="produit-<?php echo $p->id; ?>"><?php if(strlen($p->description)): echo Html::encode($p->description) ; else: echo Html::encode($p->nom) ; endif; ?></label></td>
<td><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><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>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<input type="submit" name="valider_produit_selec" class="btn btn-default" value="Valider" />
</form>
<?php endif; ?>
</div>
<div class="col-md-9">
<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>
<?php endforeach; ?>
</ul>
<?php if($date != ''): ?>
<h1>
Production du <?php echo date('d/m/Y',strtotime($date)) ; ?>
<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>
</div>
</h1>

<strong>Livraison</strong>
<div class="btn-group" role="group">
<a class="btn btn-default<?php if($production->livraison): ?> btn-success<?php endif; ?>" href="<?php echo Yii::$app->urlManager->createUrl(['commande/change-livraison','date'=>$date,'livraison'=>1]); ?>">Activé</a>
<a class="btn btn-default<?php if(!$production->livraison): ?> btn-danger<?php endif; ?>" href="<?php echo Yii::$app->urlManager->createUrl(['commande/change-livraison','date'=>$date,'livraison'=>0]); ?>">Désactivé</a>
</div>
<br /><br />
<?php if(!count($commandes)): ?>
<div class="alert alert-info">Aucune commande passée pour cette date</div>
<?php else: ?>
<a class="btn btn-primary" href="<?php echo Yii::$app->urlManager->createUrl(['commande/download','date'=>$date,'id_point_vente'=>0,'global'=>1]); ?>"><span class="glyphicon glyphicon-download-alt"></span> Récapitulatif global</a>
<br />
<br />
<?php endif;?>

<?php
$num_jour_semaine = date('w',strtotime($date));
$arr_jour_semaine = [0=>'dimanche',1=>'lundi',2=>'mardi', 3=>'mercredi', 4=>'jeudi', 5=>'vendredi', 6=>'samedi'] ;
$champs_horaires_point_vente = 'horaires_'.$arr_jour_semaine[$num_jour_semaine] ;
?>
<?php //if(count($pv->commandes)):?>
<form class="form-commandes-point-vente" action="<?php echo Yii::$app->urlManager->createUrl(['commande/index','date'=>$date]); ?>" method="post">
<!-- <h2><?php //echo Html::encode($pv->nom); ?> <a href="<?php //echo Yii::$app->urlManager->createUrl(['commande/download','date'=>$date,'id_point_vente'=>$pv->id]); ?>" class="btn btn-default">CSV</a></h2> -->
<!-- <p><?php //echo Html::encode($pv->adresse); ?></p> -->
<table class="table table-striped table-bordered">
<thead>
<tr>
<td class="title-point-vente" colspan="<?php echo count($produits)+4; ?>"><strong>Global</strong></td>
</tr>
<tr>
<td></td>
<?php foreach($produits as $p): ?>
<?php if(isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']): ?>
<td class="center<?php if($p->vrac): ?> vrac<?php endif; ?>">
<strong><?php echo Html::encode($p->getLibelleAdmin()); ?></strong>
</td>
<?php endif; ?>
<?php endforeach; ?>
<td><strong>Potentiel</strong></td>
<td><strong>Commandé</strong></td>
</tr>
<tr>
<td><strong>Pain</strong></td>
<?php
foreach($produits as $p) {
if(isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
$quantite = Commande::getQuantiteProduit($p->id, $commandes) ;
$str_quantite = '' ;
if($quantite)
$str_quantite = $quantite ;
$classe = 'center total' ;
if($str_quantite > $produits_selec[$p->id]['quantite_max'] && !$produits_selec[$p->id]['vrac']) {
$classe .= ' depasse' ;
}
if($p->vrac) {
$classe .= ' vrac' ;
}
echo '<td class="'.$classe.'"><strong>'.$str_quantite.' <span>' ;
if($produits_selec[$p->id]['quantite_max'] && $str_quantite)
echo '/ '.$produits_selec[$p->id]['quantite_max'].'</span></strong></td>' ;
}
}
?>
<td><strong><?php echo number_format($ca_potentiel,2) ; ?> €</strong><br /><?php echo number_format($poids_total/1000,2) ; ?> kg</td>
<td><strong><?php echo str_replace(' ','&nbsp;',$recettes_pain.' €') ; ?></strong><br /><?php echo round($poids_pain).' kg'; ?></td>
<td></td>
</tr>
<tr>
<td><strong>Vrac</strong></td>
<td colspan="<?php echo $cpt_non_vrac; ?>">
<?php
$first = true ;
foreach($produits as $p) {
if($p->vrac) {
$quantite = Commande::getQuantiteProduit($p->id, $commandes) ;
if($quantite) {
if(!$first)
echo ', ' ;
echo $quantite.'&nbsp;'.Html::encode($p->diminutif) ;
$first = false ;
}
}
}
?>
</td>
<!-- liste vrac -->
<td></td>
<?php
foreach($produits as $p) {
if($p->vrac)
echo '<td class="vrac"></td>' ;
}
?>
<td><strong><?php echo str_replace(' ','&nbsp;',$recettes_vrac.' €') ; ?></strong><br /><?php echo round($poids_vrac).' kg'; ?></td>
<td></td>
</tr>
</thead>
<tbody>
<?php foreach($points_vente as $pv): ?>
<?php
if(strlen($pv->$champs_horaires_point_vente)):
?>
<tr>
<td class="title-point-vente" colspan="<?php echo count($produits)+4; ?>"><?php echo Html::encode($pv->nom); ?></td>
</tr>
<tr>
<td></td>
<?php foreach($produits as $p): ?>
<?php if(isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']): ?>
<td class="center<?php if($p->vrac): ?> vrac<?php endif; ?>">
<strong><?php echo Html::encode($p->getLibelleAdmin()); ?></strong>
</td>
<?php endif; ?>
<?php endforeach; ?>
<td class="center">
<strong>VRAC</strong>
</td>
<td></td>
<td></td>
</tr>
<?php foreach($pv->commandes as $c): ?>
<tr>
<td>
<?php if(isset($c->user)): ?>
<?php echo Html::encode($c->user->prenom.' '.$c->user->nom) ;?>
<?php else: ?>
<?php echo Html::encode($c->username) ; ?>
<?php endif; ?>
<?php if(strlen($c->commentaire)): ?>
<button type="button" class="btn btn-xs btn-info" data-toggle="popover" title="Commentaire" data-content="<?php echo Html::encode($c->commentaire); ?>"><span class="glyphicon glyphicon-comment"></span></button>
<?php endif; ?>
<br /><span class="date-commande"><?php echo date('d/m/Y à H:i ',strtotime($c->date)) ; if($c->date_update && date('d/m/Y',strtotime($c->date_update)) != date('d/m/Y',strtotime($c->date))): ?><br />modif. <?php echo date('d/m/Y',strtotime($c->date_update)) ; ?><?php endif;?></span>
</td>
<?php
foreach($produits as $p) {
if(isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
$add = false ;
$quantite = 0 ;
foreach($c->commandeProduits as $cp) {
if($p->id == $cp->id_produit) {
$quantite = $cp->quantite ;
$add = true ;
}
}
echo '<td class="td-produit'.(($p->vrac) ? ' vrac' : '').'"><input class="quantite" type="text" value="'.$quantite.'" name="produit_'.$c->id.'_'.$p->id.'" /></td>' ;
}
}
?>
<!-- liste vrac -->
<td><?php echo $c->strListeVrac(); ?></td>
<td><?php echo str_replace(' ','&nbsp;',number_format($c->montant,2).' €') ; ?></td>
<td><a href="<?php echo Yii::$app->urlManager->createUrl(['commande/delete-commande','date'=>$date,'delete'=>1,'id_commande'=>$c->id]) ; ?>" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a></td>
</tr>
<?php endforeach; ?>
<tr>
<td><!-- <select class="select-user" name="user_pv_<?php echo $pv->id;?>">
<?php foreach($users as $id_user => $libelle_user) {
echo '<option value="'.$id_user.'">'.$libelle_user.'</option>' ;
}?>
</select> -->
<input type="text" placeholder="Nom" class="text" name="username_pv_<?php echo $pv->id;?>" />
<br />
<input type="text" name="date_commande_pv_<?php echo $pv->id;?>" class="datepicker" value="<?php echo date('d/m/Y'); ?>" />
</td>
<?php
foreach($produits as $p) {
if(isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
echo '<td class="td-produit'.(($p->vrac) ? ' vrac' : '').'"><input class="quantite" type="text" value="0" name="produit_pv_'.$pv->id.'_'.$p->id.'" /></td>' ;
}
}
?>
<!-- liste vrac -->
<td><a href="javascript:void(0):" class="btn btn-default btn-xs edit-vrac"><i class="glyphicon glyphicon-pencil"></i></a></td>
<td></td>
<td></td>
</tr>
<?php if(count($pv->commandes) && strlen($pv->$champs_horaires_point_vente)) {
echo '<tr>' ;
echo '<td><strong>Total pain</strong></td>' ;
//$cpt_non_vrac = 0 ;
foreach($produits as $p) {
if(isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
$quantite = Commande::getQuantiteProduit($p->id, $pv->commandes) ;
$str_quantite = '' ;
if(!$p->vrac) {
//$cpt_non_vrac ++ ;
if($quantite)
$str_quantite = $quantite ;
}
echo '<td class="center'.(($p->vrac) ? ' vrac' : '').'"><strong>'.$str_quantite.'</strong></td>' ;
}
}
// liste vrac
echo '<td></td>' ;
// total
echo '<td><strong>'.number_format($pv->recettes_pain,2).' €</strong></td><td></td></tr>' ;
/*
* VRAC
*/
echo '<tr>' ;
echo '<td><strong>Total vrac</strong></td>' ;
echo '<td colspan="'.$cpt_non_vrac.'">'.$pv->strListeVrac().'</td>' ;
foreach($produits as $p) {
if($p->vrac)
echo '<td class="vrac"></td>' ;
}
// liste vrac
echo '<td></td>' ;
echo '<td><strong>'.number_format($pv->recettes_vrac,2).' €</strong></td><td></td></tr>' ;
} ?>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
<input type="submit" class="btn btn-primary submit-pv" value="Enregistrer" name="submit_pv" />
</form>
<div class="clr"></div>
<?php if(count($commandes) && false): ?>
<h2>Récapitulatif production <a href="<?php echo Yii::$app->urlManager->createUrl(['commande/download','date'=>$date]); ?>" class="btn btn-default">CSV</a></h2>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Lieu</th>
<?php foreach($produits as $p): ?>
<?php if(isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) : ?>
<th><?php echo Html::encode($p->description); ?></th>
<?php endif; ?>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php
foreach($points_vente as $pv) {
if(count($pv->commandes) && strlen($pv->$champs_horaires_point_vente)) {
echo '<tr>' ;
echo '<td>'.Html::encode($pv->nom).'</td>' ;
foreach($produits as $p) {
if(isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
$quantite = Commande::getQuantiteProduit($p->id, $pv->commandes) ;
$str_quantite = '' ;
if($quantite)
$str_quantite = $quantite ;
echo '<td>'.$str_quantite.'</td>' ;
}
}
echo '</tr>' ;
}
}
?>
</tbody>
<tfoot>
<tr>
<td><strong>Total</strong></td>
<?php
foreach($produits as $p) {
if(isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
$quantite = Commande::getQuantiteProduit($p->id, $commandes) ;
$str_quantite = '' ;
if($quantite)
$str_quantite = $quantite ;
echo '<td class="'.(($p->vrac) ? 'vrac' : '').'">'.$str_quantite.'</td>' ;
}
}
?>
</tr>
</tfoot>
</table>
<?php endif;?>
<?php endif; ?>
</div>
<div id="row1">
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Calendrier</h3>
</div>
<div class="panel-body">
<?php
// chargement assets
common\components\fullcalendar\FullcalendarWidget::widget();
// --> lancement du js en manuel (via lechatdesnoisettes.js)
?>
<div id="calendar"></div>
</div>
</div>
</div>
<?php if ($date != ''): ?>
<div class="col-md-5">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Production du <strong><?php echo date('d/m/Y', strtotime($date)); ?></strong></h3>
</div>
<div class="panel-body">
<strong>Production</strong>
<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>
</div>
<br />
<br />
<strong>Livraison</strong>
<div class="btn-group" role="group">
<a class="btn btn-default<?php if ($production->livraison): ?> btn-success<?php endif; ?>" href="<?php echo Yii::$app->urlManager->createUrl(['commande/change-livraison', 'date' => $date, 'livraison' => 1]); ?>">Activé</a>
<a class="btn btn-default<?php if (!$production->livraison): ?> btn-danger<?php endif; ?>" href="<?php echo Yii::$app->urlManager->createUrl(['commande/change-livraison', 'date' => $date, 'livraison' => 0]); ?>">Désactivé</a>
</div>
<br /><br />

<?php if (!count($commandes)): ?>
<div class="alert alert-info">Aucune commande passée pour cette date</div>
<?php else: ?>
<a class="btn btn-primary" href="<?php echo Yii::$app->urlManager->createUrl(['commande/download', 'date' => $date, 'id_point_vente' => 0, 'global' => 1]); ?>"><span class="glyphicon glyphicon-download-alt"></span> Récapitulatif global</a>
<br />
<br />
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php if ($production): ?>
<div id="bloc-produits" class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Produits</h3>
</div>
<div class="panel-body">
<!-- produits sélectionnés -->
<form id="produits-production" action="<?php echo Yii::$app->urlManager->createUrl(['commande/index', 'date' => $date]); ?>" method="post">
<table class="table table-bordered">
<tbody>
<?php foreach ($produits as $p): ?>
<tr<?php if ($p->vrac): ?> style="display:none;"<?php endif; ?>>
<td><label for="produit-<?php echo $p->id; ?>"><?php if (strlen($p->description)): echo Html::encode($p->description);
else: echo Html::encode($p->nom);
endif; ?></label></td>
<td><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><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>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<input type="submit" name="valider_produit_selec" class="btn btn-default" value="Valider" />
</form>
</div>
</div>
</div>
<?php endif; ?>
</div>
<div id="row2" class="col-md-12">
<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>
<?php endforeach; ?>
</ul>
<?php if ($date != ''): ?>

<?php
$num_jour_semaine = date('w', strtotime($date));
$arr_jour_semaine = [0 => 'dimanche', 1 => 'lundi', 2 => 'mardi', 3 => 'mercredi', 4 => 'jeudi', 5 => 'vendredi', 6 => 'samedi'];
$champs_horaires_point_vente = 'horaires_' . $arr_jour_semaine[$num_jour_semaine];
?>
<form class="form-commandes-point-vente" action="<?php echo Yii::$app->urlManager->createUrl(['commande/index', 'date' => $date]); ?>" method="post">

<table class="table table-striped table-header-rotated">
<thead>
<tr>
<td class="title-point-vente" colspan="<?php echo count($produits) + 3; ?>"><strong>Global</strong></td>
</tr>
<tr>
<th></th>
<?php foreach ($produits as $p): ?>
<?php if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']): ?>
<th class="center rotate-45">
<div><span><strong><?php echo Html::encode($p->getLibelleAdmin()); ?></strong></span></div>
</th>
<?php endif; ?>
<?php endforeach; ?>
<th class="title-totaux"><strong>Potentiel</strong></td>
<th class="title-totaux"><strong>Commandé</strong></td>
</tr>
<tr>
<td><strong>Pain</strong></td>
<?php
foreach ($produits as $p) {
if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
$quantite = Commande::getQuantiteProduit($p->id, $commandes);
$str_quantite = '';
if ($quantite)
$str_quantite = $quantite;

$classe = 'center total';
if ($str_quantite > $produits_selec[$p->id]['quantite_max'] && !$produits_selec[$p->id]['vrac']) {
$classe .= ' depasse';
}

if ($p->vrac) {
$classe .= ' vrac';
}

echo '<td class="' . $classe . '"><strong>' . $str_quantite . ' <span>';

if ($produits_selec[$p->id]['quantite_max'] && $str_quantite)
echo '/ ' . $produits_selec[$p->id]['quantite_max'] . '</span></strong></td>';
}
}
?>

<td><strong><?php echo number_format($ca_potentiel, 2); ?> €</strong><br /><?php echo number_format($poids_total / 1000, 2); ?> kg</td>

<td><strong><?php echo str_replace(' ', '&nbsp;', $recettes_pain . ' €'); ?></strong><br /><?php echo round($poids_pain) . ' kg'; ?></td>

</tr>
</thead>
<tbody>

<?php foreach ($points_vente as $pv): ?>
<?php
if (strlen($pv->$champs_horaires_point_vente)):
?>
<tr>
<td class="title-point-vente" colspan="<?php echo count($produits) + 3; ?>"><?php echo Html::encode($pv->nom); ?></td>
</tr>
<tr>
<th></th>
<?php foreach ($produits as $p): ?>
<?php if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']): ?>
<th class="center rotate-45">
<div><span><strong><?php echo Html::encode($p->getLibelleAdmin()); ?></strong></span></div>
</th>
<?php endif; ?>
<?php endforeach; ?>
<th></th>
<th></th>
</tr>

<?php foreach ($pv->commandes as $c): ?>
<tr>
<td>
<?php if (isset($c->user)): ?>
<?php echo Html::encode($c->user->prenom . ' ' . $c->user->nom); ?>
<?php else: ?>
<?php echo Html::encode($c->username); ?>
<?php endif; ?>

<?php if (strlen($c->commentaire)): ?>
<button type="button" class="btn btn-xs btn-info" data-toggle="popover" title="Commentaire" data-content="<?php echo Html::encode($c->commentaire); ?>"><span class="glyphicon glyphicon-comment"></span></button>
<?php endif; ?>

<br /><span class="date-commande"><?php echo date('d/m/Y à H:i ', strtotime($c->date));
if ($c->date_update && date('d/m/Y', strtotime($c->date_update)) != date('d/m/Y', strtotime($c->date))): ?><br />modif. <?php echo date('d/m/Y', strtotime($c->date_update)); ?><?php endif; ?></span>
</td>

<?php
foreach ($produits as $p) {
if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
$add = false;
$quantite = 0;
foreach ($c->commandeProduits as $cp) {
if ($p->id == $cp->id_produit) {
$quantite = $cp->quantite;
$add = true;
}
}

echo '<td class="td-produit"><input class="quantite" type="text" value="' . $quantite . '" name="produit_' . $c->id . '_' . $p->id . '" /></td>';
}
}
?>

<td><?php echo str_replace(' ', '&nbsp;', number_format($c->montant, 2) . ' €'); ?></td>
<td><a href="<?php echo Yii::$app->urlManager->createUrl(['commande/delete-commande', 'date' => $date, 'delete' => 1, 'id_commande' => $c->id]); ?>" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a></td>
</tr>
<?php endforeach; ?>

<tr>
<td><!-- <select class="select-user" name="user_pv_<?php echo $pv->id; ?>">
<?php
foreach ($users as $id_user => $libelle_user) {
echo '<option value="' . $id_user . '">' . $libelle_user . '</option>';
}
?>
</select> -->

<input type="text" placeholder="Nom" class="text" name="username_pv_<?php echo $pv->id; ?>" />
<br />
<input type="text" name="date_commande_pv_<?php echo $pv->id; ?>" class="datepicker" value="<?php echo date('d/m/Y'); ?>" />
</td>
<?php
foreach ($produits as $p) {
if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
echo '<td class="td-produit' . (($p->vrac) ? ' vrac' : '') . '"><input class="quantite" type="text" value="0" name="produit_pv_' . $pv->id . '_' . $p->id . '" /></td>';
}
}
?>

<td></td>
<td></td>
</tr>

<?php
if (count($pv->commandes) && strlen($pv->$champs_horaires_point_vente)) {
echo '<tr>';
echo '<td><strong>Total pain</strong></td>';

//$cpt_non_vrac = 0 ;
foreach ($produits as $p) {
if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {

$quantite = Commande::getQuantiteProduit($p->id, $pv->commandes);
$str_quantite = '';

if (!$p->vrac) {
//$cpt_non_vrac ++ ;
if ($quantite)
$str_quantite = $quantite;
}

echo '<td class="center' . (($p->vrac) ? ' vrac' : '') . '"><strong>' . $str_quantite . '</strong></td>';
}
}

// total
echo '<td><strong>' . number_format($pv->recettes_pain, 2) . ' €</strong></td><td></td></tr>';
}
?>

<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
<input type="submit" class="btn btn-primary submit-pv" value="Enregistrer" name="submit_pv" />
</form>
<div class="clr"></div>


<?php if (count($commandes) && false): ?>
<h2>Récapitulatif production <a href="<?php echo Yii::$app->urlManager->createUrl(['commande/download', 'date' => $date]); ?>" class="btn btn-default">CSV</a></h2>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Lieu</th>
<?php foreach ($produits as $p): ?>
<?php if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) : ?>
<th><?php echo Html::encode($p->description); ?></th>
<?php endif; ?>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php
foreach ($points_vente as $pv) {
if (count($pv->commandes) && strlen($pv->$champs_horaires_point_vente)) {
echo '<tr>';
echo '<td>' . Html::encode($pv->nom) . '</td>';
foreach ($produits as $p) {
if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
$quantite = Commande::getQuantiteProduit($p->id, $pv->commandes);
$str_quantite = '';
if ($quantite)
$str_quantite = $quantite;

echo '<td>' . $str_quantite . '</td>';
}
}
echo '</tr>';
}
}
?>
</tbody>
<tfoot>
<tr>
<td><strong>Total</strong></td>
<?php
foreach ($produits as $p) {
if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
$quantite = Commande::getQuantiteProduit($p->id, $commandes);
$str_quantite = '';
if ($quantite)
$str_quantite = $quantite;

echo '<td class="' . (($p->vrac) ? 'vrac' : '') . '">' . $str_quantite . '</td>';
}
}
?>
</tr>
</tfoot>
</table>
<?php endif; ?>
<?php endif; ?>
</div>
</div>

+ 3
- 1
backend/views/layouts/main.php Näytä tiedosto

@@ -27,8 +27,10 @@ AppAsset::register($this);
NavBar::begin([
'brandLabel' => '<span class="glyphicon glyphicon-home"></span>',
'brandUrl' => Yii::$app->homeUrl,
'innerContainerOptions' => ['class'=>'container-fluid'],
'options' => [
'class' => 'navbar-inverse navbar-fixed-top nav-header',
],
]);
$menuItems = [
@@ -61,7 +63,7 @@ AppAsset::register($this);
NavBar::end();
?>

<div class="container">
<div class="container-fluid container-body">
<?php if(!Yii::$app->user->isGuest): ?>
<div class="nom-boulange">
<span><?= Html::encode(Yii::$app->user->identity->getNomMagasin()) ; ?></span>

BIN
backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc Näytä tiedosto


+ 109
- 32
backend/web/css/screen.css Näytä tiedosto

@@ -20,11 +20,16 @@
}

/* line 22, ../sass/screen.scss */
.container-body {
padding-top: 70px;
}

/* line 26, ../sass/screen.scss */
.nom-boulange {
margin-bottom: 15px;
text-align: center;
}
/* line 25, ../sass/screen.scss */
/* line 29, ../sass/screen.scss */
.nom-boulange span {
position: relative;
top: -12px;
@@ -38,147 +43,219 @@
margin-bottom: 20px;
}

/* line 39, ../sass/screen.scss */
/* line 43, ../sass/screen.scss */
.table thead th.actions {
width: 220px;
}
/* line 42, ../sass/screen.scss */
/* line 46, ../sass/screen.scss */
.table thead th.order {
width: 58px;
}
/* line 45, ../sass/screen.scss */
/* line 49, ../sass/screen.scss */
.table thead th.actif {
width: 75px;
text-align: center;
}
/* line 51, ../sass/screen.scss */
/* line 55, ../sass/screen.scss */
.table tbody td.center {
text-align: center;
}

/* line 59, ../sass/screen.scss */
/* line 62, ../sass/screen.scss */
#page-commande #bloc-produits {
max-height: 400px;
overflow-y: scroll;
}
/* line 72, ../sass/screen.scss */
#page-commande h1 .btn-group {
float: right;
}
/* line 64, ../sass/screen.scss */
/* line 77, ../sass/screen.scss */
#page-commande #jours-production {
display: none;
}
/* line 69, ../sass/screen.scss */
/* line 82, ../sass/screen.scss */
#page-commande #calendar .fc-header-title {
margin-left: 10px;
}
/* line 75, ../sass/screen.scss */
/* line 88, ../sass/screen.scss */
#page-commande #calendar .dayWithEvent {
background-color: #fee48d;
cursor: pointer;
}
/* line 79, ../sass/screen.scss */
/* line 92, ../sass/screen.scss */
#page-commande #calendar .fc-event-container {
display: none;
}
/* line 80, ../sass/screen.scss */
/* line 93, ../sass/screen.scss */
#page-commande #calendar .fc-today {
border-bottom: solid 1px #C9302C;
background-color: white;
}
/* line 84, ../sass/screen.scss */
/* line 97, ../sass/screen.scss */
#page-commande #calendar .fc-today.dayWithEvent {
background-color: #fee48d;
}
/* line 89, ../sass/screen.scss */
/* line 102, ../sass/screen.scss */
#page-commande #calendar .fc-day {
cursor: pointer;
text-align: center;
}
/* line 92, ../sass/screen.scss */
/* line 105, ../sass/screen.scss */
#page-commande #calendar .fc-day:hover {
-moz-box-shadow: 0px 0px 2px black inset;
-webkit-box-shadow: 0px 0px 2px black inset;
box-shadow: 0px 0px 2px black inset;
}
/* line 97, ../sass/screen.scss */
/* line 110, ../sass/screen.scss */
#page-commande #calendar .current-date {
-moz-box-shadow: 0px 0px 2px black inset;
-webkit-box-shadow: 0px 0px 2px black inset;
box-shadow: 0px 0px 2px black inset;
}
/* line 101, ../sass/screen.scss */
/* line 114, ../sass/screen.scss */
#page-commande #calendar .fc-day-number {
float: none;
padding-top: 2px;
}
/* line 108, ../sass/screen.scss */
/* line 121, ../sass/screen.scss */
#page-commande #produits-production input.quantite-max {
background-color: white;
border: 1px solid #e0e0e0;
text-align: center;
width: 50px;
}
/* line 116, ../sass/screen.scss */
/* line 129, ../sass/screen.scss */
#page-commande .form-commandes-point-vente {
margin-top: 20px;
}
/* line 120, ../sass/screen.scss */
/* line 133, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-point-vente {
background-color: #fff8e2;
border-left: solid 3px #fdd44b;
font-weight: bold;
text-align: left;
padding: 10px;
}
/* line 141, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-totaux {
text-align: center;
}
/* line 126, ../sass/screen.scss */
/* line 145, ../sass/screen.scss */
#page-commande .form-commandes-point-vente input.quantite {
width: 50px;
width: 30px;
background-color: white;
border: solid 1px #e0e0e0;
text-align: center;
}
/* line 133, ../sass/screen.scss */
/* line 153, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .td-produit {
text-align: center;
}
/* line 137, ../sass/screen.scss */
/* line 157, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .submit-pv {
float: right;
}
/* line 141, ../sass/screen.scss */
/* line 161, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .select-user {
background-color: #F9F9F9;
border: solid 1px #e0e0e0;
}
/* line 146, ../sass/screen.scss */
/* line 166, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .date-commande {
font-size: 12px;
}
/* line 150, ../sass/screen.scss */
/* line 170, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .datepicker, #page-commande .form-commandes-point-vente .text {
background-color: white;
border: solid 1px #e0e0e0;
margin-top: 3px;
width: 100px;
}
/* line 158, ../sass/screen.scss */
/* line 178, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.center {
text-align: center;
}
/* line 162, ../sass/screen.scss */
/* line 184, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .depasse {
color: #b32815;
}
/* line 166, ../sass/screen.scss */
/* line 188, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .total strong span {
font-weight: normal;
font-size: 13px;
}
/* line 171, ../sass/screen.scss */
/* line 193, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .vrac {
display: none;
}
/* line 203, ../sass/screen.scss */
#page-commande .table-header-rotated td {
width: 20px;
padding: 0px;
border-top: 1px solid #dddddd;
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
vertical-align: middle;
text-align: center;
}
/* line 213, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 {
height: 80px;
width: 20px;
min-width: 20px;
max-width: 20px;
position: relative;
vertical-align: bottom;
padding: 0;
font-size: 12px;
line-height: 0.8;
}
/* line 225, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 > div {
position: relative;
top: 0px;
left: 40px;
/* 80 * tan(45) / 2 = 40 where 80 is the height on the cell and 45 is the transform angle*/
height: 100%;
-ms-transform: skew(-45deg, 0deg);
-moz-transform: skew(-45deg, 0deg);
-webkit-transform: skew(-45deg, 0deg);
-o-transform: skew(-45deg, 0deg);
transform: skew(-45deg, 0deg);
overflow: hidden;
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
border-top: 1px solid #dddddd;
}
/* line 241, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 span {
-ms-transform: skew(45deg, 0deg) rotate(315deg);
-moz-transform: skew(45deg, 0deg) rotate(315deg);
-webkit-transform: skew(45deg, 0deg) rotate(315deg);
-o-transform: skew(45deg, 0deg) rotate(315deg);
transform: skew(45deg, 0deg) rotate(315deg);
position: absolute;
bottom: 30px;
/* 40 cos(45) = 28 with an additional 2px margin*/
bottom: 16px;
left: -25px;
/*Because it looked good, but there is probably a mathematical link here as well*/
left: 0px;
display: inline-block;
width: 85px;
/* 80 / cos(45) - 40 cos (45) = 85 where 80 is the height of the cell, 40 the width of the cell and 45 the transform angle*/
width: 43px;
text-align: left;
white-space: nowrap;
/*whether to display in one line or not*/
}

/* line 183, ../sass/screen.scss */
/* line 266, ../sass/screen.scss */
#email-masse-form #ids-users {
line-height: 30px;
}
/* line 185, ../sass/screen.scss */
/* line 268, ../sass/screen.scss */
#email-masse-form #ids-users .label {
text-transform: capitalize;
}

+ 84
- 1
backend/web/sass/screen.scss Näytä tiedosto

@@ -19,6 +19,10 @@
}
}

.container-body {
padding-top: 70px ;
}

.nom-boulange {
margin-bottom: 15px ;
text-align: center ;
@@ -55,6 +59,15 @@
}

#page-commande {
#bloc-produits {
max-height: 400px ;
overflow-y: scroll ;
}
#row2 {
}
h1 {
.btn-group {
float: right ;
@@ -121,10 +134,17 @@
background-color: lighten(#fdd44b, 30) ;
border-left: solid 3px #fdd44b ;
font-weight: bold ;
text-align: left ;
padding: 10px ;
}
.title-totaux {
text-align: center ;
}
input.quantite {
width: 50px ;
//width: 50px ;
width: 30px ;
background-color: white ;
border: solid 1px #e0e0e0 ;
text-align: center ;
@@ -158,6 +178,8 @@
td.center {
text-align: center ;
}
.depasse {
color: #b32815 ;
@@ -173,6 +195,67 @@
}
}
.table-header-rotated th.row-header{
//width: auto;
}

.table-header-rotated td{
width: 20px;
padding: 0px ;
border-top: 1px solid #dddddd;
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
vertical-align: middle;
text-align: center;
}

.table-header-rotated th.rotate-45{
height: 80px;
width: 20px;
min-width: 20px;
max-width: 20px;
position: relative;
vertical-align: bottom;
padding: 0;
font-size: 12px;
line-height: 0.8;
}

.table-header-rotated th.rotate-45 > div{
position: relative;
top: 0px;
left: 40px; /* 80 * tan(45) / 2 = 40 where 80 is the height on the cell and 45 is the transform angle*/
height: 100%;
-ms-transform:skew(-45deg,0deg);
-moz-transform:skew(-45deg,0deg);
-webkit-transform:skew(-45deg,0deg);
-o-transform:skew(-45deg,0deg);
transform:skew(-45deg,0deg);
overflow: hidden;
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
border-top: 1px solid #dddddd;
}

.table-header-rotated th.rotate-45 span {
-ms-transform:skew(45deg,0deg) rotate(315deg);
-moz-transform:skew(45deg,0deg) rotate(315deg);
-webkit-transform:skew(45deg,0deg) rotate(315deg);
-o-transform:skew(45deg,0deg) rotate(315deg);
transform:skew(45deg,0deg) rotate(315deg);
position: absolute;
bottom: 30px; /* 40 cos(45) = 28 with an additional 2px margin*/
bottom: 16px; // pour width 20px
left: -25px; /*Because it looked good, but there is probably a mathematical link here as well*/
left: 0px ;
display: inline-block;
// width: 100%;
width: 85px; /* 80 / cos(45) - 40 cos (45) = 85 where 80 is the height of the cell, 40 the width of the cell and 45 the transform angle*/
width: 43px ;
text-align: left;
white-space: nowrap; /*whether to display in one line or not*/
}

+ 3
- 5
common/models/Produit.php Näytä tiedosto

@@ -89,11 +89,9 @@ class Produit extends \yii\db\ActiveRecord
return $description ;
}
public function getLibelleAdmin() {
if(strlen($this->diminutif))
return $this->diminutif ;
else
return $this->description ;
public function getLibelleAdmin()
{
return $this->nom ;
}
public function save($runValidation = true, $attributeNames = NULL)

Loading…
Peruuta
Tallenna