Financial Accounting Automatic Triggers
In the AI GO platform, the financial accounting system is the intelligent core of enterprise operations. To break down information silos between finance and other departments and eliminate tedious and error-prone manual bookkeeping, the system implements a fully automated "Accounting Triggers" mechanism. When sales, warehouse, or HR staff complete daily operations, the system automatically generates or updates accounting vouchers and bills in the background, achieving real-time financial transparency.
This chapter details the five built-in accounting trigger mechanisms.
1. Sales Invoicing Trigger (Sale to Account)
When sales colleagues complete sales operations, the system automatically prepares customer invoices in the background for the finance department:
- Trigger: When the user clicks "Create Invoice" on a confirmed Sales Order.
- Background Automation: The system extracts order details, pending invoicing quantities, unit prices, and discounts to generate a draft "Customer Invoice (out_invoice)". Meanwhile, the system queries the product category, fetches the default income account (
property_account_income_id) and tax rate, saving time for manual entries. - Auto-Billing by Payment Terms: Integrated with the advanced business engine, the system supports batch auto-billing by payment terms. The system aggregates all delivered but uninvoiced orders for a specific client over a certain period, and automatically creates customer invoices in batch.
2. Vendor Bill Trigger (Purchase to Account)
Linkage between purchasing and accounts payable ensures expenditures are recorded accurately and prevents duplicate payments:
- Trigger: When the Purchase Order is confirmed, warehouse staff have received parts or all of the goods, and the user clicks "Create Bill".
- Background Automation: The system compares the order's "Received Quantity (qty_received)" minus "Invoiced Quantity (qty_invoiced)", and generates a draft "Vendor Bill (in_invoice)" for only the received but unbilled quantities and differences. The system automatically debits the expense account (
property_account_expense_id) of the product category, and credits accounts payable.
3. Real-Time Stock Valuation Trigger (Stock to Account)
Traditional accounting usually conducts inventory counting and valuation at the end of the month. AI GO supports advanced "Real-Time Stock Valuation", letting the balance sheet reflect inventory asset changes instantly:
- Trigger: When warehouse staff complete inventory receipts, deliveries, or internal transfers (StockMove), and the state changes to "Done".
- Background Automation: If the product category is configured for real-time valuation (
property_valuation = 'real_time'), the system automatically calculates the inventory value change (Quantity × Unit Cost) and directly generates a posted stock valuation accounting journal entry:- Receipts (Supplier/Production → Internal Location): Debit Stock Valuation Account / Credit Stock Input Account (or Expense Account).
- Deliveries (Internal Location → Customer/Production): Debit Cost of Goods Sold (COGS) Account / Credit Stock Valuation Account.
- This guarantees that COGS on the income statement and inventory assets on the balance sheet are updated within seconds of inventory movements.
4. Payroll Posting Trigger (Payroll to Account)
HR payroll confirmation and financial posting are completed with one click in the system, avoiding bookkeeping errors:
- Trigger: When HR colleagues confirm a payroll run batch (
HrPayrollRun). - Background Automation:
- Confirm Run: Upon confirmation, the system automatically generates a corresponding payroll journal entry, debiting basic salaries, allowances, and employer-paid insurance portions to expense accounts and crediting payroll payables.
- Cancel Run: If HR managers discover errors and cancel the payroll batch, the system automatically generates a reversing journal entry (reconciliation entry) to cancel out the original posting, maintaining accounting correctness.
5. Payment Reconciliation Trigger (Payment to Invoice Reconcile)
Cash receipt/payment and invoice matching are the most tedious daily tasks in closing accounting periods. AI GO's automatic reconciliation engine automates this:
- Trigger: When cashier or finance staff confirm a payment receipt or payment voucher (
AccountPayment), marking it as "Posted". - Background Automation:
- Auto-Balancing & Numbering: Upon posting, the system creates payment journal entries. If a minor debit/credit rounding difference is detected, the system creates an "auto-balancing entry" to post the entry smoothly.
- FIFO Auto-Reconciliation: The system searches for all outstanding invoices or bills associated with the customer or supplier. The reconciliation engine matches payment amounts to these bills in First-In, First-Out (FIFO) order, generating
AccountPartialReconcileorAccountFullReconcilerecords. - Payment Status Deduction: Once a bill's remaining amount is reduced to zero, the system updates its payment status to "Paid", or otherwise marks it as "Partial", achieving automated accounts receivable and payable closing.