Purchases
The Purchases module allows branches to record and manage purchase orders from suppliers, track expected deliveries, and update stock based on received items. It supports full and partial receipt of items, ensuring accurate inventory tracking.
Index Page
The Purchases Index Page lists all purchase orders created in the system.
It provides a quick overview of suppliers, total amounts, status, and expected delivery dates.

Filters
- Branch
- Supplier
- Status
- Expected At (date range)
- From
- To
Actions
- Create Purchase – Create a new purchase order.
Row Actions
- On Click Row → Opens Show Purchase page.
- Show Purchase – View details of the purchase order.
- Edit Purchase – Available only if status is Pending (not Received).
- Mark as Received – Available if status is not Received. Allows confirmation of received quantities.
- Delete Purchase – Remove purchase order.
Bulk Actions
- Delete multiple purchases at once.
CRUD Attributes
Purchase Information
| Attribute | Description | Required |
|---|---|---|
| Branch | The branch where the purchase is assigned. | Yes |
| Supplier | The supplier providing the ingredients. | Yes |
| Tax | Tax applied to the purchase. | Yes |
| Discount | Discount applied to the purchase. | No |
| Expected Date | The expected delivery date of the purchase. | No |
| Notes | Additional notes about the purchase order. | No |
Purchase Items
| Attribute | Description | Required |
|---|---|---|
| Ingredient | The ingredient being purchased. | Yes |
| Quantity | The number of units being purchased. | Yes |
| Unit Cost | The cost per unit of the ingredient. | Yes |
Note: Line totals are automatically calculated as:
Line Total = Quantity × Unit Cost
Create Page
The Create Purchase page allows users to:

- Select Branch and Supplier.
- Add Tax, Discount, Expected Date, and Notes.
- Add multiple Purchase Items (ingredient, quantity, unit cost).
- Subtotal, discount, tax, and total are automatically calculated.
- Items can be added or removed dynamically.
Edit Page
The Edit Purchase page allows modifications of a purchase order only if its status is not Received.

- Users can update Supplier, Tax, Discount, Expected Date, Notes, and Items.
- Existing purchase items can be edited (quantity, cost, ingredient).
- Items can be removed or new items added before the purchase is finalized.
- Totals update automatically after changes.
Show Page
The Show Purchase page displays all details of a purchase order.
There are two different UIs depending on the status:
UI 1 – Pending Purchase
If the purchase is still pending:

- Shows order details (Reference, Branch, Supplier, Status, Expected At, Notes, Subtotal, Discount, Tax, Total).
- Shows purchase items (Ingredient, Quantity, Unit Cost, Line Total).
- Received Quantity is
0since items are not yet received. - Option to Mark as Received is available.
UI 2 – Received / Partially Received Purchase
If the purchase is received (fully or partially):

- Shows all order details as above.
- Displays purchase items with:
- Quantity Ordered
- Received Quantity
- Unit Cost
- Line Total
- Includes a receiving history panel showing receipts with reference numbers, quantities, and timestamps.
- Tracks partial receipts until the purchase is fully received.
Mark as Received
When marking a purchase as Received (or Partially Received), the system requires confirmation of actual quantities received for each item.

| Attribute | Description | Required |
|---|---|---|
| Ingredient | The ingredient listed in the purchase order. | Auto |
| Ordered Quantity | The originally ordered quantity (read-only). | Auto |
| Received Quantity | The actual quantity received for the ingredient. | Yes |
| Unit Cost | The cost per unit (taken from the purchase order). | Auto |
| Reference No | Optional reference number for the goods receipt. | No |
| Notes | Additional comments about the receipt (e.g., damages). | No |
Note:
- If Received Quantity < Ordered Quantity, the status becomes Partially Received.
- If Received Quantity = Ordered Quantity for all items, the status becomes Received.
- Received quantities update stock automatically.
Notes
- Once a purchase order is marked as Received, it cannot be edited, only viewed.
- Partial receiving allows items to be received in multiple batches.
- Stock levels are updated based on confirmed received quantities.
