Browse Source

[backend] Bouton permettant d'importer les commandes issues des abonnements dans la page gérant les distribution

refactoring
Guillaume Bourgeois 5 years ago
parent
commit
39e3460dfa
6 changed files with 66 additions and 41 deletions
  1. +14
    -0
      backend/controllers/DistributionController.php
  2. +0
    -11
      backend/controllers/OrderController.php
  3. +1
    -0
      backend/views/distribution/index.php
  4. +36
    -30
      backend/web/css/screen.css
  5. +9
    -0
      backend/web/js/vuejs/distribution-index.js
  6. +6
    -0
      backend/web/sass/distribution/_index.scss

+ 14
- 0
backend/controllers/DistributionController.php View File

@@ -504,6 +504,8 @@ class DistributionController extends BackendController
*/
public function actionAjaxProcessActiveWeekDistribution($date, $active)
{
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
$week = sprintf('%02d',date('W',strtotime($date)));
$start = strtotime(date('Y',strtotime($date)).'W'.$week);
$dateMonday = date('Y-m-d',strtotime('Monday',$start)) ;
@@ -559,4 +561,16 @@ class DistributionController extends BackendController
return ['success'] ;
}
/**
* Ajoute les commandes récurrentes pour une date donnée.
*
* @param string $date
*/
public function actionAjaxProcessAddSubscriptions($date)
{
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
Subscription::addAll($date, true);
return ['success'] ;
}
}

+ 0
- 11
backend/controllers/OrderController.php View File

@@ -667,17 +667,6 @@ class OrderController extends BackendController
];
}
/**
* Ajoute les commandes récurrentes pour une date donnée.
*
* @param string $date
*/
public function actionAddSubscriptions($date)
{
Subscription::addAll($date, true);
$this->redirect(['index', 'date' => $date]);
}

/**
* Change l'état d'un jour de production (activé, désactivé).
*

+ 1
- 0
backend/views/distribution/index.php View File

@@ -207,6 +207,7 @@ $this->setPageTitle('Distributions') ;
<h3 class="panel-title">Commandes <label class="label label-success" v-if="orders.length">{{ orders.length }}</label><label class="label label-danger" v-else>0</label></h3>
</div>
<div class="panel-body">
<button id="btn-add-subscriptions" @click="addSubscriptions" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-plus"></span> Importer les abonnements</button>
<button id="btn-add-order" @click="showModalFormOrderCreate = true" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-plus"></span> Ajouter une commande</button>
<order-form
v-if="showModalFormOrderCreate"

+ 36
- 30
backend/web/css/screen.css View File

@@ -1796,22 +1796,28 @@ termes.
right: 10px;
}
/* line 193, ../sass/distribution/_index.scss */
.distribution-index #orders #btn-add-subscriptions {
position: absolute;
top: 9px;
right: 180px;
}
/* line 199, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale {
margin-bottom: 10px;
}
/* line 196, ../sass/distribution/_index.scss */
/* line 202, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale {
margin: 0px;
padding: 0px;
list-style-type: none;
}
/* line 201, ../sass/distribution/_index.scss */
/* line 207, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li {
float: left;
margin-right: 10px;
margin-bottom: 10px;
}
/* line 207, ../sass/distribution/_index.scss */
/* line 213, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li a .label {
background-color: white;
border: solid 1px #e0e0e0;
@@ -1819,84 +1825,84 @@ termes.
-webkit-border-radius: 10px;
border-radius: 10px;
}
/* line 220, ../sass/distribution/_index.scss */
/* line 226, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions {
text-align: right;
width: 230px;
}
/* line 224, ../sass/distribution/_index.scss */
/* line 230, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions .modal-form-order,
.distribution-index #orders table td.column-actions .modal-payment {
text-align: left;
}
/* line 229, ../sass/distribution/_index.scss */
/* line 235, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions .add-subscription {
position: relative;
}
/* line 231, ../sass/distribution/_index.scss */
/* line 237, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions .add-subscription .glyphicon-plus {
position: absolute;
top: 4px;
right: 4px;
font-size: 7px;
}
/* line 240, ../sass/distribution/_index.scss */
/* line 246, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-state-payment {
width: 120px;
}
/* line 245, ../sass/distribution/_index.scss */
/* line 251, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-payment div.btn-group {
width: 125px;
}
/* line 251, ../sass/distribution/_index.scss */
/* line 257, ../sass/distribution/_index.scss */
.distribution-index #orders table tr.view ul {
list-style-type: none;
margin-left: 0px;
padding-left: 15px;
}
/* line 260, ../sass/distribution/_index.scss */
/* line 266, ../sass/distribution/_index.scss */
.distribution-index #orders table tr.view .comment {
margin-top: 20px;
}
/* line 271, ../sass/distribution/_index.scss */
/* line 277, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products .product-ordered td {
background-color: #e9e9e9;
}
/* line 275, ../sass/distribution/_index.scss */
/* line 281, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products .product-ordered input {
font-size: 16px;
font-weight: bold;
}
/* line 281, ../sass/distribution/_index.scss */
/* line 287, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity {
width: 150px;
}
/* line 284, ../sass/distribution/_index.scss */
/* line 290, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity input {
text-align: center;
color: gray;
}
/* line 290, ../sass/distribution/_index.scss */
/* line 296, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining {
text-align: right;
}
/* line 296, ../sass/distribution/_index.scss */
/* line 302, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .actions-form button {
margin-left: 15px;
}
/* line 304, ../sass/distribution/_index.scss */
/* line 310, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon {
width: 50px;
}
/* line 306, ../sass/distribution/_index.scss */
/* line 312, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon i {
font-size: 30px;
}
/* line 310, ../sass/distribution/_index.scss */
/* line 316, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-content {
margin-left: 50px;
}
/* line 316, ../sass/distribution/_index.scss */
/* line 322, ../sass/distribution/_index.scss */
.distribution-index .modal-mask {
position: fixed;
z-index: 9998;
@@ -1908,12 +1914,12 @@ termes.
display: table;
transition: opacity .3s ease;
}
/* line 328, ../sass/distribution/_index.scss */
/* line 334, ../sass/distribution/_index.scss */
.distribution-index .modal-wrapper {
display: table-cell;
vertical-align: middle;
}
/* line 333, ../sass/distribution/_index.scss */
/* line 339, ../sass/distribution/_index.scss */
.distribution-index .modal-container {
width: 70%;
margin: 0px auto;
@@ -1924,37 +1930,37 @@ termes.
transition: all .3s ease;
font-family: Helvetica, Arial, sans-serif;
}
/* line 344, ../sass/distribution/_index.scss */
/* line 350, ../sass/distribution/_index.scss */
.distribution-index .modal-header {
padding-bottom: 0px;
}
/* line 346, ../sass/distribution/_index.scss */
/* line 352, ../sass/distribution/_index.scss */
.distribution-index .modal-header h3 {
margin-top: 0;
color: #333;
text-transform: uppercase;
margin-bottom: 0px;
}
/* line 354, ../sass/distribution/_index.scss */
/* line 360, ../sass/distribution/_index.scss */
.distribution-index .modal-body {
margin: 20px 0;
max-height: 300px;
height: 300px;
overflow-y: scroll;
}
/* line 361, ../sass/distribution/_index.scss */
/* line 367, ../sass/distribution/_index.scss */
.distribution-index .modal-default-button {
float: right;
}
/* line 374, ../sass/distribution/_index.scss */
/* line 380, ../sass/distribution/_index.scss */
.distribution-index .modal-enter {
opacity: 0;
}
/* line 378, ../sass/distribution/_index.scss */
/* line 384, ../sass/distribution/_index.scss */
.distribution-index .modal-leave-active {
opacity: 0;
}
/* line 382, ../sass/distribution/_index.scss */
/* line 388, ../sass/distribution/_index.scss */
.distribution-index .modal-enter .modal-container,
.distribution-index .modal-leave-active .modal-container {
-webkit-transform: scale(1.1);

+ 9
- 0
backend/web/js/vuejs/distribution-index.js View File

@@ -358,6 +358,15 @@ var app = new Vue({
}

return clone ;
},
addSubscriptions: function() {
var app = this ;
axios.get(UrlManager.getBaseUrlAbsolute()+"distribution/ajax-process-add-subscriptions",{params: {
date: this.getDate()
}})
.then(function(response) {
app.init(app.idActivePointSale) ;
}) ;
}
},
});

+ 6
- 0
backend/web/sass/distribution/_index.scss View File

@@ -190,6 +190,12 @@ termes.
right: 10px ;
}
#btn-add-subscriptions {
position: absolute ;
top: 9px ;
right: 180px ;
}
#wrapper-nav-points-sale {
margin-bottom: 10px ;

Loading…
Cancel
Save