diff --git a/api/app/static/css/style.css b/api/app/static/css/style.css index 622883c..45f61c3 100644 --- a/api/app/static/css/style.css +++ b/api/app/static/css/style.css @@ -1229,26 +1229,21 @@ tr.mapping-deleted td { flex-shrink: 0; filter: drop-shadow(0 0 3px rgba(202,138,4,0.3)); } -.addr-table { width: 100%; border-collapse: collapse; font-size: 13px; } -.addr-table th { - font-family: var(--font-display); - font-size: 12px; - font-weight: 500; - text-transform: uppercase; - color: var(--text-muted); - padding: 6px 8px; - text-align: left; +.addr-line .bi-exclamation-octagon { + color: var(--error-text); + flex-shrink: 0; + filter: drop-shadow(0 0 3px rgba(220,38,38,0.3)); } -.addr-table td { padding: 8px; vertical-align: top; font-family: var(--font-body); } -.addr-mismatch { background: var(--warning-light) !important; } -.addr-efactura-risk { background: var(--error-light) !important; } -.addr-label { - font-family: var(--font-display); - font-size: 11px; +/* Denomination mismatch alert */ +.denom-mismatch { + background: var(--warning-light); + padding: 8px 12px; + border-radius: var(--card-radius); +} +.denom-mismatch-title { + font-size: 12px; + color: var(--warning-text); font-weight: 500; - text-transform: uppercase; - color: var(--text-secondary); - margin-bottom: 4px; } /* Mobile address cards */ .addr-card { border: 1px solid var(--border); border-radius: var(--card-radius); margin-bottom: 8px; overflow: hidden; } diff --git a/api/app/static/js/shared.js b/api/app/static/js/shared.js index 460cb7f..e65890e 100644 --- a/api/app/static/js/shared.js +++ b/api/app/static/js/shared.js @@ -517,15 +517,20 @@ async function renderOrderDetailModal(orderNumber, opts) { if (priceCheckEl) priceCheckEl.innerHTML = ''; const reconEl = document.getElementById('detailInvoiceRecon'); if (reconEl) { reconEl.innerHTML = ''; reconEl.style.display = 'none'; } + // Remove diff badge from previous render + const prevDiffBadge = document.querySelector('.diff-badge'); + if (prevDiffBadge) prevDiffBadge.remove(); // Reset compact header elements const partenerRoa = document.getElementById('detailPartenerRoa'); if (partenerRoa) { partenerRoa.style.display = 'none'; partenerRoa.textContent = ''; } const cuiGomag = document.getElementById('detailCuiGomag'); if (cuiGomag) cuiGomag.style.display = 'none'; const cuiRoa = document.getElementById('detailCuiRoa'); - if (cuiRoa) cuiRoa.style.display = 'none'; - const anafArea = document.getElementById('detailPartnerAnafArea'); - if (anafArea) anafArea.innerHTML = ''; + if (cuiRoa) { + cuiRoa.style.display = 'none'; + // Restore original structure (may have been replaced by PF indicator) + cuiRoa.innerHTML = 'CUI: '; + } const denomMismatch = document.getElementById('detailDenomMismatch'); if (denomMismatch) { denomMismatch.style.display = 'none'; denomMismatch.innerHTML = ''; } const addressBlock = document.getElementById('detailAddressBlock'); @@ -693,7 +698,10 @@ async function renderOrderDetailModal(orderNumber, opts) { 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.pret_roa == null && priceInfo.match == null) { + if (item.kit) { + matchDot = 'Kit'; + rowStyle = ''; + } else if (priceInfo.pret_roa == null && priceInfo.match == null) { matchDot = ''; rowStyle = ''; } else if (priceInfo.match === false) { @@ -895,10 +903,16 @@ function _renderHeaderInfo(order) { document.getElementById('detailCuiRoaVal').textContent = pi.cod_fiscal_roa || '\u2014'; cuiRoaEl.style.display = ''; - // CUI correction badge + // CUI correction badge: +RO (added prefix) or −RO (removed prefix) let cuiCorrHtml = ''; - if (pi.anaf_cod_fiscal_adjusted) { - cuiCorrHtml = ' Corectat'; + if (pi.anaf_cod_fiscal_adjusted && pi.cod_fiscal_gomag && pi.cod_fiscal_roa) { + const gomagHasRO = /^RO\s*/i.test(pi.cod_fiscal_gomag); + const roaHasRO = /^RO\s*/i.test(pi.cod_fiscal_roa); + if (!gomagHasRO && roaHasRO) { + cuiCorrHtml = ' +RO'; + } else if (gomagHasRO && !roaHasRO) { + cuiCorrHtml = ' −RO'; + } } // ANAF badge @@ -906,15 +920,24 @@ function _renderHeaderInfo(order) { if (anafArea) { let anafBadge; if (pi.anaf_platitor_tva === 1) { - anafBadge = 'Platitor TVA'; + anafBadge = 'Platitor TVA'; } else if (pi.anaf_platitor_tva === 0) { - anafBadge = 'Neplatitor TVA'; + anafBadge = 'Neplatitor TVA'; } else { - anafBadge = '?'; + anafBadge = '?'; } anafArea.innerHTML = cuiCorrHtml + ' ' + anafBadge; } } + } else { + // PF indicator — show muted text in CUI area + const cuiRoaEl = document.getElementById('detailCuiRoa'); + if (cuiRoaEl) { + document.getElementById('detailCuiRoaVal').textContent = ''; + document.getElementById('detailPartnerAnafArea').innerHTML = ''; + cuiRoaEl.innerHTML = 'Persoana fizica'; + cuiRoaEl.style.display = ''; + } } // ERROR orders: muted dashes for ROA fields @@ -927,8 +950,8 @@ function _renderHeaderInfo(order) { if (isPJ && pi.anaf_denumire_mismatch && pi.denumire_anaf) { const denomEl = document.getElementById('detailDenomMismatch'); if (denomEl) { - denomEl.innerHTML = `