# Admin Finance Reports

## Location

The admin finance reports section is available under:

- `/admin/finance/overview`
- `/admin/finance/revenue`
- `/admin/finance/expenses`
- `/admin/finance/expenses/manage`
- `/admin/finance/cashflow`
- `/admin/finance/aging`

Legacy URLs under `/admin/finance-reports/*` remain available and redirect to the new paths.

## Sidebar

The admin sidebar shows a dedicated group titled:

- `تقارير مالية` / `Rapports financiers`

The group contains exactly these links:

1. Overview
2. Revenue
3. Expenses
4. Manage expenses
5. Cashflow
6. Aging

## Permission

Routes are protected by:

- `auth`
- `can:finance.reports.view`

Primary permission:

- `finance.reports.view`

Optional export permission:

- `finance.reports.export`

Expense entry permission:

- `finance.expenses.manage`

Backward-compatible legacy permissions are still recognized:

- `view_finance_reports`
- `export_finance_reports`

## Default role assignment

These roles receive access by default:

- `admin`
- `super_admin`
- `finance`
- `finance_manager`
- `finance_reporting`

Users such as support, teacher, or student will not see the sidebar section and cannot access the pages unless the permission is granted explicitly.

## Expense Entry Workflow

- Open `/admin/finance/expenses`
- Click `إدارة المصاريف / Gestion des dépenses`
- Add, edit, or delete expense rows from `/admin/finance/expenses/manage`
- Manage expense categories from the same screen before entering a new type of spending

New expenses feed:

- expense report
- cashflow report
- finance overview totals

## Expense Categories

- Default categories remain available out of the box
- New categories can be added from `/admin/finance/expenses/manage`
- Categories can be disabled without deleting old expense rows
- Custom categories already used in expense records cannot be deleted

## Expense Payment Methods

- Expense payment methods are managed from `/admin/finance/expenses/manage`
- Default methods ship with the platform and can be disabled if not used
- New custom methods can be added for operational needs
- Custom methods already used in expense records cannot be deleted

## Revenue Rules

- Student payments are revenue, not expenses
- Confirmed, verified, and partial payments with a received amount are counted in revenue totals
- Partial payments increase revenue by `amount_paid` only, while the remaining balance stays visible in receivables
