@@ -940,6 +940,7 @@ class OrderController extends BackendController | |||
$order->comment = $comment; | |||
if ($idUser) { | |||
$order->username = '' ; | |||
$order->id_user = $idUser; | |||
// commentaire du point de vente |
@@ -226,6 +226,7 @@ $this->setPageTitle('Distributions') ; | |||
:points-sale="pointsSale" | |||
:users="users" | |||
:products="products" | |||
:producer="producer" | |||
@close="showModalFormOrderCreate = false" | |||
@ordercreatedupdated="orderCreatedUpdated" | |||
></order-form> | |||
@@ -316,6 +317,7 @@ $this->setPageTitle('Distributions') ; | |||
:users="users" | |||
:products="products" | |||
:order="ordersUpdate[key]" | |||
:producer="producer" | |||
@close="showModalFormOrderUpdate = false" | |||
@ordercreatedupdated="orderCreatedUpdated" | |||
></order-form> | |||
@@ -460,8 +462,12 @@ $this->setPageTitle('Distributions') ; | |||
</select> | |||
</div> | |||
<div class="form-group"> | |||
<label class="control-label" for="select-id-user">Utilisateur</label> | |||
<a v-if="producer.credit && order.id_user > 0" class="btn btn-xs btn-primary btn-credit" :href="baseUrl+'/user/credit?id='+user.id_user" v-for="user in users" v-if="user.id_user == order.id_user">{{ parseFloat(user.credit).toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}</a> | |||
<label class="control-label" for="select-id-user"> | |||
Utilisateur | |||
</label> | |||
<select class="form-control" v-model="order.id_user"> | |||
<option value="0">--</option> | |||
<option v-for="user in users" :value="user.id_user">{{ user.lastname +' '+ user.name }}</option> | |||
</select> | |||
<input v-model="order.username" type="text" class="form-control" placeholder="Ou saisissez ici le nom de l'utilisateur" /> | |||
@@ -511,8 +517,8 @@ $this->setPageTitle('Distributions') ; | |||
</div> | |||
<div slot="footer"> | |||
<div class="actions-form"> | |||
<button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-if="!order.id && order.id_user" data-process-credit="1">Créer et payer</button> | |||
<button class="modal-default-button btn btn-primary" @click="submitFormUpdate" v-if="order.id && order.id_user" data-process-credit="1">Modifier et payer</button> | |||
<button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-if="!order.id && order.id_user > 0" data-process-credit="1">Créer et payer</button> | |||
<button class="modal-default-button btn btn-primary" @click="submitFormUpdate" v-if="order.id && order.id_user > 0" data-process-credit="1">Modifier et payer</button> | |||
<button class="modal-default-button btn btn-primary" @click="submitFormUpdate" v-if="order.id">Modifier</button> | |||
<button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-else>Créer</button> |
@@ -2015,30 +2015,34 @@ termes. | |||
.distribution-index #orders table tr.view .comment { | |||
margin-top: 20px; | |||
} | |||
/* line 257, ../sass/distribution/_index.scss */ | |||
/* line 255, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-form-order .btn-credit { | |||
float: right; | |||
} | |||
/* line 261, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-form-order table.table-products .product-ordered td { | |||
background-color: #e9e9e9; | |||
} | |||
/* line 261, ../sass/distribution/_index.scss */ | |||
/* line 265, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-form-order table.table-products .product-ordered input { | |||
font-size: 16px; | |||
font-weight: bold; | |||
} | |||
/* line 267, ../sass/distribution/_index.scss */ | |||
/* line 271, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-form-order table.table-products td.quantity { | |||
width: 165px; | |||
} | |||
/* line 270, ../sass/distribution/_index.scss */ | |||
/* line 274, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-form-order table.table-products td.quantity input { | |||
text-align: center; | |||
color: black; | |||
} | |||
/* line 274, ../sass/distribution/_index.scss */ | |||
/* line 278, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-form-order table.table-products td.quantity .form-control { | |||
border-right: 0px none; | |||
padding-right: 4px; | |||
} | |||
/* line 278, ../sass/distribution/_index.scss */ | |||
/* line 282, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-form-order table.table-products td.quantity .input-group-addon { | |||
padding: 5px; | |||
padding-left: 0px; | |||
@@ -2046,35 +2050,35 @@ termes. | |||
border-left: 0px none; | |||
border-right: 0px none; | |||
} | |||
/* line 286, ../sass/distribution/_index.scss */ | |||
/* line 290, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-form-order table.table-products td.quantity-remaining { | |||
text-align: right; | |||
} | |||
/* line 289, ../sass/distribution/_index.scss */ | |||
/* line 293, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-form-order table.table-products td.quantity-remaining.quantity-remaining, .distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite { | |||
color: #00A65A; | |||
} | |||
/* line 293, ../sass/distribution/_index.scss */ | |||
/* line 297, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-form-order table.table-products td.quantity-remaining.negative { | |||
color: #DD4B39; | |||
} | |||
/* line 297, ../sass/distribution/_index.scss */ | |||
/* line 301, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite, .distribution-index .modal-form-order table.table-products td.quantity-remaining.empty { | |||
font-size: 18px; | |||
} | |||
/* line 304, ../sass/distribution/_index.scss */ | |||
/* line 308, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-form-order .actions-form button { | |||
margin-left: 15px; | |||
} | |||
/* line 312, ../sass/distribution/_index.scss */ | |||
/* line 316, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-payment .info-box .info-box-icon { | |||
width: 50px; | |||
} | |||
/* line 314, ../sass/distribution/_index.scss */ | |||
/* line 318, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-payment .info-box .info-box-icon i { | |||
font-size: 30px; | |||
} | |||
/* line 318, ../sass/distribution/_index.scss */ | |||
/* line 322, ../sass/distribution/_index.scss */ | |||
.distribution-index .modal-payment .info-box .info-box-content { | |||
margin-left: 50px; | |||
} |
@@ -411,7 +411,7 @@ Vue.component('modal', { | |||
}) | |||
Vue.component('order-form',{ | |||
props: ['date', 'pointsSale', 'users', 'products', 'order'], | |||
props: ['date', 'pointsSale', 'users', 'products', 'order', 'producer'], | |||
data: function() { | |||
return { | |||
errors: [], | |||
@@ -419,6 +419,8 @@ Vue.component('order-form',{ | |||
idUser: 0, | |||
username : '', | |||
comment: '', | |||
producer: null, | |||
baseUrl: $('meta[name=baseurl]').attr('content'), | |||
} ; | |||
}, | |||
template: '#order-form-template', | |||
@@ -434,7 +436,7 @@ Vue.component('order-form',{ | |||
} | |||
if(this.order.id_point_sale | |||
&& (this.order.id_user || (this.order.username && this.order.username.length)) | |||
&& (this.order.id_user > 0 || (this.order.username && this.order.username.length)) | |||
&& countProducts > 0) { | |||
return true ; | |||
} | |||
@@ -443,7 +445,7 @@ Vue.component('order-form',{ | |||
this.errors.push('Veuillez sélectionner un point de vente') ; | |||
} | |||
if(!this.order.id_user && !this.order.username) { | |||
if((!this.order.id_user || this.order.id_user == 0) && !this.order.username.length) { | |||
this.errors.push('Veuillez sélectionner ou saisir un utilisateur') ; | |||
} | |||
@@ -451,6 +453,7 @@ Vue.component('order-form',{ | |||
this.errors.push('Veuillez sélectionner au moins un produit') ; | |||
} | |||
console.log('id_user : '+this.order.id_user+' / username : '+this.order.username) ; | |||
}, | |||
submitFormCreate: function(event) { | |||
var app = this ; |
@@ -251,8 +251,12 @@ termes. | |||
} | |||
.modal-form-order { | |||
.btn-credit { | |||
float: right ; | |||
} | |||
table.table-products { | |||
.product-ordered { | |||
td { | |||
background-color: #e9e9e9 ; |