Parcourir la source

Backend : formulaire commande

Tri des utilisateurs par nom, prénom.
Possibilité de saisir/modifier le commentaire de la commande.
prodstable
keun il y a 8 ans
Parent
révision
b8c4a365f5
7 fichiers modifiés avec 256 ajouts et 218 suppressions
  1. +9
    -34
      backend/controllers/CommandeController.php
  2. +9
    -7
      backend/views/commande/index.php
  3. BIN
      backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc
  4. +99
    -94
      backend/web/css/screen.css
  5. +132
    -82
      backend/web/js/lechatdesnoisettes.js
  6. +5
    -0
      backend/web/sass/screen.scss
  7. +2
    -1
      common/models/Commande.php

+ 9
- 34
backend/controllers/CommandeController.php Voir le fichier

@@ -326,6 +326,7 @@ class CommandeController extends BackendController {
$array_options[$c->id]['str_montant'] = number_format($c->montant, 2, ',', '').' €' ;
$array_options[$c->id]['montant_paye'] = $c->montant_paye ;
$array_options[$c->id]['produits'] = [] ;
$array_options[$c->id]['commentaire'] = Html::encode($c->commentaire) ;
foreach($c->commandeProduits as $cp)
{
$array_options[$c->id]['produits'][$cp->id_produit] = $cp->quantite ;
@@ -529,28 +530,12 @@ class CommandeController extends BackendController {
$arr_jour_semaine = [0 => 'dimanche', 1 => 'lundi', 2 => 'mardi', 3 => 'mercredi', 4 => 'jeudi', 5 => 'vendredi', 6 => 'samedi'];
$champs_horaires_point_vente = 'horaires_' . $arr_jour_semaine[$num_jour_semaine];

// header
/* $line = [''] ;
foreach($produits as $p) {
if(isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
$line[] = $p->getLibelleAdmin() ;
}
}
$data[] = $line ; */

// par point de vente
foreach ($points_vente as $pv) {
if (count($pv->commandes) && strlen($pv->$champs_horaires_point_vente)) {
//$data[] = [$pv->nom] ;

$line = [$pv->nom, 'Produits', 'Montant', 'Commentaire'];

/* foreach($produits as $p) {
if(isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
$line[] = $p->getLibelleAdmin() ;
}
} */

$data[] = $line;

$res = $this->contentPointVenteCSV($date, $produits, $points_vente, $pv->id);
@@ -636,20 +621,6 @@ class CommandeController extends BackendController {

$infos = $this->actionIndex($date, true);

// $data[] = [] ;

/* $data[] = [
'CA potentiel boutique',
number_format($infos['ca_potentiel'] - $infos['recettes_pain_livre'], 2).' €',
] ; */


/* $res = $this->contentRecapCSV($date, $produits, $points_vente, $commandes) ;
$data[] = ['Récapitulatif global'] ;
foreach($res['data'] as $line) {
$data[] = $line ;
} */

CSV::downloadSendHeaders($filename . '.csv');
echo CSV::array2csv($data);
die();
@@ -824,7 +795,7 @@ class CommandeController extends BackendController {
$this->redirect(['index', 'date' => $date]);
}
public function actionAjaxUpdate($id_commande, $produits, $date)
public function actionAjaxUpdate($id_commande, $produits, $date, $commentaire)
{
$commande = Commande::find()->with('production','creditHistorique','user')->where(['id' => $id_commande])->one() ;
@@ -870,6 +841,7 @@ class CommandeController extends BackendController {
}
$commande->date_update = date('Y-m-d H:i:s') ;
$commande->commentaire = $commentaire ;
$commande->save() ;
// data commande
@@ -940,7 +912,7 @@ class CommandeController extends BackendController {
die() ;
}
public function actionAjaxCreate($date, $id_pv, $id_user, $username, $produits)
public function actionAjaxCreate($date, $id_pv, $id_user, $username, $produits, $commentaire)
{
$produits = json_decode($produits) ;
$point_vente = PointVente::findOne($id_pv) ;
@@ -957,6 +929,7 @@ class CommandeController extends BackendController {
$commande->id_point_vente = $id_pv ;
$commande->id_production = $production->id ;
$commande->type = Commande::TYPE_ADMIN ;
$commande->commentaire = $commentaire ;
if($id_user)
{
@@ -1009,6 +982,8 @@ class CommandeController extends BackendController {
}
$json_commande = json_encode(['montant' => number_format($commande->montant, 2), 'produits' => $produits]) ;
$json_commande = $commande->getDataJson() ;
$str_user = '' ;
if($commande->user)
$str_user = $commande->user->nom.' '.$commande->user->prenom ;
@@ -1018,7 +993,7 @@ class CommandeController extends BackendController {
$str_commentaire = '' ;
if(strlen($commande->commentaire))
{
$str_commentaire = '<span class="glyphicon glyphicon-comment">'.Html::encode($commande->commentaire).'</span>' ;
$str_commentaire = ' <span class="glyphicon glyphicon-comment"></span>' ;
}
$str_label_type_commande = '';
@@ -1037,7 +1012,7 @@ class CommandeController extends BackendController {
. '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.$str_label_type_commande.'</span>'
. '<span class="user">'.$str_label_type_commande.' '.$str_user.'</span>'
. $str_commentaire
. '</a></li>',
]) ;

+ 9
- 7
backend/views/commande/index.php Voir le fichier

@@ -170,7 +170,7 @@ foreach ($produits as $p) {
<?php endif; ?>
</div>
<ul class="liste-commandes btn-group-vertical">
<ul class="liste-commandes btn-group-vertical<?php if(!count($pv->commandes)): ?> no-commande<?php endif; ?>">
<?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)); ?>">
@@ -179,11 +179,6 @@ foreach ($produits as $p) {
<?php if($c->montant_paye - $c->montant > 0.01): ?><span class="glyphicon glyphicon-warning-sign"></span><?php endif; ?>
</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; ?>
<?php if($c->type): ?>
<?php if($c->type == Commande::TYPE_ADMIN): ?>
<span class="label label-warning">vous</span>
@@ -193,6 +188,12 @@ foreach ($produits as $p) {
<span class="label label-success">client</span>
<?php endif; ?>
<?php endif; ?>
<?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>
@@ -216,7 +217,7 @@ foreach ($produits as $p) {
</span>
<span class="the-title"></span>
<span class="choix-user">
<?= Html::activeDropDownList(new User, 'id', ArrayHelper::map(User::find()->joinWith('userEtablissement')->where('user_etablissement.id_etablissement = '.Yii::$app->user->identity->id_etablissement)->andWhere('user_etablissement.actif = 1')->all(), 'id', function($model, $defaultValue) {
<?= Html::activeDropDownList(new User, 'id', ArrayHelper::map(User::find()->joinWith('userEtablissement')->where('user_etablissement.id_etablissement = '.Yii::$app->user->identity->id_etablissement)->andWhere('user_etablissement.actif = 1')->orderBy('user.nom ASC, user.prenom ASC')->all(), 'id', function($model, $defaultValue) {
return $model['nom'].' '.$model['prenom'];
}), ['prompt' => '--','class' => 'form-control user-id']) ?>
OU <input type="text" class="form-control username" placeholder="Choisissez un nom" />
@@ -224,6 +225,7 @@ foreach ($produits as $p) {
</h2>
<div class="commentaire alert alert-info">
</div>
<textarea name="commentaire" class="form-control textarea-commentaire" placeholder="Commentaire"></textarea>
<table class="table table-bordered table-condensed tab-content table-produits">
<tbody>
<?php foreach ($produits as $p): ?>

BIN
backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc Voir le fichier


+ 99
- 94
backend/web/css/screen.css Voir le fichier

@@ -471,11 +471,15 @@ a:hover, a:focus, a:active {
overflow-y: scroll;
}
/* line 452, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes.no-commande {
display: none;
}
/* line 456, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li {
padding: 0;
margin: 0;
}
/* line 455, ../sass/screen.scss */
/* line 459, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a {
text-align: left;
-moz-border-radius: 0px;
@@ -485,22 +489,22 @@ a:hover, a:focus, a:active {
padding: 7px;
color: #333;
}
/* line 463, ../sass/screen.scss */
/* line 467, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .montant {
float: right;
color: #BB8757;
font-weight: bold;
}
/* line 468, ../sass/screen.scss */
/* line 472, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .montant.paye {
color: #5cb85c;
color: #519951;
}
/* line 474, ../sass/screen.scss */
/* line 478, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .glyphicon-comment {
color: #BB8757;
}
/* line 478, ../sass/screen.scss */
/* line 482, ../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;
@@ -511,81 +515,82 @@ a:hover, a:focus, a:active {
-webkit-transition: all 0.1s;
transition: all 0.1s;
}
/* line 492, ../sass/screen.scss */
/* line 496, ../sass/screen.scss */
#page-commande #commandes-points-vente .creer-commande,
#page-commande #commandes-points-vente .commandes-auto {
width: 100%;
margin-bottom: 10px;
}
/* line 498, ../sass/screen.scss */
/* line 502, ../sass/screen.scss */
#page-commande #commandes-points-vente .bloc-commande {
padding-top: 20px;
margin-top: 20px;
display: none;
}
/* line 504, ../sass/screen.scss */
/* line 508, ../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 509, ../sass/screen.scss */
/* line 514, ../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 516, ../sass/screen.scss */
/* line 521, ../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 520, ../sass/screen.scss */
/* line 525, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .buttons-save-cancel {
display: none;
}
/* line 524, ../sass/screen.scss */
/* line 529, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .choix-user {
display: none;
}
/* line 527, ../sass/screen.scss */
/* line 532, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .choix-user .form-control {
width: 200px;
display: inline;
}
/* line 535, ../sass/screen.scss */
/* line 540, ../sass/screen.scss */
#page-commande #commandes-points-vente table.table-produits .td-commande {
text-align: center;
}
/* line 538, ../sass/screen.scss */
/* line 543, ../sass/screen.scss */
#page-commande #commandes-points-vente table.table-produits input.form-control {
text-align: center;
}
/* line 544, ../sass/screen.scss */
/* line 549, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-produit,
#page-commande #commandes-points-vente .th-produit {
width: 70%;
}
/* line 549, ../sass/screen.scss */
/* line 554, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-commande,
#page-commande #commandes-points-vente .th-commande {
width: 30%;
text-align: center;
}
/* line 555, ../sass/screen.scss */
/* line 560, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-produit {
text-transform: uppercase;
}
/* line 559, ../sass/screen.scss */
/* line 564, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-commande {
font-weight: bold;
}
/* line 563, ../sass/screen.scss */
/* line 568, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-total {
font-size: 18px;
text-align: center;
}
/* line 567, ../sass/screen.scss */
/* line 572, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-total span {
padding: 2px 10px;
background-color: #BB8757;
@@ -595,33 +600,33 @@ a:hover, a:focus, a:active {
-webkit-border-radius: 8px;
border-radius: 8px;
}
/* line 577, ../sass/screen.scss */
/* line 582, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-paiement .buttons-credit {
float: right;
}
/* line 583, ../sass/screen.scss */
/* line 588, ../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 590, ../sass/screen.scss */
/* line 595, ../sass/screen.scss */
#page-commande #commandes-points-vente .panel-commande-automatique .jours .form-group {
float: left;
margin-right: 10px;
}
/* line 599, ../sass/screen.scss */
/* line 604, ../sass/screen.scss */
#page-commande #old-commandes {
display: none;
}
/* line 603, ../sass/screen.scss */
/* line 608, ../sass/screen.scss */
#page-commande .form-commandes-point-vente {
margin-top: 20px;
}
/* line 607, ../sass/screen.scss */
/* line 612, ../sass/screen.scss */
#page-commande .form-commandes-point-vente table {
border-bottom: solid 1px #e0e0e0;
}
/* line 611, ../sass/screen.scss */
/* line 616, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-point-vente {
background-color: #fff8e2;
border-left: solid 3px #BB8757;
@@ -629,76 +634,76 @@ a:hover, a:focus, a:active {
text-align: left;
padding: 10px;
}
/* line 619, ../sass/screen.scss */
/* line 624, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-totaux {
text-align: center;
}
/* line 623, ../sass/screen.scss */
/* line 628, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-left {
border-left: solid 1px #e0e0e0;
}
/* line 627, ../sass/screen.scss */
/* line 632, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-right {
border-right: solid 1px #e0e0e0;
}
/* line 631, ../sass/screen.scss */
/* line 636, ../sass/screen.scss */
#page-commande .form-commandes-point-vente input.quantite {
width: 30px;
background-color: white;
border: solid 1px #e0e0e0;
text-align: center;
}
/* line 639, ../sass/screen.scss */
/* line 644, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .td-produit {
text-align: center;
}
/* line 643, ../sass/screen.scss */
/* line 648, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .submit-pv {
float: right;
}
/* line 647, ../sass/screen.scss */
/* line 652, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .select-user {
background-color: #F9F9F9;
border: solid 1px #e0e0e0;
}
/* line 652, ../sass/screen.scss */
/* line 657, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .date-commande {
font-size: 12px;
}
/* line 656, ../sass/screen.scss */
/* line 661, ../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 664, ../sass/screen.scss */
/* line 669, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.center {
text-align: center;
}
/* line 670, ../sass/screen.scss */
/* line 675, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .depasse {
color: #b32815;
}
/* line 674, ../sass/screen.scss */
/* line 679, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .total strong span {
font-weight: normal;
font-size: 13px;
}
/* line 679, ../sass/screen.scss */
/* line 684, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .vrac {
display: none;
}
/* line 683, ../sass/screen.scss */
/* line 688, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client {
text-align: left;
padding: 3px;
}
/* line 686, ../sass/screen.scss */
/* line 691, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client .date-commande {
color: gray;
}
/* line 693, ../sass/screen.scss */
/* line 698, ../sass/screen.scss */
#page-commande .table-header-rotated {
border-top: 0px;
border-left: 0px;
@@ -706,15 +711,15 @@ a:hover, a:focus, a:active {
width: 100%;
width: auto;
}
/* line 700, ../sass/screen.scss */
/* line 705, ../sass/screen.scss */
#page-commande .table-header-rotated .total strong {
border-bottom: solid 1px gray;
}
/* line 705, ../sass/screen.scss */
/* line 710, ../sass/screen.scss */
#page-commande .table-header-rotated th.row-header {
width: auto;
}
/* line 709, ../sass/screen.scss */
/* line 714, ../sass/screen.scss */
#page-commande .table-header-rotated td {
width: 40px;
border-top: 1px solid #dddddd;
@@ -723,7 +728,7 @@ a:hover, a:focus, a:active {
vertical-align: middle;
text-align: center;
}
/* line 718, ../sass/screen.scss */
/* line 723, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 {
font-weight: normal;
height: 80px;
@@ -737,7 +742,7 @@ a:hover, a:focus, a:active {
line-height: 1;
border: 0px none;
}
/* line 732, ../sass/screen.scss */
/* line 737, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 > div {
background-color: #F5F5F5;
position: relative;
@@ -755,7 +760,7 @@ a:hover, a:focus, a:active {
border-right: 1px solid #dddddd;
border-top: 1px solid #dddddd;
}
/* line 749, ../sass/screen.scss */
/* line 754, ../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);
@@ -773,51 +778,51 @@ a:hover, a:focus, a:active {
text-align: left;
}

/* line 770, ../sass/screen.scss */
/* line 775, ../sass/screen.scss */
#email-masse-form #ids-users {
line-height: 30px;
}
/* line 772, ../sass/screen.scss */
/* line 777, ../sass/screen.scss */
#email-masse-form #ids-users .label {
text-transform: capitalize;
}

/* line 780, ../sass/screen.scss */
/* line 785, ../sass/screen.scss */
.produit-create #jours-production .form-group, .produit-update #jours-production .form-group {
float: left;
margin-right: 15px;
}
/* line 784, ../sass/screen.scss */
/* line 789, ../sass/screen.scss */
.produit-create #jours-production .form-group label, .produit-update #jours-production .form-group label {
font-weight: normal;
}
/* line 789, ../sass/screen.scss */
/* line 794, ../sass/screen.scss */
.produit-create .field-produit-id_etablissement, .produit-update .field-produit-id_etablissement {
display: none;
}

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

/* line 799, ../sass/screen.scss */
/* line 804, ../sass/screen.scss */
.wrap .produit-index .td-photo {
max-width: 100px;
width: 100px;
}
/* line 803, ../sass/screen.scss */
/* line 808, ../sass/screen.scss */
.wrap .produit-index .photo-produit {
max-width: 100px;
}
/* line 807, ../sass/screen.scss */
/* line 812, ../sass/screen.scss */
.wrap .produit-index .ui-state-highlight {
height: 75px;
background-color: #F8F1DD;
}

/* communiquer */
/* line 815, ../sass/screen.scss */
/* line 820, ../sass/screen.scss */
.communiquer-mode-emploi {
border: solid 1px #e0e0e0;
padding: 10px;
@@ -827,18 +832,18 @@ a:hover, a:focus, a:active {
margin-bottom: 30px;
font-family: "myriadpro-regular";
}
/* line 823, ../sass/screen.scss */
/* line 828, ../sass/screen.scss */
.communiquer-mode-emploi .header .logo {
float: left;
width: 75px;
padding-right: 20px;
padding-top: 10px;
}
/* line 829, ../sass/screen.scss */
/* line 834, ../sass/screen.scss */
.communiquer-mode-emploi .header .logo img {
width: 75px;
}
/* line 835, ../sass/screen.scss */
/* line 840, ../sass/screen.scss */
.communiquer-mode-emploi .header h1 {
font-family: "comfortaaregular";
font-size: 40px;
@@ -846,7 +851,7 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
font-weight: normal;
}
/* line 843, ../sass/screen.scss */
/* line 848, ../sass/screen.scss */
.communiquer-mode-emploi .header h2 {
margin-top: 0px;
font-family: "myriadpro-regular";
@@ -856,7 +861,7 @@ a:hover, a:focus, a:active {
left: 2px;
font-weight: normal;
}
/* line 854, ../sass/screen.scss */
/* line 859, ../sass/screen.scss */
.communiquer-mode-emploi h3 {
font-family: "comfortaalight";
font-family: "myriadpro-regular";
@@ -866,45 +871,45 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
}

/* line 864, ../sass/screen.scss */
/* line 869, ../sass/screen.scss */
.communiquer-mode-emploi-encart {
width: 420px;
margin-top: 20px;
}
/* line 868, ../sass/screen.scss */
/* line 873, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header .logo {
width: 60px;
margin-right: 20px;
padding-top: 5px;
}
/* line 873, ../sass/screen.scss */
/* line 878, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header .logo img {
width: 60px;
}
/* line 879, ../sass/screen.scss */
/* line 884, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header h1 {
margin-bottom: 3px;
}
/* line 888, ../sass/screen.scss */
/* line 893, ../sass/screen.scss */
.communiquer-mode-emploi-encart h3 {
margin-top: 15px;
margin-bottom: 15px;
}

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

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

/* line 905, ../sass/screen.scss */
/* line 910, ../sass/screen.scss */
.communiquer-mode-emploi-pdf {
border: 0px none;
-moz-border-radius: 0px;
@@ -913,82 +918,82 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
padding: 20px 0px 20px 30px;
}
/* line 913, ../sass/screen.scss */
/* line 918, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header .logo {
float: left;
width: 55px;
padding-right: 15px;
padding-top: 10px;
}
/* line 919, ../sass/screen.scss */
/* line 924, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header .logo img {
width: 55px;
}
/* line 923, ../sass/screen.scss */
/* line 928, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header h1 {
font-size: 32px;
}
/* line 926, ../sass/screen.scss */
/* line 931, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header h2 {
font-size: 16px;
}
/* line 931, ../sass/screen.scss */
/* line 936, ../sass/screen.scss */
.communiquer-mode-emploi-pdf h3 {
font-weight: normal;
}

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

/* commandes auto */
/* line 946, ../sass/screen.scss */
/* line 951, ../sass/screen.scss */
.commandeauto-form #bloc-select-user {
padding-left: 0px;
}
/* line 950, ../sass/screen.scss */
/* line 955, ../sass/screen.scss */
.commandeauto-form #or-user {
font-size: 20px;
text-align: center;
}
/* line 953, ../sass/screen.scss */
/* line 958, ../sass/screen.scss */
.commandeauto-form #or-user span {
position: relative;
top: 24px;
}
/* line 959, ../sass/screen.scss */
/* line 964, ../sass/screen.scss */
.commandeauto-form .field-commandeautoform-id_etablissement {
display: none;
}
/* line 963, ../sass/screen.scss */
/* line 968, ../sass/screen.scss */
.commandeauto-form .jours .form-group {
float: left;
margin-right: 20px;
}
/* line 970, ../sass/screen.scss */
/* line 975, ../sass/screen.scss */
.commandeauto-form .produits .table {
width: 500px;
}
/* line 973, ../sass/screen.scss */
/* line 978, ../sass/screen.scss */
.commandeauto-form .produits .quantite {
text-align: center;
}

/* points de vente */
/* line 982, ../sass/screen.scss */
/* line 987, ../sass/screen.scss */
.point-vente-form #pointvente-users {
display: none;
height: 500px;
overflow-y: scroll;
}
/* line 986, ../sass/screen.scss */
/* line 991, ../sass/screen.scss */
.point-vente-form #pointvente-users label {
font-weight: normal;
display: block;
}
/* line 990, ../sass/screen.scss */
/* line 995, ../sass/screen.scss */
.point-vente-form #pointvente-users .commentaire {
display: none;
margin-left: 17px;
@@ -996,28 +1001,28 @@ a:hover, a:focus, a:active {
}

/* utilisateurs */
/* line 1001, ../sass/screen.scss */
/* line 1006, ../sass/screen.scss */
.user-index .input-group {
width: 180px;
}
/* line 1004, ../sass/screen.scss */
/* line 1009, ../sass/screen.scss */
.user-index .input-group .input-credit {
text-align: center;
}

/* facturation */
/* line 1012, ../sass/screen.scss */
/* line 1017, ../sass/screen.scss */
#estimation-facture {
text-align: center;
margin-bottom: 30px;
padding-bottom: 20px;
background-color: #F9F9F9;
}
/* line 1018, ../sass/screen.scss */
/* line 1023, ../sass/screen.scss */
#estimation-facture h2 {
font-family: "myriadpro-it";
}
/* line 1022, ../sass/screen.scss */
/* line 1027, ../sass/screen.scss */
#estimation-facture .montant span {
font-size: 25px;
color: white;

+ 132
- 82
backend/web/js/lechatdesnoisettes.js Voir le fichier

@@ -19,6 +19,11 @@ function chat_tooltip() {
$('[data-toggle="tooltip"]').tooltip();
}

function chat_nl2br(str, is_xhtml) {
var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br />' : '<br>';
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1'+ breakTag +'$2');
}

function chat_points_vente_acces() {
// affichage du bloc acces restreint
$('#pointvente-acces_restreint').change(function() {
@@ -74,7 +79,7 @@ function chat_index_commandes_points_vente() {
// affiche la commande
var id_commande = $(this).data('id-commande') ;
chat_index_commandes_affiche_commande(id_commande) ;
chat_index_commandes_affiche_commande(id_pv, id_commande) ;
}) ;
$('#commandes-points-vente .bloc-point-vente').each(function() {
@@ -116,7 +121,7 @@ function chat_index_commandes_points_vente() {
$('#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')) ;
chat_index_commandes_affiche_commande(id_pv, commande_next.data('id-commande')) ;
}
else {
$('#point-vente-'+id_pv+' .liste-commandes').hide() ;
@@ -133,7 +138,8 @@ function chat_index_commandes_points_vente() {
$('#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')) ;
$('#point-vente-'+id_pv+' .btn-save').removeClass('is-create') ;
chat_index_commandes_affiche_commande(id_pv, $(this).data('id-commande')) ;
}) ;

// save
@@ -161,7 +167,8 @@ function chat_index_commandes_points_vente() {
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)
produits: JSON.stringify(tab_produits),
commentaire: $('#point-vente-'+id_pv+' .textarea-commentaire').val()
}, function(data) {
$('#point-vente-'+id_pv+' .btn-save').removeAttr('disabled') ;
$('#point-vente-'+id_pv+' .btn-save').removeClass('is-create') ;
@@ -178,7 +185,7 @@ function chat_index_commandes_points_vente() {
$('#point-vente-'+id_pv+' .user-id').val(0) ;
$('#point-vente-'+id_pv+' .user-id').val('') ;

chat_index_commandes_affiche_commande(data.id_commande) ;
chat_index_commandes_affiche_commande(id_pv, data.id_commande) ;
chat_alert('success', 'Commande créée') ;
}, 'json') ;
}
@@ -195,14 +202,16 @@ function chat_index_commandes_points_vente() {
r: 'commande/ajax-update',
id_commande: id_commande,
produits: JSON.stringify(tab_produits),
date: $('#date-production').val()
date: $('#date-production').val(),
commentaire: $('#point-vente-'+id_pv+' .textarea-commentaire').val()
}, function(data) {
$('#point-vente-'+id_pv+' .btn-save').removeAttr('disabled') ;
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+']').attr('data-commande',data.json_commande);
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant').html(data.json_commande.str_montant) ;
chat_index_commandes_affiche_commande(id_commande) ;
chat_index_commandes_affiche_commande(id_pv, id_commande) ;
chat_index_commandes_maj_recap_pv(id_pv, data.total_pv) ;

$('#point-vente-'+id_pv+' .buttons-edit-remove').show() ;
@@ -235,12 +244,12 @@ function chat_index_commandes_points_vente() {
$('#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() ;
}
/*if(!$('#point-vente-'+id_pv+' .btn-cancel').data('id-commande') &&
$('#point-vente-'+id_pv+' .liste-commandes li').size()) {
$('#point-vente-'+id_pv+' .btn-cancel').data('id-commande',$('#point-vente-'+id_pv+' .liste-commandes li:first a').data('id-commande')) ;
}*/
$('#point-vente-'+id_pv+' .btn-save').data('id-commande',0) ;

chat_index_commandes_inputs_commande(id_pv, false) ;

@@ -271,20 +280,41 @@ function chat_index_commandes_maj_recap_pv(id_pv, total) {
if(nb_commandes == 0) {
$('#point-vente-'+id_pv+' .recap-pv .commandes').html('Aucune commande') ;
$('#point-vente-'+id_pv+' .recap-pv .recettes').hide() ;
$('#point-vente-'+id_pv+' .liste-commandes').addClass('no-commande') ;
}
else if(nb_commandes == 1) {
$('#point-vente-'+id_pv+' .recap-pv .commandes').html('1 commande') ;
$('#point-vente-'+id_pv+' .recap-pv .recettes').show() ;
$('#point-vente-'+id_pv+' .liste-commandes').removeClass('no-commande') ;
}
else {
$('#point-vente-'+id_pv+' .recap-pv .commandes').html(nb_commandes+' commandes') ;
$('#point-vente-'+id_pv+' .recap-pv .recettes').show() ;
$('#point-vente-'+id_pv+' .liste-commandes').removeClass('no-commande') ;
}
$('#btn-point-vente-'+id_pv+' .badge').html(nb_commandes) ;
}

function chat_index_commandes_inputs_commande(id_pv, use_quantite) {
// commentaire
$('#point-vente-'+id_pv+' .commentaire').hide() ;
$('#point-vente-'+id_pv+' .textarea-commentaire').show() ;
var id_commande = $('#point-vente-'+id_pv+' .btn-save').data('id-commande') ;
if(id_commande) {
var link = $('a[data-id-commande='+id_commande+']') ;
if(!$.isPlainObject(link.attr('data-commande'))) {
var commande = JSON.parse(link.attr('data-commande')) ;
if(commande.commentaire && commande.commentaire.length)
$('#point-vente-'+id_pv+' .textarea-commentaire').val(commande.commentaire) ;
}
}
else {
$('#point-vente-'+id_pv+' .textarea-commentaire').val('') ;
}
// produits
$('#point-vente-'+id_pv+' .table-produits tr').each(function() {
var quantite = '' ;
if(use_quantite)
@@ -337,82 +367,102 @@ function chat_btn_plus_moins() {
}

function chat_index_commandes_affiche_commande(id_commande) {
function chat_index_commandes_affiche_commande(id_pv, id_commande) {
var link = $("a[data-id-commande="+id_commande+"]") ;
var id_pv = link.data('pv-id') ;
$('#point-vente-'+id_pv+' .bloc-commande').hide() ;
$('#point-vente-'+id_pv+' .liste-commandes a').removeClass('active') ;
link.addClass('active') ;
var commande = link.attr('data-commande') ;
if(!$.isPlainObject(link.attr('data-commande'))) {
commande = JSON.parse(link.attr('data-commande')) ;
}
// maj ligne commande
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant').removeClass('paye') ;
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant .glyphicon').remove() ;
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant').html() ;
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant').html(commande.str_montant) ;
if(commande.montant_paye >= commande.montant) {
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant').addClass('paye') ;

if(id_commande) {

$('#point-vente-'+id_pv+' .bloc-commande').hide() ;

$('#point-vente-'+id_pv+' .liste-commandes a').removeClass('active') ;
link.addClass('active') ;

var commande = link.attr('data-commande') ;
if(!$.isPlainObject(link.attr('data-commande'))) {
commande = JSON.parse(link.attr('data-commande')) ;
}

// maj ligne commande
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant').removeClass('paye') ;
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant .glyphicon').remove() ;
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant').html() ;

$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant').html(commande.str_montant) ;
if(commande.montant_paye >= commande.montant) {
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant').addClass('paye') ;

if(commande.montant_paye > commande.montant) {
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant').append(' <span class="glyphicon glyphicon-warning-sign"></span>') ;
}
}
if(commande.montant_paye > commande.montant) {
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .montant').append(' <span class="glyphicon glyphicon-warning-sign"></span>') ;
// commentaire
if(commande.commentaire && commande.commentaire.length) {
if(!$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .glyphicon-comment').size()) {
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+']').append(' <span class="glyphicon glyphicon-comment"></span>') ;
}
console.log(id_pv+' '+commande.commentaire) ;
$('#point-vente-'+id_pv+' .commentaire').html(chat_nl2br(commande.commentaire)).show() ;
}
}
// 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') ;
$.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.str_montant+'</span>') ;
$('#point-vente-'+id_pv+' .tr-total').show() ;
else {
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+'] .glyphicon-comment').remove() ;
$('#point-vente-'+id_pv+' .commentaire').hide() ;
}

// 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+' .textarea-commentaire').hide() ;

$('#point-vente-'+id_pv+' .td-commande').html('') ;
$('#point-vente-'+id_pv+' .td-total').html('') ;
$('#point-vente-'+id_pv+' tr').removeClass('active') ;

$.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.str_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>") ;

var commentaire = link.data('commentaire') ;
if(commentaire) {
$('#point-vente-'+id_pv+' .commentaire').html(commentaire).show() ;
$('#point-vente-'+id_pv+' .bloc-commande').fadeIn() ;
$('#point-vente-'+id_pv+' .title-user').show() ;
$('#point-vente-'+id_pv+' .tr-total').show() ;

// paiement
$.get('index.php',{
r: 'commande/statut-paiement',
id_commande: id_commande
}, function(data) {
$('#point-vente-'+id_pv+' .bloc-commande .td-paiement').html(data.html_statut_paiement) ;
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+']').attr('data-commande',data.json_commande) ;
chat_index_commandes_boutons_paiement(id_pv, id_commande) ;
},'json') ;
}
else {
$('#point-vente-'+id_pv+' .commentaire').hide() ;
$('#point-vente-'+id_pv+' .bloc-commande').hide() ;
}

$('#point-vente-'+id_pv+' .title-user span.the-title').html(link.find('.user').html()+" <small>"+link.data('date')+"</small>") ;
$('#point-vente-'+id_pv+' .bloc-commande').fadeIn() ;
$('#point-vente-'+id_pv+' .title-user').show() ;
$('#point-vente-'+id_pv+' .tr-total').show() ;
// paiement
$.get('index.php',{
r: 'commande/statut-paiement',
id_commande: id_commande
}, function(data) {
$('#point-vente-'+id_pv+' .bloc-commande .td-paiement').html(data.html_statut_paiement) ;
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+']').attr('data-commande',data.json_commande) ;
chat_index_commandes_boutons_paiement(id_pv, id_commande) ;
},'json') ;
}

function chat_index_commandes_boutons_paiement(id_pv, id_commande) {
@@ -426,7 +476,7 @@ function chat_index_commandes_boutons_paiement(id_pv, id_commande) {
}, function(data) {
$('#point-vente-'+id_pv+' .bloc-commande .td-paiement').html(data.html_statut_paiement) ;
$('#point-vente-'+id_pv+' a[data-id-commande='+id_commande+']').attr('data-commande',data.json_commande) ;
chat_index_commandes_affiche_commande(id_commande) ;
chat_index_commandes_affiche_commande(id_pv, id_commande) ;
chat_index_commandes_boutons_paiement(id_pv, id_commande) ;
}, 'json') ;
}) ;

+ 5
- 0
backend/web/sass/screen.scss Voir le fichier

@@ -448,6 +448,10 @@ a {
margin-top: 0px ;
width: 100% ;
overflow-y: scroll ;

&.no-commande {
display: none ;
}
li {
padding: 0 ;
@@ -505,6 +509,7 @@ a {
display: none ;
font-size: 19px ;
margin-top: 0px ;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif ;
.btn-edit, .btn-remove,
.btn-cancel, .btn-save {

+ 2
- 1
common/models/Commande.php Voir le fichier

@@ -220,7 +220,8 @@ class Commande extends \yii\db\ActiveRecord
'produits'=> [],
'montant' => $commande->montant,
'str_montant' => $commande->getMontantFormat(),
'montant_paye' => $commande->getMontantPaye()
'montant_paye' => $commande->getMontantPaye(),
'commentaire' => $commande->commentaire,
] ;
foreach($commande->commandeProduits as $commande_produit)

Chargement…
Annuler
Enregistrer