From efb055c2be19f4f84b32deafa574416c3cac5392 Mon Sep 17 00:00:00 2001 From: Claude Agent Date: Fri, 27 Mar 2026 13:25:07 +0000 Subject: [PATCH] =?UTF-8?q?fix(qa):=20ISSUE-002=20=E2=80=94=20ROA=20prices?= =?UTF-8?q?=20not=20showing=20in=20order=20detail=20modal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The JS read pret_roa from order.price_check.items[idx] which doesn't exist. The backend puts pret_roa and price_match directly on each item in the items array. Fixed both desktop table and mobile view to read from item.pret_roa and item.price_match instead. Co-Authored-By: Claude Opus 4.6 (1M context) --- api/app/static/js/shared.js | 10 +++++----- api/app/templates/base.html | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/app/static/js/shared.js b/api/app/static/js/shared.js index 34a18fd..80050d5 100644 --- a/api/app/static/js/shared.js +++ b/api/app/static/js/shared.js @@ -607,8 +607,8 @@ async function renderOrderDetailModal(orderNumber, opts) { : `${esc(item.codmat || '–')}`; const valoare = (Number(item.price || 0) * Number(item.quantity || 0)); const clickAttr = opts.onQuickMap ? `onclick="_sharedModalQuickMap('${esc(item.sku)}','${esc(item.product_name||'')}','${esc(orderNumber)}',${idx})"` : ''; - const priceInfo = (order.price_check?.items || {})[idx]; - const priceMismatchHtml = priceInfo?.match === false + const priceInfo = { pret_roa: item.pret_roa, match: item.price_match }; + const priceMismatchHtml = priceInfo.match === false ? `
ROA: ${fmtNum(priceInfo.pret_roa)} lei
` : ''; return `
@@ -676,10 +676,10 @@ async function renderOrderDetailModal(orderNumber, opts) { let tableHtml = items.map((item, idx) => { const valoare = Number(item.price || 0) * Number(item.quantity || 0); - const priceInfo = (order.price_check?.items || {})[idx]; - const pretRoaHtml = priceInfo?.pret_roa != null ? fmtNum(priceInfo.pret_roa) : '–'; + const priceInfo = { pret_roa: item.pret_roa, match: item.price_match }; + const pretRoaHtml = priceInfo.pret_roa != null ? fmtNum(priceInfo.pret_roa) : '–'; let matchDot, rowStyle; - if (priceInfo == null) { + if (priceInfo.pret_roa == null && priceInfo.match == null) { matchDot = ''; rowStyle = ''; } else if (priceInfo.match === false) { diff --git a/api/app/templates/base.html b/api/app/templates/base.html index 0b2dc73..f2a0bf3 100644 --- a/api/app/templates/base.html +++ b/api/app/templates/base.html @@ -144,7 +144,7 @@ - +