fix(price): normalize cantitate_roa < 1 in price comparison (false mismatch)

Kit detection only checked cantitate_roa > 1, missing fractional values
like 0.5 (GoMag 50buc/set → ROA 100buc/set). This caused false price
difference alerts (e.g. GoMag 7.00 vs ROA 14.00 for order #481595156).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-04-01 10:23:09 +00:00
parent 9d824fd5f9
commit 1a912b5fa4
2 changed files with 125 additions and 2 deletions

View File

@@ -705,7 +705,7 @@ def get_prices_for_order(items: list[dict], app_settings: dict, conn=None) -> di
is_kit = len(codmat_details) > 1 or (
len(codmat_details) == 1
and float(codmat_details[0].get("cantitate_roa") or 1) > 1
and float(codmat_details[0].get("cantitate_roa") or 1) != 1
)
pret_roa_total = 0.0