# Sponsor Funds, Bulk Student Allocation and Accrual Accounting

## Purpose

This module handles third-party student funding received from:

- Higher Education Loans Board (HELB)
- County government bursaries
- National Government Constituencies Development Fund (NG-CDF) bursaries
- Scholarships, foundations, churches, employers and other sponsors

It prevents double receipting by separating the **one actual bank/cheque receipt** from the **many non-cash student allocations** made from that receipt.

## Where to find the feature

After logging in as **Finance**, **Admin** or **System Admin**, open:

- **Finance → Bulk Sponsor Receipting** for a funding-agency receipt with an optional CSV/XLSX schedule
- **Finance → Sponsor Receipts** for cheque clearance, approval, printing and reversal
- **Finance → Bulk Student Allocations** for validation, posting and student allocation advices
- **Finance → Sponsor Control Reports** for receipt-to-allocation reconciliation

Custom roles must include the `finance_sponsors` privilege.

## Controlled workflow

`Funding source → optional accrued award → one sponsor receipt/cheque acknowledgement → clearance and approval → one or more allocation batches → many student credits → reconciliation`

### 1. Funding source

Create a separate source for each organisation or programme, for example:

- HELB
- Nandi County Government Bursary
- Emgwen NG-CDF/CDF Bursary
- Equity Leaders Programme Scholarship

The source type supports HELB, County Bursary, NG-CDF/CDF Bursary, Scholarship and Other Sponsor.

### 2. Sponsor award or approved schedule

Where a sufficiently reliable award or approved schedule exists before cash is received, record an accrued award.

Accrual entry:

```text
Dr 1110 Sponsor Bursary and Scholarship Receivables
    Cr 2200 Sponsor Funds Unallocated Control
```

For a receipt-basis award, approval records the administrative commitment but no journal is posted until funds are received.

### 3. One bank or cheque receipt

Record the actual bank transfer, deposited cheque or other verified receipt only once. The student schedule is optional at this stage: Finance can save only the parent receipt, attach a schedule immediately, or allocate later manually/in bulk. The system blocks a repeated bank/cheque transaction reference across sponsor and direct-student receipt ledgers. A cheque may be recorded first as **Pending Clearance** and printed as an acknowledgement; it cannot be posted to the bank ledger or used for a posted student allocation until it is marked **Cleared**.

Receipt against an accrued award:

```text
Dr 1000 Cash at Bank
    Cr 1110 Sponsor Bursary and Scholarship Receivables
```

Receipt without a prior accrual:

```text
Dr 1000 Cash at Bank
    Cr 2200 Sponsor Funds Unallocated Control
```

The printable sponsor receipt is issued to the payer or retained as evidence of the actual bank receipt.

### 4. Bulk allocation to students

Create an allocation batch linked to the posted sponsor receipt. Students may be added manually or imported from CSV/XLSX using these headers:

```text
admission_no,amount,reference,beneficiary_reference,remarks
```

Download the Excel or CSV template directly from **Bulk Sponsor Receipting** or from the batch screen. The importer also accepts common alternatives such as `admission_number`, `adm_no`, `allocated_amount`, `bursary_amount` and `loan_amount`.

Posting the batch creates one balanced journal:

```text
Dr 2200 Sponsor Funds Unallocated Control
    Cr 1100 Student Fee Receivables
```

Each student statement receives a sponsor credit linked to the parent sponsor receipt and allocation batch. It does not create another cash receipt and is excluded from cashier and bank collection totals.

The direct student fee-payment screen is reserved for genuinely new money from a student, parent, guardian, employer or individual donor. It rejects sponsor descriptions, requires an explicit new-money confirmation, and blocks an exact student/amount match against a recently posted sponsor allocation. A System Admin/Admin may override only when separate bank evidence exists and must enter an audit reason.

## Example

A county cheque of KSh 100,000 covers four students:

| Student | Allocation |
|---|---:|
| Student A | 25,000 |
| Student B | 30,000 |
| Student C | 20,000 |
| Student D | 25,000 |
| **Total** | **100,000** |

The institution records:

1. One county sponsor receipt for KSh 100,000.
2. One allocation batch containing four student lines.
3. Four non-cash credits on student fee statements.
4. One receipt-to-allocation reconciliation showing a zero unallocated balance.

## Validation and approval controls

- A cheque or transfer must be marked cleared before the sponsor receipt can be approved and posted.
- Parent receipt must be approved and posted before allocation.
- Duplicate bank, cheque and M-Pesa references are blocked across sponsor and direct-student receipts.
- Sponsor allocations generate allocation advices, never official student cash receipts.
- Exact student/amount matches against recent sponsor allocations are blocked on the direct payment screen unless a System Admin/Admin records a verified exception.
- Allocation batch date cannot precede the parent receipt date.
- Every admission number must exist in the student register.
- Every amount must be greater than zero.
- Expected schedule total, when entered, must equal imported/entered allocation lines.
- Active batches cannot collectively exceed the parent receipt.
- A posted receipt cannot be reversed while active allocation batches remain.
- Posted records are corrected through reversals, not deletion.
- Student balances are recalculated after posting and reversal.
- All state-changing actions use role checks, CSRF protection and audit logging.

## Accrual and IPSAS-oriented finance features

The sponsor module works with the existing double-entry general ledger, chart of accounts, journal entries, trial balance, period closing, reconciliations, budget-versus-actual reporting and IPSAS-oriented reporting pack.

The reporting pack includes:

- Statement of Financial Performance
- Statement of Financial Position
- Statement of Cash Flows
- Statement of Changes in Net Assets
- Budget versus Actual comparison
- Sponsor receivable and unallocated-funds controls
- Sponsor receipt-to-allocation reconciliation

Additional accrual accounts are available for sponsor receivables, prepayments, property plant and equipment, accumulated depreciation, employee benefits payable, deferred income, grants/transfers revenue and depreciation/amortisation expense.

## Reports and documents

- Sponsor Cheque Acknowledgement for pending-clearance instruments
- Official Sponsor Receipt after bank clearance and approval
- Sponsor Allocation Batch Register
- Individual Student Sponsor Allocation Advices marked as non-cash
- Sponsor Control Report with opening unallocated balance, period receipts, period allocations and closing unallocated balance
- Student Fee Statement showing non-cash sponsor credit
- General Ledger and Trial Balance
- IPSAS-Aligned Financial Reporting Pack

## Installation and upgrade

For an existing installation:

```bash
php bin/migrate.php
php bin/check_integrity.php
```

The migrations are:

```text
database/migrations/20260713_002_sponsor_funds_accrual.sql
database/migrations/20260714_003_bulk_sponsor_receipting.sql
database/migrations/20260714_004_no_double_receipting.sql
```

For a clean installation, import:

```text
database/schema/college_erp_current.sql
```

Grant the Finance role the `finance_sponsors` privilege where custom roles are used.

## Reporting boundary

The module is designed to support accrual accounting and IPSAS-oriented institutional reporting. Final statutory statements still require institution-specific chart-of-accounts mapping, opening balance validation, accounting policy decisions, year-end accruals, asset/depreciation registers, disclosure notes and review by the institution accountant and auditor. The software should therefore not be described as independently certified for IPSAS compliance solely because these features are enabled.
