Ver código fonte

[Backend] Nouvelle vue des commandes

Les commandes sont désormais classées par point de vente dans des onglets.
Une seule commande est affichée à la fois. On a constamment le global sur la droite.
Tout est en ajax pour améliorer l'ergonomie.
On affiche moins mais mieux !
master
keun 8 anos atrás
pai
commit
f9c2c05b98
9 arquivos alterados com 1231 adições e 380 exclusões
  1. +300
    -3
      backend/controllers/CommandeController.php
  2. +43
    -0
      backend/views/commande/_total_commandes.php
  3. +107
    -279
      backend/views/commande/index.php
  4. +2
    -0
      backend/views/layouts/main.php
  5. BIN
      backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc
  6. +266
    -89
      backend/web/css/screen.css
  7. +319
    -3
      backend/web/js/lechatdesnoisettes.js
  8. +192
    -5
      backend/web/sass/screen.scss
  9. +2
    -1
      common/models/PointVente.php

+ 300
- 3
backend/controllers/CommandeController.php Ver arquivo

@@ -10,11 +10,11 @@ use yii\web\Controller;
use common\models\LoginForm;
use yii\filters\VerbFilter;
use common\models\Commande;
use common\models\CommandeProduit;
use common\models\PointVente;
use common\models\Produit;
use common\helpers\CSV;
use common\models\User;
use common\models\CommandeProduit;
use kartik\mpdf\Pdf;

class CommandeController extends BackendController {
@@ -304,6 +304,38 @@ class CommandeController extends BackendController {
// init commandes point de vente
foreach ($points_vente as $pv) {
$pv->initCommandes($commandes);
$data_select_commandes = [] ;
$data_options_commandes = [] ;
foreach($pv->commandes as $c)
{
if($c->user)
{
$data_select_commandes[$c->id] = $c->user->nom.' '.$c->user->prenom ;
}
else {
$data_select_commandes[$c->id] = $c->username;
}
$data_options_commandes[$c->id] = [] ;
$array_options = [] ;
$array_options[$c->id]['montant'] = number_format($c->montant, 2, ',', '') ;
$array_options[$c->id]['produits'] = [] ;
foreach($c->commandeProduits as $cp)
{
$array_options[$c->id]['produits'][$cp->id_produit] = $cp->quantite ;
}
$data_options_commandes[$c->id]['data-commande'] = json_encode($array_options[$c->id]) ;
$data_options_commandes[$c->id]['value'] = $c->id ;
//print_r($data_options_commandes) ;
//die() ;
//$data_options_commandes[] ;
}
//die() ;
$pv->data_select_commandes = $data_select_commandes ;
$pv->data_options_commandes = $data_options_commandes ;
}

// gestion produits selec
@@ -758,7 +790,8 @@ class CommandeController extends BackendController {
];
}

public function actionChangeState($date, $actif) {
public function actionChangeState($date, $actif)
{

// changement état
$production = Production::find()->where(['date' => $date])->one();
@@ -768,11 +801,275 @@ class CommandeController extends BackendController {
$this->redirect(['index', 'date' => $date]);
}

public function actionChangeLivraison($date, $livraison) {
public function actionChangeLivraison($date, $livraison)
{
$production = Production::find()->where(['date' => $date])->one();
$production->livraison = $livraison;
$production->save();
$this->redirect(['index', 'date' => $date]);
}
public function actionAjaxUpdate($id_commande, $produits, $date)
{
$commande = Commande::find()->with('production')->where(['id' => $id_commande])->one() ;
if($commande &&
$commande->production->id_etablissement == Yii::$app->user->identity->id_etablissement)
{
$produits = json_decode($produits) ;
foreach($produits as $key => $quantite)
{
$commande_produit = CommandeProduit::findOne([
'id_commande' => $id_commande,
'id_produit' => $key
]) ;
if($quantite)
{
if($commande_produit)
{

$commande_produit->quantite = $quantite ;
}
else {

$produit = Produit::findOne($key) ;

if($produit)
{
$commande_produit = new CommandeProduit ;
$commande_produit->id_commande = $id_commande ;
$commande_produit->id_produit = $key ;
$commande_produit->quantite = $quantite ;
$commande_produit->prix = $produit->prix ;
}
}
$commande_produit->save() ;
}
else {
if($commande_produit)
$commande_produit->delete() ;
}
}
$commande->date_update = date('Y-m-d H:i:s') ;
$commande->save() ;
// total commande
$commande = Commande::find()->with('commandeProduits')->where(['id' => $id_commande])->one() ;
$commande->init() ;
$json_commande = ['produits'=> [], 'montant' => number_format($commande->montant, 2)] ;
foreach($commande->commandeProduits as $commande_produit)
{
$json_commande['produits'][$commande_produit->id_produit] = $commande_produit->quantite ;
}
// total point de vente
$point_vente = PointVente::findOne($commande->id_point_vente) ;
$commandes = Commande::find()
->with('commandeProduits', 'user')
->joinWith('production')
->where(['production.date' => $date])
->andWhere(['production.id_etablissement' => Yii::$app->user->identity->id_etablissement])
->orderBy('date ASC')
->all();
foreach($commandes as $c) $c->init() ;
$point_vente->initCommandes($commandes) ;
echo json_encode([
'total_commande' => number_format($commande->montant, 2).' €',
'total_pv' => number_format($point_vente->recettes, 2).' €',
'json_commande' => json_encode($json_commande)
]) ;
die() ;
}
}
public function actionAjaxDelete($date, $id_commande)
{
$commande = Commande::find()->where(['id' => $id_commande])->one();
// delete
if ($commande) {
$commande->delete();
CommandeProduit::deleteAll(['id_commande' => $id_commande]);
}
// total point de vente
$point_vente = PointVente::findOne($commande->id_point_vente) ;
$commandes = Commande::find()
->with('commandeProduits', 'user')
->joinWith('production')
->where(['production.date' => $date])
->andWhere(['production.id_etablissement' => Yii::$app->user->identity->id_etablissement])
->orderBy('date ASC')
->all();
foreach($commandes as $c) $c->init() ;
$point_vente->initCommandes($commandes) ;

echo json_encode([
'total_pv' => number_format($point_vente->recettes, 2).' €',
]) ;
die() ;
}
public function actionAjaxCreate($date, $id_pv, $id_user, $username, $produits)
{
$produits = json_decode($produits) ;
$point_vente = PointVente::findOne($id_pv) ;
$production = Production::findOne(['date' => $date]) ;
if(preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/",$date) &&
($id_user || strlen($username)) &&
$point_vente &&
count($produits) &&
$production)
{
$commande = new Commande ;
$commande->date = date('Y-m-d H:i:s', strtotime($date.' '.date('H:i:s'))) ;
$commande->id_point_vente = $id_pv ;
$commande->id_production = $production->id ;
if($id_user)
{
$commande->id_user = $id_user ;
}
else {
$commande->username = $username ;
$commande->id_user = 0 ;
}
$commande->save() ;
foreach($produits as $key => $quantite)
{
$produit = Produit::findOne($key) ;
if($produit)
{
$commande_produit = new CommandeProduit ;
$commande_produit->id_commande = $commande->id ;
$commande_produit->id_produit = $key ;
$commande_produit->quantite = $quantite ;
$commande_produit->prix = $produit->prix ;
$commande_produit->save() ;
}
}
// total point de vente
$point_vente = PointVente::findOne($commande->id_point_vente) ;
$commandes = Commande::find()
->with('commandeProduits', 'user')
->joinWith('production')
->where(['production.date' => $date])
->andWhere(['production.id_etablissement' => Yii::$app->user->identity->id_etablissement])
->orderBy('date ASC')
->all();
foreach($commandes as $c) $c->init() ;
$point_vente->initCommandes($commandes) ;
// json commande
$commande = Commande::find()
->with('commandeProduits', 'user')
->where(['commande.id' => $commande->id])
->one();
$commande->init() ;
$produits = [] ;
foreach($commande->commandeProduits as $cp)
{
$produits[$cp->id_produit] = $cp->quantite ;
}
$json_commande = json_encode(['montant' => number_format($commande->montant, 2), 'produits' => $produits]) ;
$str_user = '' ;
if($commande->user)
$str_user = $commande->user->nom.' '.$commande->user->prenom ;
else
$str_user = $commande->username ;
$str_commentaire = '' ;
if(strlen($commande->commentaire))
{
$str_commentaire = '<span class="glyphicon glyphicon-comment">'.Html::encode($commande->commentaire).'</span>' ;
}
echo json_encode([
'id_commande' => $commande->id,
'total_pv' => number_format($point_vente->recettes, 2).' €',
'commande' => '<li>'
. '<a class="btn btn-default" href="javascript:void(0);" '
. 'data-pv-id="'.$id_pv.'" '
. 'data-id-commande="'.$commande->id.'" '
. 'data-commande=\''.$json_commande.'\' '
. 'data-date="'.date('d/m H:i', strtotime($commande->date)).'">'
. '<span class="montant">'.number_format($commande->montant, 2).' €</span>'
. '<span class="user">'.$str_user.'</span>'
. $str_commentaire
. '</a></li>',
]) ;
die() ;
}
}
public function actionAjaxTotalCommandes($date)
{
$production = Production::find()
->where(['date' => $date])
->andWhere(['id_etablissement'=>Yii::$app->user->identity->id_etablissement])
->one();
if($production)
{
// produits
$produits = Produit::find()
->where(['id_etablissement' => Yii::$app->user->identity->id_etablissement])
->orderBy('order ASC')
->all();



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

foreach ($commandes as $c)
{
$c->init();
}

// produits selec pour production
$produits_selec = ProductionProduit::findProduits($production->id);
$html_totaux = $this->renderPartial('_total_commandes.php',[
'produits' => $produits,
'commandes' => $commandes,
'produits_selec' => $produits_selec
]);
echo json_encode([
'html_totaux' => $html_totaux
]) ;
}
die() ;
}

}

+ 43
- 0
backend/views/commande/_total_commandes.php Ver arquivo

@@ -0,0 +1,43 @@
<?php

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

?>


<tbody>
<?php
foreach ($produits as $p) {
if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
echo '<tr>' ;

$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>';

echo '<td>'.Html::encode($p->getLibelleAdmin()).'</td></tr>' ;
}
}
?>

<tr class="tr-total">
<td class="td-total"></td>
<td></td>
</tr>
</tbody>

+ 107
- 279
backend/views/commande/index.php Ver arquivo

@@ -2,6 +2,8 @@

use yii\helpers\Html;
use common\models\Commande;
use common\models\User ;
use yii\helpers\ArrayHelper ;

$this->title = 'Commande';

@@ -31,11 +33,13 @@ foreach ($produits as $p) {
?>
<div id="calendar"></div>
</div>
</div>
</div>
<?php if ($date != ''): ?>
<div class="col-md-5" id="bloc-production">
<input type="hidden" id="date-production" value="<?= $date ?>" />
<div class="panel panel-default">
<div class="panel-heading">
<?php if (!count($commandes)): ?><span class="label label-danger">Aucune commande</span>
@@ -45,11 +49,6 @@ foreach ($produits as $p) {
<h3 class="panel-title">Production du <strong><?php echo date('d/m/Y', strtotime($date)); ?></strong></h3>
</div>
<div class="panel-body">
<?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 les commandes</a>
<?php endif; ?>
<strong>Production</strong><br />
<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>
@@ -128,290 +127,119 @@ foreach ($produits as $p) {
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Commandes</h3>
</div>
<div class="panel-body">
<!-- Nav tabs -->
<ul 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 ?>" aria-controls="point-vente-<?= $pv->id ?>" role="tab" data-toggle="tab"><?= Html::encode($pv->nom) ?> <span class="label label-<?php if(count($pv->commandes)): ?>success<?php else: ?>danger<?php endif; ?>"><?php echo count($pv->commandes); ?></span></a>
</li>
<?php endforeach; ?>
</ul>

<!-- Tab panes -->
<div class="tab-content">
<?php foreach($points_vente as $pv): ?>
<div role="tabpanel" class="tab-pane<?php if($pv->point_fabrication): ?> active<?php endif; ?>" id="point-vente-<?= $pv->id ?>">
<table class="table">
<thead>
<tr>
<th>Produits</th>
<th>
<select>
<option value="">Guillaume Bourgeois</option>
<option value="">Jean-Marc Bonard</option>
</select>
</th>
<th><a href="#" class="btn btn-default">Nouvelles commande</a></th>
</tr>
</thead>
<tbody>
<?php foreach ($produits as $p): ?>
<?php if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']): ?>
<tr>
<td><?php echo Html::encode($p->getLibelleAdmin()); ?></td>
<td><?= rand(1,10) ?></td>
<td><input type="text" /></td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Commandes</h3>
<h3 class="panel-title">
Commandes
<?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 endif; ?>
</h3>
</div>
<div class="panel-body">
<form class="form-commandes-point-vente" action="<?php echo Yii::$app->urlManager->createUrl(['commande/index', 'date' => $date]); ?>" method="post">

<table class="table table-hover table-header-rotated">
<thead>
<tr>
<td class="title-point-vente" colspan="<?php echo count($produits) + 3; ?>"><strong>Global</strong></td>
</tr>
<tr>
<th class="border-left"></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></th>
<th class="title-totaux border-right"><strong>Commandé</strong></th>
</tr>
<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;

$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 class="border-left"></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>
<div class="col-md-9">
<!-- Nav tabs -->
<ul 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>
</li>
<?php endforeach; ?>
</ul>

<!-- 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="col-md-4">
<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>
<?php else: ?>
<strong class="commandes">Aucune commande</strong>
<span class="recettes"></span>
<?php endif; ?>
</div>
<ul class="liste-commandes btn-group-vertical">
<?php foreach($pv->commandes as $c): ?>
<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"><?= Html::encode(number_format($c->montant, 2)); ?> €</span>
<span class="user">
<?php if(isset($c->user)): ?>
<?= Html::encode($c->user->nom.' '.$c->user->prenom); ?>
<?php else: ?>
<?= Html::encode($c->username); ?>
<?php endif; ?>
</span>
<?php if (strlen($c->commentaire)): ?>
<span class="glyphicon glyphicon-comment"></span>
<?php endif; ?>
</a>
</li>
<?php endforeach; ?>
<th></th>
<th class="border-right"></th>
</tr>

<?php foreach ($pv->commandes as $c): ?>
<tr>
<td class="client">
<?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 class="client"><!-- <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; ?>
</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]) ?>
</div>
<div class="col-md-8">
<h2 class="title-user">
<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-pencil"></span> Modifier', 'javascript:void(0);', ['class' => 'btn btn-default btn-edit']) ?>
</span>
<span class="buttons-save-cancel">
<?= Html::a('<span class="glyphicon glyphicon-ok"></span> Sauvegarder', 'javascript:void(0);', ['class' => 'btn btn-primary btn-save']) ?>
<?= Html::a('<span class="glyphicon glyphicon-remove"></span> Annuler', 'javascript:void(0);', ['class' => 'btn btn-default btn-cancel']) ?>
</span>
<span class="the-title"></span>
<span class="choix-user">
<?= Html::activeDropDownList(new User, 'id', ArrayHelper::map(User::find()->all(), 'id', function($model, $defaultValue) {
return $model['nom'].' '.$model['prenom'];
}), ['prompt' => '--','class' => 'form-control user-id']) ?>
OU <input type="text" class="form-control username" placeholder="Choisissez un nom" />
</span>
</h2>
<div class="commentaire alert alert-info">
</div>
<table class="table table-bordered table-condensed tab-content table-produits">
<tbody>
<?php foreach ($produits as $p): ?>
<?php if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']): ?>
<tr class="produit-<?= $p->id ?>" data-id-produit="<?= $p->id ?>">
<td class="td-commande"></td>
<td class="td-produit"><?php echo Html::encode($p->getLibelleAdmin()); ?></td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<tr class="tr-total">
<td class="td-total"></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<?php endforeach; ?>
</tbody>
</div>
</div>
<div class="col-md-3" id="bloc-totaux">
<h2>Global</h2>
<table class="table table-bordered table-condensed tab-content table-produits">
<?= $this->render('_total_commandes.php',[
'produits' => $produits,
'commandes' => $commandes,
'produits_selec' => $produits_selec
]); ?>
</table>
<input type="submit" class="btn btn-primary submit-pv" value="Enregistrer" name="submit_pv" />
</form>
</div>
</div>
</div>
<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>

+ 2
- 0
backend/views/layouts/main.php Ver arquivo

@@ -97,6 +97,8 @@ AppAsset::register($this);
</div>
</div>

<div id="alerts-fixed"></div>
<footer class="footer">
<div class="container">
<p class="pull-left"></p>

BIN
backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc Ver arquivo


+ 266
- 89
backend/web/css/screen.css Ver arquivo

@@ -148,6 +148,17 @@ a:hover, a:focus, a:active {
}

/* line 103, ../sass/screen.scss */
#alerts-fixed {
position: fixed;
bottom: 20px;
left: 20px;
}
/* line 108, ../sass/screen.scss */
#alerts-fixed .alert {
margin-top: 20px;
}

/* line 113, ../sass/screen.scss */
.nom-boulange {
margin-bottom: 15px;
text-align: left;
@@ -168,14 +179,14 @@ a:hover, a:focus, a:active {
-webkit-box-shadow: 0px 0px 5px gray;
box-shadow: 0px 0px 5px gray;
}
/* line 122, ../sass/screen.scss */
/* line 132, ../sass/screen.scss */
.nom-boulange #etat-paiement-etablissement {
float: right;
text-align: right;
color: #8d6139;
font-size: 16px;
}
/* line 127, ../sass/screen.scss */
/* line 137, ../sass/screen.scss */
.nom-boulange #etat-paiement-etablissement .strong {
background-color: white;
color: #BB8757;
@@ -184,170 +195,336 @@ a:hover, a:focus, a:active {
border-radius: 10px;
padding: 0px 10px;
}
/* line 133, ../sass/screen.scss */
/* line 143, ../sass/screen.scss */
.nom-boulange #etat-paiement-etablissement .btn {
padding: 2px 5px;
}

/* line 141, ../sass/screen.scss */
/* line 151, ../sass/screen.scss */
.table thead th.actions {
width: 220px;
}
/* line 144, ../sass/screen.scss */
/* line 154, ../sass/screen.scss */
.table thead th.order {
width: 58px;
}
/* line 147, ../sass/screen.scss */
/* line 157, ../sass/screen.scss */
.table thead th.actif {
width: 75px;
text-align: center;
}
/* line 153, ../sass/screen.scss */
/* line 163, ../sass/screen.scss */
.table tbody td.center {
text-align: center;
}

/* line 166, ../sass/screen.scss */
/* line 176, ../sass/screen.scss */
#page-commande h1 .btn-group {
float: right;
}
/* line 171, ../sass/screen.scss */
/* line 181, ../sass/screen.scss */
#page-commande #jours-production {
display: none;
}
/* line 177, ../sass/screen.scss */
/* line 187, ../sass/screen.scss */
#page-commande #calendar h2 {
font-size: 20px;
position: relative;
top: 3px;
}
/* line 183, ../sass/screen.scss */
/* line 193, ../sass/screen.scss */
#page-commande #calendar .fc-header-title {
margin-left: 10px;
}
/* line 189, ../sass/screen.scss */
/* line 199, ../sass/screen.scss */
#page-commande #calendar .dayWithEvent {
background-color: #fee48d;
cursor: pointer;
}
/* line 193, ../sass/screen.scss */
/* line 203, ../sass/screen.scss */
#page-commande #calendar .fc-event-container {
display: none;
}
/* line 194, ../sass/screen.scss */
/* line 204, ../sass/screen.scss */
#page-commande #calendar .fc-today {
border-bottom: solid 1px #C9302C;
background-color: white;
}
/* line 198, ../sass/screen.scss */
/* line 208, ../sass/screen.scss */
#page-commande #calendar .fc-today.dayWithEvent {
background-color: #fee48d;
}
/* line 203, ../sass/screen.scss */
/* line 213, ../sass/screen.scss */
#page-commande #calendar .fc-day {
cursor: pointer;
text-align: center;
}
/* line 206, ../sass/screen.scss */
/* line 216, ../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 211, ../sass/screen.scss */
/* line 221, ../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 215, ../sass/screen.scss */
/* line 225, ../sass/screen.scss */
#page-commande #calendar .fc-day-number {
float: none;
padding-top: 2px;
}
/* line 223, ../sass/screen.scss */
/* line 233, ../sass/screen.scss */
#page-commande #bloc-production .label {
float: right;
font-size: 13px;
}
/* line 228, ../sass/screen.scss */
/* line 238, ../sass/screen.scss */
#page-commande #bloc-production .btn-success {
background-color: #5cb85c;
border-color: #4cae4c;
}
/* line 233, ../sass/screen.scss */
#page-commande #bloc-production #btn-export-commandes {
float: right;
margin-top: 20px;
}
/* line 246, ../sass/screen.scss */
/* line 251, ../sass/screen.scss */
#page-commande #produits-production .overflow table {
width: 100%;
}
/* line 250, ../sass/screen.scss */
/* line 255, ../sass/screen.scss */
#page-commande #produits-production .overflow thead, #page-commande #produits-production .overflow tbody, #page-commande #produits-production .overflow tr, #page-commande #produits-production .overflow td, #page-commande #produits-production .overflow th {
display: block;
}
/* line 252, ../sass/screen.scss */
/* line 257, ../sass/screen.scss */
#page-commande #produits-production .overflow tr:after {
content: ' ';
display: block;
visibility: hidden;
clear: both;
}
/* line 259, ../sass/screen.scss */
/* line 264, ../sass/screen.scss */
#page-commande #produits-production .overflow thead th {
height: 30px;
/*text-align: left;*/
}
/* line 265, ../sass/screen.scss */
/* line 270, ../sass/screen.scss */
#page-commande #produits-production .overflow tbody {
height: 200px;
overflow-y: auto;
}
/* line 273, ../sass/screen.scss */
/* line 278, ../sass/screen.scss */
#page-commande #produits-production .overflow thead th {
width: 32%;
float: left;
}
/* line 278, ../sass/screen.scss */
/* line 283, ../sass/screen.scss */
#page-commande #produits-production .overflow tbody td {
width: 33%;
float: left;
}
/* line 283, ../sass/screen.scss */
/* line 288, ../sass/screen.scss */
#page-commande #produits-production .overflow .td-produit {
width: 60%;
}
/* line 286, ../sass/screen.scss */
/* line 291, ../sass/screen.scss */
#page-commande #produits-production .overflow .td-actif, #page-commande #produits-production .overflow .td-max {
width: 20%;
text-align: center;
}
/* line 292, ../sass/screen.scss */
/* line 297, ../sass/screen.scss */
#page-commande #produits-production .overflow thead .td-produit {
width: 57%;
}
/* line 298, ../sass/screen.scss */
/* line 303, ../sass/screen.scss */
#page-commande #produits-production input.quantite-max {
background-color: white;
border: 1px solid #e0e0e0;
text-align: center;
width: 50px;
}
/* line 306, ../sass/screen.scss */
/* line 311, ../sass/screen.scss */
#page-commande #produits-production td label {
font-weight: normal;
}
/* line 312, ../sass/screen.scss */
/* line 317, ../sass/screen.scss */
#page-commande #btn-export-commandes {
float: right;
color: white;
position: relative;
top: -5px;
right: -7px;
padding: 2px 5px;
}
/* line 328, ../sass/screen.scss */
#page-commande #bloc-totaux .table-produits .depasse {
color: #b32815;
}
/* line 332, ../sass/screen.scss */
#page-commande #bloc-totaux .table-produits .total strong span {
font-weight: normal;
font-size: 13px;
}
/* line 341, ../sass/screen.scss */
#page-commande #commandes-points-vente .tab-pane {
padding-top: 20px;
}
/* line 348, ../sass/screen.scss */
#page-commande #commandes-points-vente .recap-pv.no-commande .recettes {
display: none;
}
/* line 352, ../sass/screen.scss */
#page-commande #commandes-points-vente .recap-pv .recettes {
float: right;
color: #BB8757;
border: solid 1px #BB8757;
padding: 4px 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
font-weight: bold;
position: relative;
top: -3px;
}
/* line 366, ../sass/screen.scss */
#page-commande #commandes-points-vente .alert.commentaire {
display: none;
}
/* line 370, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes {
margin-top: 10px;
list-style-type: none;
height: 100%;
max-height: 400px;
margin-left: 0;
padding-left: 0;
margin-top: 0px;
width: 100%;
overflow-y: scroll;
}
/* line 382, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li {
padding: 0;
margin: 0;
}
/* line 385, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a {
text-align: left;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 0px;
display: block;
padding: 7px;
color: #333;
}
/* line 393, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .montant {
float: right;
color: #BB8757;
font-weight: bold;
}
/* line 399, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .glyphicon-comment {
color: #BB8757;
}
/* line 403, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a:hover, #page-commande #commandes-points-vente ul.liste-commandes li a:active, #page-commande #commandes-points-vente ul.liste-commandes li a.active {
text-decoration: none;
background-color: #FCF8E3;
outline: none;
border-color: #ccc;
-moz-transition: all 0.1s;
-o-transition: all 0.1s;
-webkit-transition: all 0.1s;
transition: all 0.1s;
}
/* line 417, ../sass/screen.scss */
#page-commande #commandes-points-vente .creer-commande {
width: 100%;
}
/* line 421, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user {
display: none;
font-size: 19px;
margin-top: 0px;
}
/* line 426, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .btn-edit, #page-commande #commandes-points-vente .title-user .btn-remove,
#page-commande #commandes-points-vente .title-user .btn-cancel, #page-commande #commandes-points-vente .title-user .btn-save {
float: right;
position: relative;
top: -6px;
}
/* line 433, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .btn-edit, #page-commande #commandes-points-vente .title-user .btn-cancel {
margin-right: 10px;
}
/* line 437, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .buttons-save-cancel {
display: none;
}
/* line 441, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .choix-user {
display: none;
}
/* line 444, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .choix-user .form-control {
width: 200px;
display: inline;
}
/* line 452, ../sass/screen.scss */
#page-commande #commandes-points-vente table.table-produits .td-commande {
text-align: center;
}
/* line 455, ../sass/screen.scss */
#page-commande #commandes-points-vente table.table-produits input.form-control {
text-align: center;
}
/* line 461, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-produit,
#page-commande #commandes-points-vente .th-produit {
width: 70%;
}
/* line 466, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-commande,
#page-commande #commandes-points-vente .th-commande {
width: 30%;
text-align: center;
}
/* line 472, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-produit {
text-transform: uppercase;
}
/* line 476, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-commande {
font-weight: bold;
}
/* line 480, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-total {
font-size: 20px;
text-align: center;
}
/* line 484, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-total span {
padding: 5px 10px;
background-color: #BB8757;
color: white;
font-weight: bold;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
}
/* line 495, ../sass/screen.scss */
#page-commande #old-commandes {
display: none;
}
/* line 499, ../sass/screen.scss */
#page-commande .form-commandes-point-vente {
margin-top: 20px;
}
/* line 316, ../sass/screen.scss */
/* line 503, ../sass/screen.scss */
#page-commande .form-commandes-point-vente table {
border-bottom: solid 1px #e0e0e0;
}
/* line 320, ../sass/screen.scss */
/* line 507, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-point-vente {
background-color: #fff8e2;
border-left: solid 3px #BB8757;
@@ -355,76 +532,76 @@ a:hover, a:focus, a:active {
text-align: left;
padding: 10px;
}
/* line 328, ../sass/screen.scss */
/* line 515, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-totaux {
text-align: center;
}
/* line 332, ../sass/screen.scss */
/* line 519, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-left {
border-left: solid 1px #e0e0e0;
}
/* line 336, ../sass/screen.scss */
/* line 523, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-right {
border-right: solid 1px #e0e0e0;
}
/* line 340, ../sass/screen.scss */
/* line 527, ../sass/screen.scss */
#page-commande .form-commandes-point-vente input.quantite {
width: 30px;
background-color: white;
border: solid 1px #e0e0e0;
text-align: center;
}
/* line 348, ../sass/screen.scss */
/* line 535, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .td-produit {
text-align: center;
}
/* line 352, ../sass/screen.scss */
/* line 539, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .submit-pv {
float: right;
}
/* line 356, ../sass/screen.scss */
/* line 543, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .select-user {
background-color: #F9F9F9;
border: solid 1px #e0e0e0;
}
/* line 361, ../sass/screen.scss */
/* line 548, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .date-commande {
font-size: 12px;
}
/* line 365, ../sass/screen.scss */
/* line 552, ../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 373, ../sass/screen.scss */
/* line 560, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.center {
text-align: center;
}
/* line 379, ../sass/screen.scss */
/* line 566, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .depasse {
color: #b32815;
}
/* line 383, ../sass/screen.scss */
/* line 570, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .total strong span {
font-weight: normal;
font-size: 13px;
}
/* line 388, ../sass/screen.scss */
/* line 575, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .vrac {
display: none;
}
/* line 392, ../sass/screen.scss */
/* line 579, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client {
text-align: left;
padding: 3px;
}
/* line 395, ../sass/screen.scss */
/* line 582, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client .date-commande {
color: gray;
}
/* line 406, ../sass/screen.scss */
/* line 593, ../sass/screen.scss */
#page-commande .table-header-rotated td {
width: 20px;
padding: 0px;
@@ -434,7 +611,7 @@ a:hover, a:focus, a:active {
vertical-align: middle;
text-align: center;
}
/* line 416, ../sass/screen.scss */
/* line 603, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 {
height: 80px;
width: 20px;
@@ -446,7 +623,7 @@ a:hover, a:focus, a:active {
font-size: 12px;
line-height: 0.8;
}
/* line 428, ../sass/screen.scss */
/* line 615, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 > div {
position: relative;
top: 0px;
@@ -463,7 +640,7 @@ a:hover, a:focus, a:active {
border-right: 1px solid #dddddd;
border-top: 1px solid #dddddd;
}
/* line 444, ../sass/screen.scss */
/* line 631, ../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);
@@ -486,51 +663,51 @@ a:hover, a:focus, a:active {
/*whether to display in one line or not*/
}

/* line 469, ../sass/screen.scss */
/* line 656, ../sass/screen.scss */
#email-masse-form #ids-users {
line-height: 30px;
}
/* line 471, ../sass/screen.scss */
/* line 658, ../sass/screen.scss */
#email-masse-form #ids-users .label {
text-transform: capitalize;
}

/* line 479, ../sass/screen.scss */
/* line 666, ../sass/screen.scss */
.produit-create #jours-production .form-group, .produit-update #jours-production .form-group {
float: left;
margin-right: 15px;
}
/* line 483, ../sass/screen.scss */
/* line 670, ../sass/screen.scss */
.produit-create #jours-production .form-group label, .produit-update #jours-production .form-group label {
font-weight: normal;
}
/* line 488, ../sass/screen.scss */
/* line 675, ../sass/screen.scss */
.produit-create .field-produit-id_etablissement, .produit-update .field-produit-id_etablissement {
display: none;
}

/* line 493, ../sass/screen.scss */
/* line 680, ../sass/screen.scss */
.table-striped > tbody > tr:nth-of-type(2n) {
background-color: white;
}

/* line 498, ../sass/screen.scss */
/* line 685, ../sass/screen.scss */
.wrap .produit-index .td-photo {
max-width: 100px;
width: 100px;
}
/* line 502, ../sass/screen.scss */
/* line 689, ../sass/screen.scss */
.wrap .produit-index .photo-produit {
max-width: 100px;
}
/* line 506, ../sass/screen.scss */
/* line 693, ../sass/screen.scss */
.wrap .produit-index .ui-state-highlight {
height: 75px;
background-color: #F8F1DD;
}

/* communiquer */
/* line 514, ../sass/screen.scss */
/* line 701, ../sass/screen.scss */
.communiquer-mode-emploi {
border: solid 1px #e0e0e0;
padding: 10px;
@@ -540,18 +717,18 @@ a:hover, a:focus, a:active {
margin-bottom: 30px;
font-family: "myriadpro-regular";
}
/* line 522, ../sass/screen.scss */
/* line 709, ../sass/screen.scss */
.communiquer-mode-emploi .header .logo {
float: left;
width: 75px;
padding-right: 20px;
padding-top: 10px;
}
/* line 528, ../sass/screen.scss */
/* line 715, ../sass/screen.scss */
.communiquer-mode-emploi .header .logo img {
width: 75px;
}
/* line 534, ../sass/screen.scss */
/* line 721, ../sass/screen.scss */
.communiquer-mode-emploi .header h1 {
font-family: "comfortaaregular";
font-size: 40px;
@@ -559,7 +736,7 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
font-weight: normal;
}
/* line 542, ../sass/screen.scss */
/* line 729, ../sass/screen.scss */
.communiquer-mode-emploi .header h2 {
margin-top: 0px;
font-family: "myriadpro-regular";
@@ -569,7 +746,7 @@ a:hover, a:focus, a:active {
left: 2px;
font-weight: normal;
}
/* line 553, ../sass/screen.scss */
/* line 740, ../sass/screen.scss */
.communiquer-mode-emploi h3 {
font-family: "comfortaalight";
font-family: "myriadpro-regular";
@@ -579,45 +756,45 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
}

/* line 563, ../sass/screen.scss */
/* line 750, ../sass/screen.scss */
.communiquer-mode-emploi-encart {
width: 420px;
margin-top: 20px;
}
/* line 567, ../sass/screen.scss */
/* line 754, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header .logo {
width: 60px;
margin-right: 20px;
padding-top: 5px;
}
/* line 572, ../sass/screen.scss */
/* line 759, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header .logo img {
width: 60px;
}
/* line 578, ../sass/screen.scss */
/* line 765, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header h1 {
margin-bottom: 3px;
}
/* line 587, ../sass/screen.scss */
/* line 774, ../sass/screen.scss */
.communiquer-mode-emploi-encart h3 {
margin-top: 15px;
margin-bottom: 15px;
}

/* line 593, ../sass/screen.scss */
/* line 780, ../sass/screen.scss */
.bloc-mode-emploi-pdf {
width: 49.9%;
float: left;
border-bottom: dotted 1px gray;
}

/* line 599, ../sass/screen.scss */
/* line 786, ../sass/screen.scss */
.bloc-mode-emploi-border {
border-right: dotted 1px gray;
border-bottom: dotted 1px gray;
}

/* line 604, ../sass/screen.scss */
/* line 791, ../sass/screen.scss */
.communiquer-mode-emploi-pdf {
border: 0px none;
-moz-border-radius: 0px;
@@ -626,31 +803,31 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
padding: 20px 0px 20px 30px;
}
/* line 612, ../sass/screen.scss */
/* line 799, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header .logo {
float: left;
width: 55px;
padding-right: 15px;
padding-top: 10px;
}
/* line 618, ../sass/screen.scss */
/* line 805, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header .logo img {
width: 55px;
}
/* line 622, ../sass/screen.scss */
/* line 809, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header h1 {
font-size: 32px;
}
/* line 625, ../sass/screen.scss */
/* line 812, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header h2 {
font-size: 16px;
}
/* line 630, ../sass/screen.scss */
/* line 817, ../sass/screen.scss */
.communiquer-mode-emploi-pdf h3 {
font-weight: normal;
}

/* line 635, ../sass/screen.scss */
/* line 822, ../sass/screen.scss */
.bloc-mode-emploi-bottom {
border-bottom: 0px none;
border-bottom: solid 1px white;

+ 319
- 3
backend/web/js/lechatdesnoisettes.js Ver arquivo

@@ -5,10 +5,321 @@ $(document).ready(function() {
chat_email_masse() ;
$('button[data-toggle=popover]').popover() ;
chat_ordre_produits() ;
chat_liste_produits_index_commandes() ;
chat_index_commandes_liste_produits() ;
chat_index_commandes_points_vente() ;
}) ;

function chat_liste_produits_index_commandes() {
function chat_index_commandes_points_vente() {
$('#commandes-points-vente .liste-commandes a').unbind('click').click(function() {
var id_pv = $(this).data('pv-id') ;
// affiche la commande
var id_commande = $(this).data('id-commande') ;
chat_index_commandes_affiche_commande(id_commande) ;
}) ;
$('#commandes-points-vente .bloc-point-vente').each(function() {
var id_pv = $(this).data('id-pv') ;
// edit
$('#point-vente-'+id_pv+' .btn-edit').unbind('click').click(function() {
// boutons
$('#point-vente-'+id_pv+' .buttons-edit-remove').hide() ;
$('#point-vente-'+id_pv+' .buttons-save-cancel').show() ;
$('#point-vente-'+id_pv+' .tr-total').hide() ;

// inputs
chat_index_commandes_inputs_commande(id_pv, true) ;
}) ;

// remove
$('#point-vente-'+id_pv+' .btn-remove').unbind('click').click(function() {

var id_commande = $(this).data('id-commande') ;
$(this).attr('disabled', 'disabled') ;

$.get('index.php',{
r: 'commande/ajax-delete',
date: $('#date-production').val(),
id_commande: id_commande
}, function(data) {
$('#point-vente-'+id_pv+' .btn-remove').removeAttr('disabled') ;


if($('#point-vente-'+id_pv+' .liste-commandes li').size()) {
if($('#point-vente-'+id_pv+' .liste-commandes li:last-child a').is('.active')) {
var commande_next = $('#point-vente-'+id_pv+' .liste-commandes a.active').parent().prev().find('a') ;
}
else {
var commande_next = $('#point-vente-'+id_pv+' .liste-commandes a.active').parent().next().find('a') ;
}

$('#point-vente-'+id_pv+' .liste-commandes a.active').parent().remove() ;

if($('#point-vente-'+id_pv+' .liste-commandes li').size()) {
chat_index_commandes_affiche_commande(commande_next.data('id-commande')) ;
}
else {
$('#point-vente-'+id_pv+' .liste-commandes').hide() ;
$('#point-vente-'+id_pv+' .creer-commande').trigger('click') ;
}
}
chat_index_commandes_maj_recap_pv(id_pv, data.total_pv) ;
chat_index_commandes_maj_total_commandes() ;
chat_alert('success','Commande supprimée') ;
}, 'json') ;
});

// cancel
$('#point-vente-'+id_pv+' .btn-cancel').unbind('click').click(function() {
$('#point-vente-'+id_pv+' .buttons-edit-remove').show() ;
$('#point-vente-'+id_pv+' .buttons-save-cancel').hide() ;
chat_index_commandes_affiche_commande($(this).data('id-commande')) ;
}) ;

// save
$('#point-vente-'+id_pv+' .btn-save').unbind('click').click(function() {

var tab_produits = {} ;
var cpt_produits = 0 ;
$('#point-vente-'+id_pv+' .table-produits tr').each(function() {
tab_produits[$(this).data('id-produit')] = $(this).find('.quantite').val() ;
if($(this).find('.quantite').val())
cpt_produits ++ ;
}) ;

if(cpt_produits) {
// création
if($(this).hasClass('is-create')) {

if($('#point-vente-'+id_pv+' .user-id').val() || $('#point-vente-'+id_pv+' .username').val().length) {

$(this).attr('disabled', 'disabled') ;

$.get('index.php',{
r: 'commande/ajax-create',
date: $('#date-production').val(),
id_pv: id_pv,
id_user: $('#point-vente-'+id_pv+' .user-id').val(),
username: $('#point-vente-'+id_pv+' .username').val(),
produits: JSON.stringify(tab_produits)
}, function(data) {
$('#point-vente-'+id_pv+' .btn-save').removeAttr('disabled') ;
$('#point-vente-'+id_pv+' .btn-save').removeClass('is-create') ;

$('#point-vente-'+id_pv+' .liste-commandes').append(data.commande) ;

chat_index_commandes_points_vente() ;

chat_index_commandes_maj_recap_pv(id_pv, data.total_pv) ;

$('#point-vente-'+id_pv+' .buttons-edit-remove').show() ;
$('#point-vente-'+id_pv+' .buttons-save-cancel').hide() ;
$('#point-vente-'+id_pv+' .btn-create').removeClass('is-create') ;
$('#point-vente-'+id_pv+' .user-id').val(0) ;
$('#point-vente-'+id_pv+' .user-id').val('') ;

chat_index_commandes_affiche_commande(data.id_commande) ;
chat_alert('success', 'Commande créée') ;
}, 'json') ;
}
else {
chat_alert('danger', 'Veuillez choisir ou saisir un nom d\'utilisateur') ;
}
}
// modification
else {
var id_commande = $(this).data('id-commande') ;

$(this).attr('disabled', 'disabled') ;
$.get('index.php',{
r: 'commande/ajax-update',
id_commande: id_commande,
produits: JSON.stringify(tab_produits),
date: $('#date-production').val()
}, function(data) {
$('#point-vente-'+id_pv+' .btn-save').removeAttr('disabled') ;
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+']').data('commande',data.json_commande);
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant').html(data.total_commande) ;
chat_index_commandes_affiche_commande(id_commande) ;
chat_index_commandes_maj_recap_pv(id_pv, data.total_pv) ;

$('#point-vente-'+id_pv+' .buttons-edit-remove').show() ;
$('#point-vente-'+id_pv+' .buttons-save-cancel').hide() ;

chat_alert('success','Commande modifiée') ;
}, 'json') ;
}
}
else {
chat_alert('danger', 'Veuillez saisir au moins un produit') ;
}

chat_index_commandes_maj_total_commandes() ;

}) ;

// create
$('.creer-commande').unbind('click').click(function() {
var id_pv = $(this).data('pv-id') ;
$('#point-vente-'+id_pv+' .liste-commandes a.active').removeClass('active') ;
$('#point-vente-'+id_pv+' .tr-total').hide() ;
$('#point-vente-'+id_pv+' .buttons-edit-remove').hide() ;
$('#point-vente-'+id_pv+' .the-title').hide() ;
$('#point-vente-'+id_pv+' .buttons-save-cancel').show() ;
$('#point-vente-'+id_pv+' .choix-user').show() ;
$('#point-vente-'+id_pv+' .choix-user .user-id').val(0) ;
$('#point-vente-'+id_pv+' .choix-user .username').val('') ;
$('#point-vente-'+id_pv+' .commentaire').hide() ;
$('#point-vente-'+id_pv+' .btn-save').addClass('is-create');

if($('#point-vente-'+id_pv+' .liste-commandes li').size() == 0) {
$('#point-vente-'+id_pv+' .btn-cancel').hide() ;
}
else {
$('#point-vente-'+id_pv+' .btn-cancel').show() ;
}

chat_index_commandes_inputs_commande(id_pv, false) ;

$('#point-vente-'+id_pv+' .title-user').show() ;
}) ;
}) ;
$('#commandes-points-vente .liste-commandes').each(function() {
$(this).find('a:first').trigger('click') ;
}) ;
}

function chat_index_commandes_maj_total_commandes() {
$.get('index.php',{
r: 'commande/ajax-total-commandes',
date: $('#date-production').val()
}, function(data) {
$('#bloc-totaux .table-produits').html(data.html_totaux) ;
}, 'json') ;
}

function chat_index_commandes_maj_recap_pv(id_pv, total) {
$('#point-vente-'+id_pv+' .recap-pv .recettes').html(total) ;
var nb_commandes = $('#point-vente-'+id_pv+' .liste-commandes li').size() ;
if(nb_commandes == 0) {
$('#point-vente-'+id_pv+' .recap-pv .commandes').html('Aucune commande') ;
$('#point-vente-'+id_pv+' .recap-pv .recettes').hide() ;
}
else if(nb_commandes == 1) {
$('#point-vente-'+id_pv+' .recap-pv .commandes').html('1 commande') ;
$('#point-vente-'+id_pv+' .recap-pv .recettes').show() ;
}
else {
$('#point-vente-'+id_pv+' .recap-pv .commandes').html(nb_commandes+' commandes') ;
$('#point-vente-'+id_pv+' .recap-pv .recettes').show() ;
}
$('#btn-point-vente-'+id_pv+' .badge').html(nb_commandes) ;
}

function chat_index_commandes_inputs_commande(id_pv, use_quantite) {
$('#point-vente-'+id_pv+' .table-produits tr').each(function() {
var quantite = '' ;
if(use_quantite)
quantite = $(this).find('.td-commande').html() ;
var id_produit = $(this).data('id-produit') ;

$(this).find('.td-commande').html('<div class="input-group">'+
'<span class="input-group-btn">'+
'<button class="btn btn-default btn-moins" type="button"><span class="glyphicon glyphicon-minus"></span></button>'+
'</span>'+
'<input type="text" class="form-control quantite" value="'+quantite+'" name="produit_'+id_produit+'">'+
'<span class="input-group-btn">'+
'<button class="btn btn-default btn-plus" type="button"><span class="glyphicon glyphicon-plus"></span></button>'+
'</span>'+
'</div>') ;

// plus / moins
$(this).find('.btn-plus').click(function() {
var input = $(this).parent().parent().find('input') ;
var value = input.val() ;
if(value)
value ++ ;
else
value = 1 ;
input.val(value) ;
}) ;
$(this).find('.btn-moins').click(function() {
var input = $(this).parent().parent().find('input') ;
var value = input.val() ;
if(value && value > 1)
value -- ;
else
value = '' ;

input.val(value) ;
}) ;

}) ;
}

function chat_index_commandes_affiche_commande(id_commande) {

var link = $("a[data-id-commande="+id_commande+"]") ;

var id_pv = link.data('pv-id') ;
$('#point-vente-'+id_pv+' .liste-commandes a').removeClass('active') ;
link.addClass('active') ;
// set id_commande
$('#point-vente-'+id_pv+' .btn-cancel').data('id-commande',id_commande) ;
$('#point-vente-'+id_pv+' .btn-save').data('id-commande',id_commande) ;
$('#point-vente-'+id_pv+' .btn-remove').data('id-commande',id_commande) ;
$('#point-vente-'+id_pv+' .btn-create').removeClass('is-create') ;
$('#point-vente-'+id_pv+' .buttons-edit-remove').show() ;
$('#point-vente-'+id_pv+' .buttons-save-cancel').hide() ;
$('#point-vente-'+id_pv+' .choix-user').hide() ;
$('#point-vente-'+id_pv+' .the-title').show() ;
$('#point-vente-'+id_pv+' .td-commande').html('') ;
$('#point-vente-'+id_pv+' .td-total').html('') ;
$('#point-vente-'+id_pv+' tr').removeClass('active') ;
var commande = link.data('commande') ;
if(!$.isPlainObject(link.data('commande'))) {
commande = JSON.parse(link.data('commande')) ;
}
$.each(commande.produits, function(i, item) {
$('#point-vente-'+id_pv+' .produit-'+i+' .td-commande').html(item) ;
$('#point-vente-'+id_pv+' .produit-'+i).addClass('active') ;
}) ;
$('#point-vente-'+id_pv+' .td-total').html('<span>'+commande.montant+' €</span>') ;
$('#point-vente-'+id_pv+' .tr-total').show() ;

var commentaire = link.data('commentaire') ;
if(commentaire) {
$('#point-vente-'+id_pv+' .commentaire').html(commentaire).show() ;
}
else {
$('#point-vente-'+id_pv+' .commentaire').hide() ;
}

$('#point-vente-'+id_pv+' .title-user span.the-title').html(link.find('.user').html()+"<small>"+link.data('date')+"</small>") ;
$('#point-vente-'+id_pv+' .title-user').show() ;
$('#point-vente-'+id_pv+' .tr-total').show() ;
}

function chat_index_commandes_liste_produits() {
$('#produits-production .td-max input').click(function() {
$(this).select() ;
@@ -22,7 +333,12 @@ function chat_liste_produits_index_commandes() {
$(this).parent().parent().removeClass('active(') ;
}
}) ;
}

function chat_alert(type, message) {
var id = 'alert-'+$('#alerts-fixed .alert').size() + 1 ;
$('#alerts-fixed').append('<div id="'+id+'" class="alert alert-'+type+'">'+message+'</div>') ;
setTimeout('$("#'+id+'").fadeOut();',3000) ;
}

function chat_ordre_produits() {

+ 192
- 5
backend/web/sass/screen.scss Ver arquivo

@@ -100,6 +100,16 @@ a {
}
}

#alerts-fixed {
position: fixed ;
bottom: 20px ;
left: 20px ;
.alert {
margin-top: 20px ;
}
}

.nom-boulange {
//font-family: 'Georgia' ;
margin-bottom: 15px ;
@@ -230,11 +240,6 @@ a {
border-color: #4cae4c ;
}
#btn-export-commandes {
float: right ;
margin-top: 20px ;
}
}
#produits-production {
@@ -308,6 +313,188 @@ a {
}
}
}
#btn-export-commandes {
float: right ;
color: white ;
position: relative;
top: -5px ;
right: -7px ;
padding: 2px 5px ;
}
#bloc-totaux {
.table-produits {
.depasse {
color: #b32815 ;
}

.total strong span {
font-weight: normal ;
font-size: 13px ;
}
}
}
#commandes-points-vente {
.tab-pane {
padding-top: 20px ;
}
.recap-pv {
&.no-commande {
.recettes {
display: none;
}
}
.recettes {
float: right ;
color: $color1 ;
//background-color: $color1 ;
border: solid 1px $color1 ;
padding: 4px 10px ;
@include border-radius(10px) ;
font-weight: bold ;
position: relative ;
top: -3px ;
}
}
.alert.commentaire {
display: none ;
}
ul.liste-commandes {
margin-top: 10px ;
list-style-type: none ;
height: 100% ;
max-height: 400px ;
//border: solid 1px #e0e0e0 ;
margin-left: 0 ;
padding-left: 0 ;
margin-top: 0px ;
width: 100% ;
overflow-y: scroll ;
li {
padding: 0 ;
margin: 0 ;
a {
text-align: left;
@include border-radius(0px) ;
display: block ;
padding: 7px ;
//border-bottom: solid 1px #e0e0e0 ;
color: #333 ;
.montant {
float: right ;
color: $color1 ;
font-weight: bold ;
}
.glyphicon-comment {
color: $color1 ;
}
&:hover, &:active, &.active {
text-decoration: none ;
//background-color: #F5F5F5 ;
//background-color: lighten($color2,5) ;
background-color: #FCF8E3 ;
//border-right: solid 3px $color1 ;
outline: none ;
border-color: #ccc ;
@include transition(all 0.1s) ;
}
}
}
}
.creer-commande {
width: 100% ;
}
.title-user {
display: none ;
font-size: 19px ;
margin-top: 0px ;
.btn-edit, .btn-remove,
.btn-cancel, .btn-save {
float: right ;
position: relative ;
top: -6px ;
}
.btn-edit, .btn-cancel {
margin-right: 10px ;
}
.buttons-save-cancel {
display: none ;
}
.choix-user {
display: none ;
.form-control {
width: 200px ;
display: inline ;
}
}
}
table.table-produits {
.td-commande {
text-align: center ;
}
input.form-control {
//width: 100px ;
text-align: center ;
}
}
.td-produit,
.th-produit {
width: 70% ;
}
.td-commande,
.th-commande {
width: 30% ;
text-align: center ;
}
.td-produit {
text-transform: uppercase ;
}
.td-commande {
font-weight: bold ;
}
.td-total {
font-size: 20px ;
text-align: center ;
span {
padding: 5px 10px ;
background-color: $color1 ;
color: white ;
font-weight: bold ;
@include border-radius(15px ) ;
}
}
}
#old-commandes {
display: none ;
}
.form-commandes-point-vente {

+ 2
- 1
common/models/PointVente.php Ver arquivo

@@ -20,7 +20,8 @@ class PointVente extends \yii\db\ActiveRecord
var $recettes = 0 ;
var $recettes_pain = 0 ;
var $recettes_vrac = 0 ;

var $data_select_commandes ;
var $data_options_commandes ;
/**
* @inheritdoc

Carregando…
Cancelar
Salvar