Commerce General Ledger
Double-entry accounting with chart of accounts, journal entries, period management, and financial statement generation.
How It Works
- Set up the chart of accounts with account hierarchy.
- Open accounting periods (monthly, quarterly, yearly).
- Post journal entries with balanced debits and credits.
- Configure auto-posting rules for commerce transactions.
- Generate trial balance, balance sheet, and income statement.
- Close periods to lock posted entries.
Usage
- MCP tools:
list_gl_accounts, create_gl_account, update_gl_account, list_gl_periods, create_gl_period, close_gl_period, create_journal_entry, post_journal_entry, void_journal_entry, get_trial_balance, get_balance_sheet, get_income_statement, configure_auto_posting.
- Writes require
--apply.
Account Types
- Asset (normal debit), Liability (normal credit), Equity (normal credit), Revenue (normal credit), Expense (normal debit)
- 25+ subtypes: Cash, AccountsReceivable, Inventory, FixedAssets, AccountsPayable, SalesRevenue, COGS, etc.
Period Statuses
- Future -> Open -> Closed -> Locked
Journal Entry Statuses
- Draft -> Pending -> Posted (or Voided/Reversed)
Journal Entry Sources
- Manual, AutoInvoice, AutoPayment, AutoBill, AutoBillPayment, AutoInventory, AutoWriteOff, SystemClosing, Import
Output
{"status":"posted","journal_entry_id":"JE-2025-0100","period":"2025-01","total_debits":1500.00,"total_credits":1500.00}
Present Results to User
- Journal entry number and posting status.
- Debit/credit totals (must balance).
- Affected accounts and running balances.
- Period status and closing readiness.
Troubleshooting
- Entry won't post: verify debits equal credits.
- Period locked: cannot post to a locked period; use adjusting entries in the next open period.
- Account inactive: reactivate account or use a different posting account.
References
- references/gl-accounts.md
- /home/dom/stateset-icommerce/crates/stateset-core/src/models/general_ledger.rs
- /home/dom/stateset-icommerce/crates/stateset-embedded/src/general_ledger.rs
1---2name: commerce-general-ledger3description: Manage the general ledger, chart of accounts, journal entries, and financial statements. Use when posting transactions, closing periods, or generating trial balance and financial reports.4---5
6# Commerce General Ledger
7
8Double-entry accounting with chart of accounts, journal entries, period management, and financial statement generation.
9
10## How It Works
11
121. Set up the chart of accounts with account hierarchy.
132. Open accounting periods (monthly, quarterly, yearly).
143. Post journal entries with balanced debits and credits.
154. Configure auto-posting rules for commerce transactions.
165. Generate trial balance, balance sheet, and income statement.
176. Close periods to lock posted entries.
18
19## Usage
20
21- MCP tools: `list_gl_accounts`, `create_gl_account`, `update_gl_account`, `list_gl_periods`, `create_gl_period`, `close_gl_period`, `create_journal_entry`, `post_journal_entry`, `void_journal_entry`, `get_trial_balance`, `get_balance_sheet`, `get_income_statement`, `configure_auto_posting`.
22- Writes require `--apply`.
23
24## Account Types
25
26- Asset (normal debit), Liability (normal credit), Equity (normal credit), Revenue (normal credit), Expense (normal debit)
27- 25+ subtypes: Cash, AccountsReceivable, Inventory, FixedAssets, AccountsPayable, SalesRevenue, COGS, etc.
28
29## Period Statuses
30
31- Future -> Open -> Closed -> Locked
32
33## Journal Entry Statuses
34
35- Draft -> Pending -> Posted (or Voided/Reversed)
36
37## Journal Entry Sources
38
39- Manual, AutoInvoice, AutoPayment, AutoBill, AutoBillPayment, AutoInventory, AutoWriteOff, SystemClosing, Import
40
41## Output
42
43```json
44{"status":"posted","journal_entry_id":"JE-2025-0100","period":"2025-01","total_debits":1500.00,"total_credits":1500.00}
45```
46
47## Present Results to User
48
49- Journal entry number and posting status.
50- Debit/credit totals (must balance).
51- Affected accounts and running balances.
52- Period status and closing readiness.
53
54## Troubleshooting
55
56- Entry won't post: verify debits equal credits.
57- Period locked: cannot post to a locked period; use adjusting entries in the next open period.
58- Account inactive: reactivate account or use a different posting account.
59
60## References
61- references/gl-accounts.md
62- /home/dom/stateset-icommerce/crates/stateset-core/src/models/general_ledger.rs
63- /home/dom/stateset-icommerce/crates/stateset-embedded/src/general_ledger.rs