Browse Source

[Backend] Commandes automatiques (migration, index, début create)

Mise en place de la fonctionnalité de commandes automatiques avec création
des tables, modèles, création du controller, liste des commandes auto et début
du formulaire de création.
prodstable
keun 8 years ago
parent
commit
8bad814c18
14 changed files with 639 additions and 86 deletions
  1. +5
    -0
      backend/controllers/CommandeController.php
  2. +77
    -0
      backend/controllers/CommandeautoController.php
  3. +5
    -3
      backend/views/commande/index.php
  4. +35
    -0
      backend/views/commandeauto/_form.php
  5. +20
    -0
      backend/views/commandeauto/create.php
  6. +86
    -0
      backend/views/commandeauto/index.php
  7. BIN
      backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc
  8. +97
    -81
      backend/web/css/screen.css
  9. +23
    -2
      backend/web/sass/screen.scss
  10. +91
    -0
      common/models/CommandeAuto.php
  11. +65
    -0
      common/models/CommandeAutoForm.php
  12. +55
    -0
      common/models/CommandeAutoProduit.php
  13. +50
    -0
      console/migrations/m161125_075714_commandes_automatiques.php
  14. +30
    -0
      console/migrations/m161125_091622_add_champs_commande_auto.php

+ 5
- 0
backend/controllers/CommandeController.php View File

use common\helpers\CSV; use common\helpers\CSV;
use common\models\User; use common\models\User;
use kartik\mpdf\Pdf; use kartik\mpdf\Pdf;
use common\models\CommandeAutoForm ;


class CommandeController extends BackendController { class CommandeController extends BackendController {


]) ])
->all(); ->all();


// commandes auto
$model_commande_auto = new CommandeAutoForm ;
$datas = [ $datas = [
'produits' => $produits, 'produits' => $produits,
'points_vente' => $points_vente, 'points_vente' => $points_vente,
'poids_vrac' => $poids_vrac, 'poids_vrac' => $poids_vrac,
'ca_potentiel' => $ca_potentiel, 'ca_potentiel' => $ca_potentiel,
'poids_total' => $poids_total, 'poids_total' => $poids_total,
'model_commande_auto' => $model_commande_auto,
]; ];


if ($return_data) { if ($return_data) {

+ 77
- 0
backend/controllers/CommandeautoController.php View File

<?php

namespace backend\controllers;

use Yii;
use common\models\Production;
use yii\filters\AccessControl;
use yii\web\Controller;
use common\models\LoginForm;
use yii\filters\VerbFilter;
use common\models\Commande;
use common\models\CommandeProduit;
use common\models\PointVente;
use common\models\Produit;
use common\models\User;
use common\models\CommandeAutoForm ;
use common\models\ProductionProduit;
use yii\data\ActiveDataProvider;
use common\models\CommandeAuto ;

class CommandeautoController extends BackendController {

var $enableCsrfValidation = false;

public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['@'],
'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER;
}
]
],
],
];
}
public function actionIndex()
{
$dataProvider = new ActiveDataProvider([
'query' => CommandeAuto::find()
->with('user', 'etablissement', 'pointVente','commandeAutoProduit')
->where(['id_etablissement'=>Yii::$app->user->identity->id_etablissement]),
'pagination' => [
'pageSize' => 1000,
],
]);
return $this->render('index',[
'dataProvider' => $dataProvider
]) ;
}
public function actionCreate()
{
$model = new CommandeAutoForm ;
if($model->load(Yii::$app->request->post()) && $model->validate() && $model->save())
{
}
return $this->render('create',[
'model' => $model
]) ;
}
}

+ 5
- 3
backend/views/commande/index.php View File

use common\models\Commande; use common\models\Commande;
use common\models\User ; use common\models\User ;
use yii\helpers\ArrayHelper ; use yii\helpers\ArrayHelper ;
use yii\widgets\ActiveForm;


$this->title = 'Commande'; $this->title = 'Commande';


<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">
Commandes
<?php if (count($commandes)): ?>
Commandes
<?php if (count($commandes)): ?>
<a id="btn-export-commandes" class="btn btn-primary" href="<?php echo Yii::$app->urlManager->createUrl(['commande/report', 'date' => $date, 'id_point_vente' => 0, 'global' => 1]); ?>"><span class="glyphicon glyphicon-download-alt"></span> Exporter</a> <a id="btn-export-commandes" class="btn btn-primary" href="<?php echo Yii::$app->urlManager->createUrl(['commande/report', 'date' => $date, 'id_point_vente' => 0, 'global' => 1]); ?>"><span class="glyphicon glyphicon-download-alt"></span> Exporter</a>
<?php endif; ?>
<?php endif; ?>
<a id="btn-commande-auto" class="btn btn-default" href="<?php echo Yii::$app->urlManager->createUrl(['commandeauto/index']); ?>"><span class="glyphicon glyphicon-repeat"></span> Commandes automatiques</a>
</h3> </h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">

+ 35
- 0
backend/views/commandeauto/_form.php View File

<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper ;
use common\models\User ;
use common\models\PointVente ;

?>


<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id_user')->dropDownList( ArrayHelper::map(User::find()->joinWith('userEtablissement')->where('user_etablissement.id_etablissement = '.Yii::$app->user->identity->id_etablissement)->all(), 'id', function($model, $defaultValue) {
return $model['nom'].' '.$model['prenom'];
}), ['prompt' => '--','class' => 'form-control user-id']) ?>
<?= $form->field($model, 'id_etablissement')->hiddenInput() ?>
<?= $form->field($model, 'id_point_vente')->dropDownList( ArrayHelper::map(PointVente::find()->where('id_etablissement = '.Yii::$app->user->identity->id_etablissement)->all(), 'id', function($model, $defaultValue) {
return $model['nom'];
}), ['prompt' => '--','class' => 'form-control user-id']) ?>
<?= $form->field($model, 'date_debut') ?>
<?= $form->field($model, 'date_fin') ?>
<div class="jours">
<?= $form->field($model, 'lundi')->checkbox() ?>
<?= $form->field($model, 'mardi')->checkbox() ?>
<?= $form->field($model, 'mercredi')->checkbox() ?>
<?= $form->field($model, 'jeudi')->checkbox() ?>
<?= $form->field($model, 'vendredi')->checkbox() ?>
<?= $form->field($model, 'samedi')->checkbox() ?>
<?= $form->field($model, 'dimanche')->checkbox() ?>
</div>
<div class="clr"></div>
<?= $form->field($model, 'periodicite_semaine')->dropDownList([1=>1, 2=>2, 3=>3, 4=>4]) ?>

<?= Html::submitButton('Enregistrer' , ['class' => 'btn btn-primary']) ?>
<?php ActiveForm::end(); ?>

+ 20
- 0
backend/views/commandeauto/create.php View File

<?php

use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model app\models\Produit */

$this->title = 'Ajouter une commande automatique';
$this->params['breadcrumbs'][] = ['label' => 'Commandes automatiques', 'url' => ['index']];
$this->params['breadcrumbs'][] = 'Ajouter';
?>
<div class="produit-create">

<h1><?= Html::encode($this->title) ?></h1>

<?= $this->render('_form', [
'model' => $model,
]) ?>

</div>

+ 86
- 0
backend/views/commandeauto/index.php View File

<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Commandes automatiques';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="commande-auto-index">

<h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?></h1>

<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'id_user',
'format' => 'raw',
'value' => function($model) {
return Html::encode($model->user->nom.' '.$model->user->prenom) ;
}
],
[
'attribute' => 'id_point_vente',
'format' => 'raw',
'value' => function($model) {
return Html::encode($model->pointVente->nom) ;
}
],
[
'attribute' => 'produits',
'format' => 'raw',
'value' => function($model) {
$html = '' ;
foreach($model->commandeAutoProduit as $commande_produit)
{
$html .= $commande_produit->quantite . ' x '.Html::encode($commande_produit->produit->nom).'<br />' ;
}
return $html ;
}
],
[
'attribute' => 'date_debut',
'value' => function($model) {
return date('d/m/Y',strtotime($model->date_debut)) ;
}
],
[
'attribute' => 'date_fin',
'value' => function($model) {
return date('d/m/Y',strtotime($model->date_fin)) ;
}
],
[
'attribute' => 'periodicite_semaine',
'value' => function($model) {
if($model->periodicite_semaine == 1)
return 'Toutes les semaines' ;
else
return 'Toutes les '.$model->periodicite_semaine.' semaines' ;
}
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{update} {delete}',
'headerOptions' => ['class' => 'actions'],
'buttons' => [
'update' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-pencil"></span> Modifier', $url, [
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default'
]);
},
'delete' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-trash"></span> Suprimer', $url, [
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default'
]);
}
],
],
],
]); ?>
</div>

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


+ 97
- 81
backend/web/css/screen.css View File

font-weight: normal; font-weight: normal;
} }
/* line 317, ../sass/screen.scss */ /* line 317, ../sass/screen.scss */
#page-commande #btn-export-commandes {
#page-commande #btn-export-commandes,
#page-commande #btn-commande-auto {
float: right; float: right;
color: white;
position: relative; position: relative;
top: -5px; top: -5px;
right: -7px; right: -7px;
padding: 2px 5px; padding: 2px 5px;
} }
/* line 328, ../sass/screen.scss */
/* line 326, ../sass/screen.scss */
#page-commande #btn-export-commandes {
color: white;
margin-left: 10px;
padding: 1px 5px;
}
/* line 334, ../sass/screen.scss */
#page-commande #bloc-totaux .table-produits .depasse { #page-commande #bloc-totaux .table-produits .depasse {
color: #b32815; color: #b32815;
} }
/* line 332, ../sass/screen.scss */
/* line 338, ../sass/screen.scss */
#page-commande #bloc-totaux .table-produits .total strong span { #page-commande #bloc-totaux .table-produits .total strong span {
font-weight: normal; font-weight: normal;
font-size: 13px; font-size: 13px;
} }
/* line 341, ../sass/screen.scss */
/* line 347, ../sass/screen.scss */
#page-commande #commandes-points-vente .tab-pane { #page-commande #commandes-points-vente .tab-pane {
padding-top: 20px; padding-top: 20px;
} }
/* line 348, ../sass/screen.scss */
/* line 354, ../sass/screen.scss */
#page-commande #commandes-points-vente .recap-pv.no-commande .recettes { #page-commande #commandes-points-vente .recap-pv.no-commande .recettes {
display: none; display: none;
} }
/* line 352, ../sass/screen.scss */
/* line 358, ../sass/screen.scss */
#page-commande #commandes-points-vente .recap-pv .recettes { #page-commande #commandes-points-vente .recap-pv .recettes {
float: right; float: right;
color: #BB8757; color: #BB8757;
position: relative; position: relative;
top: -3px; top: -3px;
} }
/* line 366, ../sass/screen.scss */
/* line 372, ../sass/screen.scss */
#page-commande #commandes-points-vente .alert.commentaire { #page-commande #commandes-points-vente .alert.commentaire {
display: none; display: none;
} }
/* line 370, ../sass/screen.scss */
/* line 376, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes { #page-commande #commandes-points-vente ul.liste-commandes {
margin-top: 10px; margin-top: 10px;
list-style-type: none; list-style-type: none;
width: 100%; width: 100%;
overflow-y: scroll; overflow-y: scroll;
} }
/* line 382, ../sass/screen.scss */
/* line 388, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li { #page-commande #commandes-points-vente ul.liste-commandes li {
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
/* line 385, ../sass/screen.scss */
/* line 391, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a { #page-commande #commandes-points-vente ul.liste-commandes li a {
text-align: left; text-align: left;
-moz-border-radius: 0px; -moz-border-radius: 0px;
padding: 7px; padding: 7px;
color: #333; color: #333;
} }
/* line 393, ../sass/screen.scss */
/* line 399, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .montant { #page-commande #commandes-points-vente ul.liste-commandes li a .montant {
float: right; float: right;
color: #BB8757; color: #BB8757;
font-weight: bold; font-weight: bold;
} }
/* line 399, ../sass/screen.scss */
/* line 405, ../sass/screen.scss */
#page-commande #commandes-points-vente ul.liste-commandes li a .glyphicon-comment { #page-commande #commandes-points-vente ul.liste-commandes li a .glyphicon-comment {
color: #BB8757; color: #BB8757;
} }
/* line 403, ../sass/screen.scss */
/* line 409, ../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 { #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; text-decoration: none;
background-color: #FCF8E3; background-color: #FCF8E3;
-webkit-transition: all 0.1s; -webkit-transition: all 0.1s;
transition: all 0.1s; transition: all 0.1s;
} }
/* line 417, ../sass/screen.scss */
/* line 423, ../sass/screen.scss */
#page-commande #commandes-points-vente .creer-commande { #page-commande #commandes-points-vente .creer-commande {
width: 100%; width: 100%;
} }
/* line 421, ../sass/screen.scss */
/* line 427, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user { #page-commande #commandes-points-vente .title-user {
display: none; display: none;
font-size: 19px; font-size: 19px;
margin-top: 0px; margin-top: 0px;
} }
/* line 426, ../sass/screen.scss */
/* line 432, ../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-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 { #page-commande #commandes-points-vente .title-user .btn-cancel, #page-commande #commandes-points-vente .title-user .btn-save {
float: right; float: right;
position: relative; position: relative;
top: -6px; top: -6px;
} }
/* line 433, ../sass/screen.scss */
/* line 439, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .btn-edit, #page-commande #commandes-points-vente .title-user .btn-cancel { #page-commande #commandes-points-vente .title-user .btn-edit, #page-commande #commandes-points-vente .title-user .btn-cancel {
margin-right: 10px; margin-right: 10px;
} }
/* line 437, ../sass/screen.scss */
/* line 443, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .buttons-save-cancel { #page-commande #commandes-points-vente .title-user .buttons-save-cancel {
display: none; display: none;
} }
/* line 441, ../sass/screen.scss */
/* line 447, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .choix-user { #page-commande #commandes-points-vente .title-user .choix-user {
display: none; display: none;
} }
/* line 444, ../sass/screen.scss */
/* line 450, ../sass/screen.scss */
#page-commande #commandes-points-vente .title-user .choix-user .form-control { #page-commande #commandes-points-vente .title-user .choix-user .form-control {
width: 200px; width: 200px;
display: inline; display: inline;
} }
/* line 452, ../sass/screen.scss */
/* line 458, ../sass/screen.scss */
#page-commande #commandes-points-vente table.table-produits .td-commande { #page-commande #commandes-points-vente table.table-produits .td-commande {
text-align: center; text-align: center;
} }
/* line 455, ../sass/screen.scss */
/* line 461, ../sass/screen.scss */
#page-commande #commandes-points-vente table.table-produits input.form-control { #page-commande #commandes-points-vente table.table-produits input.form-control {
text-align: center; text-align: center;
} }
/* line 461, ../sass/screen.scss */
/* line 467, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-produit, #page-commande #commandes-points-vente .td-produit,
#page-commande #commandes-points-vente .th-produit { #page-commande #commandes-points-vente .th-produit {
width: 70%; width: 70%;
} }
/* line 466, ../sass/screen.scss */
/* line 472, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-commande, #page-commande #commandes-points-vente .td-commande,
#page-commande #commandes-points-vente .th-commande { #page-commande #commandes-points-vente .th-commande {
width: 30%; width: 30%;
text-align: center; text-align: center;
} }
/* line 472, ../sass/screen.scss */
/* line 478, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-produit { #page-commande #commandes-points-vente .td-produit {
text-transform: uppercase; text-transform: uppercase;
} }
/* line 476, ../sass/screen.scss */
/* line 482, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-commande { #page-commande #commandes-points-vente .td-commande {
font-weight: bold; font-weight: bold;
} }
/* line 480, ../sass/screen.scss */
/* line 486, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-total { #page-commande #commandes-points-vente .td-total {
font-size: 20px; font-size: 20px;
text-align: center; text-align: center;
} }
/* line 484, ../sass/screen.scss */
/* line 490, ../sass/screen.scss */
#page-commande #commandes-points-vente .td-total span { #page-commande #commandes-points-vente .td-total span {
padding: 5px 10px; padding: 5px 10px;
background-color: #BB8757; background-color: #BB8757;
-webkit-border-radius: 15px; -webkit-border-radius: 15px;
border-radius: 15px; border-radius: 15px;
} }
/* line 495, ../sass/screen.scss */
/* line 500, ../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 507, ../sass/screen.scss */
#page-commande #commandes-points-vente .panel-commande-automatique .jours .form-group {
float: left;
margin-right: 10px;
}
/* line 516, ../sass/screen.scss */
#page-commande #old-commandes { #page-commande #old-commandes {
display: none; display: none;
} }
/* line 499, ../sass/screen.scss */
/* line 520, ../sass/screen.scss */
#page-commande .form-commandes-point-vente { #page-commande .form-commandes-point-vente {
margin-top: 20px; margin-top: 20px;
} }
/* line 503, ../sass/screen.scss */
/* line 524, ../sass/screen.scss */
#page-commande .form-commandes-point-vente table { #page-commande .form-commandes-point-vente table {
border-bottom: solid 1px #e0e0e0; border-bottom: solid 1px #e0e0e0;
} }
/* line 507, ../sass/screen.scss */
/* line 528, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-point-vente { #page-commande .form-commandes-point-vente .title-point-vente {
background-color: #fff8e2; background-color: #fff8e2;
border-left: solid 3px #BB8757; border-left: solid 3px #BB8757;
text-align: left; text-align: left;
padding: 10px; padding: 10px;
} }
/* line 515, ../sass/screen.scss */
/* line 536, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .title-totaux { #page-commande .form-commandes-point-vente .title-totaux {
text-align: center; text-align: center;
} }
/* line 519, ../sass/screen.scss */
/* line 540, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-left { #page-commande .form-commandes-point-vente .border-left {
border-left: solid 1px #e0e0e0; border-left: solid 1px #e0e0e0;
} }
/* line 523, ../sass/screen.scss */
/* line 544, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .border-right { #page-commande .form-commandes-point-vente .border-right {
border-right: solid 1px #e0e0e0; border-right: solid 1px #e0e0e0;
} }
/* line 527, ../sass/screen.scss */
/* line 548, ../sass/screen.scss */
#page-commande .form-commandes-point-vente input.quantite { #page-commande .form-commandes-point-vente input.quantite {
width: 30px; width: 30px;
background-color: white; background-color: white;
border: solid 1px #e0e0e0; border: solid 1px #e0e0e0;
text-align: center; text-align: center;
} }
/* line 535, ../sass/screen.scss */
/* line 556, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .td-produit { #page-commande .form-commandes-point-vente .td-produit {
text-align: center; text-align: center;
} }
/* line 539, ../sass/screen.scss */
/* line 560, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .submit-pv { #page-commande .form-commandes-point-vente .submit-pv {
float: right; float: right;
} }
/* line 543, ../sass/screen.scss */
/* line 564, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .select-user { #page-commande .form-commandes-point-vente .select-user {
background-color: #F9F9F9; background-color: #F9F9F9;
border: solid 1px #e0e0e0; border: solid 1px #e0e0e0;
} }
/* line 548, ../sass/screen.scss */
/* line 569, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .date-commande { #page-commande .form-commandes-point-vente .date-commande {
font-size: 12px; font-size: 12px;
} }
/* line 552, ../sass/screen.scss */
/* line 573, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .datepicker, #page-commande .form-commandes-point-vente .text { #page-commande .form-commandes-point-vente .datepicker, #page-commande .form-commandes-point-vente .text {
background-color: white; background-color: white;
border: solid 1px #e0e0e0; border: solid 1px #e0e0e0;
margin-top: 3px; margin-top: 3px;
width: 100px; width: 100px;
} }
/* line 560, ../sass/screen.scss */
/* line 581, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.center { #page-commande .form-commandes-point-vente td.center {
text-align: center; text-align: center;
} }
/* line 566, ../sass/screen.scss */
/* line 587, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .depasse { #page-commande .form-commandes-point-vente .depasse {
color: #b32815; color: #b32815;
} }
/* line 570, ../sass/screen.scss */
/* line 591, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .total strong span { #page-commande .form-commandes-point-vente .total strong span {
font-weight: normal; font-weight: normal;
font-size: 13px; font-size: 13px;
} }
/* line 575, ../sass/screen.scss */
/* line 596, ../sass/screen.scss */
#page-commande .form-commandes-point-vente .vrac { #page-commande .form-commandes-point-vente .vrac {
display: none; display: none;
} }
/* line 579, ../sass/screen.scss */
/* line 600, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client { #page-commande .form-commandes-point-vente td.client {
text-align: left; text-align: left;
padding: 3px; padding: 3px;
} }
/* line 582, ../sass/screen.scss */
/* line 603, ../sass/screen.scss */
#page-commande .form-commandes-point-vente td.client .date-commande { #page-commande .form-commandes-point-vente td.client .date-commande {
color: gray; color: gray;
} }
/* line 593, ../sass/screen.scss */
/* line 614, ../sass/screen.scss */
#page-commande .table-header-rotated td { #page-commande .table-header-rotated td {
width: 20px; width: 20px;
padding: 0px; padding: 0px;
vertical-align: middle; vertical-align: middle;
text-align: center; text-align: center;
} }
/* line 603, ../sass/screen.scss */
/* line 624, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 { #page-commande .table-header-rotated th.rotate-45 {
height: 80px; height: 80px;
width: 20px; width: 20px;
font-size: 12px; font-size: 12px;
line-height: 0.8; line-height: 0.8;
} }
/* line 615, ../sass/screen.scss */
/* line 636, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 > div { #page-commande .table-header-rotated th.rotate-45 > div {
position: relative; position: relative;
top: 0px; top: 0px;
border-right: 1px solid #dddddd; border-right: 1px solid #dddddd;
border-top: 1px solid #dddddd; border-top: 1px solid #dddddd;
} }
/* line 631, ../sass/screen.scss */
/* line 652, ../sass/screen.scss */
#page-commande .table-header-rotated th.rotate-45 span { #page-commande .table-header-rotated th.rotate-45 span {
-ms-transform: skew(45deg, 0deg) rotate(315deg); -ms-transform: skew(45deg, 0deg) rotate(315deg);
-moz-transform: skew(45deg, 0deg) rotate(315deg); -moz-transform: skew(45deg, 0deg) rotate(315deg);
/*whether to display in one line or not*/ /*whether to display in one line or not*/
} }


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


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


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


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


/* communiquer */ /* communiquer */
/* line 701, ../sass/screen.scss */
/* line 722, ../sass/screen.scss */
.communiquer-mode-emploi { .communiquer-mode-emploi {
border: solid 1px #e0e0e0; border: solid 1px #e0e0e0;
padding: 10px; padding: 10px;
margin-bottom: 30px; margin-bottom: 30px;
font-family: "myriadpro-regular"; font-family: "myriadpro-regular";
} }
/* line 709, ../sass/screen.scss */
/* line 730, ../sass/screen.scss */
.communiquer-mode-emploi .header .logo { .communiquer-mode-emploi .header .logo {
float: left; float: left;
width: 75px; width: 75px;
padding-right: 20px; padding-right: 20px;
padding-top: 10px; padding-top: 10px;
} }
/* line 715, ../sass/screen.scss */
/* line 736, ../sass/screen.scss */
.communiquer-mode-emploi .header .logo img { .communiquer-mode-emploi .header .logo img {
width: 75px; width: 75px;
} }
/* line 721, ../sass/screen.scss */
/* line 742, ../sass/screen.scss */
.communiquer-mode-emploi .header h1 { .communiquer-mode-emploi .header h1 {
font-family: "comfortaaregular"; font-family: "comfortaaregular";
font-size: 40px; font-size: 40px;
margin-bottom: 0px; margin-bottom: 0px;
font-weight: normal; font-weight: normal;
} }
/* line 729, ../sass/screen.scss */
/* line 750, ../sass/screen.scss */
.communiquer-mode-emploi .header h2 { .communiquer-mode-emploi .header h2 {
margin-top: 0px; margin-top: 0px;
font-family: "myriadpro-regular"; font-family: "myriadpro-regular";
left: 2px; left: 2px;
font-weight: normal; font-weight: normal;
} }
/* line 740, ../sass/screen.scss */
/* line 761, ../sass/screen.scss */
.communiquer-mode-emploi h3 { .communiquer-mode-emploi h3 {
font-family: "comfortaalight"; font-family: "comfortaalight";
font-family: "myriadpro-regular"; font-family: "myriadpro-regular";
margin-bottom: 0px; margin-bottom: 0px;
} }


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


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


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


/* line 791, ../sass/screen.scss */
/* line 812, ../sass/screen.scss */
.communiquer-mode-emploi-pdf { .communiquer-mode-emploi-pdf {
border: 0px none; border: 0px none;
-moz-border-radius: 0px; -moz-border-radius: 0px;
margin-bottom: 0px; margin-bottom: 0px;
padding: 20px 0px 20px 30px; padding: 20px 0px 20px 30px;
} }
/* line 799, ../sass/screen.scss */
/* line 820, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header .logo { .communiquer-mode-emploi-pdf .header .logo {
float: left; float: left;
width: 55px; width: 55px;
padding-right: 15px; padding-right: 15px;
padding-top: 10px; padding-top: 10px;
} }
/* line 805, ../sass/screen.scss */
/* line 826, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header .logo img { .communiquer-mode-emploi-pdf .header .logo img {
width: 55px; width: 55px;
} }
/* line 809, ../sass/screen.scss */
/* line 830, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header h1 { .communiquer-mode-emploi-pdf .header h1 {
font-size: 32px; font-size: 32px;
} }
/* line 812, ../sass/screen.scss */
/* line 833, ../sass/screen.scss */
.communiquer-mode-emploi-pdf .header h2 { .communiquer-mode-emploi-pdf .header h2 {
font-size: 16px; font-size: 16px;
} }
/* line 817, ../sass/screen.scss */
/* line 838, ../sass/screen.scss */
.communiquer-mode-emploi-pdf h3 { .communiquer-mode-emploi-pdf h3 {
font-weight: normal; font-weight: normal;
} }


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

+ 23
- 2
backend/web/sass/screen.scss View File

} }
} }
#btn-export-commandes {
#btn-export-commandes,
#btn-commande-auto {
float: right ; float: right ;
color: white ;
position: relative; position: relative;
top: -5px ; top: -5px ;
right: -7px ; right: -7px ;
padding: 2px 5px ; padding: 2px 5px ;
} }
#btn-export-commandes {
color: white ;
margin-left: 10px ;
padding: 1px 5px ;
}
#bloc-totaux { #bloc-totaux {
.table-produits { .table-produits {
.depasse { .depasse {
} }
} }
.panel-commande-automatique {
.field-commandeautoform-id_user,
.field-commandeautoform-id_etablissement
{
display: none ;
}
.jours {
.form-group {
float: left ;
margin-right: 10px ;
}
}
}
} }
#old-commandes { #old-commandes {

+ 91
- 0
common/models/CommandeAuto.php View File

<?php

namespace common\models;

use Yii;

use common\models\Etablissement ;
use common\models\PointVente ;

/**
* This is the model class for table "commande_auto".
*
* @property integer $id
* @property integer $id_user
* @property integer $id_etablissement
* @property string $date_debut
* @property string $date_fin
* @property integer $lundi
* @property integer $mardi
* @property integer $mercredi
* @property integer $jeudi
* @property integer $vendredi
* @property integer $samedi
* @property integer $dimanche
* @property integer $periodicite_semaine
*/
class CommandeAuto extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'commande_auto';
}

/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_user', 'id_etablissement', 'id_point_vente'], 'required'],
[['id_user', 'id_etablissement', 'id_point_vente', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche', 'periodicite_semaine'], 'integer'],
[['date_debut', 'date_fin'], 'safe'],
];
}

/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'id_user' => 'Utilisateur',
'id_etablissement' => 'Etablissement',
'id_point_vente' => 'Point de vente',
'date_debut' => 'Date de début',
'date_fin' => 'Date de fin',
'lundi' => 'Lundi',
'mardi' => 'Mardi',
'mercredi' => 'Mercredi',
'jeudi' => 'Jeudi',
'vendredi' => 'Vendredi',
'samedi' => 'Samedi',
'dimanche' => 'Dimanche',
'periodicite_semaine' => 'Périodicité',
];
}
public function getUser()
{
return $this->hasOne(User::className(), ['id'=>'id_user']) ;
}
public function getEtablissement()
{
return $this->hasOne(Etablissement::className(), ['id'=>'id_etablissement']) ;
}
public function getPointVente()
{
return $this->hasOne(PointVente::className(), ['id'=>'id_point_vente']) ;
}
public function getCommandeAutoProduit()
{
return $this->hasMany(CommandeAutoProduit::className(), ['id_commande_auto'=>'id'])->with('produit') ;
}
}

+ 65
- 0
common/models/CommandeAutoForm.php View File

<?php
namespace common\models;

use Yii;
use yii\base\Model;

/**
* Login form
*/
class CommandeAutoForm extends Model
{
public $id ;
public $id_user ;
public $id_etablissement ;
public $id_point_vente ;
public $date_debut;
public $date_fin ;
public $lundi ;
public $mardi ;
public $mercredi ;
public $jeudi ;
public $vendredi ;
public $samedi ;
public $dimanche ;
public $periodicite_semaine ;
public $produits ;
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_user', 'id_etablissement', 'periodicite_semaine'], 'integer'],
[['date_debut', 'date_fin'], 'date'],
[['lundi','mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche'], 'boolean'],
[['id_user', 'id_etablissement'],'required', 'message' => 'Champs obligatoire']
];
}
public function attributeLabels()
{
return [
'id' => 'ID',
'id_user' => 'Utilisateur',
'id_etablissement' => 'ID Etablissement',
'id_point_vente' => 'Point de vente',
'date_debut' => 'Date de début',
'date_fin' => 'Date de fin',
'lundi' => 'Lundi',
'mardi' => 'Mardi',
'mercredi' => 'Mercredi',
'jeudi' => 'Jeudi',
'vendredi' => 'Vendredi',
'samedi' => 'Samedi',
'dimanche' => 'Dimanche',
'periodicite_semaine' => 'Périodicité (semaines)',
];
}
public function save()
{
}
}

+ 55
- 0
common/models/CommandeAutoProduit.php View File

<?php

namespace common\models;

use Yii;
use common\models\Produit ;

/**
* This is the model class for table "commande_auto_produit".
*
* @property integer $id
* @property integer $id_commande_auto
* @property integer $id_produit
* @property double $quantite
*/
class CommandeAutoProduit extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'commande_auto_produit';
}

/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_commande_auto', 'id_produit'], 'required'],
[['id_commande_auto', 'id_produit'], 'integer'],
[['quantite'], 'number'],
];
}

/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'id_commande_auto' => 'Id Commande Auto',
'id_produit' => 'Id Produit',
'quantite' => 'Quantite',
];
}
public function getProduit()
{
return $this->hasOne(Produit::className(), ['id'=>'id_produit']) ;
}
}

+ 50
- 0
console/migrations/m161125_075714_commandes_automatiques.php View File

<?php

use yii\db\Migration;
use yii\db\Schema;

class m161125_075714_commandes_automatiques extends Migration
{
public function up()
{
$this->createTable('commande_auto', [
'id' => 'pk',
'id_user' => Schema::TYPE_INTEGER . ' NOT NULL',
'id_etablissement' => Schema::TYPE_INTEGER. ' NOT NULL',
'date_debut' => Schema::TYPE_DATE,
'date_fin' => Schema::TYPE_DATE,
'lundi' => Schema::TYPE_BOOLEAN,
'mardi' => Schema::TYPE_BOOLEAN,
'mercredi' => Schema::TYPE_BOOLEAN,
'jeudi' => Schema::TYPE_BOOLEAN,
'vendredi' => Schema::TYPE_BOOLEAN,
'samedi' => Schema::TYPE_BOOLEAN,
'dimanche' => Schema::TYPE_BOOLEAN,
'periodicite_semaine' => Schema::TYPE_INTEGER,
]);
$this->createTable('commande_auto_produit', [
'id' => 'pk',
'id_commande_auto' => Schema::TYPE_INTEGER . ' NOT NULL',
'id_produit' => Schema::TYPE_INTEGER . ' NOT NULL',
'quantite' => Schema::TYPE_FLOAT,
]);
}

public function down()
{
$this->dropTable('commande_auto') ;
$this->dropTable('commande_auto_produit') ;
}

/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}

public function safeDown()
{
}
*/
}

+ 30
- 0
console/migrations/m161125_091622_add_champs_commande_auto.php View File

<?php

use yii\db\Migration;
use yii\db\Schema;

class m161125_091622_add_champs_commande_auto extends Migration
{
public function up()
{
$this->addColumn('commande_auto', 'id_point_vente', Schema::TYPE_INTEGER.' NOT NULL') ;
$this->addColumn('commande', 'type', Schema::TYPE_STRING) ;
}

public function down()
{
$this->dropColumn('commande_auto', 'id_point_vente') ;
$this->dropColumn('commande', 'type') ;
}

/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}

public function safeDown()
{
}
*/
}

Loading…
Cancel
Save