9.7 KiB
Accounting Features
Accounting Dashboard
Routes:
app/ac_dashboard/index.phpapp/ac_dashboard/api/engine/by_source.phpapp/ac_dashboard/api/engine/journals.phpapp/ac_dashboard/api/engine/pl.phpapp/ac_dashboard/api/engine/posting_window.phpapp/ac_dashboard/api/engine/recent.phpapp/ac_dashboard/api/engine/trend.php
The accounting dashboard summarizes accounting KPIs, posting window status, and high-level financial indicators.
Backend support:
ac_dashboard/api/engine/*FinancialReportsCompanySettingManager
Revenue Documents
Routes:
app/revenue/quotation.phpapp/revenue/manage_quotation.phpapp/revenue/order.phpapp/revenue/manage_order.phpapp/revenue/invoice.phpapp/revenue/manage_invoice.phpapp/revenue/manage_credit_note.phpapp/revenue/view_invoice.phpapp/revenue/receipt.php
Revenue workflows include quotations, sales orders, sales invoices, and customer credit notes. Quotations can be converted forward, sales documents support inline tax, and invoices can be posted to the GL.
Backend support:
QuotationManagerOrderManagerInvoiceManagerrevenue/api/engine/*
Expense Documents
Routes:
app/expense/purchase_request.phpapp/expense/manage_purchase_request.phpapp/expense/purchase_order.phpapp/expense/manage_purchase_order.phpapp/expense/purchase_invoice.phpapp/expense/manage_purchase_invoice.phpapp/expense/manage_supplier_credit_note.phpapp/expense/payment.php
Expense workflows include purchase requests, purchase orders, purchase invoices, and supplier credit notes. Purchase requests can be submitted, approved, rejected, reopened, cancelled, and converted to purchase orders. Purchase documents support inline tax and accounting formula assignment.
Backend support:
PurchaseRequestManagerPurchaseOrderManagerInvoiceManagerexpense/api/engine/*
Receipt Billing And Receipts
Routes:
app/finance/receipt_billing.phpapp/finance/manage_receipt_billing.phpapp/finance/receipt.phpapp/finance/manage_receipt.php
Receipt Billing groups customer invoices for collection. Receipts allocate cash against open customer documents, refresh invoice settlement status, and can be assigned formulas for GL posting.
Backend support:
ReceiptBillingManagerReceiptManager
Payment Billing And Payments
Routes:
app/finance/payment_billing.phpapp/finance/manage_payment_billing.phpapp/finance/payment.phpapp/finance/manage_payment.php
Payment Billing groups supplier invoices for payment. Payments allocate cash against open supplier documents, refresh settlement status, and can be assigned formulas for GL posting.
Backend support:
PaymentBillingManagerPaymentManager
Chart Of Accounts
Routes:
app/accounting/chart_of_accounts.phpapp/accounting/manage_account.phpapp/accounting/api/engine/account.phpapp/accounting/api/engine/manage_account.php
The chart of accounts manages account code, account name, account type, account category, parent account, posting flag, and status. Account categories are used by reports such as VAT.
Backend support:
ChartOfAccounts::getAll()ChartOfAccounts::create()ChartOfAccounts::update()ChartOfAccounts::isPostingAccount()
Departments
Routes:
app/accounting/departments.phpapp/accounting/manage_department.phpapp/accounting/api/engine/department.php
Departments are optional dimensions on journal lines and accounting reports. Reports can filter by department where supported.
Backend support:
DepartmentManager
Account Formulas
Routes:
app/accounting/account_formulas.phpapp/accounting/api/engine/account_formula.php
Account Formulas define GL posting templates by document type. A formula consists of debit/credit lines, account codes, amount keys, descriptions, status, and default flag.
Supported amount keys:
grand_total: final document total.total: pre-tax/subtotal-style amount, split by SKU when Product Account Mapping applies.tax: document tax amount.amount: receipt or payment amount.
Backend support:
AccountFormulaManagerBasePosting::resolveFormula()
Product Account Mapping
Routes:
app/accounting/account_formulas.phpapp/accounting/api/engine/product_account_mapping.phpapp/inventory/manage_product.php
Product Account Mapping assigns sales and purchase GL accounts to each product/SKU. It is used when an account formula line uses total.
The Product Accounts tab inside Account Formulas is an accounting-only maintenance view. The pencil action opens a modal that edits only sales_account_code and purchase_account_code; full product master data remains in the product maintenance page.
Posting behavior:
- Sales invoice and credit note
totallines usesales_account_code. - Purchase invoice and supplier credit note
totallines usepurchase_account_code. - If a product mapping is blank, posting falls back to the formula account for that line.
- Batch GL posting checks loaded invoice documents and blocks Run when product mappings are missing for formulas that use
total.
Backend support:
ProductManager::updateAccountMapping()BasePosting::buildSkuTotalLines()InvoicePostingCreditNotePostingPurchaseInvoicePostingSupplierCreditNotePosting
Manual GL Journal
Routes:
app/accounting/journal_listing.phpapp/journal/index.phpapp/journal/new.phpapp/accounting/api/engine/save_manual_journal.phpapp/accounting/api/engine/get_journal_listing.phpapp/accounting/api/engine/get_journal_detail.php
Manual GL Journals allow users to create or edit journal entries outside source documents. Journal lines include account code, department, debit, credit, and description.
Backend support:
GlManager::postManual()GlManager::replaceManual()
Source Document GL Posting
Routes:
app/accounting/api/engine/post_gl_entry.php
Source document posting builds journal lines from a source document and selected/default formula, then writes or replaces td_gl and td_gl_item.
Supported source types:
invoicecredit_notepurchase_invoicesupplier_credit_notereceiptpayment
Posting behavior:
- First post:
GlManager::post()createstd_glandtd_gl_itemrows. - Re-post:
GlManager::replace()snapshots the current lines as JSON intotd_gl.history, incrementstd_gl.current_version, then writes new lines. Full version history is preserved. - Void: calls
GlManager::delete()which hard-deletes thetd_glandtd_gl_itemrows. No reversal entry is created (future work).
Backend support:
BasePostingInvoicePostingCreditNotePostingPurchaseInvoicePostingSupplierCreditNotePostingReceiptPostingPaymentPostingGlManager::post()GlManager::replace()
Planned — not yet implemented:
PostingManager(app/assets/utils/classes/PostingManager.php) is a stub intended as the sole bridge between WMS engine files and the accounting engine. WMS endpoints would callPostingManager::postInvoice()etc. instead of importing accounting classes directly. All methods are TODO — GL posting is currently triggered manually fromgl_entries.php, not automatically from WMS saves.
Batch GL Entries
Routes:
app/accounting/gl_entries.phpapp/accounting/api/engine/get_gl_documents.phpapp/accounting/api/engine/post_gl_entry.phpapp/accounting/api/engine/acquire_op_lock.phpapp/accounting/api/engine/release_op_lock.phpapp/accounting/api/engine/log_batch_action.php
Batch GL Entries load documents by date range and formula, then post or replace GL entries one document at a time. A DB lock prevents overlapping batch posting jobs across tabs/users.
Current safeguards:
- Requires formula selection.
- Uses operation locks for
gl_postviaOperationLockManager— prevents two users running overlapping batch jobs. - Uses retry behavior through
batch_process(). - Blocks Run when Product Account Mapping is incomplete for selected formula/document set.
- Shows Product Accounts status per loaded invoice document.
- Logs batch totals and failed IDs via
BatchActionManager— records start time, end time, total processed, failed IDs, and result message intobatch_action_log.
Backend support:
OperationLockManagerBatchActionManager::log(array $data)
Posting Window
Routes:
app/accounting/posting_window.phpapp/accounting/api/engine/posting_window.php
The posting window controls which dates are open for accounting postings and approved inventory entries. It supports open-from and open-to boundaries.
Backend support:
CompanySettingManagerPostingWindowGuard::assertOpenDate()GlManagerposting validationReceiptManagerandPaymentManagerdate validation
Financial Reports
Routes:
app/accounting/trial_balance.phpapp/accounting/pl_statement.phpapp/accounting/balance_sheet.phpapp/accounting/gl_movement.phpapp/accounting/vat_report.phpapp/accounting/api/engine/get_trial_balance.phpapp/accounting/api/engine/get_pl_statement.phpapp/accounting/api/engine/get_balance_sheet.phpapp/accounting/api/engine/get_gl_movement.phpapp/accounting/api/engine/get_vat_report.php
Reports are generated from td_gl, td_gl_item, md_account, and optional departments.
Report behavior:
- Date filters use full dates (
YYYY-MM-DDpayload,dd/mm/yyyyUI). - Trial Balance shows opening, movement, and closing balances.
- P&L shows revenue, expenses, and net profit.
- Balance Sheet shows asset, liability, equity, and retained earnings.
- GL Movement shows account-level journal movement.
- VAT Report uses account categories such as
sales_taxandpurchase_tax.
Backend support:
FinancialReportsTaxReportManager