# Skulitech ERP Cashbook, Finance and Procurement Upgrade Validation

## Package scope
This upgrade is based on `Skulitech_ERP_Auto_Registration_Academic_Results_Integration_2026-07-25(2).zip` and retains its admission, automatic registration, academic-results integration, fee controls, payments, expenses and payroll functions.

## Implemented
- General-ledger-driven cashbook with From Date and To Date selectors.
- Today, This Month and This Year shortcuts.
- Account, transaction-source and text filters.
- Opening balance, receipts, payments, closing balance and daily movement summary.
- Print and CSV export with spreadsheet-formula-injection protection.
- Bank, petty-cash and mobile-money account register.
- Controlled receipt, payment and transfer vouchers.
- Draft, submit, independent approve/post and reversal workflow.
- Transaction-hash verification before cashbook approval.
- Secure supporting-document upload controls.
- Finance and procurement control-centre integration.
- Exact cashbook-account selection on procurement payment vouchers.
- Maker-checker separation for LPOs, cashbook vouchers, finance approval requests, expense claims and supplier payment vouchers.
- Payment-voucher approver cannot release the same payment.
- PO-linked supplier invoices must use the controlled procurement payment-voucher route.
- Pending and approved vouchers reserve invoice balances to prevent collective over-vouchering.
- Three-way matching, invoice approval, supplier status, qualification, tax compliance, insurance and bank verification are revalidated.
- Future dates and closed accounting periods are blocked on applicable finance and procurement transactions.
- Supplier invoice and voucher rows are locked during payment processing to reduce concurrent double payment.
- Payment and receipt references are checked across supplier payments, debtor receipts, cashbook vouchers and accounting journals.
- Posted records are reversed by balancing journals rather than deleted.
- Additional XAMPP readiness and database-integrity checks.

## Database change
Run migration:

```bat
C:\xampp\php\php.exe bin\migrate.php
```

The migration is:

`database/migrations/20260726_013_cashbook_finance_procurement_hardening.sql`

It creates the cashbook tables, seeds default cashbook accounts, adds procurement payment-voucher cashbook-account selection, updates access privileges and normalizes eligible legacy manual supplier invoices.

## Validation performed
- 213 PHP files checked with `php -l`.
- PHP syntax errors: 0.
- Migration parsed into 9 SQL statements without unclosed quotes or comments.
- Original files removed: 0.
- New files added: 6.
- Existing files strengthened: 12.
- Cashbook upload directory is protected against executable files and directory listing.

## Required XAMPP checks after installation
Run these commands from the `college_erp` directory:

```bat
C:\xampp\php\php.exe bin\migrate.php
C:\xampp\php\php.exe bin\check_integrity.php
C:\xampp\php\php.exe bin\xampp_check.php
```

The build environment used for this upgrade did not have a live MySQL/XAMPP database or the `pdo_mysql` extension, so database migration and end-to-end transaction tests must be completed on the target XAMPP installation.

## Minimum acceptance test
1. Confirm Finance can open **Finance > Cashbook**.
2. Filter the cashbook by a custom From Date and To Date.
3. Create and submit a receipt voucher; approve it using a different user.
4. Create and submit a payment voucher; approve it using a different user.
5. Create a transfer between two cashbook accounts.
6. Reverse one posted test voucher and confirm the balancing journal.
7. Create a procurement payment voucher and select the correct bank/mobile-money account.
8. Confirm the preparer cannot approve the voucher and the approver cannot release the payment.
9. Confirm two pending vouchers cannot exceed one supplier invoice balance.
10. Run `bin/check_integrity.php` and resolve any exceptions before live deployment.
