# Cashbook, Finance and Procurement Hardening

## Added cashbook
- New **Finance > Cashbook** module.
- Date selection using From Date and To Date, with Today, This Month and This Year shortcuts.
- Cash/bank account, source-module and text filters.
- Opening balance, receipts, payments and closing balance.
- Daily movement summary, print view and CSV export.
- Uses posted general-ledger lines as the source of truth, preventing duplicate entry of fee receipts, supplier payments, expense payments and other cash movements.
- Supports controlled manual Receipt, Payment and Transfer vouchers.
- Maker-checker workflow: Draft, Submitted, Posted and Reversed; no user, including administrators, can approve their own voucher.
- No deletion of posted entries; corrections use balancing journal reversals.
- Cashbook account register for bank, cash and mobile-money chart accounts.

## Finance controls hardened
- Future-dated expense claims and petty-cash entries are blocked.
- Closed accounting periods are respected before creating or approving entries.
- Payment and collection references are checked across journals, supplier payments, debtor receipts and cashbook vouchers.
- Expense claim approval and payment release are separated, and finance approval requests cannot be approved or rejected by their requester.
- Petty-cash approval revalidates dates and periods.
- Cashbook transaction hashes are recalculated before approval to detect unauthorised alteration.
- Legacy creditor and debtor routes now enforce locking, closed periods, future-date controls, role separation and cross-module reference uniqueness.

## Procurement controls hardened
- Pending and approved payment vouchers now reserve an invoice balance.
- Multiple vouchers cannot collectively exceed the outstanding supplier invoice.
- Supplier eligibility, qualification, tax compliance, insurance and bank verification are rechecked at voucher approval and payment.
- Three-way matching and invoice approval are rechecked at payment time.
- Voucher and supplier invoice records are locked during approval/payment to reduce concurrent double payment risk.
- Payment dates cannot be future dated or earlier than the voucher date.
- Payment release is separated from payment-voucher approval.
- References are checked across procurement payments, accounting journals and cashbook vouchers.
- Supplier invoice balances are rechecked immediately before payment.
- Every procurement payment voucher selects the exact bank, cash or mobile-money cashbook account; the general-ledger payment uses that account instead of a hard-coded bank account.
- Purchase-order invoices can only be released through the controlled Payment Voucher workflow; the older ledger route is limited to approved manual non-PO invoices.

## Installation
1. Back up the current database and application folder.
2. Replace the application with this upgraded package.
3. Run `php bin/migrate.php` from the `college_erp` directory.
4. Open **Finance > Cashbook** and confirm the Cash at Bank, Petty Cash and Mobile Money accounts.
5. Test one receipt, one payment, one transfer, one supplier voucher and one reversal before live use.
