Book 4 — Finance & Accounting (Index)¶
Bizwiz Guide · Book 4 of 7 · Review instrument Where all the money ends up: the General Ledger that every other module posts into, the fixed-asset register that depreciates onto those same books, and the petty-cash/expenses engine that turns small day-to-day spend into ledger entries.
This book covers the book-of-record end of Bizwiz. If Books 1–3 are where value moves (sales, stock, purchases), Book 4 is where every one of those movements lands as an accounting entry and is kept in balance. Read it as: one ledger table (wa_gl_trans) is the trial-balance spine; Fixed Assets and Petty Cash are two feeder modules that post into it; and a large toolbox of utilities exists to keep the spine balanced.
| # | Chapter | One-line scope |
|---|---|---|
| 15 | General Ledger & Journals | The wa_gl_trans trial-balance spine, Chart of Accounts, manual journal vouchers, inquiry screens, integrity utilities, financial statements |
| 16 | Fixed Assets | Asset register, depreciation (SL / reducing-balance), capitalization, revaluation/impairment, disposal — a modern module posting into the same GL |
| 17 | Petty Cash & Expenses | Vehicle/Buildings/General requisition engine, M-Pesa disbursement, budgeted expenses from GRN, GL + AP-voucher settlement |
The money-lands-here flow¶
flowchart TD
subgraph FEEDERS[Value-moving modules — Books 1–3]
AP[Accounts Payable · Book 3<br/>supplier invoices, GRN, cash pay]
SALES[Sales / Debtors · Book 1<br/>invoices, route sales, receipts]
INV[Inventory · Book 2<br/>adjustments, COGS, movement]
end
subgraph BOOK4[Book 4 — Finance]
PC[Petty Cash · Ch17<br/>petty_cash_purchase_orders]
FA[Fixed Assets · Ch16<br/>fixed_assets register]
JV[Manual Journal Voucher · Ch15<br/>wa_journal_entries]
end
AP -->|*GlPostingService| GL
SALES -->|*GlPostingService| GL
INV -->|*GlPostingService| GL
PC -->|disbursement CR petty-cash / DR expense| GL
PC -.voucher-paid payment_method=4.-> AP
FA -->|FAC / FAD / DSP / FAV series| GL
JV -->|process| GL
GL[(wa_gl_trans<br/>SIGNED-AMOUNT TRIAL-BALANCE SPINE<br/>debit +ve / credit −ve · must net to 0)]
GL --> STMT[Trial Balance · P&L · Balance Sheet<br/>routed by wa_charts_of_accounts.pl_or_bs]
GL -. sub-ledger sync .-> SUB[wa_banktrans · wa_debtor_trans · wa_supp_tran]
UTIL[Utility submenu<br/>drift / orphan / unbalanced hunters] -.reconciles.-> GL
The one-sentence version: every value event in the ERP funnels through GlTransactionService into wa_gl_trans as signed legs that must net to zero; Fixed Assets and Petty Cash are two Book-4 feeders; the sub-ledgers (wa_banktrans / wa_debtor_trans / wa_supp_tran) are kept in step, and the Utility screens hunt the drift when they aren't.
Cross-chapter & cross-book seams¶
Within Book 4:
- Ch16 → Ch15: Fixed Assets posts every money event (capitalization FAC, depreciation FAD, disposal DSP, valuation FAV) into wa_gl_trans via WaGlTran::insert(), using the same signed-amount / net-to-zero convention. Two separate calendars: fixed_asset_periods decides what to depreciate; wa_accounting_periods (is_current_period=1) decides where the journal lands.
- Ch17 → Ch15: Petty-cash disbursement posts CR petty-cash 54000-001 / DR expense-by-source; voucher accrual posts DR expense / DR VAT / CR creditors — both into wa_gl_trans, firing on the M-Pesa callback.
- Ch17 → Ch13 (Book 3 AP): voucher-paid requisitions (payment_method=4) settle through the same polymorphic payment_voucher_items engine documented in Book 3 Ch13, raising a wa_supp_trans creditor bill. Petty cash is one more payable type on the shared voucher engine.
To other books (the CRITICAL inbound seam — Book 4 GL is the destination trial balance):
- ← Book 3 (Accounts Payable): posts to wa_gl_trans + wa_banktrans — DR GIT/Purchases + VAT input, CR Creditors control / WHT-VAT-statutory liabilities / Bank. AP is the primary money-out feeder. Confirmed via SupplierInvoiceGlPostingService, GrnGlPostingService, SupplierCashPaymentGlPostingService all delegating to GlTransactionService.
- ← Book 1 (Sales / Debtors): DR Debtors control / Cash Control, CR Sales + Output VAT (RouteSalesGlPostingService, CreditNoteGlPostingService, …). Book 1 Ch6 owns the money-in / receivables-reconciliation side and posts on approval; Ch15 documents the GL-side banking (bank master, deposits, transfers) and the ledger table itself — the two do not overlap.
- ← Book 2 (Inventory): DR/CR Stock movement, COGS, Purchase variance.
- ↔ Fleet (Book 5, upcoming): a fixed_assets row can be polymorphically linked to a Vehicle (assetable_type/assetable_id) — the only wired linkable type today. This is the Ch16 → Fleet seam.
Consolidated open questions (the review agenda)¶
Grouped from each chapter's §7. CODE-PROVEN items are stated as fact in the chapters; the items below are what needs human/dev confirmation.
Configuration / "which is live per client":
- Extensive vs default GL posting — gated per-tenant by administration_settings.slug = 'use-extensive-gl-posting'. When on, sales/purchase/inventory events post a rich per-category leg set with per-branch account resolution; when off, a simpler legacy posting runs. Which mode each distributor runs is a standing question.
- Which config surface is authoritative for postings — gl_configurations (edited via GlConfigurationsController, created 2025-10) vs the per-category columns on WaCompanyPreference/TaxManager that the extensive services actually read. A posting path that reads gl_configurations was not statically confirmed.
- Fixed-asset FA_* GL config codes and whether granular fixed-asset-* / petty-cash permission strings are seeded per tenant or fall back to the base module — seeding not inspected.
Data-integrity quirks / naming to verify against the live schema:
- wa_banktrans vs wa_bank_trans/wa_banktran naming — the migration creates wa_banktrans; code and Book 1 Ch6 use variants. Confirm the single live table name (this recurs across Books 1, 3, 4).
- Misspelled identifiers (verbatim): wa_journal_entrie_items; FK wa_gl_trans.wa_journal_entrie_id; wa_banktrans.wa_curreny_id. Consistent with the ERP's other misspellings (qauntity, journel_entry_id).
- "Processed" semantics for GL rows — Ch15 asserts wa_gl_trans has no status flag and "processed" is a source-document state; confirm no module treats a GL row as draft/unposted.
- Ch17 petty-cash payable_type literal was not pinned to an exact string; Route Parking Fees has no route/table (likely dropped); order-taking/delivery/scheduled budgeted-expense paths may be inactive (look commented).
Ownership / architecture boundaries & semantics:
- GL EOD Routine screen (GlEodRoutineController@index) — verification-only or corrective? (The RunEndOfDayChecks console command closes shifts, posts no GL.)
- Journal approval — store + process were found but no separate approve method; confirm approval is folded into process().
- Fixed-asset approvals — which role approves transfers/disposals, and whether self-approval is blocked (no self-approval guard confirmed). The scheduler that acts on auto_preview/auto_post run types was not located.
- Procurement → asset origination — only a soft supplier_id/purchase_reference + the capitalization_gl_status='external' (anti-double-post) flag were found; no hard LPO/GRN→fixed_assets creation path. Capitalization appears to be a manual step from the register. Confirm whether procurement ever auto-creates an asset.
- Legacy coexistence — wa_petty_cash_requests (with initial/final approval) still coexists with the newer petty_cash_purchase_orders; Budgeting and Cash Management render in the nav but are hard-disabled placeholders (general_ledger.blade.php:582–604).
Recurring Bizwiz patterns reinforced by Book 4¶
- One ledger, many feeders — the single
wa_gl_transsigned-amount spine, written only throughGlTransactionService(40+*GlPostingServiceclasses), is the cleanest example yet of "one durable abstraction, many callers." Mirror of Book 3's one-voucher-engine finding. - Approval queues everywhere — manual journals (
pending→processed), fixed-asset transfer/disposal maker-checker, petty-cash multi-stage requisition (requested→…→paid). Another rich "approvers not curators" surface: humans mostly validate entries the system already assembled. - Mid-modernization layering — Fixed Assets (2026-06→08) is a modern, cleanly-layered module (service classes, account resolver, state machine, IAS-16/36 revaluation) posting into the same legacy
wa_gl_transcore. "Modern surface, integrated underneath" — and legacy paths (wa_petty_cash_requests, disabled Budgeting/Cash-Mgmt nav) kept alongside. - Real external integrations — Petty cash pays out over M-Pesa B2C/B2B (Daraja) with receipt-number reconciliation (
disbursements.receipt_no↔petty_cash_statements.receipt_number), joining Book 3's Equity H2H and Supplier-Portal backend as live dependencies. - Config- and flag-driven behaviour — the extensive-vs-default posting flag and per-branch account resolution mean the same business event yields different GL legs per tenant; documenting both branches (and flagging "which is live" for humans) remains the standing method.
Book 4 complete: 3 chapters (15/16/17) + this index, assembled from static analysis of the bizwiz monolith. All three verified on disk (3,813 / 2,873 / 3,774 words; all 8 template sections). Next in the fan-out: Book 5 — Fleet & Logistics (routing, deliveries, vehicles — carry the Ch16 assetable_type=Vehicle seam forward). Then Book 6 HR & Payroll, Book 7 Platform & Admin, and the Manufacturing/Laboratory placeholders + cross-module handoff map.