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 @@ - +