# Purchase Requisitions, LPOs and Sales Orders

## Setup

1. In Roles, under Purchases, grant the relevant requisition/LPO actions and
   View Own or View All. Approval setup and approval decisions are separate
   permissions. Existing roles are not automatically granted these rights.
2. Purchases > Purchase Requisitions > Approval Levels: choose a branch and add
   approval levels in order, e.g. Department Manager, Finance, Director.
   Select the approver role for each level. Give those roles Purchases module
   access and the corresponding Approve / Reject permission, and assign users
   to the branch. The document preparer cannot approve their own document.
3. Configure LPO approval levels separately if required. Without LPO levels,
   submitting a draft issues it immediately. Requisitions always require levels.
4. Sales Orders is a separate module immediately below Sales. Grant its module
   access and individual permissions in Roles, including View Own or View All.

## Purchase requisition

Purchases > Purchase Requisitions > Add Purchase Requisition opens a two-step
popup: header/branch/dates, then product search, quantity, price and discount.
Save a draft, review it, then submit. Submission makes it Pending, not final.
Approvers review sequentially. Only completion of every level makes it Approved.
Give approvers both Update Requisition and Approve / Reject permissions if they
need to revise requested items. The current approver can use Edit Requisition
while it is pending, but cannot change its branch. Saving revisions restarts all
approval levels; prior items and decisions are retained in the activity log.
Stale approval forms cannot approve the revised document. Approved requisitions
are locked. Rejection requires a reason; a rejected request remains in history
and a revised request must be created.
Submitted documents retain their approval chain if setup changes later.

Print opens a supplier-friendly requisition with product names, units and
quantities. Prices are hidden by default. Tick Show Prices on the print page
to include unit prices, discounts, VAT and totals. This affects only the printout,
not stored values. Draft/Pending/Approved status remains visible on every copy.

## LPO

Purchases > Purchase Orders (LPO) lists orders. The same two-step form includes
supplier, external reference, payment terms, freight, shipping and delivery.
An approved requisition has Create LPO. Only one LPO can be created from it,
and approved products/quantities must be retained; supplier prices can change.
Draft LPOs may be edited. Submit/Issue applies configured approval levels.
Print produces an A4 document, clearly showing Draft/Pending/Issued status.
Cancellation retains the document and activity history; there is no hard delete.

## Sales orders

Create a customer order, add items, save the draft, then confirm it. Confirmed
orders may be closed or cancelled by authorised users. Closing only closes
the order document; it is not invoice posting or payment receipt.

## Stock, VAT and accounting

All three documents are planning documents. They do not reserve/deduct stock,
create supplier debts, sales, purchases, payments, VAT ledger entries or journals.
Item estimates use each product's existing VAT rules, including VAT-inclusive
prices, exemption and zero rating. Product names, prices and tax breakdowns
are saved on the document, so later product changes do not rewrite history.
Combo products are excluded from requisitions/LPOs. Non-selling products are
allowed in procurement but excluded from Sales Orders.

Actual goods receipt must still be recorded using Add New Purchase. Actual
sales must still be posted through the existing selling screens. Automatic
LPO receipt or sales-order invoice conversion is not included in this upgrade.
SMS notifications are not enabled.

## Deployment

Back up the client database; copy the updated code and run:

```text
php artisan migrate --force
php artisan route:clear
php artisan view:clear
```

Migration: `2026_10_11_100000_create_procurement_and_sales_orders`. It adds four
document/approval tables, new permission checkboxes and the Sales Orders module.
No existing transaction, product or stock balance is changed. Module ordering
after Sales is shifted by one to make room for Sales Orders.
