fix(sync): prevent kit/bax price sync from overwriting individual CRM prices
Three code paths could overwrite CRM list prices with wrong values when web unit (50 buc) differs from ROA unit (100 buc): - price_sync_service: kit path now skips components that have their own ARTICOLE_TERTI mapping (individual path handles them with correct ÷0.5) - validation_service: sync_prices_from_order now skips bax SKUs (cantitate_roa > 1) in addition to multi-component kits - pack_import_comenzi: skip negative kit discount (markup), ROUND prices to nzecimale_pretv decimals Also adds: - SQL script for 6 ARTICOLE_TERTI mappings (cantitate_roa=0.5) for cup articles where web=50buc, ROA=100buc/set - Oracle schema reference documentation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -154,6 +154,12 @@ async def run_catalog_price_sync(run_id: str):
|
||||
if is_kit:
|
||||
for comp in mapped_data[sku]:
|
||||
comp_codmat = comp["codmat"]
|
||||
|
||||
# Skip components that have their own ARTICOLE_TERTI mapping
|
||||
# (they'll be synced with correct cantitate_roa in individual path)
|
||||
if comp_codmat in mapped_data:
|
||||
continue
|
||||
|
||||
comp_product = products_by_sku.get(comp_codmat)
|
||||
if not comp_product:
|
||||
continue # Component not in GoMag as standalone product
|
||||
|
||||
Reference in New Issue
Block a user