Companies created before the standard existed keep the chart they were born with — and because the account pickers now offer only the accounts that belong to each job's band of the chart, an older chart can leave some pickers short (a savings-bank account the standard expects, for example, may simply not be there), and its account roles were never written down. Your platform operator can bring such a company up to the standard with one deliberate, reviewable procedure, run from the application terminal:
- Review first.
php artisan chart:repair --dry-runprints, for every company, exactly what a repair would do — every structural move it would make, in the order it would make them, the accounts it would add, the account groups it would supply, the role mappings it would write — and changes nothing. - Then run it.
php artisan chart:repairapplies the repair (add--company=<id>to repair one company at a time). A company with a data migration still in progress is refused, by name, until the migration finishes.
The repair adds what is missing and aligns what is there, under these promises:
- It adds. Missing standard accounts are added with the standard's names; missing account groups are supplied; role mappings are written for the roles whose accounts now exist.
- It aligns structure — by evidence, never by guess. An older chart may number its accounts differently from the standard (the debtors control at 1110, say, or VAT sitting on the accrual account's number). Where the evidence — your role mappings, your tax codes and party defaults, the account's own name and flags — identifies an account as one of the standard's, the repair moves it onto the standard's number, class and group, so every picker and report sees the chart the standard describes. If another account is sitting on a number the standard needs, that account is moved to a free number inside its own part of the chart. The dry-run lists every move in the order it will happen — that list is the audit trail — and names anything it cannot identify, which it leaves exactly where it is.
- Names and balances never move. An account keeps the name your chart gives it, and the account itself — its balance and its whole history — stays the same record; only its number and placement align. A role mapping you set yourself is never overwritten, and an account a role points at is never dragged away from the job you gave it.
- Name differences are reported, not "fixed". If your chart calls an account by a different name than the standard does, the report names the difference and leaves your name standing — renaming is your decision, made in System Setup like any other chart edit.
- A plainly different account is skipped, and the skip is named. Sometimes an account sits on a standard number but is a different thing from what the standard means by that number — your PAYE account where the standard keeps customer deposits, say. The repair will not write that number's role onto such an account, and will not file it under the standard's group for that number; the report names each skip and the account keeps its own group and place until you decide what it should be. A role whose mapping is skipped stays on its built-in fallback, exactly as if the account were absent. A difference of spelling or punctuation alone ("Trade Debtors Control" against the standard's "Trade Debtors — Control") is the same meaning and is never skipped.
- The Model company is never repaired — it is the standard.
- Running it twice is safe: the second run finds nothing to do.
After a repair, an older company's pickers offer the same accounts a newly created company's do, and its Account roles page shows the mappings the repair wrote — re-point any of them there, as usual.