From 5d3b45a3a4b83f16c98af8393b47e61d64f58c5d Mon Sep 17 00:00:00 2001 From: "Claude (auto-fix)" Date: Fri, 19 Jun 2026 03:39:19 +0530 Subject: [PATCH] fix(po-detail): show approval date as PO date on detail screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PO date field was only displayed when a submitter explicitly set it. For approved POs without an explicit date, the approval date is now shown. Precedence: submitter-set poDate → approvedAt → createdAt (matches the export route which already used this logic). Fixes #5 --- App/components/po/po-detail.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/App/components/po/po-detail.tsx b/App/components/po/po-detail.tsx index 7c74b32..21288b0 100644 --- a/App/components/po/po-detail.tsx +++ b/App/components/po/po-detail.tsx @@ -163,6 +163,9 @@ export async function PoDetail({ po, currentUserId, currentRole, readOnly = fals .reverse() .find((a) => a.actionType === "APPROVED" || a.actionType === "APPROVED_WITH_NOTE"); + // PO date: submitter-set date → approved date → creation date + const poDisplayDate = po.poDate ?? po.approvedAt ?? po.createdAt; + return (
{/* Header */} @@ -302,7 +305,7 @@ export async function PoDetail({ po, currentUserId, currentRole, readOnly = fals {approvalAction && (
Approved By
{approvalAction.actor.name}
)} - {po.poDate &&
PO Date
{formatDate(po.poDate)}
} +
PO Date
{formatDate(poDisplayDate)}
{po.projectCode &&
Project Code
{po.projectCode}
} {po.dateRequired &&
Delivery Date Required
{formatDate(po.dateRequired)}
} {po.piQuotationNo &&
PI / Quotation No.
{po.piQuotationNo}
}