] ; | ] ; | ||||
} | } | ||||
if ($firstOrder && $firstOrder->id_user) { | |||||
if ($firstOrder) { | |||||
// génération du BL | // génération du BL | ||||
if(!$deliveryNote) { | if(!$deliveryNote) { | ||||
$deliveryNote = new DeliveryNote; | $deliveryNote = new DeliveryNote; |
} | } | ||||
if(parseFloat(this.order.productOrder[id_product].quantity) + quantity >= 0) { | if(parseFloat(this.order.productOrder[id_product].quantity) + quantity >= 0) { | ||||
var theQuantity = parseFloat(this.order.productOrder[id_product].quantity) + parseFloat(quantity) ; | var theQuantity = parseFloat(this.order.productOrder[id_product].quantity) + parseFloat(quantity) ; | ||||
Vue.set(this.order.productOrder, id_product, { | Vue.set(this.order.productOrder, id_product, { | ||||
quantity: theQuantity, | |||||
quantity: theQuantity.toFixed(2), | |||||
unit: this.order.productOrder[id_product].unit, | unit: this.order.productOrder[id_product].unit, | ||||
price: this.order.productOrder[id_product].price, | price: this.order.productOrder[id_product].price, | ||||
active: this.order.productOrder[id_product].active | active: this.order.productOrder[id_product].active |
(this.products[product.index].quantity_form + quantity <= (this.products[product.index].quantity_remaining * this.products[product.index].coefficient_unit) || | (this.products[product.index].quantity_form + quantity <= (this.products[product.index].quantity_remaining * this.products[product.index].coefficient_unit) || | ||||
!this.products[product.index].quantity_max) | !this.products[product.index].quantity_max) | ||||
) { | ) { | ||||
this.products[product.index].quantity_form += quantity ; | |||||
var theQuantity = parseFloat(this.products[product.index].quantity_form) + parseFloat(quantity); | |||||
this.products[product.index].quantity_form = parseFloat(theQuantity.toFixed(2)) ; | |||||
} | } | ||||
}, | }, | ||||
oneProductOrdered: function() { | oneProductOrdered: function() { |