MR check: finance-services !2704: feat(po-service): enhance mapping logic for PO and invoice items
- MR finance-services!2704, from
release-autest/yXIVqg2t-po-line-itemintoautest, by Bariq, updated 2026-11-03, checked at commita889705b. - Verdict: Affected. Of 50 certified dashboards: Broken 0, Affected 7, Needs review 0, Safe 43.
- Post the comment? Recommended: the developer should see this before merging.
- Changed: 0 migration(s), 0 model file(s), 1 code file(s) naming report data, 0 other file(s).
Drafted comment (not posted)
The comment a developer would see, between the two lines. Nothing is posted by the tool; whether comments are ever posted, and by whom, is not decided.
Report impact check: Affected. This MR changes data that 7 certified Superset dashboards show. The reports keep working, but their numbers or labels can change.
Why: po.service.ts: Changes how invoice line items get their cost code from the PO. When a PO is updated, invoice items in review are now matched to PO lines by po_item_uuid (or not at all for new line items) instead of by position; and a commitment increase now writes po_item_uuid and the new PO line's cost code back into the invoice's items JSON. Invoice line cost codes in invoices.items, which Invoice Line Items, WIP and P&L group by, can differ from before. Medium: how often the old index matching gave a different cost code is unknown. (lines: po.service.ts line 6416, po.service.ts line 6477)
| Dashboard | Verdict | Charts it touches |
|---|---|---|
| Finance Dashboard | Affected | Net Working Capital vs Gross Working Capital, Total Account Receivable and Payable Aging |
| Invoice Line Items | Affected | Invoice Line Items |
| Payment Run | Affected | Payment Run |
| Profit & Loss | Affected | Profit & Loss, Profit & Loss Details |
| WIP Detailed | Affected | Costs |
| WIP | Affected | Report |
| Invoice Report by Xero Entity | Affected | Xero Entity |
How the change reaches each dashboard
- Finance Dashboard (Affected, medium confidence): dataset "DATASET_Net Working Capital vs Gross Working Capital" → 2 charts: Net Working Capital vs Gross Working Capital, Total Account Receivable and Payable Aging
- Invoice Line Items (Affected, medium confidence): dataset "DATASET_Invoice Line Items" → 1 chart: Invoice Line Items
- Payment Run (Affected, medium confidence): dataset "DATASET_Weekly Payment Run" → 1 chart: Payment Run
- Profit & Loss (Affected, medium confidence): dataset "DATASET_Historical Profit & Loss" → 2 charts: Profit & Loss, Profit & Loss Details
- WIP Detailed (Affected, medium confidence): dataset "DATASET_MV WIP Costs" → 1 chart: Costs
- WIP (Affected, medium confidence): dataset "DATASET_WIP Report" → 1 chart: Report
- Invoice Report by Xero Entity (Affected, medium confidence): dataset "DATASET_Xero Entity" → 1 chart: Xero Entity
Checked at a889705b against the 50 published and certified Superset dashboards (map built 2026-11-16) by the Report Impact Checker AI Tool (read-only). Questions: Lucas (BI).
Details for Lucas
Reviewed: flagged
- Affected (medium):
src/po.service.ts: Changes how invoice line items get their cost code from the PO. When a PO is updated, invoice items in review are now matched to PO lines by po_item_uuid (or not at all for new line items) instead of by position; and a commitment increase now writes po_item_uuid and the new PO line's cost code back into the invoice's items JSON. Invoice line cost codes in invoices.items, which Invoice Line Items, WIP and P&L group by, can differ from before. Medium: how often the old index matching gave a different cost code is unknown.