# TOBAS Release R3: what is in it

R2 (the pilot) gave branches their own books and gave Headquarters oversight of them. R3 adds Headquarters'
view of the **whole church**: consolidated accounts, dashboards, alerts, remittances with due dates, and a
controlled way for Headquarters to step into a branch's books. Details of each change are in
[CHANGELOG.md](../../CHANGELOG.md); the reasons behind them are in [DECISIONS.md](../../DECISIONS.md) (D-052 to
D-059). The proof that it works is in [phase-7-exit-evidence.md](../phases/phase-7-exit-evidence.md).

## Since R2

- **Working offline** (Phase 6, D-052 to D-055): TOBAS offline on a phone or laptop:
  - giving, counting sheets, petty cash, requisitions, cash counts and members recorded with no connection;
  - sent when the connection returns, never twice, with final numbers in the order recorded;
  - anything refused waits in **Sync issues**.

  See [OFFLINE-GUIDE.md](OFFLINE-GUIDE.md).
- **Consolidated accounts** (7A, D-056): the trial balance, income and expenditure, financial position and cash
  flows for the whole church or a region. Each has:
  - a column per branch (a column per region above 12 branches);
  - inter-branch balances and remittances eliminated, journal by journal, with any unmatched difference shown;
  - a **tie-out** on every statement;
  - drill-down to the branch's ledger and journal;
  - downloads and scheduled emails.
- **HQ dashboard** (7B, D-057):
  - income, expenditure, surplus and cash against last year;
  - budget used, banks reconciled, giving posted on time, remittances paid and on time;
  - a 12-month chart;
  - every branch ranked in a coloured table;
  - two to five branches compared side by side.
- **Alerts** (7C, D-058): one list of what needs attention across the branches:
  - months not closed and year ends late;
  - banks not reconciled and negative cash;
  - budgets overspent;
  - unusual transactions;
  - devices not synced and sync issues;
  - the subscription renewal;
  - remittances overdue.

  Alerts are acknowledged, assigned and resolved. Headquarters Finance gets a morning email, and each branch sees
  Headquarters' alerts about it.
- **Remittances** (7C, D-058):
  - due on the 15th of the next month;
  - drafted on the 1st;
  - confirmed by the branch treasurer, or approved by Headquarters with a reason;
  - reminders, and each branch's on-time record.
- **Interventions** (7D, D-059):
  - **adjusting entries** in a branch's books, drafted and posted by two people at Headquarters, marked
    "HQ adjustment", and reversible only by Headquarters;
  - every intervention (adjustments, returned year ends, reopened months, status changes, access resets,
    revoked devices) listed for the branch on **Setup › From Headquarters** and in Directs;
  - **Find a transaction** in any branch, with every opening logged.
- **Guide for HQ Finance**: [HQ-FINANCE-GUIDE.md](HQ-FINANCE-GUIDE.md), covering month end, consolidation,
  alerts, remittances and adjustments.

## Not in R3 (later phases)

- Per-branch licences, licence states, payment and bulk renewal (Phase 8). Until then, the "licence" alert
  reads the church's subscription.
- Online giving settled and reconciled into branch ledgers (Phase 9).
- Performance work at scale and the security review (Phase 10).
- A map of branches (offered in the plan, not asked for).

## Upgrading a server to R3

Back up first, then:

```
php artisan backup:run
php artisan migrate --force
php artisan config:cache
php artisan permissions:sync
npm ci && npm run build
php artisan ledger:verify
```

The scheduler (every minute, as in R2) now also runs:
- `directs:alerts` at 06:45;
- `remittances:draft` on the 1st at 01:30;
- `remittances:remind` at 08:15.

## R3 checklist

| | Check | Done |
|---|---|---|
| 1 | Upgrade commands above run without errors; `ledger:verify` shows no problems | [ ] |
| 2 | Directs › Consolidation › Trial balance for the whole church, this year: every tie-out line ties | [ ] |
| 3 | The same for income and expenditure, financial position and cash flows | [ ] |
| 4 | Any **unmatched** inter-branch line is explained (a remittance posted on one side, a transfer not yet received) and fixed or accepted | [ ] |
| 5 | The HQ dashboard's surplus equals the consolidated income and expenditure surplus for the same dates | [ ] |
| 6 | Alerts: the list was reviewed, each critical alert assigned, and the morning email received by HQ Finance | [ ] |
| 7 | Remittances: the 15th suits the church as the due day (another day is a church setting, `remittance_due_day`, set on the server: there is no screen for it yet); last month's drafts are listed | [ ] |
| 8 | Each branch treasurer has seen their draft and knows to confirm it | [ ] |
| 9 | Two people at HQ (HQ Finance and the HQ Administrator, or two HQ Finance officers) can draft and post adjusting entries | [ ] |
| 10 | One test adjusting entry posted and reversed in a pilot branch; the branch saw both on From Headquarters | [ ] |
| 11 | The test scripts for 7A to 7D have been run and signed (docs/phases) | [ ] |

| Signed (HQ Administrator) | Signed (HQ Finance) | Date |
|---|---|---|
| | | |
