erpclaw
Full-Stack ERP Controller for ERPClaw. Handles company setup, chart of accounts, journal entries,
payments, tax, financial reports, customers, sales, suppliers, purchasing, inventory, billing,
HR (employees, leave, attendance, expenses), US payroll (FICA, W-2, garnishments), advanced accounting
(ASC 606/842, intercompany, consolidation), and 43 industry modules. Single local SQLite DB, double-entry GL, immutable audit trail.
Security: Local-first (~/.openclaw/erpclaw/data.sqlite). Parameterized queries. RBAC (PBKDF2). Immutable GL. Network only for fetch-exchange-rates (public API) and install-module (GitHub avansaber/*, requires user approval). Integration API keys (Stripe, Shopify, etc.) are passed via --api-key flags and stored in the local DB only — no credentials in code or environment variables.
Skill Activation Triggers
Activate when user mentions: ERP, accounting, invoice, sales order, purchase order, customer, supplier, inventory, payment, GL, trial balance, P&L, balance sheet, tax, billing, modules, install module, onboard, CRM, manufacturing, healthcare, education, retail, employee, HR, payroll, salary, leave, attendance, expense claim, W-2, garnishment, integration.
Auto-Detection
When a user describes their business: detect type (e.g., "dental practice" -> dental), ask user to confirm before proceeding, then call setup-company --industry <type>. Industry values: retail, restaurant, healthcare, dental, veterinary, construction, manufacturing, legal, agriculture, hospitality, property, school, university, nonprofit, automotive, therapy, home-health, consulting, distribution, saas. When a user asks about a service or integration not currently installed, search the module registry and suggest installation (never auto-install without user approval).
Setup
CODEBLOCK0
All 467 Actions
Setup & Admin (44)
| Action | Description |
|---|
INLINECODE6 / setup-company / update-company / get-company / INLINECODE10 | DB init & company CRUD |
INLINECODE11 / list-currencies / add-exchange-rate / get-exchange-rate / list-exchange-rates / INLINECODE16 |
Currency & FX |
|
add-payment-terms /
list-payment-terms /
add-uom /
list-uoms /
add-uom-conversion | Terms & UoMs |
|
seed-defaults /
seed-demo-data /
check-installation /
install-guide /
setup-web-dashboard /
tutorial /
onboarding-step /
status | Seeding & utilities |
|
add-user /
update-user /
get-user /
list-users /
set-password | User management |
|
add-role /
list-roles /
assign-role /
revoke-role /
seed-permissions | RBAC & security |
|
link-telegram-user /
unlink-telegram-user /
check-telegram-permission | Telegram integration |
|
backup-database /
list-backups /
verify-backup /
restore-database /
cleanup-backups | DB backup/restore |
|
get-audit-log /
get-schema-version /
update-regional-settings /
onboard | System admin |
General Ledger (26)
| Action | Description |
|---|
INLINECODE52 / add-account / update-account / get-account / INLINECODE56 | Account CRUD |
INLINECODE57 / unfreeze-account / get-account-balance / INLINECODE60 |
Account management |
|
post-gl-entries /
reverse-gl-entries /
list-gl-entries | GL posting |
|
add-fiscal-year /
list-fiscal-years /
validate-period-close /
close-fiscal-year /
reopen-fiscal-year | Fiscal year |
|
add-cost-center /
list-cost-centers /
add-budget /
list-budgets | Cost centers & budgets |
|
seed-naming-series /
next-series /
revalue-foreign-balances | Naming & FX revaluation |
|
import-chart-of-accounts /
import-opening-balances | CSV import |
Journal Entries (16)
| Action | Description |
|---|
INLINECODE78 / update-journal-entry / get-journal-entry / INLINECODE81 | JE CRUD |
INLINECODE82 / cancel-journal-entry / amend-journal-entry / delete-journal-entry / INLINECODE86 |
JE lifecycle |
|
create-intercompany-je | Intercompany JE |
|
add-recurring-template /
update-recurring-template /
list-recurring-templates /
get-recurring-template /
process-recurring /
delete-recurring-template | Recurring JEs |
Payments (13)
| Action | Description |
|---|
INLINECODE94 / update-payment / get-payment / list-payments / submit-payment / cancel-payment / INLINECODE100 | Payment CRUD & lifecycle |
INLINECODE101 / get-outstanding / get-unallocated-payments / allocate-payment / reconcile-payments / INLINECODE106 |
Reconciliation |
Tax (17)
| Action | Description |
|---|
INLINECODE107 / update-tax-template / get-tax-template / list-tax-templates / INLINECODE111 | Tax template CRUD |
INLINECODE112 / calculate-tax / add-tax-category / list-tax-categories / add-tax-rule / INLINECODE117 |
Tax rules |
|
add-item-tax-template /
add-tax-withholding-category /
get-withholding-details | Withholding |
|
record-withholding-entry /
record-1099-payment /
generate-1099-data | 1099 reporting |
Financial Reports (20)
| Action | Description |
|---|
INLINECODE124 / profit-and-loss / balance-sheet / cash-flow / general-ledger / INLINECODE129 | Core statements |
INLINECODE130 / ap-aging / budget-vs-actual (alias: budget-variance) |
Aging & budget |
|
tax-summary /
payment-summary /
gl-summary /
comparative-pl /
check-overdue | Summaries |
|
add-elimination-rule /
list-elimination-rules /
run-elimination /
list-elimination-entries | Intercompany |
Selling (48)
| Action | Description |
|---|
INLINECODE143 / update-customer / get-customer / list-customers / INLINECODE147 | Customer CRUD |
INLINECODE148 / update-quotation / get-quotation / list-quotations / submit-quotation / INLINECODE153 |
Quotations |
|
add-sales-order /
update-sales-order /
get-sales-order /
list-sales-orders /
submit-sales-order /
cancel-sales-order /
amend-sales-order /
close-sales-order | Sales orders |
|
add-blanket-order /
get-blanket-order /
list-blanket-orders /
submit-blanket-order /
create-so-from-blanket | Blanket orders |
|
create-delivery-note /
get-delivery-note /
list-delivery-notes /
submit-delivery-note /
cancel-delivery-note /
add-packing-slip /
get-packing-slip /
list-packing-slips | Delivery & packing |
|
create-sales-invoice /
update-sales-invoice /
get-sales-invoice /
list-sales-invoices /
submit-sales-invoice /
cancel-sales-invoice | Invoicing |
|
create-credit-note /
list-credit-notes /
update-invoice-outstanding | Credit notes |
|
add-sales-partner /
list-sales-partners | Sales partners |
|
add-recurring-template /
update-recurring-template /
list-recurring-templates /
generate-recurring-invoices | Recurring invoices |
|
add-intercompany-account-map /
list-intercompany-account-maps /
create-intercompany-invoice /
list-intercompany-invoices /
cancel-intercompany-invoice | Intercompany |
Buying (40)
| Action | Description |
|---|
INLINECODE195 / update-supplier / get-supplier / list-suppliers / INLINECODE199 | Supplier CRUD |
INLINECODE200 / submit-material-request / INLINECODE202 |
Material requests |
|
add-rfq /
submit-rfq /
list-rfqs /
add-supplier-quotation /
list-supplier-quotations /
compare-supplier-quotations | RFQs & quotes |
|
add-purchase-order /
update-purchase-order /
get-purchase-order /
list-purchase-orders /
submit-purchase-order /
cancel-purchase-order /
close-purchase-order | Purchase orders |
|
add-blanket-po /
get-blanket-po /
list-blanket-pos /
submit-blanket-po /
create-po-from-blanket /
create-po-from-so /
create-drop-ship-order | Blanket POs & drop ship |
|
create-purchase-receipt /
get-purchase-receipt /
list-purchase-receipts /
submit-purchase-receipt /
cancel-purchase-receipt | Receipts |
|
create-purchase-invoice /
update-purchase-invoice /
get-purchase-invoice /
list-purchase-invoices /
submit-purchase-invoice /
cancel-purchase-invoice | Purchase invoices |
|
create-debit-note /
add-landed-cost-voucher /
update-receipt-tolerance /
update-three-way-match-policy | Adjustments |
Inventory (42)
| Action | Description |
|---|
INLINECODE238 / update-item / get-item / list-items / import-items / add-item-group / INLINECODE244 | Item master |
INLINECODE245 / create-item-variant / generate-item-variants / INLINECODE248 |
Item variants |
|
add-item-supplier /
list-item-suppliers /
set-item-purchase-uom | Item suppliers |
|
add-warehouse /
update-warehouse /
list-warehouses | Warehouses |
|
add-stock-entry /
get-stock-entry /
list-stock-entries /
submit-stock-entry /
cancel-stock-entry | Stock entries |
|
create-stock-ledger-entries /
reverse-stock-ledger-entries | Stock ledger |
|
get-stock-balance /
stock-balance /
stock-balance-report /
stock-ledger-report /
get-projected-qty | Stock reports |
|
add-batch /
list-batches /
add-serial-number /
list-serial-numbers | Batch & serial |
|
add-price-list /
add-item-price /
get-item-price /
add-pricing-rule | Pricing |
|
add-stock-reconciliation /
submit-stock-reconciliation | Reconciliation |
|
revalue-stock /
list-stock-revaluations /
get-stock-revaluation /
cancel-stock-revaluation /
check-reorder | Revaluation & reorder |
Billing & Metering (23)
| Action | Description |
|---|
INLINECODE282 / update-meter / get-meter / list-meters / add-meter-reading / INLINECODE287 | Meters |
| INLINECODE288 / INLINECODE289 |
Usage tracking |
|
add-rate-plan /
update-rate-plan /
get-rate-plan /
list-rate-plans /
rate-consumption | Rate plans |
|
create-billing-period /
run-billing /
generate-invoices /
get-billing-period /
list-billing-periods | Billing cycles |
|
add-billing-adjustment /
add-prepaid-credit /
get-prepaid-balance | Adjustments & prepaid |
|
add-recurring-bill-template /
list-recurring-bill-templates /
generate-recurring-bills | Recurring bills |
Advanced Accounting (45)
| Action | Description |
|---|
INLINECODE306 / update-revenue-contract / get-revenue-contract / INLINECODE309 | Revenue contracts |
INLINECODE310 / list-performance-obligations / INLINECODE312 |
ASC 606 |
|
add-variable-consideration /
list-variable-considerations /
modify-contract | Variable consideration |
|
calculate-revenue-schedule /
generate-revenue-entries /
revenue-waterfall-report /
revenue-recognition-summary | Revenue recognition |
|
recognize-schedule-entry /
update-performance-obligation /
update-schedule-amounts | Revenue schedule management |
|
add-lease /
update-lease /
get-lease /
list-leases /
classify-lease | ASC 842 leases |
|
calculate-rou-asset /
calculate-lease-liability /
generate-amortization-schedule /
record-lease-payment | Lease calculations |
|
lease-maturity-report /
lease-disclosure-report /
lease-summary | Lease reports |
|
add-ic-transaction /
update-ic-transaction /
get-ic-transaction /
list-ic-transactions | Intercompany |
|
approve-ic-transaction /
post-ic-transaction /
add-transfer-price-rule /
list-transfer-price-rules | IC approvals |
|
ic-reconciliation-report /
ic-elimination-report | IC reports |
|
add-consolidation-group /
list-consolidation-groups /
add-group-entity /
add-currency-translation | Consolidation setup |
|
run-consolidation /
generate-elimination-entries /
consolidation-trial-balance-report /
consolidation-summary | Consolidation |
|
standards-compliance-dashboard | ASC 606/842 compliance |
HR & Payroll (58)
| Action | Description |
|---|
INLINECODE354 / update-employee / get-employee / list-employees / INLINECODE358 | Employee CRUD |
INLINECODE359 / list-employee-bank-accounts / add-employee-document / get-employee-document / list-employee-documents / INLINECODE364 |
Employee details |
|
add-department /
list-departments /
add-designation /
list-designations | Org structure |
|
add-leave-type /
list-leave-types /
add-leave-allocation /
get-leave-balance | Leave config |
|
add-leave-application /
approve-leave /
reject-leave /
list-leave-applications | Leave requests |
|
mark-attendance /
bulk-mark-attendance /
list-attendance /
add-holiday-list | Attendance |
|
add-shift-type /
update-shift-type /
list-shift-types /
assign-shift /
list-shift-assignments | Shift management |
|
add-regularization-rule /
apply-attendance-regularization | Attendance regularization |
|
add-expense-claim /
submit-expense-claim /
approve-expense-claim /
reject-expense-claim /
update-expense-claim-status /
list-expense-claims | Expenses |
|
add-salary-component /
list-salary-components /
add-salary-structure /
get-salary-structure /
list-salary-structures | Salary config |
|
add-salary-assignment /
list-salary-assignments /
add-income-tax-slab /
add-state-tax-slab /
update-employee-state-config | Payroll config |
|
update-fica-config /
update-futa-suta-config /
add-overtime-policy /
calculate-overtime /
calculate-retro-pay | Tax & overtime |
|
create-payroll-run /
generate-salary-slips /
get-salary-slip /
list-salary-slips /
submit-payroll-run /
cancel-payroll-run | Payroll processing |
|
generate-w2-data /
generate-nacha-file /
add-garnishment /
update-garnishment /
get-garnishment /
list-garnishments | W-2, NACHA, garnishments |
|
get-amendment-history | Amendment tracking |
Module Management & Quality (41)
| Action | Description |
|---|
INLINECODE422 / remove-module / update-modules / list-modules / available-modules / search-modules / INLINECODE428 | Module catalog (install/remove require user approval) |
INLINECODE429 / list-all-actions / list-profiles / onboard / INLINECODE433 |
Actions & profiles |
|
validate-module /
generate-module /
configure-module /
deploy-module | Module lifecycle (all require user approval) |
|
build-table-registry /
list-articles /
install-suite /
classify-operation /
run-audit /
compliance-weather-status | Validation & audit |
|
schema-plan /
schema-apply /
schema-rollback /
schema-drift /
deploy-audit-log | Schema migration (apply/rollback require user approval) |
|
semantic-check /
semantic-rules-list | Semantic correctness |
|
log-improvement /
list-improvements /
review-improvement | Improvement suggestions (advisory only) |
|
dgm-run-variant /
dgm-list-variants /
dgm-select-best | Variant analysis (advisory only, never auto-deployed) |
|
heartbeat-analyze /
heartbeat-report /
heartbeat-suggest /
detect-gaps /
suggest-modules | Gap detection (suggestions only) |
|
regenerate-skill-md | Regenerate SKILL.md |
Always confirm with user before running: setup-company, onboard, install-module, remove-module, update-modules, generate-module, deploy-module, schema-apply, schema-rollback, submit-*, cancel-*, approve-*, reject-*, run-elimination, run-consolidation, restore-database, close-fiscal-year, initialize-database --force.
Technical Details (Tier 3)
Router:
scripts/db_query.py -> 14 core domains. Optional modules installed from GitHub (
avansaber/*) to
~/.openclaw/erpclaw/modules/ (user-approved only). Single SQLite DB (WAL). 188 core tables (688 with modules). Money=TEXT(Decimal), IDs=TEXT(UUID4), GL immutable. Python 3.10+. All network activity limited to: (1)
fetch-exchange-rates — public exchange rate API, (2)
install-module — git clone from
github.com/avansaber/* only, requires user approval.
erpclaw
全栈ERP控制器,用于ERPClaw。处理公司设置、会计科目表、日记账分录、付款、税务、财务报告、客户、销售、供应商、采购、库存、开票、人力资源(员工、休假、考勤、费用)、美国薪资(FICA、W-2、工资扣押)、高级会计(ASC 606/842、公司间、合并)以及43个行业模块。单一本地SQLite数据库,复式记账总账,不可变审计追踪。
安全性: 本地优先(~/.openclaw/erpclaw/data.sqlite)。参数化查询。基于角色的访问控制(PBKDF2)。不可变总账。仅fetch-exchange-rates(公共API)和install-module(GitHub avansaber/*,需用户批准)需要网络。集成API密钥(Stripe、Shopify等)通过--api-key标志传递并仅存储在本地数据库中——代码或环境变量中不包含任何凭据。
技能激活触发器
当用户提及以下内容时激活:ERP、会计、发票、销售订单、采购订单、客户、供应商、库存、付款、总账、试算平衡表、损益表、资产负债表、税务、开票、模块、安装模块、入职、CRM、制造、医疗保健、教育、零售、员工、人力资源、薪资、工资、休假、考勤、费用报销、W-2、工资扣押、集成。
自动检测
当用户描述其业务时:检测类型(例如,牙科诊所 -> 牙科),在继续前请用户确认,然后调用setup-company --industry 。行业值:零售、餐饮、医疗保健、牙科、兽医、建筑、制造、法律、农业、酒店、物业、学校、大学、非营利、汽车、治疗、家庭健康、咨询、分销、软件即服务。当用户询问当前未安装的服务或集成时,搜索模块注册表并建议安装(未经用户批准绝不自动安装)。
设置
python3 {baseDir}/scripts/erpclaw-setup/db_query.py --action initialize-database
python3 {baseDir}/scripts/db_query.py --action seed-defaults --company-id
python3 {baseDir}/scripts/dbquery.py --action setup-chart-of-accounts --company-id --template usgaap
全部467个操作
设置与管理(44个)
| 操作 | 描述 |
|---|
| initialize-database / setup-company / update-company / get-company / list-companies | 数据库初始化与公司增删改查 |
| add-currency / list-currencies / add-exchange-rate / get-exchange-rate / list-exchange-rates / fetch-exchange-rates |
货币与外汇 |
| add-payment-terms / list-payment-terms / add-uom / list-uoms / add-uom-conversion | 条款与计量单位 |
| seed-defaults / seed-demo-data / check-installation / install-guide / setup-web-dashboard / tutorial / onboarding-step / status | 种子数据与工具 |
| add-user / update-user / get-user / list-users / set-password | 用户管理 |
| add-role / list-roles / assign-role / revoke-role / seed-permissions | 基于角色的访问控制与安全 |
| link-telegram-user / unlink-telegram-user / check-telegram-permission | Telegram集成 |
| backup-database / list-backups / verify-backup / restore-database / cleanup-backups | 数据库备份/恢复 |
| get-audit-log / get-schema-version / update-regional-settings / onboard | 系统管理 |
总账(26个)
| 操作 | 描述 |
|---|
| setup-chart-of-accounts / add-account / update-account / get-account / list-accounts | 账户增删改查 |
| freeze-account / unfreeze-account / get-account-balance / check-gl-integrity |
账户管理 |
| post-gl-entries / reverse-gl-entries / list-gl-entries | 总账过账 |
| add-fiscal-year / list-fiscal-years / validate-period-close / close-fiscal-year / reopen-fiscal-year | 会计年度 |
| add-cost-center / list-cost-centers / add-budget / list-budgets | 成本中心与预算 |
| seed-naming-series / next-series / revalue-foreign-balances | 命名与外汇重估 |
| import-chart-of-accounts / import-opening-balances | CSV导入 |
日记账分录(16个)
| 操作 | 描述 |
|---|
| add-journal-entry / update-journal-entry / get-journal-entry / list-journal-entries | 日记账分录增删改查 |
| submit-journal-entry / cancel-journal-entry / amend-journal-entry / delete-journal-entry / duplicate-journal-entry |
日记账分录生命周期 |
| create-intercompany-je | 公司间日记账分录 |
| add-recurring-template / update-recurring-template / list-recurring-templates / get-recurring-template / process-recurring / delete-recurring-template | 定期日记账分录 |
付款(13个)
| 操作 | 描述 |
|---|
| add-payment / update-payment / get-payment / list-payments / submit-payment / cancel-payment / delete-payment | 付款增删改查与生命周期 |
| create-payment-ledger-entry / get-outstanding / get-unallocated-payments / allocate-payment / reconcile-payments / bank-reconciliation |
对账 |
税务(17个)
| 操作 | 描述 |
|---|
| add-tax-template / update-tax-template / get-tax-template / list-tax-templates / delete-tax-template | 税务模板增删改查 |
| resolve-tax-template / calculate-tax / add-tax-category / list-tax-categories / add-tax-rule / list-tax-rules |
税务规则 |
| add-item-tax-template / add-tax-withholding-category / get-withholding-details | 预扣税 |
| record-withholding-entry / record-1099-payment / generate-1099-data | 1099报告 |
财务报告(20个)
| 操作 | 描述 |
|---|
| trial-balance / profit-and-loss / balance-sheet / cash-flow / general-ledger / party-ledger | 核心报表 |
| ar-aging / ap-aging / budget-vs-actual(别名:budget-variance) |
账龄与预算 |
| tax-summary / payment-summary / gl-summary / comparative-pl / check-overdue | 汇总 |
| add-elimination-rule / list-elimination-rules / run-elimination / list-elimination-entries | 公司间 |
销售(48个)
| 操作 | 描述 |
|---|
| add-customer / update-customer / get-customer / list-customers / import-customers | 客户增删改查 |
| add-quotation / update-quotation / get-quotation / list-quotations / submit-quotation / convert-quotation-to-so |
报价 |
| add-sales-order / update-sales-order / get-sales-order / list-sales-orders / submit-sales-order / cancel-sales-order / amend-sales-order / close-sales-order | 销售订单 |
| add-blanket-order / get-blanket-order / list-blanket-orders / submit-blanket-order / create-so-from-blanket | 总括订单 |