30/04/2026

  - Terms & Conditions (end of PO)                                    [DONE - App implemented 05/05, structured 05/05]
  - Tax (GST)                                                         [DONE - App implemented 05/05]
  - Currency in INR                                                   [DONE - App implemented 05/05]
  - Discount                                                          [PENDING - not yet specced or built]
  - Cost centre and vessel is same                                    [PENDING SPEC UPDATE]
  - Account codes are too many. Can be divided in Account Group / Account code  [PENDING SPEC UPDATE]
  - UoM can be drop down                                              [DONE - Spec updated]
  - Size can be a different box for easy filtering                    [DONE - Spec updated]
  - In Edit mode, manager must be allowed to make changes in the line items with different font colour. Previous entry to be made visible with strike off  [DONE - App implemented]
  - Unable to see approved PO from dashboard                          [DONE - Spec updated]
  - Unable to see breakup of the expenses approved                    [DONE - Spec updated]
  - User dashboard Cannot open old PO                                 [DONE - Spec updated]

03/05/2026

  - List of Product and product codes needs to be maintained in db along with last known prices (along with vendor)
    when po is paid, the product db is automatically updated and vendor stored. if vendor is already on list, price updated
    [DONE - Spec updated]
    [DONE - App implemented]
      prisma/schema.prisma      — Product model, productId on POLineItem, PRODUCT_PRICE_UPDATED ActionType, Vendor→Product relation
      lib/permissions.ts        — manage_products permission (Admin)
      payments/actions.ts       — markPaid auto-updates Product.lastPrice + lastVendorId; logs PRODUCT_PRICE_UPDATED action
      admin/products/page.tsx   — Admin Product Catalogue list (code, name, description, lastPrice, lastVendor, status)
      admin/products/actions.ts — createProduct, toggleProductActive server actions
      sidebar.tsx               — Products link in admin nav
      seed.ts                   — 4 sample products; PO-2026-00001 line items linked to products
    [DONE - Migration applied as part of 20260505114211_add_po_export_fields]

04/05/2026

  - po needs to have delivery date                                    [DONE - App implemented 05/05]
  - terms and conditions is at the end of PO, set by tech/manning    [DONE - App implemented 05/05]
  - manager can edit any item on po                                   [DONE - App implemented (amber edit mode)]
  - po needs to have vendor before being approved                     [PENDING - no enforcement in approval action yet]
  - export to excel(xlsx) needed for individual PO                   [DONE - App implemented 05/05]

05/05/2026

  - PO export (XLSX + PDF) for sample PO PMS/HNR3/056/2026-27       [DONE]
      Output: Progress/PMS_HNR3_056_2026-27.xlsx  — Excel with live formulas
              Progress/PMS_HNR3_056_2026-27.pdf   — PDF matching sample layout
      Script:  generate_po.py (project root) — reusable for any future standalone export

  - App updated: all Sample PO fields + in-app individual PO export  [DONE]
      Schema changes (migration 20260505114211_add_po_export_fields applied):
        PurchaseOrder  += piQuotationNo, piQuotationDate, requisitionNo, requisitionDate,
                          placeOfDelivery, termsAndConditions; currency default USD → INR
        POLineItem     += gstRate (default 0.18 = 18%)
        Vendor         += address, gstin, contactMobile
      Forms (New PO + Edit PO):
        + Quotation Reference section (PI No. + Date)
        + Requisition section (Req No. + Date)
        + Delivery section (Place of Delivery, pre-filled)
        + Terms & Conditions section (pre-filled 7-point T&C, editable)
        + GST% per line item (0/5/12/18/28% dropdown, default 18%)
        + Taxable / GST / Grand Total breakdown live in editor
      Vendor admin: address, GSTIN, contact mobile added to add/edit form
      PO Detail: all new fields displayed; vendor shows address, GSTIN, contacts
      Export route: GET /api/po/[id]/export?format=pdf|xlsx
        PDF  — HTML print page matching Sample_PO layout (auto-triggers print dialog)
        XLSX — SheetJS workbook matching Sample_PO column layout
      Export PDF / Export XLSX buttons added to PO detail header
      Currency display updated to INR (en-IN locale) throughout

  PENDING: restart dev server → `pnpm db:generate`
           (Prisma client types are stale — DLL was locked during generate.
            Both migrations are fully applied; runtime works correctly.)

05/05/2026 (later) -

  - T&C section broken into structured fields                         [DONE]
      Schema:   termsAndConditions (free text) replaced by:
                tcDelivery, tcDispatch, tcInspection, tcTransitInsurance,
                tcPaymentTerms, tcOthers
      Migration: structured_tc_fields (applied)
      Forms:    Line 1 — fixed read-only banner (same for all POs)
                Lines 2–6 — labelled single-line inputs, pre-filled with defaults
                Line 7 — Others, multiline textarea
      Detail:   Numbered list, each field shown as "LABEL: value"
      Export:   PDF + XLSX both render numbered list with LABEL: value format

14/05/2026

- Need to add support for multiple accounts in single PO [DONE]
- Need to rename Vessel to "Cost Center" [DONE]
- need to have the support for multiple contacts at single vendor
- need to make items page tabular
- need to make vendor details page
- need to add new mail notification for paid and approved po
- need to ensure accounts notified on approved po
- need to make last line of t&c compulsory [DONE]

15/05/2026
- When site is selected, the sorting should happen by distance automatically with the option to select price
- Irrespective of whether the sorting is by distance or price, the tags of cheapest and closest should show up regardless (if site is selected)
- When logged in as technical the dashboard should display colored badges for PO status
- any edits on the PO should be highlighted once edit requested is resolved
- accounts should also get history
- approver name should show up as the signatory, not submitter
- on confirm receipt page, allow po to be partially closed until all items are delivered
