fix: price sync kit components + vat_included type bug

- Fix vat_included comparison: GoMag API returns int 1, not str "1",
  causing all prices to be multiplied by TVA again (double TVA)
- Normalize vat_included to string in gomag_client at parse time
- Price sync now processes kit components individually by looking up
  each component's CODMAT as standalone GoMag product
- Add _insert_component_price for components without existing Oracle price
- resolve_mapped_codmats: ROW_NUMBER dedup for CODMATs with multiple
  NOM_ARTICOLE entries, prefer article with current stock
- pack_import_comenzi: merge_or_insert_articol to merge quantities when
  same article appears from kit + individual on same order

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-03-20 15:07:53 +00:00
parent 0666d6bcdf
commit b221b257a3
5 changed files with 189 additions and 37 deletions

View File

@@ -170,7 +170,7 @@ async def download_products(
"sku": p["sku"],
"price": p.get("price", "0"),
"vat": p.get("vat", "19"),
"vat_included": p.get("vat_included", "1"),
"vat_included": str(p.get("vat_included", "1")),
"bundleItems": p.get("bundleItems", []),
})