# Phase 16 — Government finance, tendering, and data quality controls

## 1. Financial periods and year-end close
- Facility-scoped financial period register.
- Prevents overlapping financial periods for a facility.
- Opening balance entry supports multiple chart accounts and requires debit/credit equality.
- Closing requires an explicit confirmation and approval reference.
- Closing posts period revenue and expense balances to accumulated fund (account 3000) through `LedgerPoster`.
- Ledger posting service rejects backdated postings into closed financial periods.
- Period close is maker/approver controlled at LCDA administrator level.

**Limit:** opening balances are a basic manual journal interface; no automated carry-forward of every balance-sheet account or period reversal workflow is included.

## 2. Government financial reporting
- Date and facility filters.
- Revenue and expenditure summaries.
- Asset, liability and equity activity summaries.
- Cash account debit/credit movement proxy.
- Consolidated facility revenue/expenditure table.
- Facility service indicator scorecard.
- CSV ledger and audit trail exports.

**Limit:** these are activity summaries and diagnostic statements. They are not certified IPSAS/IFRS or statutory government financial statements. Full opening-to-closing balance sheet, cash-flow classification, fund accounting, commitments disclosure, notes, consolidation eliminations and audited closing balances still require finance policy design.

## 3. Tender and supplier governance
- Tender draft, separate LCDA publication approval, published bid capture, technical/commercial evaluation and award.
- Bid scoring uses a configurable-in-code 70% technical / 30% commercial weighting.
- Evaluation is blocked until the tender closing date has passed.
- Award is restricted to LCDA administrators and must select the highest evaluated score.
- Tender evaluators cannot approve the award.
- Supplier quality, delivery and compliance scores are recorded.
- Procurement approval thresholds can require a specified role for defined value bands.

**Limit:** bid entry is a staff-mediated registry, not an external supplier portal or cryptographically sealed e-tendering platform. Procurement law, public advertisement, conflict declarations, independent evaluation committee, bid opening records, appeals and exceptions must be governed by the LCDA's approved procurement policy.

## 4. Data quality monitoring
The scanner flags:
- Missing patient date of birth.
- Missing patient contact phone.
- Unknown patient gender.
- Draft encounters older than seven days.
- Expired stock with positive available quantity.
- Stock below item reorder level.

Issues are recorded with facility scope, rule code, severity, entity reference, review status and resolution note. The scan does not modify patient records or stock balances.

## 5. Audit exports
- Date-filtered CSV export of audit events.
- Restricted to LCDA administration, medical director and auditor roles.

## 6. Acceptance test source
- `FinancialPeriodAcceptanceTest`: closing a period and rejecting a backdated posting.
- `DataQualityAcceptanceTest`: missing demographics flagged without modifying the patient record.
- Existing ledger, procurement, GRN and workflow tests remain included.

## 7. Known limitations and controls
- No PHPUnit, migration, Docker or database runtime test was executed in this environment.
- Government statements require formal chart-of-accounts and reporting-policy approval.
- Tender scoring weighting must be approved by procurement/legal leadership.
- Data quality rules are indicative operational checks, not clinical decision rules.
- Audit CSV export is a convenience export; immutable retention and independent SIEM replication remain necessary.
- Full privacy/legal, clinical safety, cybersecurity and executive release approvals remain mandatory.
