4 Changelog
shad0w edited this page 2026-06-24 10:24:03 +00:00

Changelog

Mirrors CHANGELOG.md at the repo root (the authoritative copy). Releases are tagged vX.Y.Z; the deployed production version is whichever tag is currently checked out in ~/pms. See Deployment and Operations.

[Unreleased]

Added

  • Reports — Purchasing spend analytics (view_analytics) — /reports/cost-centres and /reports/accounting-codes, each index → drill-down → detail; KPI tiles, comparison/trend charts (one colour per item), Top-N tables, sparklines, CSV export; URL-driven filters (Weekly/Monthly/Yearly, FY, Top/Bottom-N, "Add to graph"). Spend = post-approval POs by approvedAt/totalAmount, allocated per line-item account. See Reports.
  • Email PO to vendor (issue #14) — Outlook draft with a 7-day PO-PDF link, rendered by the PdfService microservice and cached per PO. See Deployment and Operations.
  • MicroservicesEpfoService (UAN/EPFO lookup) and PdfService (PO→PDF) join GstService; all auto-deployed on each release tag via ecosystem.config.js.
  • Unsaved-changes prompt (issue #18) — leaving the PO create/edit screen with unsaved edits offers Save as draft / Discard / Stay.
  • Crew login on hire (crewing) — onboarding/placement/admin-create can set an explicit login email + initial password for management ranks.
  • Companies (multi-company invoicing)Company model and /admin/companies CRUD. A PO is billed under a selected company (name, short code, GST number, address, phone/mobile, contact + invoice email, invoice address); details populate the exported PO header / invoice block. See Purchase Orders.
  • Structured PO numbers (lib/po-number.ts) — COMPANY/VESSEL/ID/FY; Indian financial year; system IDs start at 9000; imported POs keep their original number. See Purchase Orders.
  • 3-level accounting-code hierarchyAccount.parentId self-relation (Top → Sub → Leaf), 6-digit codes seeded from prisma/accounting-codes-data.ts. Only leaf codes are PO-selectable, via a searchable combobox.
  • Compulsory payment datePurchaseOrder.paymentDate captured at payment; defaults to today, rejects future dates. Backfilled for existing POs.
  • Editable PO date (poDate) — exported "Date" shows poDate ?? approvedAt ?? createdAt.
  • Submitter vendor creationcreate_vendor lets Technical/Manning add vendors; created unverified, verified when a PO closes/pays with them, on import, or via Manager/Accounts/Admin. See Vendors.
  • Import PO → Closed/po/import saves a parsed Excel PO directly as CLOSED, auto-detecting company, matching vessel, auto-creating vendor, products, and per-vendor prices.
  • Inventory feature flag (NEXT_PUBLIC_INVENTORY_ENABLED) — site stock/consumption gated; PO catalogue stays available. Inventory increments at PO approval. See Inventory and Catalogue.
  • Dashboards — Accounts gains a "Payments Completed This Month" card.
  • Automated issue-to-deploy pipeline — Report Issue button → Forgejo issue → Claude watcher triage/fix → PR → tag-triggered deploy. See Issue-to-Deploy Pipeline.

Changed

  • Cost centre is now a Vessel only. The Vessel-or-Site cost-centre model was removed: PurchaseOrder.vesselId is required, costCentreRef is gone, and Vessel no longer links to a Site. Vessels are surfaced as "Cost Centre" (/admin/vessels → "Cost Centre Management"). See Glossary.
  • Closed PO list — submitters see only their own CLOSED POs; Managers/SuperUsers see all.
  • Sidebar reorganised into Purchasing and Administration (role-aware); "Inventory" renamed to "Purchasing".
  • Items/admin/products is the editable catalogue; /inventory/items is read-only; both link to a shared item detail page.
  • Profile reachable by every role (incl. SSO-only users, with an email fallback lookup); only approvers can upload an approval signature.
  • Manager dashboard "Approved This Month" now counts by approvedAt (no longer undercounts once a PO progresses past MGR_APPROVED).

Fixed

  • "Email to vendor" never rendered — auth middleware bounced the PdfService svc-token export fetch to /login; /api/po/<id>/export is now allowed through when the svc token matches (#127).
  • Reports charts all one colourSERIES_COLORS imported from a "use client" module into server components resolved to a proxy (undefined); moved the palette to a dependency-free module (#120).
  • Production P2022 … column does not exist after deploy — caused by shipping code whose Prisma client expected a column before migrate deploy ran. Migrations must be applied before the new build serves traffic (now in the README and the deploy workflow).

Recent fixes (from git history)

A sample of recently merged fixes, many via the automated claude/issue-N pipeline:

  • PO details: show all attachments, grouped by type (#27/#10).
  • History: allow filtering by multiple statuses (#33/#31).
  • Approved-this-month counts all POs approved in the period (#34/#32).
  • Approved POs show approval date as the PO date (screen + export) (#22/#5).
  • Closed-PO list filters corrected for manager and submitter (#21/#6).
  • Exported PO includes optional line-item description (#23/#8).
  • Allow attachments (incl. delivery receipt) at delivery confirmation (#25/#9); Receipt upserted on repeat confirmations.
  • Automation: test-DB mirror + dev-server env for autofix; staging on pms1; SSH-tunnel lock + dev banner; ported watcher to bash for 24/7 cron.

Tags so far: 0.1, 0.1.1. For the live history, see the repo's commit log and Forgejo releases.