Browse Source

Merge branch 'feature/backend/activer_production_par_semaine' into dev

dev
keun 6 years ago
parent
commit
0b5e60311f
6 changed files with 270 additions and 172 deletions
  1. +84
    -30
      backend/controllers/CommandeController.php
  2. +2
    -0
      backend/views/commande/index.php
  3. BIN
      backend/web/.sass-cache/2a0ffb00578c9d5a537db16d14c734a22b18f35c/screen.scssc
  4. +147
    -142
      backend/web/css/screen.css
  5. +5
    -0
      backend/web/sass/screen.scss
  6. +32
    -0
      common/models/Production.php

+ 84
- 30
backend/controllers/CommandeController.php View File

@@ -242,33 +242,7 @@ class CommandeController extends BackendController {
}

// création du jour de production
$production = null;
if ($date != '') {
$production = Production::find()
->where(['date' => $date])
->andWhere(['id_etablissement' => Yii::$app->user->identity->id_etablissement])
->one();
if (!$production) {
$production = new Production;
$production->date = $date;
$production->livraison = 1;
$production->id_etablissement = Yii::$app->user->identity->id_etablissement;
$production->save();
}
}

// production_point_vente à définir s'ils ne sont pas initialisés
if ($production) {
$count_productions_point_vente = ProductionPointVente::find()->
where([
'id_production' => $production->id
])
->count();

if (!$count_productions_point_vente) {
ProductionPointVente::setAll($production->id, true);
}
}
$production = Production::initProduction($date) ;

// points de vente
if ($production) {
@@ -503,6 +477,38 @@ class CommandeController extends BackendController {
}
}
// une production de la semaine activée ou non
$production_semaine_active = false ;
$week = sprintf('%02d',date('W',strtotime($date)));
$start = strtotime(date('Y',strtotime($date)).'W'.$week);
$date_lundi = date('Y-m-d',strtotime('Monday',$start)) ;
$date_mardi = date('Y-m-d',strtotime('Tuesday',$start)) ;
$date_mercredi = date('Y-m-d',strtotime('Wednesday',$start)) ;
$date_jeudi = date('Y-m-d',strtotime('Thursday',$start)) ;
$date_vendredi = date('Y-m-d',strtotime('Friday',$start)) ;
$date_samedi = date('Y-m-d',strtotime('Saturday',$start)) ;
$date_dimanche = date('Y-m-d',strtotime('Sunday',$start)) ;
$production_semaine = Production::find()
->andWhere([
'id_etablissement' => Yii::$app->user->identity->id_etablissement,
'actif' => 1,
])
->andWhere(['or',
['date' => $date_lundi],
['date' => $date_mardi],
['date' => $date_mercredi],
['date' => $date_jeudi],
['date' => $date_vendredi],
['date' => $date_samedi],
['date' => $date_dimanche],
])
->one();
if($production_semaine) {
$production_semaine_active = true ;
}
$datas = [
'produits' => $produits,
'points_vente' => $points_vente,
@@ -523,7 +529,8 @@ class CommandeController extends BackendController {
'model_commande_auto' => $model_commande_auto,
'production_point_vente' => $production_point_vente,
'productions_point_vente' => $productions_point_vente,
'arr_productions_point_vente' => $arr_productions_point_vente
'arr_productions_point_vente' => $arr_productions_point_vente,
'production_semaine_active' =>$production_semaine_active
];

if ($return_data) {
@@ -814,9 +821,10 @@ class CommandeController extends BackendController {
$this->redirect(['index', 'date' => $date]);
}

public function actionChangeState($date, $actif) {
public function actionChangeState($date, $actif, $redirect = true) {
// changement état
$production = Production::find()->where(['date' => $date, 'id_etablissement' => Yii::$app->user->identity->id_etablissement])->one();
$production = Production::initProduction($date) ;
$production->actif = $actif;
$production->save();

@@ -825,6 +833,52 @@ class CommandeController extends BackendController {
CommandeAuto::addAll($date);
}

if($redirect)
$this->redirect(['index', 'date' => $date]);
}
public function actionChangeStateSemaine($date, $actif) {
$week = sprintf('%02d',date('W',strtotime($date)));
$start = strtotime(date('Y',strtotime($date)).'W'.$week);
$date_lundi = date('Y-m-d',strtotime('Monday',$start)) ;
$date_mardi = date('Y-m-d',strtotime('Tuesday',$start)) ;
$date_mercredi = date('Y-m-d',strtotime('Wednesday',$start)) ;
$date_jeudi = date('Y-m-d',strtotime('Thursday',$start)) ;
$date_vendredi = date('Y-m-d',strtotime('Friday',$start)) ;
$date_samedi = date('Y-m-d',strtotime('Saturday',$start)) ;
$date_dimanche = date('Y-m-d',strtotime('Sunday',$start)) ;
$points_vente = PointVente::find()
->where(['id_etablissement' => Yii::$app->user->identity->id_etablissement,])
->all();
$lundi_active = false ;
$mardi_active = false ;
$mercredi_active = false ;
$jeudi_active = false ;
$vendredi_active = false ;
$samedi_active = false ;
$dimanche_active = false ;
foreach($points_vente as $pv) {
if($pv->livraison_lundi) $lundi_active = true ;
if($pv->livraison_mardi) $mardi_active = true ;
if($pv->livraison_mercredi) $mercredi_active = true ;
if($pv->livraison_jeudi) $jeudi_active = true ;
if($pv->livraison_vendredi) $vendredi_active = true ;
if($pv->livraison_samedi) $samedi_active = true ;
if($pv->livraison_dimanche) $dimanche_active = true ;
}
if($lundi_active || !$actif) $this->actionChangeState($date_lundi, $actif, false) ;
if($mardi_active || !$actif) $this->actionChangeState($date_mardi, $actif, false) ;
if($mercredi_active || !$actif) $this->actionChangeState($date_mercredi, $actif, false) ;
if($jeudi_active || !$actif) $this->actionChangeState($date_jeudi, $actif, false) ;
if($vendredi_active || !$actif) $this->actionChangeState($date_vendredi, $actif, false) ;
if($samedi_active || !$actif) $this->actionChangeState($date_samedi, $actif, false) ;
if($dimanche_active || !$actif) $this->actionChangeState($date_dimanche, $actif, false) ;

$this->redirect(['index', 'date' => $date]);
}


+ 2
- 0
backend/views/commande/index.php View File

@@ -39,6 +39,8 @@ foreach ($produits as $p) {
<span class="glyphicon glyphicon-share-alt"></span> Choisissez une date pour initier ou
éditer un jour de production.
</div>
<?php else: ?>
<a class="btn btn-sm btn-default btn-active-week" href="<?= Yii::$app->urlManager->createUrl(['commande/change-state-semaine', 'date' => $date, 'actif' => !$production_semaine_active, ]); ?>"><span class="glyphicon glyphicon-<?= $production_semaine_active ? 'remove' : 'ok' ?>"></span> <?= $production_semaine_active ? 'Désactiver' : 'Activer' ?> cette semaine de production</a>
<?php endif; ?>
</div>
</div>

BIN
backend/web/.sass-cache/2a0ffb00578c9d5a537db16d14c734a22b18f35c/screen.scssc View File


+ 147
- 142
backend/web/css/screen.css View File

@@ -494,17 +494,22 @@ a:hover, a:focus, a:active {
float: none;
padding-top: 2px;
}
/* line 472, ../sass/screen.scss */
/* line 470, ../sass/screen.scss */
#page-commande .btn-active-week {
display: block;
margin-top: 10px;
}
/* line 477, ../sass/screen.scss */
#page-commande #bloc-production .label {
float: right;
font-size: 13px;
}
/* line 477, ../sass/screen.scss */
/* line 482, ../sass/screen.scss */
#page-commande #bloc-production .btn-success {
background-color: #5cb85c;
border-color: #4cae4c;
}
/* line 482, ../sass/screen.scss */
/* line 487, ../sass/screen.scss */
#page-commande #bloc-production #productions-point-vente {
margin-top: 15px;
padding: 10px;
@@ -514,76 +519,76 @@ a:hover, a:focus, a:active {
-webkit-border-radius: 5px;
border-radius: 5px;
}
/* line 488, ../sass/screen.scss */
/* line 493, ../sass/screen.scss */
#page-commande #bloc-production #productions-point-vente label {
display: block;
font-weight: normal;
}
/* line 493, ../sass/screen.scss */
/* line 498, ../sass/screen.scss */
#page-commande #bloc-production #productions-point-vente .checkbox-list {
margin-left: 10px;
margin-top: 10px;
}
/* line 506, ../sass/screen.scss */
/* line 511, ../sass/screen.scss */
#page-commande #produits-production .overflow table {
width: 100%;
}
/* line 510, ../sass/screen.scss */
/* line 515, ../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 512, ../sass/screen.scss */
/* line 517, ../sass/screen.scss */
#page-commande #produits-production .overflow tr:after {
content: ' ';
display: block;
visibility: hidden;
clear: both;
}
/* line 519, ../sass/screen.scss */
/* line 524, ../sass/screen.scss */
#page-commande #produits-production .overflow thead th {
height: 30px;
/*text-align: left;*/
}
/* line 525, ../sass/screen.scss */
/* line 530, ../sass/screen.scss */
#page-commande #produits-production .overflow tbody {
height: 500px;
overflow-y: auto;
}
/* line 533, ../sass/screen.scss */
/* line 538, ../sass/screen.scss */
#page-commande #produits-production .overflow thead th {
width: 32%;
float: left;
}
/* line 538, ../sass/screen.scss */
/* line 543, ../sass/screen.scss */
#page-commande #produits-production .overflow tbody td {
width: 33%;
float: left;
}
/* line 543, ../sass/screen.scss */
/* line 548, ../sass/screen.scss */
#page-commande #produits-production .overflow .td-produit {
width: 60%;
}
/* line 546, ../sass/screen.scss */
/* line 551, ../sass/screen.scss */
#page-commande #produits-production .overflow .td-actif, #page-commande #produits-production .overflow .td-max {
width: 20%;
text-align: center;
}
/* line 552, ../sass/screen.scss */
/* line 557, ../sass/screen.scss */
#page-commande #produits-production .overflow thead .td-produit {
width: 57%;
}
/* line 558, ../sass/screen.scss */
/* line 563, ../sass/screen.scss */
#page-commande #produits-production input.quantite-max {
background-color: white;
border: 1px solid #e0e0e0;
text-align: center;
width: 50px;
}
/* line 566, ../sass/screen.scss */
/* line 571, ../sass/screen.scss */
#page-commande #produits-production td label {
font-weight: normal;
}
/* line 572, ../sass/screen.scss */
/* line 577, ../sass/screen.scss */
#page-commande #btn-export-commandes,
#page-commande #btn-commandes-auto {
float: right;
@@ -592,43 +597,43 @@ a:hover, a:focus, a:active {
right: -7px;
padding: 2px 5px;
}
/* line 581, ../sass/screen.scss */
/* line 586, ../sass/screen.scss */
#page-commande #btn-export-commandes,
#page-commande #btn-commandes-auto {
color: white;
margin-left: 10px;
padding: 1px 5px;
}
/* line 588, ../sass/screen.scss */
/* line 593, ../sass/screen.scss */
#page-commande #btn-commandes-auto {
top: -7px;
}
/* line 590, ../sass/screen.scss */
/* line 595, ../sass/screen.scss */
#page-commande #btn-commandes-auto .btn {
padding: 2px 5px;
}
/* line 592, ../sass/screen.scss */
/* line 597, ../sass/screen.scss */
#page-commande #btn-commandes-auto .btn span {
top: 2px;
}
/* line 600, ../sass/screen.scss */
/* line 605, ../sass/screen.scss */
#page-commande #bloc-totaux .table-produits .depasse {
color: #b32815;
}
/* line 604, ../sass/screen.scss */
/* line 609, ../sass/screen.scss */
#page-commande #bloc-totaux .table-produits .total strong span {
font-weight: normal;
font-size: 13px;
}
/* line 613, ../sass/screen.scss */
/* line 618, ../sass/screen.scss */
#page-commande #commandes-points-vente .tab-pane {
padding-top: 20px;
}
/* line 620, ../sass/screen.scss */
/* line 625, ../sass/screen.scss */
#page-commande #commandes-points-vente .recap-pv.no-commande .recettes {
display: none;
}
/* line 624, ../sass/screen.scss */
/* line 629, ../sass/screen.scss */
#page-commande #commandes-points-vente .recap-pv .recettes {
float: right;
color: #BB8757;
@@ -641,11 +646,11 @@ a:hover, a:focus, a:active {
position: relative;
top: -3px;
}
/* line 638, ../sass/screen.scss */
/* line 643, ../sass/screen.scss */
#page-commande #commandes-points-vente .alert.commentaire {
display: none;
}
/* line 642, ../sass/screen.scss */
/* line 647, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes {
margin-top: 10px;
list-style-type: none;
@@ -657,16 +662,16 @@ a:hover, a:focus, a:active {
width: 100%;
overflow-y: scroll;
}
/* line 654, ../sass/screen.scss */
/* line 659, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes.no-commande {
display: none;
}
/* line 658, ../sass/screen.scss */
/* line 663, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li {
padding: 0;
margin: 0;
}
/* line 661, ../sass/screen.scss */
/* line 666, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a {
text-align: left;
-moz-border-radius: 0px;
@@ -676,22 +681,22 @@ a:hover, a:focus, a:active {
padding: 7px;
color: #333;
}
/* line 669, ../sass/screen.scss */
/* line 674, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .montant {
float: right;
color: #BB8757;
font-weight: bold;
}
/* line 674, ../sass/screen.scss */
/* line 679, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .montant.paye {
color: #5cb85c;
color: #519951;
}
/* line 680, ../sass/screen.scss */
/* line 685, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .glyphicon-comment {
color: #BB8757;
}
/* line 684, ../sass/screen.scss */
/* line 689, ../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;
@@ -702,86 +707,86 @@ a:hover, a:focus, a:active {
-webkit-transition: all 0.1s;
transition: all 0.1s;
}
/* line 698, ../sass/screen.scss */
/* line 703, ../sass/screen.scss */
#page-commande #commandes-points-vente .creer-commande,
#page-commande #commandes-points-vente .commandes-auto {
width: 100%;
margin-bottom: 10px;
}
/* line 704, ../sass/screen.scss */
/* line 709, ../sass/screen.scss */
#page-commande #commandes-points-vente .bloc-commande {
padding-top: 20px;
margin-top: 20px;
display: none;
}
/* line 710, ../sass/screen.scss */
/* line 715, ../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 716, ../sass/screen.scss */
/* line 721, ../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 723, ../sass/screen.scss */
/* line 728, ../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 727, ../sass/screen.scss */
/* line 732, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .buttons-save-cancel {
display: none;
}
/* line 731, ../sass/screen.scss */
/* line 736, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .choix-user {
display: none;
}
/* line 734, ../sass/screen.scss */
/* line 739, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .choix-user .form-control {
width: 200px;
display: inline;
}
/* line 742, ../sass/screen.scss */
/* line 747, ../sass/screen.scss */
#page-commande #commandes-points-vente table.table-produits .td-commande {
text-align: center;
}
/* line 745, ../sass/screen.scss */
/* line 750, ../sass/screen.scss */
#page-commande #commandes-points-vente table.table-produits input.form-control {
text-align: center;
}
/* line 751, ../sass/screen.scss */
/* line 756, ../sass/screen.scss */
#page-commande #commandes-points-vente table.table-produits tr.disabled .td-produit {
color: gray;
}
/* line 757, ../sass/screen.scss */
/* line 762, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-produit,
#page-commande #commandes-points-vente .th-produit {
width: 70%;
}
/* line 762, ../sass/screen.scss */
/* line 767, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-commande,
#page-commande #commandes-points-vente .th-commande {
width: 30%;
text-align: center;
}
/* line 768, ../sass/screen.scss */
/* line 773, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-produit {
text-transform: uppercase;
}
/* line 772, ../sass/screen.scss */
/* line 777, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-commande {
font-weight: bold;
}
/* line 776, ../sass/screen.scss */
/* line 781, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-total {
font-size: 18px;
text-align: center;
}
/* line 780, ../sass/screen.scss */
/* line 785, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-total span {
padding: 2px 10px;
background-color: #BB8757;
@@ -791,33 +796,33 @@ a:hover, a:focus, a:active {
-webkit-border-radius: 8px;
border-radius: 8px;
}
/* line 790, ../sass/screen.scss */
/* line 795, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-paiement .buttons-credit {
float: right;
}
/* line 796, ../sass/screen.scss */
/* line 801, ../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 803, ../sass/screen.scss */
/* line 808, ../sass/screen.scss */
#page-commande #commandes-points-vente .panel-commande-automatique .jours .form-group {
float: left;
margin-right: 10px;
}
/* line 812, ../sass/screen.scss */
/* line 817, ../sass/screen.scss */
#page-commande #old-commandes {
display: none;
}
/* line 816, ../sass/screen.scss */
/* line 821, ../sass/screen.scss */
#page-commande .form-commandes-point-vente {
margin-top: 20px;
}
/* line 820, ../sass/screen.scss */
/* line 825, ../sass/screen.scss */
#page-commande .form-commandes-point-vente table {
border-bottom: solid 1px #e0e0e0;
}
/* line 824, ../sass/screen.scss */
/* line 829, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-point-vente {
background-color: #fff8e2;
border-left: solid 3px #BB8757;
@@ -825,76 +830,76 @@ a:hover, a:focus, a:active {
text-align: left;
padding: 10px;
}
/* line 832, ../sass/screen.scss */
/* line 837, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-totaux {
text-align: center;
}
/* line 836, ../sass/screen.scss */
/* line 841, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-left {
border-left: solid 1px #e0e0e0;
}
/* line 840, ../sass/screen.scss */
/* line 845, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-right {
border-right: solid 1px #e0e0e0;
}
/* line 844, ../sass/screen.scss */
/* line 849, ../sass/screen.scss */
#page-commande .form-commandes-point-vente input.quantite {
width: 30px;
background-color: white;
border: solid 1px #e0e0e0;
text-align: center;
}
/* line 852, ../sass/screen.scss */
/* line 857, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .td-produit {
text-align: center;
}
/* line 856, ../sass/screen.scss */
/* line 861, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .submit-pv {
float: right;
}
/* line 860, ../sass/screen.scss */
/* line 865, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .select-user {
background-color: #F9F9F9;
border: solid 1px #e0e0e0;
}
/* line 865, ../sass/screen.scss */
/* line 870, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .date-commande {
font-size: 12px;
}
/* line 869, ../sass/screen.scss */
/* line 874, ../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 877, ../sass/screen.scss */
/* line 882, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.center {
text-align: center;
}
/* line 883, ../sass/screen.scss */
/* line 888, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .depasse {
color: #b32815;
}
/* line 887, ../sass/screen.scss */
/* line 892, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .total strong span {
font-weight: normal;
font-size: 13px;
}
/* line 892, ../sass/screen.scss */
/* line 897, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .vrac {
display: none;
}
/* line 896, ../sass/screen.scss */
/* line 901, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client {
text-align: left;
padding: 3px;
}
/* line 899, ../sass/screen.scss */
/* line 904, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client .date-commande {
color: gray;
}
/* line 906, ../sass/screen.scss */
/* line 911, ../sass/screen.scss */
#page-commande .table-header-rotated {
border-top: 0px;
border-left: 0px;
@@ -902,15 +907,15 @@ a:hover, a:focus, a:active {
width: 100%;
width: auto;
}
/* line 913, ../sass/screen.scss */
/* line 918, ../sass/screen.scss */
#page-commande .table-header-rotated .total strong {
border-bottom: solid 1px gray;
}
/* line 918, ../sass/screen.scss */
/* line 923, ../sass/screen.scss */
#page-commande .table-header-rotated th.row-header {
width: auto;
}
/* line 922, ../sass/screen.scss */
/* line 927, ../sass/screen.scss */
#page-commande .table-header-rotated td {
width: 40px;
border-top: 1px solid #dddddd;
@@ -919,7 +924,7 @@ a:hover, a:focus, a:active {
vertical-align: middle;
text-align: center;
}
/* line 931, ../sass/screen.scss */
/* line 936, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 {
font-weight: normal;
height: 80px;
@@ -933,7 +938,7 @@ a:hover, a:focus, a:active {
line-height: 1;
border: 0px none;
}
/* line 945, ../sass/screen.scss */
/* line 950, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 > div {
background-color: #F5F5F5;
position: relative;
@@ -951,7 +956,7 @@ a:hover, a:focus, a:active {
border-right: 1px solid #dddddd;
border-top: 1px solid #dddddd;
}
/* line 962, ../sass/screen.scss */
/* line 967, ../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);
@@ -968,56 +973,56 @@ a:hover, a:focus, a:active {
/* 80 / cos(45) - 40 cos (45) = 85 where 80 is the height of the cell, 40 the width of the cell and 45 the transform angle*/
text-align: left;
}
/* line 978, ../sass/screen.scss */
/* line 983, ../sass/screen.scss */
#page-commande .table-header-rotated .disabled {
color: gray;
}

/* line 986, ../sass/screen.scss */
/* line 991, ../sass/screen.scss */
#email-masse-form #ids-users {
line-height: 30px;
}
/* line 988, ../sass/screen.scss */
/* line 993, ../sass/screen.scss */
#email-masse-form #ids-users .label {
text-transform: capitalize;
}

/* line 996, ../sass/screen.scss */
/* line 1001, ../sass/screen.scss */
.produit-create #jours-production .form-group, .produit-update #jours-production .form-group {
float: left;
margin-right: 15px;
}
/* line 1000, ../sass/screen.scss */
/* line 1005, ../sass/screen.scss */
.produit-create #jours-production .form-group label, .produit-update #jours-production .form-group label {
font-weight: normal;
}
/* line 1005, ../sass/screen.scss */
/* line 1010, ../sass/screen.scss */
.produit-create .field-produit-id_etablissement, .produit-update .field-produit-id_etablissement {
display: none;
}

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

/* line 1015, ../sass/screen.scss */
/* line 1020, ../sass/screen.scss */
.wrap .produit-index .td-photo {
max-width: 100px;
width: 100px;
}
/* line 1019, ../sass/screen.scss */
/* line 1024, ../sass/screen.scss */
.wrap .produit-index .photo-produit {
max-width: 100px;
}
/* line 1023, ../sass/screen.scss */
/* line 1028, ../sass/screen.scss */
.wrap .produit-index .ui-state-highlight {
height: 75px;
background-color: #F8F1DD;
}

/* communiquer */
/* line 1031, ../sass/screen.scss */
/* line 1036, ../sass/screen.scss */
.communiquer-mode-emploi {
border: solid 1px #e0e0e0;
padding: 10px;
@@ -1027,18 +1032,18 @@ a:hover, a:focus, a:active {
margin-bottom: 30px;
font-family: "myriadpro-regular";
}
/* line 1039, ../sass/screen.scss */
/* line 1044, ../sass/screen.scss */
.communiquer-mode-emploi .header .logo {
float: left;
width: 75px;
padding-right: 20px;
padding-top: 10px;
}
/* line 1045, ../sass/screen.scss */
/* line 1050, ../sass/screen.scss */
.communiquer-mode-emploi .header .logo img {
width: 75px;
}
/* line 1051, ../sass/screen.scss */
/* line 1056, ../sass/screen.scss */
.communiquer-mode-emploi .header h1 {
font-family: "comfortaaregular";
font-size: 40px;
@@ -1046,7 +1051,7 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
font-weight: normal;
}
/* line 1059, ../sass/screen.scss */
/* line 1064, ../sass/screen.scss */
.communiquer-mode-emploi .header h2 {
margin-top: 0px;
font-family: "myriadpro-regular";
@@ -1056,7 +1061,7 @@ a:hover, a:focus, a:active {
left: 2px;
font-weight: normal;
}
/* line 1070, ../sass/screen.scss */
/* line 1075, ../sass/screen.scss */
.communiquer-mode-emploi h3 {
font-family: "comfortaalight";
font-family: "myriadpro-regular";
@@ -1066,45 +1071,45 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
}

/* line 1080, ../sass/screen.scss */
/* line 1085, ../sass/screen.scss */
.communiquer-mode-emploi-encart {
width: 420px;
margin-top: 20px;
}
/* line 1084, ../sass/screen.scss */
/* line 1089, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header .logo {
width: 60px;
margin-right: 20px;
padding-top: 5px;
}
/* line 1089, ../sass/screen.scss */
/* line 1094, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header .logo img {
width: 60px;
}
/* line 1095, ../sass/screen.scss */
/* line 1100, ../sass/screen.scss */
.communiquer-mode-emploi-encart .header h1 {
margin-bottom: 3px;
}
/* line 1104, ../sass/screen.scss */
/* line 1109, ../sass/screen.scss */
.communiquer-mode-emploi-encart h3 {
margin-top: 15px;
margin-bottom: 15px;
}

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

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

/* line 1121, ../sass/screen.scss */
/* line 1126, ../sass/screen.scss */
.communiquer-mode-emploi-pdf {
border: 0px none;
-moz-border-radius: 0px;
@@ -1113,118 +1118,118 @@ a:hover, a:focus, a:active {
margin-bottom: 0px;
padding: 20px 0px 20px 30px;
}
/* line 1129, ../sass/screen.scss */
/* line 1134, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header .logo {
float: left;
width: 55px;
padding-right: 15px;
padding-top: 10px;
}
/* line 1135, ../sass/screen.scss */
/* line 1140, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header .logo img {
width: 55px;
}
/* line 1139, ../sass/screen.scss */
/* line 1144, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header h1 {
font-size: 32px;
}
/* line 1142, ../sass/screen.scss */
/* line 1147, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header h2 {
font-size: 16px;
}
/* line 1147, ../sass/screen.scss */
/* line 1152, ../sass/screen.scss */
.communiquer-mode-emploi-pdf h3 {
font-weight: normal;
}

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

/* commandes auto */
/* line 1162, ../sass/screen.scss */
/* line 1167, ../sass/screen.scss */
.commandeauto-form #bloc-select-user {
padding-left: 0px;
}
/* line 1166, ../sass/screen.scss */
/* line 1171, ../sass/screen.scss */
.commandeauto-form #or-user {
font-size: 20px;
text-align: center;
}
/* line 1169, ../sass/screen.scss */
/* line 1174, ../sass/screen.scss */
.commandeauto-form #or-user span {
position: relative;
top: 24px;
}
/* line 1175, ../sass/screen.scss */
/* line 1180, ../sass/screen.scss */
.commandeauto-form .field-commandeautoform-id_etablissement {
display: none;
}
/* line 1179, ../sass/screen.scss */
/* line 1184, ../sass/screen.scss */
.commandeauto-form .jours .form-group {
float: left;
margin-right: 20px;
}
/* line 1186, ../sass/screen.scss */
/* line 1191, ../sass/screen.scss */
.commandeauto-form .produits .table {
width: 500px;
}
/* line 1189, ../sass/screen.scss */
/* line 1194, ../sass/screen.scss */
.commandeauto-form .produits .quantite {
text-align: center;
}

/* points de vente */
/* line 1198, ../sass/screen.scss */
/* line 1203, ../sass/screen.scss */
.point-vente-form #pointvente-users {
display: none;
height: 500px;
overflow-y: scroll;
}
/* line 1202, ../sass/screen.scss */
/* line 1207, ../sass/screen.scss */
.point-vente-form #pointvente-users label {
font-weight: normal;
display: block;
}
/* line 1206, ../sass/screen.scss */
/* line 1211, ../sass/screen.scss */
.point-vente-form #pointvente-users .commentaire {
display: none;
margin-left: 17px;
width: 200px;
}
/* line 1214, ../sass/screen.scss */
/* line 1219, ../sass/screen.scss */
.point-vente-form #jours-livraison .form-group {
float: left;
margin-right: 15px;
}
/* line 1218, ../sass/screen.scss */
/* line 1223, ../sass/screen.scss */
.point-vente-form #jours-livraison .form-group label {
font-weight: normal;
}

/* utilisateurs */
/* line 1228, ../sass/screen.scss */
/* line 1233, ../sass/screen.scss */
.user-index .input-group {
width: 180px;
}
/* line 1231, ../sass/screen.scss */
/* line 1236, ../sass/screen.scss */
.user-index .input-group .input-credit {
text-align: center;
}
/* line 1236, ../sass/screen.scss */
/* line 1241, ../sass/screen.scss */
.user-index #tabs-points-vente {
margin-bottom: 20px;
}
/* line 1240, ../sass/screen.scss */
/* line 1245, ../sass/screen.scss */
.user-index .btn-liste-emails {
float: right;
position: relative;
top: -8px;
}

/* line 1248, ../sass/screen.scss */
/* line 1253, ../sass/screen.scss */
.user-credit .the-credit {
float: right;
font-weight: bold;
@@ -1240,16 +1245,16 @@ a:hover, a:focus, a:active {
}

/* facturation */
/* line 1263, ../sass/screen.scss */
/* line 1268, ../sass/screen.scss */
#estimation-facture {
padding: 20px;
background-color: #F9F9F9;
}
/* line 1267, ../sass/screen.scss */
/* line 1272, ../sass/screen.scss */
#estimation-facture h2 {
font-family: "myriadpro-it";
}
/* line 1271, ../sass/screen.scss */
/* line 1276, ../sass/screen.scss */
#estimation-facture .montant span {
font-size: 25px;
color: white;
@@ -1261,17 +1266,17 @@ a:hover, a:focus, a:active {
padding-top: 7px;
font-family: "myriadpro-regular";
}
/* line 1282, ../sass/screen.scss */
/* line 1287, ../sass/screen.scss */
#estimation-facture label {
text-transform: uppercase;
font-family: "myriadpro-light";
font-size: 20px;
}
/* line 1287, ../sass/screen.scss */
/* line 1292, ../sass/screen.scss */
#estimation-facture label span {
font-size: 16px;
}
/* line 1292, ../sass/screen.scss */
/* line 1297, ../sass/screen.scss */
#estimation-facture #etablissement-prix_libre {
width: 100px;
height: 60px;
@@ -1280,37 +1285,37 @@ a:hover, a:focus, a:active {
text-align: center;
}

/* line 1302, ../sass/screen.scss */
/* line 1307, ../sass/screen.scss */
.developpement-index ul#tabs-statuts-developpements {
margin-bottom: 30px;
border-bottom: solid 3px #BB8757;
}
/* line 1306, ../sass/screen.scss */
/* line 1311, ../sass/screen.scss */
.developpement-index ul#tabs-statuts-developpements a {
text-transform: uppercase;
}
/* line 1309, ../sass/screen.scss */
/* line 1314, ../sass/screen.scss */
.developpement-index ul#tabs-statuts-developpements .active {
border: 0px none;
background: none;
}
/* line 1312, ../sass/screen.scss */
/* line 1317, ../sass/screen.scss */
.developpement-index ul#tabs-statuts-developpements .active a {
background-color: #BB8757;
color: white;
}
/* line 1320, ../sass/screen.scss */
/* line 1325, ../sass/screen.scss */
.developpement-index #tab-developpements .btn-group-priorite {
width: 100%;
margin-bottom: 5px;
}
/* line 1324, ../sass/screen.scss */
/* line 1329, ../sass/screen.scss */
.developpement-index #tab-developpements .btn-group-priorite .btn-priorite {
display: block;
float: none;
width: 100%;
}
/* line 1331, ../sass/screen.scss */
/* line 1336, ../sass/screen.scss */
.developpement-index #tab-developpements .label-priorite {
display: block;
width: 100%;

+ 5
- 0
backend/web/sass/screen.scss View File

@@ -467,6 +467,11 @@ a {
}
}
.btn-active-week {
display: block ;
margin-top: 10px ;
}
#bloc-production {
.label {

+ 32
- 0
common/models/Production.php View File

@@ -70,5 +70,37 @@ class Production extends \yii\db\ActiveRecord {

return false;
}
public static function initProduction($date) {
$production = null ;
if ($date != '') {
$production = Production::find()
->where(['date' => $date])
->andWhere(['id_etablissement' => Yii::$app->user->identity->id_etablissement])
->one();
if (!$production) {
$production = new Production;
$production->date = $date;
$production->livraison = 1;
$production->id_etablissement = Yii::$app->user->identity->id_etablissement;
$production->save();
}
}

// production_point_vente à définir s'ils ne sont pas initialisés
if ($production) {
$count_productions_point_vente = ProductionPointVente::find()->
where([
'id_production' => $production->id
])
->count();

if (!$count_productions_point_vente) {
ProductionPointVente::setAll($production->id, true);
}
}
return $production ;
}

}

Loading…
Cancel
Save