Explorar el Código

Backend : ajout des dernières commandes sur le tableau de bord

master
keun hace 7 años
padre
commit
2a9c5578fa
Se han modificado 7 ficheros con 391 adiciones y 380 borrados
  1. +3
    -7
      backend/controllers/CommandeController.php
  2. +10
    -25
      backend/controllers/SiteController.php
  3. +172
    -201
      backend/views/site/index.php
  4. BIN
      backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc
  5. +150
    -145
      backend/web/css/screen.css
  6. +11
    -1
      backend/web/sass/screen.scss
  7. +45
    -1
      common/models/Commande.php

+ 3
- 7
backend/controllers/CommandeController.php Ver fichero

@@ -64,13 +64,9 @@ class CommandeController extends BackendController {
if(!Yii::$app->user->isGuest)
$id_etablissement = Yii::$app->user->identity->id_etablissement ;
$commandes = Commande::find()
->with('commandeProduits', 'user', 'creditHistorique', 'pointVente')
->joinWith('production')
->where(['production.date' => $date])
->andWhere(['production.id_etablissement' => $id_etablissement])
->orderBy('date ASC')
->all();
$commandes = Commande::findBy([
'date' => $date
]) ;

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

+ 10
- 25
backend/controllers/SiteController.php Ver fichero

@@ -11,6 +11,8 @@ use common\models\Produit;
use common\models\PointVente;
use common\models\Etablissement;
use common\models\Production;
use common\models\Commande;


/**
* Site controller
@@ -84,26 +86,13 @@ class SiteController extends BackendController
->limit(5)
->all() ;
// produits
$nb_produits = Produit::count() ;
$produits = Produit::find()
->where([
'id_etablissement' => Yii::$app->user->identity->id_etablissement
])
->orderBy('id DESC')
->limit(5)
->all() ;
// points de vente
$nb_points_vente = PointVente::count() ;
$points_vente = PointVente::find()
->where([
'id_etablissement' => Yii::$app->user->identity->id_etablissement
])
->orderBy('id DESC')
->limit(5)
->all() ;
// dernières commandes
$commandes = Commande::findBy([
'order' => 'DESC',
'limit' => 15
]) ;
foreach($commandes as $c)
$c->init() ;
// clients
$nb_clients = User::findBy()->count();
@@ -119,11 +108,7 @@ class SiteController extends BackendController
return $this->render('index',[
'productions' => $productions,
'nb_produits' => $nb_produits,
'produits' => $produits,
'nb_points_vente' => $nb_points_vente,
'points_vente' => $points_vente,
'commandes' => $commandes,
'clients' => $clients,
'nb_clients' => $nb_clients,

+ 172
- 201
backend/views/site/index.php Ver fichero

@@ -12,246 +12,217 @@ $this->title = 'Tableau de bord';
avant d'initialiser vos jours de production.</div>
<?php endif; ?>
<!-- commandes -->
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Commandes
<?= Html::a('Voir', ['commande/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
</h3>
<!-- commandes -->
<div class="">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Commandes
<?= Html::a('Voir', ['commande/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
</h3>
</div>
<div class="panel-body">
<?php if(count($productions)): ?>
<p>Prochaines productions : </p>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Date</th>
<th>Commandes</th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach($productions as $p): ?>
<tr>
<td><?= date('d/m/Y',strtotime($p['date'])); ?></td>
<td><?= count($p->commande); ?></td>
<td>
<?= Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['commande/index','date' => $p['date']], ['class' => 'btn btn-default btn-xs']) ; ?>
<?php if(count($p->commande)): ?><?= Html::a('<span class="glyphicon glyphicon-download-alt"></span>', ['commande/report','date' => $p['date'],'global' => 1], ['class' => 'btn btn-default btn-xs']) ; ?><?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<div class="alert alert-warning">Aucune production de programmée.</div>
<?php endif; ?>
</div>
</div>
<div class="panel-body">
<?php if(count($productions)): ?>
<p>Prochaines productions : </p>
</div>
<!-- Clients -->
<div class="">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<?= $nb_clients; ?> client<?php if($nb_clients > 1): ?>s<?php endif; ?>
<?= Html::a('Ajouter',['user/create'],['class' => 'btn btn-success btn-xs margin-left']) ; ?>
<?= Html::a('Liste', ['user/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
</h3>
</div>
<div class="panel-body">
<?php if($nb_clients): ?>
<p>Dernières inscriptions :</p>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Prénom, nom</th>
<th>Inscription</th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach($clients as $c): ?>
<tr>
<td><?= Html::encode($c['prenom'].' '.$c['nom']) ?></td>
<td><?= date('d/m/Y', $c['created_at']); ?></td>
<td><?= Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['user/update','id' => $c['user_id']], ['class' => 'btn btn-default btn-xs']) ; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<div class="alert alert-warning">Aucun client.</div>
<?php endif; ?>
</div>
</div>
</div>
<!-- Paramètres -->
<div class="">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Paramètres
<?= Html::a('Configurer',['etablissement/update'],['class' => 'btn btn-default btn-xs']) ; ?>
</h3>
</div>
<div class="panel-body">
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Date</th>
<th>Commandes</th>
<th></th>
<th>Configuration</th>
<th>Valeur</th>
</tr>
</thead>
<tbody>
<?php foreach($productions as $p): ?>
<tr>
<td><?= date('d/m/Y',strtotime($p['date'])); ?></td>
<td><?= count($p->commande); ?></td>
<td>Boulangerie activée</td>
<td>
<?= Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['commande/index','date' => $p['date']], ['class' => 'btn btn-default btn-xs']) ; ?>
<?php if(count($p->commande)): ?><?= Html::a('<span class="glyphicon glyphicon-download-alt"></span>', ['commande/report','date' => $p['date'],'global' => 1], ['class' => 'btn btn-default btn-xs']) ; ?><?php endif; ?>
<?php if($etablissement->actif): ?>
<span class="label label-success">Active</span>
<?php else: ?>
<span class="label label-danger">Hors-ligne</span>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<div class="alert alert-warning">Aucune production de programmée.</div>
<?php endif; ?>
</div>
</div>
</div>
<!-- produits -->
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<?= $nb_produits ?> produit<?php if($nb_produits > 1): ?>s<?php endif; ?>
<?= Html::a('Ajouter',['produit/create'],['class' => 'btn btn-success btn-xs margin-left']) ; ?>
<?= Html::a('Liste', ['produit/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
</h3>
</div>
<div class="panel-body">
<?php if($nb_points_vente): ?>
<p>Derniers produits ajoutés :</p>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Nom</th>
<th>Description</th>
<th></th>
<td>Boulangerie protégée par un code</td>
<td>
<?php if(strlen($etablissement->code)): ?>
<span class="label label-success">Oui</span><br />
<strong><?= Html::encode($etablissement->code) ?></strong>
<?php else: ?>
<span class="label label-danger">Non</span>
<?php endif; ?>
</td>
</tr>
</thead>
<tbody>
<?php foreach($produits as $p): ?>
<tr>
<td><?= Html::encode($p['nom']) ?></td>
<td><?= Html::encode($p['description']) ?></td>
<td><?= Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['produit/update','id' => $p['id']], ['class' => 'btn btn-default btn-xs']) ; ?></td>
<td>Délai de commande</td>
<td><?= $etablissement->delai_commande ?> jour<?php if($etablissement->delai_commande > 1): ?>s<?php endif; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<div class="alert alert-warning">Aucun produit.</div>
<?php endif; ?>
</div>
</div>
</div>
<!-- Points de vente -->
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<?= $nb_points_vente ?> point<?php if($nb_points_vente > 1): ?>s<?php endif; ?> de vente
<?= Html::a('Ajouter',['point-vente/create'],['class' => 'btn btn-success btn-xs margin-left']) ; ?>
<?= Html::a('Liste', ['point-vente/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
</h3>
</div>
<div class="panel-body">
<?php if($nb_points_vente): ?>
<p>Derniers points de vente ajoutés :</p>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Nom</th>
<th>Localisation</th>
<th></th>
<td>Heure limite de commande</td>
<td><?= $etablissement->heure_limite_commande ?>h</td>
</tr>
</thead>
<tbody>
<?php foreach($points_vente as $pv): ?>
<tr>
<td><?= Html::encode($pv['nom']) ?></td>
<td><?= Html::encode($pv['localite']) ?></td>
<td><?= Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['point-vente/update','id' => $pv['id']], ['class' => 'btn btn-default btn-xs']) ; ?></td>
<td>Système de Crédit Pain activé</td>
<td>
<?php if($etablissement->credit_pain): ?>
<span class="label label-success">Oui</span><br />
<?php else: ?>
<span class="label label-danger">Non</span>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<div class="alert alert-warning">Aucun point de vente.</div>
<?php endif; ?>
</div>
</div>
</div>

<!-- Facturation -->
<div class="" id="facturation">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Facturation
<?= Html::a('Voir',['etablissement/facturation'],['class' => 'btn btn-default btn-xs']) ; ?>
</h3>
</div>
<div class="panel-body">
<div class="col-md-6 mois-en-cours">
<h2>Chiffre d'affaire<br />du mois en cours</h2>
<div class="montant"><span><?= number_format($etablissement->getCA(date('Y-m')), 2); ?> €</span></div>
</div>

<div class="col-md-6">
<?php $montant = $etablissement->getMontantFacturer(date('Y-m'), 0); ?>
<h2>Participation<br /><em>La boîte à pain</em> (2%)</h2>
<div class="montant"><span><?php if($montant): echo number_format($montant,2).' €' ; else: echo 'Gratuit' ; endif; ?></span></div>
</div>
<div class="clr"></div>
</div>
</div>
</div>
</div>
<!-- Clients -->
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<?= $nb_clients; ?> client<?php if($nb_clients > 1): ?>s<?php endif; ?>
<?= Html::a('Ajouter',['user/create'],['class' => 'btn btn-success btn-xs margin-left']) ; ?>
<?= Html::a('Liste', ['user/index'], ['class' => 'btn btn-default btn-xs']) ; ?>
</h3>
</div>
<div class="panel-body">
<?php if($nb_clients): ?>
<p>Dernières inscriptions :</p>
<table class="table table-bordered table-condensed">
<div class="col-md-8">
<!-- dernières commandes -->
<div id="dernieres-commandes" class="">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Dernières commandes
</h3>
</div>
<div class="panel-body">
<?php if(count($commandes)): ?>
<table class="table table-condensed table-bordered">
<thead>
<tr>
<th>Prénom, nom</th>
<th>Inscription</th>
<th></th>
<th>Date</th>
<th>Client</th>
<th>Produits</th>
<th>Point de vente</th>
<th>Montant</th>
</tr>
</thead>
<tbody>
<?php foreach($clients as $c): ?>
<?php foreach($commandes as $c): ?>
<tr>
<td><?= Html::encode($c['prenom'].' '.$c['nom']) ?></td>
<td><?= date('d/m/Y', $c['created_at']); ?></td>
<td><?= Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['user/update','id' => $c['user_id']], ['class' => 'btn btn-default btn-xs']) ; ?></td>
<td><?= date('d/m/Y', strtotime($c->production->date)) ?></td>
<td><?= $c->getStrUser(); ?></td>
<td><?= $c->getResumePanier() ; ?></td>
<td><?= $c->getResumePointVente() ; ?></td>
<td><?= $c->getStrMontant() ; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<div class="alert alert-warning">Aucun client.</div>
<?php endif; ?>
</div>
</div>
</div>
<!-- Paramètres -->
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Paramètres
<?= Html::a('Configurer',['etablissement/update'],['class' => 'btn btn-default btn-xs']) ; ?>
</h3>
</div>
<div class="panel-body">
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Configuration</th>
<th>Valeur</th>
</tr>
</thead>
<tbody>
<tr>
<td>Boulangerie activée</td>
<td>
<?php if($etablissement->actif): ?>
<span class="label label-success">Active</span>
<?php else: ?>
<span class="label label-danger">Hors-ligne</span>
<?php endif; ?>
</td>
</tr>
<tr>
<td>Boulangerie protégée par un code</td>
<td>
<?php if(strlen($etablissement->code)): ?>
<span class="label label-success">Oui</span><br />
<strong><?= Html::encode($etablissement->code) ?></strong>
<?php else: ?>
<span class="label label-danger">Non</span>
<?php endif; ?>
</td>
</tr>
<tr>
<td>Délai de commande</td>
<td><?= $etablissement->delai_commande ?> jour<?php if($etablissement->delai_commande > 1): ?>s<?php endif; ?></td>
</tr>
<tr>
<td>Heure limite de commande</td>
<td><?= $etablissement->heure_limite_commande ?>h</td>
</tr>
<tr>
<td>Système de Crédit Pain activé</td>
<td>
<?php if($etablissement->credit_pain): ?>
<span class="label label-success">Oui</span><br />
<?php else: ?>
<span class="label label-danger">Non</span>
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Facturation -->
<div class="col-md-4" id="facturation">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Facturation
<?= Html::a('Voir',['etablissement/facturation'],['class' => 'btn btn-default btn-xs']) ; ?>
</h3>
</div>
<div class="panel-body">
<div class="col-md-6 mois-en-cours">
<h2>Chiffre d'affaire<br />du mois en cours</h2>
<div class="montant"><span><?= number_format($etablissement->getCA(date('Y-m')), 2); ?> €</span></div>
<?php else: ?>
<div class="alert alert-warning">Aucune commande</div>
<?php endif; ?>
</div>

<div class="col-md-6">
<?php $montant = $etablissement->getMontantFacturer(date('Y-m'), 0); ?>
<h2>Participation<br /><em>La boîte à pain</em> (2%)</h2>
<div class="montant"><span><?php if($montant): echo number_format($montant,2).' €' ; else: echo 'Gratuit' ; endif; ?></span></div>
</div>
<div class="clr"></div>
</div>
</div>

</div>
</div>

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


+ 150
- 145
backend/web/css/screen.css Ver fichero

@@ -325,27 +325,32 @@ a:hover, a:focus, a:active {
.site-index .panel .panel-title .btn.margin-left {
margin-left: 5px;
}
/* line 281, ../sass/screen.scss */
.site-index .panel .panel-body {
height: 250px;
}
/* line 287, ../sass/screen.scss */
.site-index #dernieres-commandes .localite {
font-size: 12px;
color: gray;
}
/* line 291, ../sass/screen.scss */
.site-index #dernieres-commandes .commentaire {
font-size: 12px;
}
/* line 297, ../sass/screen.scss */
.site-index #facturation h2 {
font-size: 25px;
text-align: center;
}
/* line 293, ../sass/screen.scss */
/* line 303, ../sass/screen.scss */
.site-index #facturation .mois-en-cours .montant span {
background-color: white;
color: #333;
border: solid 1px gray;
}
/* line 300, ../sass/screen.scss */
/* line 310, ../sass/screen.scss */
.site-index #facturation .montant {
margin-top: 35px;
text-align: center;
}
/* line 303, ../sass/screen.scss */
/* line 313, ../sass/screen.scss */
.site-index #facturation .montant span {
font-size: 22px;
color: white;
@@ -357,84 +362,84 @@ a:hover, a:focus, a:active {
border-radius: 5px;
}

/* line 323, ../sass/screen.scss */
/* line 333, ../sass/screen.scss */
#page-commande h1 .btn-group {
float: right;
}
/* line 328, ../sass/screen.scss */
/* line 338, ../sass/screen.scss */
#page-commande #col-left, #page-commande #col-right {
padding-left: 0px;
padding-right: 0px;
}
/* line 332, ../sass/screen.scss */
/* line 342, ../sass/screen.scss */
#page-commande #col-right {
padding-left: 20px;
}
/* line 336, ../sass/screen.scss */
/* line 346, ../sass/screen.scss */
#page-commande #jours-production {
display: none;
}
/* line 342, ../sass/screen.scss */
/* line 352, ../sass/screen.scss */
#page-commande #calendar h2 {
font-size: 20px;
position: relative;
top: 3px;
}
/* line 348, ../sass/screen.scss */
/* line 358, ../sass/screen.scss */
#page-commande #calendar .fc-header-title {
margin-left: 10px;
}
/* line 354, ../sass/screen.scss */
/* line 364, ../sass/screen.scss */
#page-commande #calendar .dayWithEvent {
background-color: #fee48d;
cursor: pointer;
}
/* line 358, ../sass/screen.scss */
/* line 368, ../sass/screen.scss */
#page-commande #calendar .fc-event-container {
display: none;
}
/* line 359, ../sass/screen.scss */
/* line 369, ../sass/screen.scss */
#page-commande #calendar .fc-today {
border-bottom: solid 1px #C9302C;
background-color: white;
}
/* line 363, ../sass/screen.scss */
/* line 373, ../sass/screen.scss */
#page-commande #calendar .fc-today.dayWithEvent {
background-color: #fee48d;
}
/* line 368, ../sass/screen.scss */
/* line 378, ../sass/screen.scss */
#page-commande #calendar .fc-day {
cursor: pointer;
text-align: center;
}
/* line 371, ../sass/screen.scss */
/* line 381, ../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 376, ../sass/screen.scss */
/* line 386, ../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 380, ../sass/screen.scss */
/* line 390, ../sass/screen.scss */
#page-commande #calendar .fc-day-number {
float: none;
padding-top: 2px;
}
/* line 388, ../sass/screen.scss */
/* line 398, ../sass/screen.scss */
#page-commande #bloc-production .label {
float: right;
font-size: 13px;
}
/* line 393, ../sass/screen.scss */
/* line 403, ../sass/screen.scss */
#page-commande #bloc-production .btn-success {
background-color: #5cb85c;
border-color: #4cae4c;
}
/* line 398, ../sass/screen.scss */
/* line 408, ../sass/screen.scss */
#page-commande #bloc-production #productions-point-vente {
margin-top: 15px;
padding: 10px;
@@ -444,76 +449,76 @@ a:hover, a:focus, a:active {
-webkit-border-radius: 5px;
border-radius: 5px;
}
/* line 404, ../sass/screen.scss */
/* line 414, ../sass/screen.scss */
#page-commande #bloc-production #productions-point-vente label {
display: block;
font-weight: normal;
}
/* line 409, ../sass/screen.scss */
/* line 419, ../sass/screen.scss */
#page-commande #bloc-production #productions-point-vente .checkbox-list {
margin-left: 10px;
margin-top: 10px;
}
/* line 422, ../sass/screen.scss */
/* line 432, ../sass/screen.scss */
#page-commande #produits-production .overflow table {
width: 100%;
}
/* line 426, ../sass/screen.scss */
/* line 436, ../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 428, ../sass/screen.scss */
/* line 438, ../sass/screen.scss */
#page-commande #produits-production .overflow tr:after {
content: ' ';
display: block;
visibility: hidden;
clear: both;
}
/* line 435, ../sass/screen.scss */
/* line 445, ../sass/screen.scss */
#page-commande #produits-production .overflow thead th {
height: 30px;
/*text-align: left;*/
}
/* line 441, ../sass/screen.scss */
/* line 451, ../sass/screen.scss */
#page-commande #produits-production .overflow tbody {
height: 500px;
overflow-y: auto;
}
/* line 449, ../sass/screen.scss */
/* line 459, ../sass/screen.scss */
#page-commande #produits-production .overflow thead th {
width: 32%;
float: left;
}
/* line 454, ../sass/screen.scss */
/* line 464, ../sass/screen.scss */
#page-commande #produits-production .overflow tbody td {
width: 33%;
float: left;
}
/* line 459, ../sass/screen.scss */
/* line 469, ../sass/screen.scss */
#page-commande #produits-production .overflow .td-produit {
width: 60%;
}
/* line 462, ../sass/screen.scss */
/* line 472, ../sass/screen.scss */
#page-commande #produits-production .overflow .td-actif, #page-commande #produits-production .overflow .td-max {
width: 20%;
text-align: center;
}
/* line 468, ../sass/screen.scss */
/* line 478, ../sass/screen.scss */
#page-commande #produits-production .overflow thead .td-produit {
width: 57%;
}
/* line 474, ../sass/screen.scss */
/* line 484, ../sass/screen.scss */
#page-commande #produits-production input.quantite-max {
background-color: white;
border: 1px solid #e0e0e0;
text-align: center;
width: 50px;
}
/* line 482, ../sass/screen.scss */
/* line 492, ../sass/screen.scss */
#page-commande #produits-production td label {
font-weight: normal;
}
/* line 488, ../sass/screen.scss */
/* line 498, ../sass/screen.scss */
#page-commande #btn-export-commandes,
#page-commande #btn-commande-auto {
float: right;
@@ -522,30 +527,30 @@ a:hover, a:focus, a:active {
right: -7px;
padding: 2px 5px;
}
/* line 497, ../sass/screen.scss */
/* line 507, ../sass/screen.scss */
#page-commande #btn-export-commandes {
color: white;
margin-left: 10px;
padding: 1px 5px;
}
/* line 505, ../sass/screen.scss */
/* line 515, ../sass/screen.scss */
#page-commande #bloc-totaux .table-produits .depasse {
color: #b32815;
}
/* line 509, ../sass/screen.scss */
/* line 519, ../sass/screen.scss */
#page-commande #bloc-totaux .table-produits .total strong span {
font-weight: normal;
font-size: 13px;
}
/* line 518, ../sass/screen.scss */
/* line 528, ../sass/screen.scss */
#page-commande #commandes-points-vente .tab-pane {
padding-top: 20px;
}
/* line 525, ../sass/screen.scss */
/* line 535, ../sass/screen.scss */
#page-commande #commandes-points-vente .recap-pv.no-commande .recettes {
display: none;
}
/* line 529, ../sass/screen.scss */
/* line 539, ../sass/screen.scss */
#page-commande #commandes-points-vente .recap-pv .recettes {
float: right;
color: #BB8757;
@@ -558,11 +563,11 @@ a:hover, a:focus, a:active {
position: relative;
top: -3px;
}
/* line 543, ../sass/screen.scss */
/* line 553, ../sass/screen.scss */
#page-commande #commandes-points-vente .alert.commentaire {
display: none;
}
/* line 547, ../sass/screen.scss */
/* line 557, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes {
margin-top: 10px;
list-style-type: none;
@@ -574,16 +579,16 @@ a:hover, a:focus, a:active {
width: 100%;
overflow-y: scroll;
}
/* line 559, ../sass/screen.scss */
/* line 569, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes.no-commande {
display: none;
}
/* line 563, ../sass/screen.scss */
/* line 573, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li {
padding: 0;
margin: 0;
}
/* line 566, ../sass/screen.scss */
/* line 576, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a {
text-align: left;
-moz-border-radius: 0px;
@@ -593,22 +598,22 @@ a:hover, a:focus, a:active {
padding: 7px;
color: #333;
}
/* line 574, ../sass/screen.scss */
/* line 584, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .montant {
float: right;
color: #BB8757;
font-weight: bold;
}
/* line 579, ../sass/screen.scss */
/* line 589, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .montant.paye {
color: #5cb85c;
color: #519951;
}
/* line 585, ../sass/screen.scss */
/* line 595, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .glyphicon-comment {
color: #BB8757;
}
/* line 589, ../sass/screen.scss */
/* line 599, ../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;
@@ -619,82 +624,82 @@ a:hover, a:focus, a:active {
-webkit-transition: all 0.1s;
transition: all 0.1s;
}
/* line 603, ../sass/screen.scss */
/* line 613, ../sass/screen.scss */
#page-commande #commandes-points-vente .creer-commande,
#page-commande #commandes-points-vente .commandes-auto {
width: 100%;
margin-bottom: 10px;
}
/* line 609, ../sass/screen.scss */
/* line 619, ../sass/screen.scss */
#page-commande #commandes-points-vente .bloc-commande {
padding-top: 20px;
margin-top: 20px;
display: none;
}
/* line 615, ../sass/screen.scss */
/* line 625, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user {
display: none;
font-size: 19px;
margin-top: 0px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
/* line 621, ../sass/screen.scss */
/* line 631, ../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 628, ../sass/screen.scss */
/* line 638, ../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 632, ../sass/screen.scss */
/* line 642, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .buttons-save-cancel {
display: none;
}
/* line 636, ../sass/screen.scss */
/* line 646, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .choix-user {
display: none;
}
/* line 639, ../sass/screen.scss */
/* line 649, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .choix-user .form-control {
width: 200px;
display: inline;
}
/* line 647, ../sass/screen.scss */
/* line 657, ../sass/screen.scss */
#page-commande #commandes-points-vente table.table-produits .td-commande {
text-align: center;
}
/* line 650, ../sass/screen.scss */
/* line 660, ../sass/screen.scss */
#page-commande #commandes-points-vente table.table-produits input.form-control {
text-align: center;
}
/* line 656, ../sass/screen.scss */
/* line 666, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-produit,
#page-commande #commandes-points-vente .th-produit {
width: 70%;
}
/* line 661, ../sass/screen.scss */
/* line 671, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-commande,
#page-commande #commandes-points-vente .th-commande {
width: 30%;
text-align: center;
}
/* line 667, ../sass/screen.scss */
/* line 677, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-produit {
text-transform: uppercase;
}
/* line 671, ../sass/screen.scss */
/* line 681, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-commande {
font-weight: bold;
}
/* line 675, ../sass/screen.scss */
/* line 685, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-total {
font-size: 18px;
text-align: center;
}
/* line 679, ../sass/screen.scss */
/* line 689, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-total span {
padding: 2px 10px;
background-color: #BB8757;
@@ -704,33 +709,33 @@ a:hover, a:focus, a:active {
-webkit-border-radius: 8px;
border-radius: 8px;
}
/* line 689, ../sass/screen.scss */
/* line 699, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-paiement .buttons-credit {
float: right;
}
/* line 695, ../sass/screen.scss */
/* line 705, ../sass/screen.scss */
#page-commande #commandes-points-vente .panel-commande-automatique .field-commandeautoform-id_user,
#page-commande #commandes-points-vente .panel-commande-automatique .field-commandeautoform-id_etablissement {
display: none;
}
/* line 702, ../sass/screen.scss */
/* line 712, ../sass/screen.scss */
#page-commande #commandes-points-vente .panel-commande-automatique .jours .form-group {
float: left;
margin-right: 10px;
}
/* line 711, ../sass/screen.scss */
/* line 721, ../sass/screen.scss */
#page-commande #old-commandes {
display: none;
}
/* line 715, ../sass/screen.scss */
/* line 725, ../sass/screen.scss */
#page-commande .form-commandes-point-vente {
margin-top: 20px;
}
/* line 719, ../sass/screen.scss */
/* line 729, ../sass/screen.scss */
#page-commande .form-commandes-point-vente table {
border-bottom: solid 1px #e0e0e0;
}
/* line 723, ../sass/screen.scss */
/* line 733, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-point-vente {
background-color: #fff8e2;
border-left: solid 3px #BB8757;
@@ -738,76 +743,76 @@ a:hover, a:focus, a:active {
text-align: left;
padding: 10px;
}
/* line 731, ../sass/screen.scss */
/* line 741, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-totaux {
text-align: center;
}
/* line 735, ../sass/screen.scss */
/* line 745, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-left {
border-left: solid 1px #e0e0e0;
}
/* line 739, ../sass/screen.scss */
/* line 749, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-right {
border-right: solid 1px #e0e0e0;
}
/* line 743, ../sass/screen.scss */
/* line 753, ../sass/screen.scss */
#page-commande .form-commandes-point-vente input.quantite {
width: 30px;
background-color: white;
border: solid 1px #e0e0e0;
text-align: center;
}
/* line 751, ../sass/screen.scss */
/* line 761, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .td-produit {
text-align: center;
}
/* line 755, ../sass/screen.scss */
/* line 765, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .submit-pv {
float: right;
}
/* line 759, ../sass/screen.scss */
/* line 769, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .select-user {
background-color: #F9F9F9;
border: solid 1px #e0e0e0;
}
/* line 764, ../sass/screen.scss */
/* line 774, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .date-commande {
font-size: 12px;
}
/* line 768, ../sass/screen.scss */
/* line 778, ../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 776, ../sass/screen.scss */
/* line 786, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.center {
text-align: center;
}
/* line 782, ../sass/screen.scss */
/* line 792, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .depasse {
color: #b32815;
}
/* line 786, ../sass/screen.scss */
/* line 796, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .total strong span {
font-weight: normal;
font-size: 13px;
}
/* line 791, ../sass/screen.scss */
/* line 801, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .vrac {
display: none;
}
/* line 795, ../sass/screen.scss */
/* line 805, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client {
text-align: left;
padding: 3px;
}
/* line 798, ../sass/screen.scss */
/* line 808, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client .date-commande {
color: gray;
}
/* line 805, ../sass/screen.scss */
/* line 815, ../sass/screen.scss */
#page-commande .table-header-rotated {
border-top: 0px;
border-left: 0px;
@@ -815,15 +820,15 @@ a:hover, a:focus, a:active {
width: 100%;
width: auto;
}
/* line 812, ../sass/screen.scss */
/* line 822, ../sass/screen.scss */
#page-commande .table-header-rotated .total strong {
border-bottom: solid 1px gray;
}
/* line 817, ../sass/screen.scss */
/* line 827, ../sass/screen.scss */
#page-commande .table-header-rotated th.row-header {
width: auto;
}
/* line 821, ../sass/screen.scss */
/* line 831, ../sass/screen.scss */
#page-commande .table-header-rotated td {
width: 40px;
border-top: 1px solid #dddddd;
@@ -832,7 +837,7 @@ a:hover, a:focus, a:active {
vertical-align: middle;
text-align: center;
}
/* line 830, ../sass/screen.scss */
/* line 840, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 {
font-weight: normal;
height: 80px;
@@ -846,7 +851,7 @@ a:hover, a:focus, a:active {
line-height: 1;
border: 0px none;
}
/* line 844, ../sass/screen.scss */
/* line 854, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 > div {
background-color: #F5F5F5;
position: relative;
@@ -864,7 +869,7 @@ a:hover, a:focus, a:active {
border-right: 1px solid #dddddd;
border-top: 1px solid #dddddd;
}
/* line 861, ../sass/screen.scss */
/* line 871, ../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);
@@ -882,51 +887,51 @@ a:hover, a:focus, a:active {
text-align: left;
}

/* line 882, ../sass/screen.scss */
/* line 892, ../sass/screen.scss */
#email-masse-form #ids-users {
line-height: 30px;
}
/* line 884, ../sass/screen.scss */
/* line 894, ../sass/screen.scss */
#email-masse-form #ids-users .label {
text-transform: capitalize;
}

/* line 892, ../sass/screen.scss */
/* line 902, ../sass/screen.scss */
.produit-create #jours-production .form-group, .produit-update #jours-production .form-group {
float: left;
margin-right: 15px;
}
/* line 896, ../sass/screen.scss */
/* line 906, ../sass/screen.scss */
.produit-create #jours-production .form-group label, .produit-update #jours-production .form-group label {
font-weight: normal;
}
/* line 901, ../sass/screen.scss */
/* line 911, ../sass/screen.scss */
.produit-create .field-produit-id_etablissement, .produit-update .field-produit-id_etablissement {
display: none;
}

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

/* line 911, ../sass/screen.scss */
/* line 921, ../sass/screen.scss */
.wrap .produit-index .td-photo {
max-width: 100px;
width: 100px;
}
/* line 915, ../sass/screen.scss */
/* line 925, ../sass/screen.scss */
.wrap .produit-index .photo-produit {
max-width: 100px;
}
/* line 919, ../sass/screen.scss */
/* line 929, ../sass/screen.scss */
.wrap .produit-index .ui-state-highlight {
height: 75px;
background-color: #F8F1DD;
}

/* communiquer */
/* line 927, ../sass/screen.scss */
/* line 937, ../sass/screen.scss */
.communiquer-mode-emploi {
border: solid 1px #e0e0e0;
padding: 10px;
@@ -936,18 +941,18 @@ a:hover, a:focus, a:active {
margin-bottom: 30px;
font-family: "myriadpro-regular";
}
/* line 935, ../sass/screen.scss */
/* line 945, ../sass/screen.scss */
.communiquer-mode-emploi .header .logo {
float: left;
width: 75px;
padding-right: 20px;
padding-top: 10px;
}
/* line 941, ../sass/screen.scss */
/* line 951, ../sass/screen.scss */
.communiquer-mode-emploi .header .logo img {
width: 75px;
}
/* line 947, ../sass/screen.scss */
/* line 957, ../sass/screen.scss */
.communiquer-mode-emploi .header h1 {
font-family: "comfortaaregular";
font-size: 40px;
@@ -955,7 +960,7 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
font-weight: normal;
}
/* line 955, ../sass/screen.scss */
/* line 965, ../sass/screen.scss */
.communiquer-mode-emploi .header h2 {
margin-top: 0px;
font-family: "myriadpro-regular";
@@ -965,7 +970,7 @@ a:hover, a:focus, a:active {
left: 2px;
font-weight: normal;
}
/* line 966, ../sass/screen.scss */
/* line 976, ../sass/screen.scss */
.communiquer-mode-emploi h3 {
font-family: "comfortaalight";
font-family: "myriadpro-regular";
@@ -975,45 +980,45 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
}

/* line 976, ../sass/screen.scss */
/* line 986, ../sass/screen.scss */
.communiquer-mode-emploi-encart {
width: 420px;
margin-top: 20px;
}
/* line 980, ../sass/screen.scss */
/* line 990, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header .logo {
width: 60px;
margin-right: 20px;
padding-top: 5px;
}
/* line 985, ../sass/screen.scss */
/* line 995, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header .logo img {
width: 60px;
}
/* line 991, ../sass/screen.scss */
/* line 1001, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header h1 {
margin-bottom: 3px;
}
/* line 1000, ../sass/screen.scss */
/* line 1010, ../sass/screen.scss */
.communiquer-mode-emploi-encart h3 {
margin-top: 15px;
margin-bottom: 15px;
}

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

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

/* line 1017, ../sass/screen.scss */
/* line 1027, ../sass/screen.scss */
.communiquer-mode-emploi-pdf {
border: 0px none;
-moz-border-radius: 0px;
@@ -1022,120 +1027,120 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
padding: 20px 0px 20px 30px;
}
/* line 1025, ../sass/screen.scss */
/* line 1035, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header .logo {
float: left;
width: 55px;
padding-right: 15px;
padding-top: 10px;
}
/* line 1031, ../sass/screen.scss */
/* line 1041, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header .logo img {
width: 55px;
}
/* line 1035, ../sass/screen.scss */
/* line 1045, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header h1 {
font-size: 32px;
}
/* line 1038, ../sass/screen.scss */
/* line 1048, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header h2 {
font-size: 16px;
}
/* line 1043, ../sass/screen.scss */
/* line 1053, ../sass/screen.scss */
.communiquer-mode-emploi-pdf h3 {
font-weight: normal;
}

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

/* commandes auto */
/* line 1058, ../sass/screen.scss */
/* line 1068, ../sass/screen.scss */
.commandeauto-form #bloc-select-user {
padding-left: 0px;
}
/* line 1062, ../sass/screen.scss */
/* line 1072, ../sass/screen.scss */
.commandeauto-form #or-user {
font-size: 20px;
text-align: center;
}
/* line 1065, ../sass/screen.scss */
/* line 1075, ../sass/screen.scss */
.commandeauto-form #or-user span {
position: relative;
top: 24px;
}
/* line 1071, ../sass/screen.scss */
/* line 1081, ../sass/screen.scss */
.commandeauto-form .field-commandeautoform-id_etablissement {
display: none;
}
/* line 1075, ../sass/screen.scss */
/* line 1085, ../sass/screen.scss */
.commandeauto-form .jours .form-group {
float: left;
margin-right: 20px;
}
/* line 1082, ../sass/screen.scss */
/* line 1092, ../sass/screen.scss */
.commandeauto-form .produits .table {
width: 500px;
}
/* line 1085, ../sass/screen.scss */
/* line 1095, ../sass/screen.scss */
.commandeauto-form .produits .quantite {
text-align: center;
}

/* points de vente */
/* line 1094, ../sass/screen.scss */
/* line 1104, ../sass/screen.scss */
.point-vente-form #pointvente-users {
display: none;
height: 500px;
overflow-y: scroll;
}
/* line 1098, ../sass/screen.scss */
/* line 1108, ../sass/screen.scss */
.point-vente-form #pointvente-users label {
font-weight: normal;
display: block;
}
/* line 1102, ../sass/screen.scss */
/* line 1112, ../sass/screen.scss */
.point-vente-form #pointvente-users .commentaire {
display: none;
margin-left: 17px;
width: 200px;
}
/* line 1110, ../sass/screen.scss */
/* line 1120, ../sass/screen.scss */
.point-vente-form #jours-livraison .form-group {
float: left;
margin-right: 15px;
}
/* line 1114, ../sass/screen.scss */
/* line 1124, ../sass/screen.scss */
.point-vente-form #jours-livraison .form-group label {
font-weight: normal;
}

/* utilisateurs */
/* line 1124, ../sass/screen.scss */
/* line 1134, ../sass/screen.scss */
.user-index .input-group {
width: 180px;
}
/* line 1127, ../sass/screen.scss */
/* line 1137, ../sass/screen.scss */
.user-index .input-group .input-credit {
text-align: center;
}

/* facturation */
/* line 1135, ../sass/screen.scss */
/* line 1145, ../sass/screen.scss */
#estimation-facture {
text-align: center;
margin-bottom: 30px;
padding-bottom: 20px;
background-color: #F9F9F9;
}
/* line 1141, ../sass/screen.scss */
/* line 1151, ../sass/screen.scss */
#estimation-facture h2 {
font-family: "myriadpro-it";
}
/* line 1145, ../sass/screen.scss */
/* line 1155, ../sass/screen.scss */
#estimation-facture .montant span {
font-size: 25px;
color: white;

+ 11
- 1
backend/web/sass/screen.scss Ver fichero

@@ -279,7 +279,17 @@ a {
}
}
.panel-body {
height: 250px ;
//height: 250px ;
}
}
#dernieres-commandes {
.localite {
font-size: 12px ;
color: gray ;
}
.commentaire {
font-size: 12px ;
}
}

+ 45
- 1
common/models/Commande.php Ver fichero

@@ -303,11 +303,16 @@ class Commande extends \yii\db\ActiveRecord
return $html ;
}
public function getStrMontant()
{
return number_format($this->montant,2).' €' ;
}
public function getResumeMontant()
{
$html = '' ;
$html .= number_format($this->montant,2).' €<br />' ;
$html .= $this->getStrMontant().'<br />' ;
if($this->montant_paye)
{
@@ -331,6 +336,45 @@ class Commande extends \yii\db\ActiveRecord
}
return $html ;
}
public function getStrUser()
{
if(isset($this->user))
{
return Html::encode($this->user->prenom.' '.$this->user->nom) ;
}
else {
return 'Client introuvable' ;
}
}
public static function findBy($params = [])
{
if(!isset($params['id_etablissement']))
$params['id_etablissement'] = Yii::$app->user->identity->id_etablissement ;
$commandes = Commande::find()
->with('commandeProduits', 'user', 'creditHistorique', 'pointVente')
->joinWith('production')
->andWhere(['production.id_etablissement' => $params['id_etablissement']]) ;
if(isset($params['date']))
$commandes = $commandes->where(['production.date' => $date]);
if(isset($params['order']))
$commandes = $commandes->orderBy('date '.$params['order']);
else
$commandes = $commandes->orderBy('date ASC');
if(isset($params['limit']))
$commandes = $commandes->limit($params['limit']) ;
$commandes = $commandes->all() ;
return $commandes ;
}
}

Cargando…
Cancelar
Guardar