# Phase 7D manual test script: interventions and finding a transaction

Needs two Headquarters people and a branch person, about 20 minutes. The rules are also proved by
`tests/Feature/InterventionsTest.php`:
- adjusting entries need two people at Headquarters;
- the branch cannot post, discard or reverse them, and is told;
- returned year ends, reopened months and revoked devices are logged on both sides;
- searching every branch, with each opening logged.

**Logins (demo church):**
- **admin@demo.church.test**: with the password you set on 18 Oct (HQ Administrator);
- **a second Headquarters person** with HQ Finance: create one under **People in all branches** if the demo has
  none (role HQ Finance Officer, no branch);
- **treasurer@demo.church.test**: Headquarters' own treasurer, for comparison;
- a person in **Lekki Branch** with the Treasurer or Branch Accountant role (create one if needed).

## A. Find a transaction

1. [ ] As admin, open **Headquarters (Directs) › Find a transaction**. Search `generator`: journals from every
   branch whose memo, line or payee mentions it are listed.
2. [ ] Search by **Amount** (for example 180000) and by **From/To** dates. Choose **Lekki Branch**: only its
   journals.
3. [ ] Click a number. The journal opens with its lines, documents and **Audit trail**. The trail's last line is
   "Opened by Headquarters (Find a transaction)" with your name.

## B. An adjusting entry

4. [ ] As the HQ Finance person, **Adjusting entries › New adjusting entry**:
   - branch Lekki, today's date;
   - a memo, and the reason "Tithe posted to offering in error";
   - two lines (debit 41020 Sunday Offerings, credit 41010 Tithes, ₦5,000);
   - **Save draft**.

   The draft is listed as **waiting**, with your name, and "Someone else posts it" instead of a Post button.
5. [ ] Try to choose **Grace Assembly (Demo)** (Headquarters) as the branch: it is not offered, and Headquarters'
   own books take an ordinary journal.
6. [ ] As the Lekki person, open **Journals**: the draft shows as **HQ adjustment**. Open it: a purple note gives the
   reason and says only Headquarters can post, discard or reverse it, and there is no **Review & post** button.
7. [ ] As admin, **Adjusting entries**: press **Post**. It gets a number, and the Lekki people with journals or
   settings access get an email.
8. [ ] As the Lekki person:
   - the dashboard shows **From Headquarters, in the last two weeks** with the entry;
   - **Setup › From Headquarters** lists it with the reason, your name and the date;
   - the journal has no **Reverse…** button.
9. [ ] As the HQ Finance person, press **Reverse…** on it, give a reason and today's date. As admin, **Post** the
   reversal. The original shows "reversed by …", and Lekki's **From Headquarters** lists "Adjusting entry
   reversed".
10. [ ] Draft another one and **Discard…** it with a reason: it disappears, and the audit trail keeps the reason.

## C. Other interventions

11. [ ] Return a Lekki year-end submission (**Setup › Year-end close**) with a comment. Then reopen a closed month
    (**Setup › Periods**) with a reason. Then revoke a Lekki device (**Devices in all branches**).
12. [ ] Lekki's page in Directs (**Branch register › Lekki**) shows each under **History and interventions**, with
    the reason; Lekki's **From Headquarters** shows the same. Headquarters' own page does not list the reopened
    month.

## D. Access

13. [ ] As the Lekki person, `/directs/query` and `/directs/adjustments` show "not found".
14. [ ] As auditor@demo, **Find a transaction** works and **Adjusting entries** lists entries without
    **New adjusting entry**, **Post** or **Reverse…**.

## Sign-off

| Tester | Date | Result | Notes |
|---|---|---|---|
| | | | |
