fix(export): show approver as signatory on PDF and XLSX reports
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 <noreply@anthropic.com>
This commit is contained in:
parent
4c1a41fe61
commit
b2bfa63f61
1 changed files with 3 additions and 3 deletions
|
|
@ -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) {
|
|||
<!-- ── Signatures ────────────────────────────────────────────── -->
|
||||
<div class="sig">
|
||||
<div class="sig-box">
|
||||
<div class="sig-name">${po.submitter.name}</div>
|
||||
<div class="sig-name">${approvedBy || po.submitter.name}</div>
|
||||
<div>
|
||||
<div class="sig-sub">Authorized Signatory & Stamp</div>
|
||||
<div class="sig-sub">For, Pelagia Marine Services Pvt. Ltd.</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue