416 Ledger & statements
Today: 9 Nov 2026

Cash flow statement

Direct method, 1 Jan 2026 - 9 Nov 2026

Closing cash = cash in the ledger
Opening cash
2,270,000.00
Operating
2,355,921.65
Investing + financing
414,800.00
Closing cash
5,040,721.65
Cash at the start of the period2,270,000.00
Operating activities
Accounts receivable (cash in) 9,998,800.47
Salaries and wages (cash out) -5,313,000.00
Accounts payable (cash out) -2,586,893.44
Training income (cash in) 394,200.00
Software sales (cash in) 262,220.00
Social security contributions (cash out) -157,500.00
Withholding tax prepaid (cash out) -137,005.30
Travel (cash out) -126,480.00
Withholding tax payable (cash in) 61,518.70
Output VAT (cash in) 45,949.40
Foreign exchange gain (cash in) 45,028.29
Interest expense (cash out) -36,500.00
Office supplies (cash out) -34,460.00
Foreign exchange loss (cash out) -32,662.37
Cost of services (cash out) -28,370.00
Interest income (cash in) 10,240.00
Bank charges (cash out) -4,766.00
Input VAT (cash out) -4,398.10
Net cash from operating activities 2,355,921.65
Investing activities
Computer equipment (cash out) -256,800.00
Office equipment (cash out) -128,400.00
Net cash from investing activities -385,200.00
Financing activities
Long-term bank loan (cash in) 800,000.00
Net cash from financing activities 800,000.00
Net change in cash2,770,721.65
CASH AT THE END OF THE PERIOD5,040,721.65

Cash in and out by month

Cash inCash out
0625K1.25M1.88M2.5MJan Cash in: 52,910.87Jan Cash out: 731,869.44JanFeb Cash in: 2,075,804.95Feb Cash out: 790,023.71FebMar Cash in: 1,631,986.80Mar Cash out: 843,992.32MarApr Cash in: 856,144.43Apr Cash out: 1,050,357.85AprMay Cash in: 1,605,451.19May Cash out: 891,896.94MayJun Cash in: 1,818,226.09Jun Cash out: 1,291,531.06JunJul Cash in: 527,441.35Jul Cash out: 841,326.99JulAug Cash in: 1,704,366.17Aug Cash out: 865,396.56AugSep Cash in: 1,268,681.23Sep Cash out: 1,007,958.65SepOct Cash in: 394,606.25Oct Cash out: 850,544.16Oct
MonthInOutNet
Jan 2026 52,911731,869 -678,959
Feb 2026 2,075,805790,024 1,285,781
Mar 2026 1,631,987843,992 787,994
Apr 2026 856,1441,050,358 -194,213
May 2026 1,605,451891,897 713,554
Jun 2026 1,818,2261,291,531 526,695
Jul 2026 527,441841,327 -313,886
Aug 2026 1,704,366865,397 838,970
Sep 2026 1,268,6811,007,959 260,723
Oct 2026 394,606850,544 -455,938

Monthly in/out also counts transfers between your own bank accounts (they cancel out in the net).

How this works - feature 416 Where the cash came from and where it went.

Concepts

  • Direct method from the ledger: in an entry that touches a cash account, the other lines explain the movement.
  • Each account has a cf_class: OPERATING, INVESTING (fixed assets) or FINANCING (loan, capital).
  • Transfers between two cash accounts have no other line, so they do not appear - as it should be.
  • A bill payment only shows Accounts payable, so the query looks through the bill: paying for laptops is investing.
  • Opening cash + net change = closing cash = the cash balance on the balance sheet.

Read the code

  • service/ReportService#cashFlow

SQL behind this page

WITH cash_entries AS (
    SELECT DISTINCT entry_id FROM v_ledger WHERE is_cash = 1
), moves AS (
    SELECT COALESCE(ba.cf_class, l.cf_class)         AS cf_class,
           COALESCE(ba.id, l.account_id)             AS account_id,
           COALESCE(ba.code, l.account_code)         AS account_code,
           COALESCE(ba.name, l.account_name)         AS account_name,
           l.credit - l.debit                        AS amount
    FROM v_ledger l
    JOIN cash_entries c ON c.entry_id = l.entry_id
    JOIN account la ON la.id = l.account_id
    LEFT JOIN bill_payment bp ON l.source_type = 'BILL_PAYMENT' AND la.system_role = 'AP' AND bp.payment_no = l.source_ref
    LEFT JOIN bill b ON b.id = bp.bill_id
    LEFT JOIN account ba ON ba.id = b.account_id AND ba.cf_class <> 'OPERATING'
    WHERE l.is_cash = 0 AND l.source_type <> 'OPENING'
      AND l.entry_date BETWEEN :from AND :to
)
SELECT cf_class, account_id, account_code, account_name, SUM(amount) AS amount
FROM moves
GROUP BY cf_class, account_id, account_code, account_name
HAVING SUM(amount) <> 0
ORDER BY cf_class, ABS(SUM(amount)) DESC