From b688fa491a71b4db4077fda3af27ce0e36dadbdd Mon Sep 17 00:00:00 2001 From: Henrik Jess Nielsen Date: Fri, 30 Oct 2026 13:45:25 +0100 Subject: [PATCH] feat(stats): Estimeret total uses real offer prices for matched items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a catalog item matches a current Lübeck offer, compute its line cost from the offer instead of the hardcoded estimate: offer price is per unit (e.g. per 100 g), so multiply by the item's quantity (qtyToKg × €/kg × rate). Only weight-based offers (g/kg) are converted — units that can't be matched cleanly keep the estimate, so the total never goes garbage. Data-offer-* attrs on matched rows; recalcAll prefers the offer line price. The total (and the budget-per-day) now move toward actual prices as matches land. --- templates/index.html | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/templates/index.html b/templates/index.html index a99c9db..e0ab8be 100644 --- a/templates/index.html +++ b/templates/index.html @@ -255,7 +255,8 @@
{% for item in sec.varer %} {% set s = saved.get(item.key, {}) %} -
+ {% set od = deals.get(item.key) %} +
{{ item.name }} @@ -548,6 +549,23 @@