Skip to content

Accounting

The Accounting module is Lubb ERP's double-entry bookkeeping core: a chart of accounts, journal entries, sales and purchase documents, and a General Ledger (GL) spine that every other financial screen reads from. It follows an ERPNext-shaped data model (Draft → Submitted → Cancelled document lifecycle, GL posts on submit, cancellation reverses rather than deletes) and is used by finance/admin staff to run the books, and — read-only, self-scoped — by customers viewing their own invoices in the Customer Portal.

Buying (purchase orders/invoices), Debtors (collections/statements/ageing workflows) and Banking (bank accounts/reconciliation) live in the same file but are documented as their own modules; this page covers only the accounting core: masters, GL, sales invoicing, payments, VAT and the financial reports.

What you can do

  • Maintain the Chart of Accounts — a self-referential tree of accounts with root type (Asset/Liability/Equity/Income/Expense), account type (Bank/Cash/Receivable/Payable/Tax/Stock/etc.), currency and group/leaf structure, scoped per Company.
  • Manage Companies, Fiscal Years, Cost Centers and Warehouses as supporting masters.
  • Configure Tax Templates (Sales/Purchase/Item) with rows for rate, charge type and the account each tax posts to, plus Payment Terms (credit days) and Modes of Payment (Cash/Cheque/Bank/EFT).
  • Raise and post Sales Invoices (with credit notes via is_return), Payment Entries (Receive/Pay/Internal Transfer) and Journal Entries (multi-line debit/credit with optional party and cost center) — each with Submit (posts to the GL) and Cancel (reverses the GL) row actions.
  • View Sales Invoice line items, POS tagging (till/profile) on invoices, and per-invoice PDF/email/SMS actions.
  • Let a customer Pay Now (hosted Paystack checkout for their outstanding balance) or have staff Charge Saved Card off-session.
  • Browse the raw General Ledger grid (one row per debit/credit posting, filterable by account/voucher, with running debit/credit totals).
  • View Debtors Ageing (FIFO-bucketed 0-10/10-20/20-30/31-60/61-90/90+ days per customer) and trigger Statement emails/SMS from it.
  • Run the full financial report set: Trial Balance, General Ledger, Profit & Loss, Balance Sheet, Cash Flow, Sales Register, Purchase Register, AR/AP Summary, AR/AP Ageing and the SARS VAT201 — each exportable as PDF.
  • Configure site-wide VAT (rate, output account, inclusive/exclusive pricing, auto-apply on/off), invoice letterhead (logo, address, footer), company defaults (default income/expense accounts) and the default bank account.
  • Maintain Naming Series (document numbering prefixes/counters) per doctype.

Common tasks

  1. Set up the chart of accounts and tax rate Open Chart of Accounts and create/edit account nodes (number, name, parent, root type, account type) under the relevant Company. Then go to Settings → Tax and set the VAT rate, the output VAT account, whether prices are VAT-inclusive, and whether VAT should auto-apply to new documents.

  2. Raise a Sales Invoice From Sales Invoices, click "New Sales Invoice" to open the line-item entry form (invoices carry child rows, so they're created via this form/API rather than an inline grid row). Pick the customer, add item lines, set posting/due date, and save as a draft. Use "Submit" to post it to the GL (debits Debtors, credits Income and output VAT) — Submit refuses to post if the document is unbalanced. A submitted invoice can be viewed as PDF, emailed, or texted to the customer; "Cancel" reverses its GL entries without deleting the row.

  3. Record a Journal Entry Click "New Journal Entry", choose an entry type (Opening Entry, Bank Entry, Cash Entry, Credit/Debit Note, Contra, etc.), and add debit/credit account lines (each may carry a party and cost center). Submit to post — total debits must equal total credits. Cancel reverses the posting.

  4. Take a payment Create a Payment Entry (Receive for money in, Pay for money out, or Internal Transfer between accounts), set the paid-from/paid-to accounts, mode of payment and amount, and Submit. Payments post on-account against the GL — there's no per-invoice allocation step; what a customer owes is simply their running GL balance (see Data model below), shown on the Customers/Debtors Ageing grids and the Statement of Account. Alternatively, a customer can self-serve via "Pay Now" (Paystack checkout for their full outstanding balance) from their invoice, or staff can "Charge Saved Card" for them.

  5. Reconcile and review the books Use the General Ledger grid to inspect individual postings by account or voucher. Run Trial Balance, Profit & Loss and Balance Sheet from the reports for a period/as-on-date view, and Sales/Purchase Register for a document-level breakdown. Debtors Ageing gives a per-customer 0–90+ day breakdown of what's owed, with buttons to email/SMS statements or disable overdue customers' services.

  6. Prepare a VAT return Run the VAT201 report for the SARS filing period (from/to dates); it nets output vs. input VAT off the tax rows posted on submitted documents (account_type == "Tax"), and can be exported as PDF for filing.

Data model

  • AccAccount — chart-of-accounts node; self-referential tree via parent_id, tagged with root_type/account_type, scoped to a Company.
  • AccCompany, AccFiscalYear, AccCostCenter, AccWarehouse — supporting masters referenced across all documents.
  • AccTaxTemplate / AccTaxTemplateRow — reusable Sales/Purchase/Item tax templates (rate, charge type, target account).
  • AccDocTax — the actual tax/charge row attached to a specific sales or purchase document (polymorphic via parent_type/parent_id).
  • AccPaymentTerms, AccModeOfPayment — payment-terms (credit days) and payment-mode masters.
  • AccSalesInvoice / AccSalesInvoiceItem — the sales invoice header (customer, posting/due date, grand total, is_return for credit notes, POS tags, Paystack pay_token) and its line items.
  • AccJournalEntry / AccJournalEntryAccount — a multi-line manual GL posting (entry type, per-line debit/credit/account/party/cost center).
  • AccPaymentEntry / AccPaymentEntryReference (historical) / AccPaymentEntryDeduction — a receive/pay/transfer document; AccPaymentEntryReference is frozen (no longer written) since the 2026-07-17 balance-forward migration replaced per-invoice allocation with GL-balance ageing.
  • GLEntry (gl_entry) — the immutable, GL-first spine: one row per debit/credit posting, linked back to its originating voucher (voucher_type/voucher_id) and, for receivable/payable rows, what it settles (against_voucher_type/against_voucher_id). Every report and balance is computed off this table.
  • AccNamingSeries — per-doctype numbering prefix/counter used when minting new document numbers.

Relationships to other modules: Debtors (customer ageing/statements/collections) reads GL balances via app.services.party_balance off AccCustomer + GLEntry. Buying (purchase orders/receipts/invoices) mirrors the selling-document flow and posts through the same GL engine and Chart of Accounts. Banking (bank accounts/reconciliation) creates Payment Entries and Journal Entries against the accounts defined here and reconciles them against GLEntry/bank transactions.

Configuration & integrations

  • VAT settings (Settings → Tax) — per-site rate, output VAT account, inclusive/exclusive pricing, and an "apply VAT automatically" toggle for documents raised through the entry form or Create Bill Run.
  • Company defaults (Settings → Accounting) — fallback income/expense accounts a document line posts to when it names none of its own (stored on AccCompany.defaults_json).
  • Invoice letterhead (Settings → Accounting) — logo, company name, address, contact line and footer text rendered on invoice/statement PDFs.
  • Default bank account (Settings → Accounting) — which bank account the Bank Reconciliation screen opens on.
  • Naming series — configurable prefix/padding/last-number per document type for auto-generated document numbers.
  • Paystack — powers the customer-facing "Pay Now" hosted checkout and staff "Charge Saved Card" off-session charge, settling against the customer's GL balance; webhook confirmation books the payment automatically.
  • PDF generation — invoice, receipt and financial-report PDFs are rendered server-side (accounting_pdf / accounting_reports_pdf) using the letterhead settings above.
  • Migration — an admin-only endpoint can pull GL-first data from a live ERPNext site into a book (idempotent, keyed on each row's original ERPNext source_id).

API reference

Master data (Companies, Chart of Accounts, Cost Centers, Warehouses, Customers, Tax Templates, Payment Terms, Modes of Payment, Naming Series) is served by the generic grid engine — standard CRUD over /grid/acc-* (e.g. /grid/acc-accounts, /grid/acc-tax-templates, /grid/acc-payment-terms), each with list/create/update/delete plus row-button actions (Submit/Cancel) where applicable. Transactional documents (invoices, payments, journals) are read/listed via the same grids but created/edited through the document endpoints below, since they carry child line rows a generic form can't build. All routes are mounted under /accounting.

MethodPathPurpose
GET/accounting/companiesList companies for report/picker dropdowns
GET/accounting/item-priceResolve the price an item should use for a given customer
GET/PUT/accounting/settings/vatRead/update site VAT settings
GET/PUT/accounting/settings/letterheadRead/update invoice letterhead branding
GET/PUT/accounting/settings/prorataRead/update prorated first-bill setting
GET/PUT/accounting/settings/company-defaultsRead/update default income/expense accounts
GET/PUT/accounting/settings/default-bankRead/update the default bank account
GET/accounting/bank-accountsList bank accounts with default flag
POST/accounting/documents/{doctype}Create a draft document (header + child rows); ?submit=true posts it immediately
GET/accounting/documents/{doctype}/{doc_id}Read a document (resolved names) for the view modal
GET/accounting/documents/{doctype}/{doc_id}/editRead a draft document in raw editable form
PUT/accounting/documents/{doctype}/{doc_id}Update a draft document; ?submit=true posts it after saving
POST/accounting/{doctype}/{doc_id}/submitPost a document to the GL
POST/accounting/{doctype}/{doc_id}/cancelCancel a document and reverse its GL entries
GET/accounting/reports/trial-balanceTrial Balance for a company/period
GET/accounting/reports/general-ledgerGL rows filtered by account/party/period
GET/accounting/reports/profit-lossProfit & Loss statement
GET/accounting/reports/balance-sheetBalance Sheet as-on a date
GET/accounting/reports/cash-flowCash Flow statement
GET/accounting/reports/sales-registerSales Register (document-level sales listing)
GET/accounting/reports/purchase-registerPurchase Register
GET/accounting/reports/ar-summary / /ap-summaryAR/AP summary as-on a date
GET/accounting/reports/ar-ageing / /ap-ageingAR/AP ageing buckets as-on a date
GET/accounting/reports/vat201SARS VAT201 return for a period
GET/accounting/reports/bank-reconciliationReconciliation summary for a bank account
GET/accounting/reports/{report}/pdfPDF export of any of the above reports
POST/accounting/migrate/{site_id}Kick a GL-first data pull from a live ERPNext site

Row-level actions on the grids (not separate routes, invoked via the grid button/bulk-action mechanism): Submit / Cancel on invoices, payments and journals; View/Email/SMS PDF on invoices and payments; Pay Now / Charge Saved Card on invoices; and, on Debtors Ageing, Test/Send Statement (email and SMS).

Lubb ERP Documentation