From b2bfa63f61a8a90e3b81cbef7a07da11460e39fa Mon Sep 17 00:00:00 2001 From: Hardik Date: Sat, 16 May 2026 15:57:39 +0530 Subject: [PATCH] fix(export): show approver as signatory on PDF and XLSX reports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The left signature block on generated PO documents (PDF and XLSX) was showing the submitter's name as the authorized signatory. The signatory should be the manager who approved the PO, since they are the one authorizing the expenditure on behalf of the company. The approvedBy name was already extracted from the APPROVED / APPROVED_WITH_NOTE action at the top of the export route — it just wasn't being used in the signature block. Now both the PDF and XLSX templates use approvedBy for the left sig block, falling back to the submitter only if the PO has not yet been approved (e.g. when exporting a draft). Co-Authored-By: Claude Sonnet 4.6 --- App/pelagia-portal/app/api/po/[id]/export/route.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/App/pelagia-portal/app/api/po/[id]/export/route.ts b/App/pelagia-portal/app/api/po/[id]/export/route.ts index 7e13578..f018790 100644 --- a/App/pelagia-portal/app/api/po/[id]/export/route.ts +++ b/App/pelagia-portal/app/api/po/[id]/export/route.ts @@ -355,8 +355,8 @@ export async function GET(request: NextRequest, { params }: Props) { ws.getRow(SIG_ROW + 1).height = 14; ws.getRow(SIG_ROW + 2).height = 14; - // Left sig block (submitter) - sc(SIG_ROW, 1, po.submitter.name, { font: fBold, border: { top: thin(), left: thin(), right: thin() }, align: alignC }); + // Left sig block (approver — the manager who authorized the PO) + sc(SIG_ROW, 1, approvedBy || po.submitter.name, { font: fBold, border: { top: thin(), left: thin(), right: thin() }, align: alignC }); ws.mergeCells(`A${SIG_ROW}:D${SIG_ROW}`); sc(SIG_ROW + 1, 1, "Authorized Signatory & Stamp", { font: fSmall, border: { left: thin(), right: thin() }, align: alignC }); ws.mergeCells(`A${SIG_ROW + 1}:D${SIG_ROW + 1}`); @@ -636,7 +636,7 @@ export async function GET(request: NextRequest, { params }: Props) {
-
${po.submitter.name}
+
${approvedBy || po.submitter.name}
Authorized Signatory & Stamp
For, Pelagia Marine Services Pvt. Ltd.