Explorar el Código

[Administration] Documents : erreur JS pricesArray

feature/souke
Guillaume Bourgeois hace 10 meses
padre
commit
2edf638122
Se han modificado 1 ficheros con 11 adiciones y 9 borrados
  1. +11
    -9
      backend/web/js/vuejs/document-form.js

+ 11
- 9
backend/web/js/vuejs/document-form.js Ver fichero

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

Cargando…
Cancelar
Guardar