[Issue]: Not able to see submitters PO #133
Labels
No labels
bug
claude-failed
claude-pr
claude-queue
claude-working
epic
feature
interactive
portal
triaged
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: shad0w/pelagia-portal#133
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Raised by
Supriya Sutar (Pelagia) (supriya.s@pelagiamarine.com, TECHNICAL) — via portal Report Issue button
Description
2.Add TCS & Discount below GST.
Priority
P2 — Medium
Context
/po/cmqtb4z8m00mouxaw96r0z0nxClaude triage
Triage — Issue #133: "Not able to see submitters PO"
Type: Feature (two bundled enhancements) · Priority: P2 · Reporter: Supriya Sutar (TECHNICAL)
The title and body don't describe anything broken. The reporter asks for two new capabilities, so this is a feature request, not a bug. It actually bundles two unrelated asks, both touching sensitive areas.
Request 1 — "Add PO summary in dashboard so we can track who issued the PO"
Wants a dashboard view that surfaces who submitted/issued each PO (the submitter).
What exists today
app/(portal)/dashboard/page.tsxrenders role-specific dashboards:SubmitterDashboard(TECHNICAL/MANNING/SUPERUSER) — only shows the current user's own POs (where: { submitterId: userId }). For these users "who issued" is always themselves, so a submitter column here is meaningless — the request only makes sense as a cross-submitter view.ManagerDashboard— "Recent Approved Orders" table (PO / Title / Cost Centre / Status / Amount / Approved). No submitter column.AccountsDashboard/GenericDashboard— stat cards only.PurchaseOrder.submitterrelation (submitterId→User, named relation"Submitter") already exists (prisma/schema.prisma:601), so the data is available without a migration.Likely action items
submitter: { select: { name: true } }) to the relevant dashboard table(s), and/or a small "PO summary" grouping of recent POs by submitter.Open questions (block an unattended run)
NEXT_PUBLIC_SUBMITTER_VIEW_ALL_ENABLEDflag that gates submitters reading all POs). Showing all submitters' POs to a TECHNICAL user by default could leak data and likely needs gating.Request 2 — "Add TCS & Discount below GST"
Add TCS (Tax Collected at Source) and a Discount line to the PO totals breakdown, positioned below the GST line.
What exists today
components/po/po-line-items-editor.tsxcalcTotals()→{ taxable, gst, grand }, rendered as Taxable subtotal → GST → Grand Total (both the read-only and editable variants; the "below GST" slot is here).totalAmount = sum(qty × unitPrice × (1 + gstRate))is recomputed server-side in the PO server actions (po/new/actions.ts,po/[id]/edit/actions.ts,po/import/actions.ts) and stored onPurchaseOrder.totalAmount(Decimal(12,2)).tcs/discountfields exist anywhere (schema, lib, components, validations all confirmed clean). GST lives only as a per-linePOLineItem.gstRate.Likely action items (wide blast radius)
discountandtcsfields — rate and/or amount — toPurchaseOrder/POLineItem.db:migrateagainstpelagia_test.totalAmountformula in every server action (new / edit / import) to apply discount and add TCS — a payments/money calculation change.lib/validations/po.ts.po-line-items-editor.tsx; display inpo-detail.tsx.app/api/po/[id]/export/) invoice/totals block.Open questions
Files / areas involved
app/(portal)/dashboard/page.tsx,components/dashboard/*(Request 1)prisma/schema.prisma+ a new migration (Request 2)components/po/po-line-items-editor.tsx,components/po/po-detail.tsx(Request 2 UI)app/(portal)/po/new/actions.ts,po/[id]/edit/actions.ts,po/import/actions.ts(totalAmount recompute)lib/validations/po.ts(Zod),app/api/po/[id]/export/(PDF/XLSX)Why not claude-queue
Request 2 requires a DB migration and changes the money/total calculation across multiple server actions and the export — explicitly out of bounds for an unattended run — and the tax/discount semantics are undefined. Request 1 needs a scope/permissions + design decision about which roles see whose POs. Both legs need human steering.
Routing rationale: Two-part feature request whose totals leg needs a schema migration plus a money-calculation change with undefined tax semantics, and whose dashboard leg needs a permissions/scope design decision — route to interactive.
Routing:
interactive| Type:feature