fix(anaf-dedup): fix ANAF parsing, facturare addr, compact modal layout
- Fix ANAF API: extract CUI from date_generale (not top-level), fix notFound casing (capital F) - Fix missing facturare address when same ID as livrare (copy instead of skip) - Replace ANAF cache pre-population stub with real logic (3-month CUIs) - Restructure order detail modal: inline 2-col GOMAG|ROA layout with compact address lines replacing collapsed sections - Fix addrMatch() to use field-level comparison with Romanian abbreviation stripping (STR, NR, BL, SC, AP, ET, ETAJ, APART) - Add dashboard "Diferente" filter pill for ANAF-adjusted orders - Update e2e test for new modal structure Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -82,8 +82,8 @@ async def _call_anaf_api(body: list[dict], retry: int = 0) -> dict[str, dict]:
|
||||
# Parse ANAF response
|
||||
found_list = data.get("found", [])
|
||||
for item in found_list:
|
||||
cui_str = str(item.get("cui", ""))
|
||||
date_generals = item.get("date_generale", {})
|
||||
cui_str = str(date_generals.get("cui", ""))
|
||||
results[cui_str] = {
|
||||
"scpTVA": item.get("inregistrare_scop_Tva", {}).get("scpTVA"),
|
||||
"denumire_anaf": date_generals.get("denumire", ""),
|
||||
@@ -91,9 +91,10 @@ async def _call_anaf_api(body: list[dict], retry: int = 0) -> dict[str, dict]:
|
||||
}
|
||||
|
||||
# Not found CUIs
|
||||
notfound_list = data.get("notfound", [])
|
||||
notfound_list = data.get("notFound", [])
|
||||
for item in notfound_list:
|
||||
cui_str = str(item.get("cui", ""))
|
||||
date_gen = item.get("date_generale", {})
|
||||
cui_str = str(date_gen.get("cui", item.get("cui", "")))
|
||||
results[cui_str] = {
|
||||
"scpTVA": None,
|
||||
"denumire_anaf": "",
|
||||
|
||||
Reference in New Issue
Block a user