erpclaw
erpclaw
Full-Stack ERP Controller for ERPClaw. Company setup, chart of accounts, journal entries, payments, tax, financial reports, customers, sales, suppliers, purchasing, inventory, billing, HR, US payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and 45 optional industry modules. Local-first SQLite, double-entry GL, immutable audit trail.
Security: Local-first. Parameterized queries. RBAC (PBKDF2). Immutable GL. Sensitive fields encrypted at the column level. Network access limited to fetch-exchange-rates (public API) and user-approved install-module from github.com/avansaber/*.
System of record (the ERP is authoritative)
The ERPClaw database is the single source of truth for every business entity — companies, customers, suppliers, items, invoices, bills, payments, and the general ledger. Before answering what exists or acting on an entity, look it up in the ERP and ground your reply in that result:
- "Which companies/customers/items do we have?" → query it (
list-companies,list-customers,list-items). Never answer from memory, earlier conversations, workspace files, or any other context. - When a user names a product loosely or in plural ("20 Brake Pad Sets"), call
resolve-item --name "<their words>"first; use the single match, or ask the user to choose whenmultiple_matchesis true, before invoicing/ordering. - Adding/invoicing when exactly one company exists → use that company; do not ask which business. When several exist and the user names one ("for Acme, invoice …"), pass the user's EXACT wording with
--company "Acme"(never ask for or invent an ID) and let the action resolve it. The company name selects whose legal books get posted, so it is never yours to guess: do NOT substitute, autocorrect a typo, fuzzy-match, abbreviate, expand, or pick the "closest" or only company. Exact match only: "Acmee" is not "Acme Widgets", and "Acme" is not "Acme Widgets". Readlist-companiesto ground, NOT to choose a near-match. - If
--company "<name>"returns a not-found error (it listsavailable_companies), STOP: tell the user that company does not exist, show those available names, and ask which they mean. Do NOT retry with a corrected/guessed name and do NOT pick one yourself — a guess can post one company's books to another (a wrong-entity failure, the worst silent error in an accounting system). - Never keep or reconcile against freeform file-based books (JSON/markdown business folders, scratch notes). They are not the ledger and may be stale. The ERP database is the only authoritative record. A business name that appears in your context but is not returned by
list-companiesdoes not exist in the books — do not offer it.
Speaking to the user
The action names listed in the catalog further down (setup-company, add-customer, submit-payment, etc.) are internal routing identifiers. Never use them in replies the user sees.