diff --git a/api/app/services/mapping_service.py b/api/app/services/mapping_service.py index ee34ee4..12290cc 100644 --- a/api/app/services/mapping_service.py +++ b/api/app/services/mapping_service.py @@ -88,7 +88,7 @@ def get_mappings(search: str = "", page: int = 1, per_page: int = 50, for r in rows if r.get("activ") == 1 ) - if pct_total >= 99.99: + if abs(pct_total - 100) <= 0.01: complete_skus += 1 else: incomplete_skus += 1 @@ -108,7 +108,7 @@ def get_mappings(search: str = "", page: int = 1, per_page: int = 50, for r in rows if r.get("activ") == 1 ) - is_complete = pct_total >= 99.99 + is_complete = abs(pct_total - 100) <= 0.01 if pct_filter == "complete" and is_complete: filtered_groups[sku] = rows elif pct_filter == "incomplete" and not is_complete: @@ -129,7 +129,7 @@ def get_mappings(search: str = "", page: int = 1, per_page: int = 50, for r in rows if r.get("activ") == 1 ) - sku_pct[sku] = {"pct_total": pct_total, "is_complete": pct_total >= 99.99} + sku_pct[sku] = {"pct_total": pct_total, "is_complete": abs(pct_total - 100) <= 0.01} for row in page_rows: meta = sku_pct.get(row["sku"], {"pct_total": 0, "is_complete": False}) diff --git a/api/app/static/js/mappings.js b/api/app/static/js/mappings.js index 95bbfec..5ce168b 100644 --- a/api/app/static/js/mappings.js +++ b/api/app/static/js/mappings.js @@ -145,7 +145,7 @@ function renderTable(mappings, showDeleted) { if (m.is_complete) { pctBadge = ` ✓ 100%`; } else { - const pctVal = typeof m.pct_total === 'number' ? m.pct_total.toFixed(0) : m.pct_total; + const pctVal = typeof m.pct_total === 'number' ? m.pct_total.toFixed(2) : m.pct_total; pctBadge = ` ⚠ ${pctVal}%`; } } @@ -276,23 +276,20 @@ function addCodmatLine() { const div = document.createElement('div'); div.className = 'border rounded p-2 mb-2 codmat-line'; div.innerHTML = ` -