metallkart-erp/scripts
louis 3fbb92b2aa fix: FinancialTracking.budgetX × Order.quantity — 3 sites + backfill
Bug: budgetX stored per-unit smeta costs instead of totals, causing
absurd overrun percentages (7140% for qty=1700, 3831% for qty=100).

Fix 3 write sites:
- estimates.service.ts syncFinancialTracking: .mul(qty)
- financial.service.ts applyRevision: revision.delta*.mul(qty)
- revisions.service.ts applyRevisionToBudget: (smeta + deltas) * qty

financial.service.ts initFromSmeta was already correct (L36-40).
committedX/actualX from PO.totalAmount — already totals, no fix needed.

Backfill: 2 FTs corrected, alertLevel RED→NONE for both.
Script is one-shot non-idempotent (never re-run).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-28 11:23:57 +03:00
..
dev-task.ps1 fix: remove duplicate СРОЧНО priority — keep only Срочный (session 34) 2026-04-08 15:48:24 +03:00
financial-tracking-quantity-backfill.ts fix: FinancialTracking.budgetX × Order.quantity — 3 sites + backfill 2026-04-28 11:23:57 +03:00
fix-pr-quantities.ts fix: analyzeImpact matches PR by description instead of sourceId — fixes P0 quantity corruption and P1 mass ПОМЕНЯТЬ tag (session 34) 2026-04-08 15:48:17 +03:00
fix-supplier-tags.sql fix: align supplier tags with all MaterialCategory values + add specific service tags 2026-04-08 15:48:23 +03:00
notify-telegram.ps1 fix: remove duplicate СРОЧНО priority — keep only Срочный (session 34) 2026-04-08 15:48:24 +03:00
orchestrator.ps1 fix: remove duplicate СРОЧНО priority — keep only Срочный (session 34) 2026-04-08 15:48:24 +03:00
po-delivery-backfill.ts feat: PO delivery date mandatory + planning UX fixes + backfill 2026-04-27 20:52:27 +03:00
s53a-mig.ts fix(s53a-mig): step 1 reconstructs originalQuantity from POLine consumed 2026-04-27 17:28:25 +03:00
seed-extended.ts fix: remove duplicate СРОЧНО priority — keep only Срочный (session 34) 2026-04-08 15:48:24 +03:00
seed-steel-references.ts fix(steel-refs): deduplicate SteelReference, add @@unique, AI self-verification 2026-04-24 16:29:19 +03:00
send-task.ps1 fix: remove duplicate СРОЧНО priority — keep only Срочный (session 34) 2026-04-08 15:48:24 +03:00