mega-plant/lib
David aac440cfef Fold purchase orders into the Running Costs Overview, with incl/excl totals
A purchase order buys parts and repairs against a plant item, so its money is
running cost and belongs in the same per-machine, per-month series the Overview
already reads. Without it September showed nothing at all.

Merged at READ time, never copied into monthly_running_costs: that collection is
deleted and rebuilt by every seed, so a purchase written there would vanish on the
next one and have to be re-uploaded. purchase_lines is never deleted, so the money
lives in one place and the Overview adds it up.

- Month comes from the PO date (when it was ordered), not "Required By":
  MEGPPO50532 is dated 07/10 but required 29/08 and those must not be confused.
- Only lines allocated to a machine are counted. An unallocated line is real money
  not yet on a plant item; it stays on /purchases, reported, rather than being
  hidden or added to the fleet total.
- A PO with no readable date is excluded and named, never guessed into January.
- Bottom total row shows incl ABOVE excl per month and for the YTD. Workbook
  figures carry no VAT column, so RUNNING_VAT_PCT (15, confirmed by every PO line)
  is the single constant to revisit if they are ever restated ex-VAT.

September now reads R 5 842 incl / R 5 080 excl from the two September POs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-10-09 12:10:13 +02:00
..
auth-policy.test.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
auth-policy.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
auth-service.test.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
auth-service.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
auth.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
chart-profit.ts Income: hide stood-down machines, with an active/inactive filter 2026-10-03 18:40:32 +02:00
cost-code.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
data.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
financing.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
insurance-rate-policy.json Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
insurance-rate-policy.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
insurance.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
intake-retry.test.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
intake-retry.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
invoice-booking-policy.json Invoices: line-item extraction, booking to plant items, VAT-inclusive income 2026-10-01 15:59:30 +02:00
invoice-booking.ts Invoices: line-item extraction, booking to plant items, VAT-inclusive income 2026-10-01 15:59:30 +02:00
invoice-parser.test.ts Test: a site typed without its space is deliberately NOT folded 2026-10-08 19:06:30 +02:00
invoice-parser.ts Invoices: one line per charge, and fold an abbreviated site 2026-10-06 11:25:10 +02:00
invoice-party-policy.json Split the invoice register into Internal and External Invoices 2026-10-08 11:49:48 +02:00
invoice-party.test.ts Split the invoice register into Internal and External Invoices 2026-10-08 11:49:48 +02:00
invoice-party.ts Split the invoice register into Internal and External Invoices 2026-10-08 11:49:48 +02:00
invoice-revalidate.ts Split the invoice register into Internal and External Invoices 2026-10-08 11:49:48 +02:00
invoice-routes.ts Split the invoice register into Internal and External Invoices 2026-10-08 11:49:48 +02:00
mechanics.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
oil.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
pb.ts Round 4: regressions fixed + mobile standard 2026-09-12 12:05:43 +02:00
plant-location-policy.json feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
plant-map.test.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
plant-map.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
profit.test.ts Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
profit.ts Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
purchase-booking.ts Fold purchase orders into the Running Costs Overview, with incl/excl totals 2026-10-09 12:10:13 +02:00
purchase-parser.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
qr-pdf.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
qr.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
rows.test.ts Invoices: line-item extraction, booking to plant items, VAT-inclusive income 2026-10-01 15:59:30 +02:00
rows.ts Fold purchase orders into the Running Costs Overview, with incl/excl totals 2026-10-09 12:10:13 +02:00
server-data.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
sites.test.ts Give external invoices a supplier name; keep them off the sites page 2026-10-08 12:04:42 +02:00
sites.ts Give external invoices a supplier name; keep them off the sites page 2026-10-08 12:04:42 +02:00
utils.ts Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00