# Phase 4D manual test script: the year-end wizard

For a branch treasurer, an HQ accountant and HQ Finance. About 30 minutes. The rules (branch submissions,
review by someone else, resubmission after changes, the new checks, the closing trial balance, the
roll-forward) are also proved by `tests/Feature/YearEndWizardTest.php`. This script checks what people see.

Closing a year cannot be undone except by HQ Finance reopening it. Run this on a copy of the data, or on
the local demo church, never on live books.

**Staff app:** http://localhost/church_acct_app/public/app
**Logins:**
- demo church: **treasurer@demo.church.test** (HQ treasurer: submits Headquarters' year) and
  **accountant@demo.church.test** (closes);
- TOBAS church: **hq.finance@toprc.test** (HQ Finance: accepts and returns; two-factor);
- a branch treasurer: make one under Users & roles if the church has none.

See `docs/test-logins.md`.

## A. A branch prepares its year

1. [ ] As a branch treasurer, open **Year-end close** (the menu shows it now) and pick last year. The
   **Branches** list shows every branch with postings that year; **your branch** shows its own checklist.
2. [ ] Red items (draft journals, open giving batches) stop the submission. Orange items include the new
   **Cash counted at year end** (a completed cash count within a week of 31 December for every cash account
   holding money) and **Depreciation charged for every month**.
3. [ ] With warnings, the Submit form asks you to explain them; submitting without an explanation is refused.
   Explain and press **Submit**. The branch shows "waiting for HQ".

## B. HQ Finance reviews

4. [ ] As HQ Finance, open **Year-end close**. Click the branch's name: its checklist shows. Press
   **Return…**, write what to fix, and send. The branch sees "Returned" and the comment.
5. [ ] As the branch treasurer, submit again. As HQ Finance, press **Accept**.
6. [ ] Submit Headquarters' own year as the HQ treasurer, and try to accept it as the same person: refused.
   Accept it as HQ Finance.
7. [ ] Post a small journal into the accepted branch's year (dated in December). The Branches list shows
   "books changed", and the church checklist says the year cannot close until the branch submits again.
   Submit again and accept.

## C. HQ closes the church's year

8. [ ] As the accountant, the **Church checklist** shows "Every branch has submitted and been accepted" in
   green. Type the year and close it.
9. [ ] **After the close**:
   - **Closing trial balance** downloads as PDF and Excel, on the letterhead, with no income or expense lines;
   - **Opening position** shows the same figures as the Statement of Financial Position at 31 December;
   - **Asset register brought forward** shows the same carrying amounts.
10. [ ] **Copy … approved budget(s)** with 5%: next year's drafts appear under Budgets.
11. [ ] As HQ Finance, **Reopen year…** with a reason, then close it again: the same closing trial balance.

## D. A church with Headquarters only

12. [ ] In a church with no branches, Year-end close has no Branches step: HQ closes directly, as before.

## Sign-off

| Section | Checked by | Date | Notes |
|---|---|---|---|
| A Branch | | | |
| B HQ review | | | |
| C Close | | | |
| D HQ only | | | |
