From 67cd529f84b2339649375a175042976bdc33744c Mon Sep 17 00:00:00 2001 From: Hardik Date: Sun, 21 Jun 2026 01:17:28 +0530 Subject: [PATCH] docs: company logo, stamp & brand bar on exported POs Document the new Company.logoKey/stampKey branding fields, the company-assets storage namespace, and how logo/stamp/brand-bar render on PO exports. Co-Authored-By: Claude Opus 4.8 --- Data-Model.md | 10 ++++++---- File-Storage.md | 10 +++++++++- Purchase-Orders.md | 7 +++++++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Data-Model.md b/Data-Model.md index 738b97e..24e7468 100644 --- a/Data-Model.md +++ b/Data-Model.md @@ -128,10 +128,12 @@ Only **leaf** accounts (no children) are PO-selectable. Seed data: ### Company — multi-company invoicing `name, code? (unique, e.g. PMS), gstNumber?, address?, telephone?, mobile?, -email?, invoiceEmail?, invoiceAddress?, isActive`. The sister company a PO is -billed under (`PurchaseOrder.companyId`, optional); its details populate the -**exported PO header / invoice block** (falling back to Pelagia defaults). -Managed at `/admin/companies`. +email?, invoiceEmail?, invoiceAddress?, logoKey?, stampKey?, isActive`. The +sister company a PO is billed under (`PurchaseOrder.companyId`, optional); its +details populate the **exported PO header / invoice block** (falling back to +Pelagia defaults). `logoKey`/`stampKey` are storage keys for the branding +images shown on exported POs (see [File Storage](File-Storage)). Managed at +`/admin/companies`. ### Vendor + VendorContact `Vendor`: `name, vendorId? (unique formal code), address?, pincode?, gstin?, diff --git a/File-Storage.md b/File-Storage.md index 05d2ec4..e17deb1 100644 --- a/File-Storage.md +++ b/File-Storage.md @@ -47,9 +47,17 @@ production**. (`@unique poId`), upserted on repeat confirmations (notes preserved). - **Approval signature** (`User.signatureKey`) — uploaded by approvers from the profile page; appears on exported PO documents. +- **Company branding** (`Company.logoKey`, `Company.stampKey`) — a logo and a + stamp/seal uploaded per company from **Admin → Companies → Edit → Branding** + (permission `manage_vessels_accounts`). Keys are deterministic + (`company-assets//{logo,stamp}.`) so a re-upload overwrites in + place. Both appear on exported POs — logo top-left, stamp in the approver's + signatory block. Upload via the `uploadCompanyAsset` server action (≤ 4 MB, + PNG/JPG/WebP), not the presigned-URL flow. Client-side upload is helped by `lib/upload-files.ts`. The export endpoint embeds -the approver's signature in the generated PDF/XLSX. +the approver's signature, the company logo and stamp, and a fixed-colour brand +bar at the bottom of the generated PDF/XLSX. ## Required env (production) diff --git a/Purchase-Orders.md b/Purchase-Orders.md index aff4d81..628dc6e 100644 --- a/Purchase-Orders.md +++ b/Purchase-Orders.md @@ -106,6 +106,13 @@ approved, not creation). approver's name (and uploaded signature) appears as signatory; company details populate the header; optional line-item descriptions are included. +**Company branding** (set per company in Admin → Companies → Edit → Branding) +also renders on the export: the uploaded **logo** floats top-left of the header, +the uploaded **stamp/seal** overlays the approver's signatory block, and a fixed +brand-colour bar (`#92D050`) runs full-width along the bottom. Each piece is +optional except the bar, which is always drawn. See +[File Storage](File-Storage#where-files-attach). + ## Import PO → CLOSED `/po/import` parses a Pelagia-format Excel PO (`lib/po-import-parser.ts`,