Commit graph

5 commits

Author SHA1 Message Date
19029a5a77 chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 23:18:58 +05:30
3b3a26eafe feat(receipt): allow partial receipt confirmation with per-item delivery tracking
Submitters can now mark individual item quantities as received when
confirming delivery, rather than treating a PO as all-or-nothing.

Schema (migration: 20260516103013_partial_receipt):
- POStatus: new PARTIALLY_CLOSED value between PAID_DELIVERED and CLOSED
- ActionType: new PARTIAL_RECEIPT_CONFIRMED value
- POLineItem: new deliveredQuantity Decimal? field — accumulates delivered qty
  across multiple receipt events

State machine:
- PAID_DELIVERED → confirm_partial_receipt → PARTIALLY_CLOSED (new)
- PARTIALLY_CLOSED → confirm_receipt → CLOSED (all delivered)
- PARTIALLY_CLOSED → confirm_partial_receipt → PARTIALLY_CLOSED (more partial)

Receipt page / form:
- Loads line items with ordered qty, previously delivered qty, and remaining qty
- Per-row numeric input for "receiving now" defaulting to all remaining
- "Mark all remaining" shortcut
- Dynamic button: "Confirm Partial Receipt" vs "Confirm Receipt & Close PO"
- Info banner telling user if the PO will stay open or close

Receipt action:
- Accumulates deliveredQuantity per line item
- If all lines fully delivered → CLOSED + fires notifications + updates inventory
- If any line still outstanding → PARTIALLY_CLOSED (no notifications yet)
- Inventory auto-update runs per-event for the delivered quantities only

Dashboard & PO detail:
- Open Orders count now includes PARTIALLY_CLOSED
- "Confirm Receipt" CTA in po-detail handles PARTIALLY_CLOSED with
  distinct amber styling and "Confirm Remaining" label
- Activity log shows PARTIAL_RECEIPT_CONFIRMED with appropriate label
- PARTIALLY_CLOSED gets warning (amber) badge variant

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 16:02:44 +05:30
4737edcee9 fix(dashboard): use color-coded PoStatusBadge on submitter and manager dashboards
The Technical/Manning dashboard's Recent Orders table was rendering all PO
statuses as a hardcoded gray pill span. The Manager dashboard's Recent
Approved Orders table was similarly hardcoded to success-green for every row,
regardless of actual state (Approved vs Sent for Payment vs Paid).

Replace both with the existing PoStatusBadge component which maps each
PO status to the correct CVA variant (success/warning/danger/default/outline)
per the design-system colour palette defined in PO_STATUS_VARIANTS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 04:11:22 +05:30
902bd5f048 refactor(labels): rename Vessel→Cost Centre and Account/Cost Centre→Account
All user-facing strings updated across 22 files. Backend field names
(vesselId, vessel relation, Vessel model) unchanged.

Vessel → Cost Centre
- Page titles: Vessel Management, Vessel Detail
- Sidebar nav item
- Form labels in New PO, Edit PO, Import PO, Manager Edit, Approvals Search
- Table column headers in Approvals, Dashboard, History, My Orders
- Filter dropdowns ("All vessels" → "All cost centres")
- vessel-form dialogs: Add/Edit/Create
- sites/[id] stat card label
- sites/page column header
- XLSX export row 7 label; PDF HTML label; CSV header
- "Vessel/Office Requisition Number" → "Cost Centre/Office Requisition Number"
- Breadcrumb in vessel detail; "Home port" → "Home site"
- spend-charts heading
- Validation error message

Account / Cost Centre → Account
- po-detail "Account / Budget Head"
- manager-edit-po-form "Account / Cost Centre"
- import-form "Account / Cost Centre"
- accounts/page heading "Account / Cost Centre Management"
- XLSX export "Budget head"; PDF HTML "Budget head"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 00:39:00 +05:30
94774ca96b feat(dashboard): role-specific dashboards for submitter, manager, accounts and admin
Submitter: open PO count, recent orders table, New PO CTA.
Manager: approvals count, approved PO listing, spend by vessel and month bar charts (Recharts).
Accounts: payment queue total value, ready-for-payment count.
Admin/Auditor: total PO count card.
2026-05-05 23:24:55 +05:30