Browse Source

[Administration] Documents : erreur JS pricesArray

feature/souke
Guillaume Bourgeois 10 months ago
parent
commit
2edf638122
1 changed files with 11 additions and 9 deletions
  1. +11
    -9
      backend/web/js/vuejs/document-form.js

+ 11
- 9
backend/web/js/vuejs/document-form.js View File

var pricesArray = product.prices; var pricesArray = product.prices;
var unitCoefficient = product.unit_coefficient; var unitCoefficient = product.unit_coefficient;


if (theQuantity) {
theQuantity = theQuantity / unitCoefficient;
}
if(pricesArray && unitCoefficient) {
if (theQuantity) {
theQuantity = theQuantity / unitCoefficient;
}


for (var i = 0; i < pricesArray.length; i++) {
if(pricesArray[i]) {
var price = pricesArray[i].price;
var fromQuantity = pricesArray[i].from_quantity;
for (var i = 0; i < pricesArray.length; i++) {
if(pricesArray[i]) {
var price = pricesArray[i].price;
var fromQuantity = pricesArray[i].from_quantity;


if (price < thePrice && fromQuantity <= theQuantity) {
thePrice = price;
if (price < thePrice && fromQuantity <= theQuantity) {
thePrice = price;
}
} }
} }
} }

Loading…
Cancel
Save