Browse Source

Produits : correctif édition quantité (arrondis) #240

refactoring
Guillaume 2 years ago
parent
commit
26f152cfa0
3 changed files with 5 additions and 3 deletions
  1. +1
    -1
      backend/controllers/DistributionController.php
  2. +2
    -1
      backend/web/js/vuejs/distribution-index.js
  3. +2
    -1
      producer/web/js/vuejs/order-order.js

+ 1
- 1
backend/controllers/DistributionController.php View File

] ; ] ;
} }


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;

+ 2
- 1
backend/web/js/vuejs/distribution-index.js View File

} }
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

+ 2
- 1
producer/web/js/vuejs/order-order.js View File

(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() {

Loading…
Cancel
Save