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

16/05/2026
- user profile page is needed to allow users to change things like passwords and apply for superuser access. on admin dashboard a page should be maintained where superusers and requests are tracked. add button for allow superuser to any user on user page. for manager allow them to add signature (for export to pdf/excel on approved POs). without signature, cannot approve pos - show a hint asking them to upload signature instead.
- notification system on page
- ensure export not possible untill signed
- format/validation for account, item, vendor, user ids, payment receipt numbers [OPEN-QUESTION]
- when payment happens from a vendor they are automatically verified
- Make buttons on screens like vendors, items, cost centers, Not Links. INcluding but not limited to - Edit, Delete, Deactivate
- mobile version for manager
- mobile version for accounts [open-question]

26/05/2026
- who assigns vendor?
- do technical/manning get to make po from excel?
- autogeneration and validation of id fields [DONE]
- pincode to geocode in bg. works on initial save
- site edit does not work? location updates but does not save
-- WAIT SAVING WORKS, THE BUTTON JUST SHOWS SAVING FOR SOME REASON
- confirm button while deleting [DONE]
- vessel edit does not save?
- 0 percent gst does not work [DONE]
- email notification take you to po [DONE]
- po word appears twice in subject [DONE]
- notification overflows on phone for manager [DONE]
- gst edit does not show strikethrough update [DONE]
- submitted for review notification not needed for submitter [DONE]
- show detail of po in email [DONE]
- accounts did not get notification
- in manager/submitter notes show name of person [DONE]
- Confirming... button appears as soon as I click Process Payment as accounts [DONE]
- phantom product prices updated by accounts in PO history [DONE]
- notify manager for receipt and partial receipt [DONE]
- allow submitter to close partially closed po [DONE]
- partial payment / advance payment for accounts [DONE]
- please confirm receipt - only for submitter not for manager [DONE]
- rename My Purchase Orders to Closed Purchase Orders [DONE]

30/05/26
- add a string code for company
- imported po should not need to be approved. it can directly be submitted and will show up in closed state in history.
- vendors from imported po should be auto added
- items from imported PO should be auto added
- hide item inventory features under an environment flag. only keep vendor and item list for pos(including cart) outside the flag.
- po number should be in the format - Company_code/Cost_centre/PO_ID/Financial_Year. Start PO_ID from 200 - 201,202, etc this number should also show on mails and on the exported PO
- based on the above format - extract company code, cost centre, po id from the imported pos

10/06:
- Allow the submitter to select a PO date. This should be picked up as the PO date and can be back/forward dated. Optional field - if not selected temporarily use creation date.
- Once approved, PO date should show date of approval, not creation. Also ensure the same is reflected in exported PO.
- For manager, closed purchase orders should show all the POs that are closed.
- For submitter, closed Purchase Order is also showing approved POs. It should only show Closed POs
- Items should get added to inventory as soon as PO is approved. Do not wait for Closed
- Line item Optional description needs to be shown in exported POs
- allow adding attachments at the delivery confirmation screen
- on po details screen show all attachments - submitted, payment and delivery. currently attachments not visible
- work order terms and conditions
- delivery receipt when confirming
- On manager screen - total approved this month is not updating/showing 0
- For Accounts User, have a similar dashboard card for Payments Completed this Month.
- add a email to vendor option once po is approved and full/partial payment is done that exports the PO as pdf and opens it in outlook with vendor email
- revive the reports feature - make it a section on the sidebar. implement the mockup

open questions - 
- what granularity in the accounting code(heading, subheading, etc.)
