diff --git a/app/config.yml b/app/config.yml index 7ea2649..19ebdff 100644 --- a/app/config.yml +++ b/app/config.yml @@ -171,6 +171,7 @@ products: fr: Rapport écrit "no": Skriftlig rapport uom: EA + qty: 1 price: 500.00 - code: REVIEW description: diff --git a/app/index.html b/app/index.html index e2fa748..a76cb6d 100644 --- a/app/index.html +++ b/app/index.html @@ -832,11 +832,12 @@ function pickProduct(i) { if (uomEl) uomEl.disabled = false; if (!fxOn && priceEl) priceEl.disabled = false; } else { - // Predefined — fill UOM + price from config; lock UOM, unlock qty + price + // Predefined — fill UOM + price (+ optional qty) from config; lock UOM, unlock qty + price const p = (cfg.products || [])[+v]; if (p) { - if (uomEl && p.uom) uomEl.value = p.uom; + if (uomEl && p.uom) uomEl.value = p.uom; if (priceEl && p.price != null) priceEl.value = p.price; + if (qtyEl && p.qty != null) qtyEl.value = p.qty; } if (qtyEl) qtyEl.disabled = false; if (uomEl) uomEl.disabled = true; // UOM locked for predefined items