fix(ui): fix set pct badge logic and compact CODMAT form layout

- Fix is_complete check: use abs(pct-100)<=0.01 instead of >=99.99
  so sets with >100% total are correctly shown as incomplete
- Show pct badge with 2 decimals (e.g. "⚠️ 200.00%")
- Remove product name pre-fill in missing SKUs map modal CODMAT field
- Compact CODMAT lines to single row with placeholders instead of labels

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-03-14 21:21:49 +00:00
parent 15ccbe028a
commit 9cacc19d15
3 changed files with 28 additions and 47 deletions

View File

@@ -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})