$order->comment = $comment; | $order->comment = $comment; | ||||
if ($idUser) { | if ($idUser) { | ||||
$order->username = '' ; | |||||
$order->id_user = $idUser; | $order->id_user = $idUser; | ||||
// commentaire du point de vente | // commentaire du point de vente |
:points-sale="pointsSale" | :points-sale="pointsSale" | ||||
:users="users" | :users="users" | ||||
:products="products" | :products="products" | ||||
:producer="producer" | |||||
@close="showModalFormOrderCreate = false" | @close="showModalFormOrderCreate = false" | ||||
@ordercreatedupdated="orderCreatedUpdated" | @ordercreatedupdated="orderCreatedUpdated" | ||||
></order-form> | ></order-form> | ||||
:users="users" | :users="users" | ||||
:products="products" | :products="products" | ||||
:order="ordersUpdate[key]" | :order="ordersUpdate[key]" | ||||
:producer="producer" | |||||
@close="showModalFormOrderUpdate = false" | @close="showModalFormOrderUpdate = false" | ||||
@ordercreatedupdated="orderCreatedUpdated" | @ordercreatedupdated="orderCreatedUpdated" | ||||
></order-form> | ></order-form> | ||||
</select> | </select> | ||||
</div> | </div> | ||||
<div class="form-group"> | <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"> | <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> | <option v-for="user in users" :value="user.id_user">{{ user.lastname +' '+ user.name }}</option> | ||||
</select> | </select> | ||||
<input v-model="order.username" type="text" class="form-control" placeholder="Ou saisissez ici le nom de l'utilisateur" /> | <input v-model="order.username" type="text" class="form-control" placeholder="Ou saisissez ici le nom de l'utilisateur" /> | ||||
</div> | </div> | ||||
<div slot="footer"> | <div slot="footer"> | ||||
<div class="actions-form"> | <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="submitFormUpdate" v-if="order.id">Modifier</button> | ||||
<button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-else>Créer</button> | <button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-else>Créer</button> |
.distribution-index #orders table tr.view .comment { | .distribution-index #orders table tr.view .comment { | ||||
margin-top: 20px; | 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 { | .distribution-index .modal-form-order table.table-products .product-ordered td { | ||||
background-color: #e9e9e9; | 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 { | .distribution-index .modal-form-order table.table-products .product-ordered input { | ||||
font-size: 16px; | font-size: 16px; | ||||
font-weight: bold; | 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 { | .distribution-index .modal-form-order table.table-products td.quantity { | ||||
width: 165px; | 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 { | .distribution-index .modal-form-order table.table-products td.quantity input { | ||||
text-align: center; | text-align: center; | ||||
color: black; | 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 { | .distribution-index .modal-form-order table.table-products td.quantity .form-control { | ||||
border-right: 0px none; | border-right: 0px none; | ||||
padding-right: 4px; | 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 { | .distribution-index .modal-form-order table.table-products td.quantity .input-group-addon { | ||||
padding: 5px; | padding: 5px; | ||||
padding-left: 0px; | padding-left: 0px; | ||||
border-left: 0px none; | border-left: 0px none; | ||||
border-right: 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 { | .distribution-index .modal-form-order table.table-products td.quantity-remaining { | ||||
text-align: right; | 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 { | .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; | 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 { | .distribution-index .modal-form-order table.table-products td.quantity-remaining.negative { | ||||
color: #DD4B39; | 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 { | .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; | font-size: 18px; | ||||
} | } | ||||
/* line 304, ../sass/distribution/_index.scss */ | |||||
/* line 308, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .actions-form button { | .distribution-index .modal-form-order .actions-form button { | ||||
margin-left: 15px; | margin-left: 15px; | ||||
} | } | ||||
/* line 312, ../sass/distribution/_index.scss */ | |||||
/* line 316, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-payment .info-box .info-box-icon { | .distribution-index .modal-payment .info-box .info-box-icon { | ||||
width: 50px; | width: 50px; | ||||
} | } | ||||
/* line 314, ../sass/distribution/_index.scss */ | |||||
/* line 318, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-payment .info-box .info-box-icon i { | .distribution-index .modal-payment .info-box .info-box-icon i { | ||||
font-size: 30px; | font-size: 30px; | ||||
} | } | ||||
/* line 318, ../sass/distribution/_index.scss */ | |||||
/* line 322, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-payment .info-box .info-box-content { | .distribution-index .modal-payment .info-box .info-box-content { | ||||
margin-left: 50px; | margin-left: 50px; | ||||
} | } |
}) | }) | ||||
Vue.component('order-form',{ | Vue.component('order-form',{ | ||||
props: ['date', 'pointsSale', 'users', 'products', 'order'], | |||||
props: ['date', 'pointsSale', 'users', 'products', 'order', 'producer'], | |||||
data: function() { | data: function() { | ||||
return { | return { | ||||
errors: [], | errors: [], | ||||
idUser: 0, | idUser: 0, | ||||
username : '', | username : '', | ||||
comment: '', | comment: '', | ||||
producer: null, | |||||
baseUrl: $('meta[name=baseurl]').attr('content'), | |||||
} ; | } ; | ||||
}, | }, | ||||
template: '#order-form-template', | template: '#order-form-template', | ||||
} | } | ||||
if(this.order.id_point_sale | 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) { | && countProducts > 0) { | ||||
return true ; | return true ; | ||||
} | } | ||||
this.errors.push('Veuillez sélectionner un point de vente') ; | 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') ; | this.errors.push('Veuillez sélectionner ou saisir un utilisateur') ; | ||||
} | } | ||||
this.errors.push('Veuillez sélectionner au moins un produit') ; | 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) { | submitFormCreate: function(event) { | ||||
var app = this ; | var app = this ; |
} | } | ||||
.modal-form-order { | .modal-form-order { | ||||
.btn-credit { | |||||
float: right ; | |||||
} | |||||
table.table-products { | table.table-products { | ||||
.product-ordered { | .product-ordered { | ||||
td { | td { | ||||
background-color: #e9e9e9 ; | background-color: #e9e9e9 ; |