Expenses — list, add, edit, view, delete
Menu: Expense Management → Expenses
This screen shows expense entries for the selected Restaurant: names, category, whether the row came from a one-time entry or a recurring rule, amount, date, payment method, and payment status. You can filter by date range, status, type, payment method, and category; paginate; and add, view, edit, or delete entries where permitted.
Top filters
| Control | Behaviour |
|---|---|
| Restaurant | Required context for all list data and for Add Expense. First outlet may be selected automatically. |
| Status | All, Unpaid, Paid, Reconciled. |
| Expense Type | All, One Time, Recurring (recurring-sourced rows show Recurring in the table). |
| Payment Method | All or one method from your configured payment methods. |
| Expense Category | All or one category from Expense Categories for this restaurant. |
| From Date / To Date | Default range when you open the page is typically the current calendar month (start–end of month). Change dates to widen or narrow the window. |
| Refresh | Reloads the list (tooltip: refresh one-time expenses). Disabled while loading or without a restaurant. |
| Add Expense | Opens Create Expense — requires Create on EXPENSES; disabled until a restaurant is selected. |
Changing filters or restaurant resets pagination to page 1 (implementation behaviour).
Table
| Column | Meaning |
|---|---|
| Name | Expense name (or — if empty). |
| Category | Linked expense category name. |
| Expense Type | One Time or Recurring if the row is linked to a recurring rule (recurring_id). |
| Amount | Two decimal places. |
| Expense Date | Formatted date (e.g. MMM dd, yyyy). |
| Payment Method | Method label (underscores shown as spaces). |
| Status | Badge: Paid (green), Reconciled (blue), or Unpaid (amber). |
| Actions | View (eye); Edit (pencil) if you may update; Delete (trash) if you may delete. |
Loading: Loading one-time expenses... (wording on screen; the list can still include recurring-generated rows).
Empty: No one-time expenses found.
How to delete an expense
- Click trash on a row.
- Confirm Delete — Are you sure you want to delete this one-time expense? (exact wording on screen).
- Delete / Deleting... or Cancel.
How to create an expense
Dialog title: Create Expense.
Basic Details
- Expense Name — required; max 150 characters (same validation rules as error messages on screen).
- Expense Category — required (dropdown includes None but validation requires a real category — pick an actual category).
- Supplier — optional (None or supplier).
- Amount — required; must be > 0.
Date Details
- Expense Date — required (date picker). Default for new rows is today.
Period start/end fields exist in the data model but the period date pickers are not shown in the current form UI.
Payment
- Payment Method — required.
Additional Notes
- Notes — optional textarea.
Footer: Create Expense / Creating..., Cancel.
Note: New expenses are submitted with Paid status in the create payload used by this screen.
How to edit an expense
Title: Edit Expense — same sections as create.
If the expense is tied to a recurring rule (recurring_id present):
- An amber info banner appears: only amount and notes can be updated.
- Expense Name, Category, Supplier, Expense Date, and Payment Method are locked (read-only / disabled) while editing.
- Name validation is skipped for this mode; date and payment method validation are relaxed accordingly.
How to view an expense
Title: View Expense — read-only; Close only.
Pagination
When there is at least one row and loading has finished, pagination appears: change page, page size, and navigate previous/next (behaviour matches your shared table pagination component).
Permissions (summary)
| Action | Permission |
|---|---|
| Open screen / Refresh / View | Read access to EXPENSES (and route guard). |
| Add Expense | Create |
| Edit | Update |
| Delete | Delete |
