소스 검색

Adaptation de l'affichage des commandes dans le tableau de bord, la liste des commandes clients et la liste des commandes dans la page des commandes.

dev
keun 6 년 전
부모
커밋
e0446ab674
11개의 변경된 파일354개의 추가작업 그리고 272개의 파일을 삭제
  1. +21
    -13
      backend/controllers/CommandeController.php
  2. +4
    -0
      backend/views/commande/index.php
  3. +2
    -7
      backend/views/site/index.php
  4. +4
    -2
      backend/views/user/commandes.php
  5. +3
    -2
      backend/views/user/index.php
  6. BIN
      backend/web/.sass-cache/2a0ffb00578c9d5a537db16d14c734a22b18f35c/screen.scssc
  7. +208
    -199
      backend/web/css/screen.css
  8. +60
    -43
      backend/web/sass/screen.scss
  9. +46
    -3
      common/models/Commande.php
  10. +3
    -1
      common/models/PointVente.php
  11. +3
    -2
      producer/controllers/CommandeController.php

+ 21
- 13
backend/controllers/CommandeController.php 파일 보기

@@ -41,6 +41,7 @@ class CommandeController extends BackendController {

$commandes = Commande::findBy([
'date' => $date,
'date_delete' => 'NULL',
'id_etablissement' => $id_etablissement,
'orderby' => 'commentaire_point_vente ASC, user.nom ASC'
]);
@@ -293,8 +294,9 @@ class CommandeController extends BackendController {

// commandes
$commandes = Commande::findBy([
'date' => $date
]);
'date' => $date,
'date_delete' => 'NULL'
]);

$recettes = 0;
$recettes_pain = 0;
@@ -305,14 +307,17 @@ class CommandeController extends BackendController {

foreach ($commandes as $c) {
$c->init();
$recettes += $c->montant;
$recettes_pain += $c->montant_pain;
$recettes_vrac += $c->montant_vrac;
if ($c->id_point_vente != 1)
$recettes_pain_livre += $c->montant_pain;

$poids_pain += $c->poids_pain;
$poids_vrac += $c->poids_vrac;
if(is_null($c->date_delete)) {
$recettes += $c->montant;
$recettes_pain += $c->montant_pain;
$recettes_vrac += $c->montant_vrac;
if ($c->id_point_vente != 1)
$recettes_pain_livre += $c->montant_pain;

$poids_pain += $c->poids_pain;
$poids_vrac += $c->poids_vrac;
}
}
$recettes = number_format($recettes, 2);
$recettes_pain = number_format($recettes_pain, 2);
@@ -1072,7 +1077,7 @@ class CommandeController extends BackendController {

// commandes
$commandes = Commande::find()
->with('commandeProduits', 'user')
->with('commandeProduits','commandeProduits.produit', 'user')
->joinWith('production')
->where(['production.date' => $date])
->andWhere(['production.id_etablissement' => Yii::$app->user->identity->id_etablissement])
@@ -1083,8 +1088,11 @@ class CommandeController extends BackendController {
$poids_pain = 0;
foreach ($commandes as $c) {
$c->init();
$recettes += $c->montant;
$poids_pain += $c->poids_pain;
if(is_null($c->date_delete)) {
$recettes += $c->montant;
$poids_pain += $c->poids_pain;
}
}

// produits selec pour production

+ 4
- 0
backend/views/commande/index.php 파일 보기

@@ -228,6 +228,10 @@ foreach ($produits as $p) {
<?php else: ?>
<?= Html::encode($c->username); ?>
<?php endif; ?>
<?php if(!is_null($c->date_delete)): ?>
(<span class="glyphicon glyphicon-remove"></span> Annulée)
<?php endif; ?>
</span>
<?php if (strlen($c->commentaire)): ?>

+ 2
- 7
backend/views/site/index.php 파일 보기

@@ -252,14 +252,9 @@ $this->title = 'Tableau de bord';
</thead>
<tbody>
<?php foreach($commandes as $c): ?>
<tr class="<?php if(!is_null($c->date_update)): ?>commande-update<?php endif; ?>">
<tr class="<?= $c->getClassHistorique() ; ?>">
<td class="infos"><?= $c->getStrType(true); ?></td>
<td class="historique">
<div class="small"><span class="glyphicon glyphicon-plus"></span> Création <br /> <strong><?= date('d/m/Y à G\hi', strtotime($c->date)) ?></strong></div>
<?php if(!is_null($c->date_update)): ?>
<div class="small"><span class="update"><span class="glyphicon glyphicon-pencil"></span> Dernière modification</span><br /> <strong><?= date('d/m/Y à G\hi', strtotime($c->date_update)) ?></strong></div>
<?php endif; ?>
</td>
<td class="historique"><?= $c->getStrHistorique() ; ?></td>
<td class="date">
<div class="bloc-date">
<div class="jour"><?= strftime('%A', strtotime($c->production->date)) ?></div>

+ 4
- 2
backend/views/user/commandes.php 파일 보기

@@ -20,7 +20,8 @@ $this->params['breadcrumbs'][] = 'Créditer';
<?php if(count($commandes)): ?>
<table id="historique-commandes" class="table table-striped table-bordered">
<thead>
<tr>
<tr>
<th>Historique</th>
<th>Date livraison</th>
<th>Résumé</th>
<th>Point de vente</th>
@@ -29,7 +30,8 @@ $this->params['breadcrumbs'][] = 'Créditer';
</thead>
<tbody>
<?php foreach($commandes as $c): ?>
<tr>
<tr class="<?= $c->getClassHistorique() ; ?>">
<td class="historique"><?= $c->getStrHistorique() ; ?></td>
<td><?php echo date('d/m/Y',strtotime($c->production->date)); ?></td>
<td class="resume"><?= $c->getResumePanier() ; ?></td>
<td><?= $c->getResumePointVente(); ?></td>

+ 3
- 2
backend/views/user/index.php 파일 보기

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

use yii\helpers\Html;
use yii\grid\GridView;
@@ -103,8 +103,9 @@ $this->params['breadcrumbs'][] = $this->title;
$count_commandes = Commande::find()
->joinWith('production')
->where([
'id_user' => $model['user_id'],
'id_user' => $model['user_id'],
'production.id_etablissement' => Yii::$app->user->identity->id_etablissement])
->andWhere('date_delete IS NULL')
->count() ;
$html = '' ;
if($count_commandes)

BIN
backend/web/.sass-cache/2a0ffb00578c9d5a537db16d14c734a22b18f35c/screen.scssc 파일 보기


+ 208
- 199
backend/web/css/screen.css
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 60
- 43
backend/web/sass/screen.scss 파일 보기

@@ -264,44 +264,26 @@ a {
}
}

// tableau de bord
.site-index {
.panel {
.panel-title {
.btn {
float: right ;
font-family: 'myriadpro-regular' ;
&.btn-success {
background-color: #5cb85c ;
color: white ;
border-color: #5cb85c ;
}
&.margin-left {
margin-left: 5px ;
}
}
}
.panel-body {
//height: 250px ;
}
}
#dernieres-commandes {
// liste de commandes
.site-index, .user-commandes {
#dernieres-commandes, #historique-commandes {

tr.commande-update {
td {
background-color: $color2 ;
}
.update {
color: $color1 ;
}
}
.small, .localite {
font-size: 12px ;
color: gray ;
}
.commentaire {
font-size: 12px ;
tr.commande-delete {
td {
background-color: lighten(#C9302C, 40);
}
.delete {
color: #C9302C ;
}
}
td.historique {
@@ -309,39 +291,49 @@ a {
.small {
margin-bottom: 7px ;
}
strong {
margin-left: 15px ;
//margin-left: 15px ;
}
.update {
color: $color1 ;
}
/*.label {
color: gray ;
border: solid 1px gray ;
}*/
}

.small, .localite {
font-size: 12px ;
color: gray ;
}
.commentaire {
font-size: 12px ;
}

.date {
text-align: center ;
.bloc-date {
width: 50% ;
margin: 0px auto ;
padding-top: 0px ;
}
.jour {
text-transform: capitalize ;
line-height: 13px ;
font-size: 10px ;
text-transform: uppercase ;
}
.num {
font-size: 23px ;
line-height: 28px ;
font-weight: bold ;
}
.mois {
text-transform: uppercase ;
line-height: 13px ;
@@ -349,6 +341,31 @@ a {
}
}
}
}

// tableau de bord
.site-index {
.panel {
.panel-title {
.btn {
float: right ;
font-family: 'myriadpro-regular' ;
&.btn-success {
background-color: #5cb85c ;
color: white ;
border-color: #5cb85c ;
}
&.margin-left {
margin-left: 5px ;
}
}
}
.panel-body {
//height: 250px ;
}
}
#facturation {
h2 {

+ 46
- 3
common/models/Commande.php 파일 보기

@@ -48,6 +48,8 @@ class Commande extends \yii\db\ActiveRecord {
foreach ($this->commandeProduits as $p) {
if ($p->mode_vente == 'unite') {
$this->montant_pain += $p->prix * $p->quantite;
if(isset($p->produit))
$this->poids_pain += ($p->quantite * $p->produit->poids) / 1000 ;
} elseif ($p->mode_vente == 'poids') {
$this->montant_pain += $p->prix * $p->quantite / 1000;
}
@@ -71,9 +73,11 @@ class Commande extends \yii\db\ActiveRecord {

if (isset($commandes) && is_array($commandes) && count($commandes)) {
foreach ($commandes as $c) {
foreach ($c->commandeProduits as $cp) {
if ($cp->id_produit == $id_produit)
$quantite += $cp->quantite;
if(is_null($c->date_delete)) {
foreach ($c->commandeProduits as $cp) {
if ($cp->id_produit == $id_produit)
$quantite += $cp->quantite;
}
}
}
}
@@ -382,4 +386,43 @@ class Commande extends \yii\db\ActiveRecord {
return $str;
}

public function getStrHistorique() {
$arr = [
'class' => 'create',
'glyphicon' => 'plus',
'str' => 'Ajoutée',
'date' => $this->date
] ;
if(!is_null($this->date_update)) {
$arr = [
'class' => 'update',
'glyphicon' => 'pencil',
'str' => 'Modifiée',
'date' => $this->date_update
] ;
}
if(!is_null($this->date_delete)) {
$arr = [
'class' => 'delete',
'glyphicon' => 'remove',
'str' => 'Annulée',
'date' => $this->date_delete
] ;
}
$html = '<div class="small"><span class="'.$arr['class'].'"><span class="glyphicon glyphicon-'.$arr['glyphicon'].'"></span> '.$arr['str'].'</span> le <strong>'.date('d/m/Y à G\hi', strtotime($arr['date'])).'</strong></div>' ;
return $html ;
}
public function getClassHistorique() {
if(!is_null($this->date_delete)) {
return 'commande-delete' ;
}
if(!is_null($this->date_update)) {
return 'commande-update' ;
}
return 'commande-create' ;
}
}

+ 3
- 1
common/models/PointVente.php 파일 보기

@@ -101,7 +101,9 @@ class PointVente extends \yii\db\ActiveRecord {
if ($this->id == $c->id_point_vente) {
$this->commandes[] = $c;

$this->recettes += (float) $c->montant;
if(is_null($c->date_delete)) {
$this->recettes += (float) $c->montant;
}
$this->recettes_pain += (float) $c->montant_pain;
$this->recettes_vrac += (float) $c->montant_vrac;
}

+ 3
- 2
producer/controllers/CommandeController.php 파일 보기

@@ -191,6 +191,7 @@ class CommandeController extends ProducerBaseController {
'id_user' => Yii::$app->user->id,
'production.id_etablissement' => $this->getProducer()->id
])
->andWhere('date_delete IS NULL')
->orderBy('production.date DESC'),
'pagination' => [
'pageSize' => 10,
@@ -469,8 +470,8 @@ class CommandeController extends ProducerBaseController {
);
}
// delete
$commande->delete();
CommandeProduit::deleteAll(['id_commande' => $commande->id]);
$commande->date_delete = date('Y-m-d H:i:s');
$commande->save() ;
Yii::$app->session->setFlash('success','Votre commande a bien été annulée.') ;
}

Loading…
취소
저장