Browse Source

[Administration] Documents : erreur JS pricesArray

feature/souke
Guillaume Bourgeois 11 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

@@ -249,17 +249,19 @@ var app = new Vue({
var pricesArray = product.prices;
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