Sub topic 2
The first links: net income to retained earnings and cash flow
This chapter assumes you know basic accounting terms, can read a simple income statement and balance sheet, and can run short Python scripts. It uses a one-period forecast with opening balances in the example code.
Net income is the profit a company earns over a period. It is the first figure that moves between the three statements. It flows into retained earnings on the balance sheet and into the top of the cash flow statement.
Rolling retained earnings forward with dividends
Retained earnings is the cumulative profit a company keeps. Each period, the closing balance equals the opening balance plus net income, minus dividends paid to shareholders.
Closing retained earnings = Opening retained earnings + Net income - Dividends
Working capital schedule: receivables, inventory, payables
Working capital is the cash tied up in daily operations. Receivables (money customers owe you) and payables (money you owe suppliers) are the main items. In the example, receivables rise from 50 to 60, which uses 10 of cash. Payables rise from 30 to 35, which provides 5 of cash. Add an inventory line the same way if the business holds stock.
Fixed assets: capex, depreciation and net PP&E
Capital expenditure (capex) is cash spent on long-term assets such as equipment. Depreciation spreads the cost of those assets over their useful life. Net property, plant and equipment (PP&E) is the balance after depreciation:
Closing PP&E = Opening PP&E + Capex - Depreciation
Depreciation is a non-cash expense. It reduces net income, so the cash flow statement adds it back.
Debt schedule, repayments and interest expense
Interest is calculated on the opening debt balance here, so it does not depend on the closing balance. That avoids a circular reference. Interest equals 8% of 120, or 9.6. Interest reduces pre-tax income, and the tax rate then gives net income.
opening = {"cash": 100.0, "ar": 50.0, "ppe": 200.0, "ap": 30.0,
"debt": 120.0, "retained_earnings": 200.0}
tax_rate = 0.25
interest_rate = 0.08
revenue = 500.0
operating_costs = 380.0
depreciation = 20.0
capex = 30.0
dividends = 20.0
debt_repayment = 10.0
ar_close = 60.0
ap_close = 35.0
interest = interest_rate * opening["debt"]
pretax = revenue - operating_costs - depreciation - interest
net_income = pretax * (1 - tax_rate)
re_close = opening["retained_earnings"] + net_income - dividends
cfo = (net_income + depreciation
- (ar_close - opening["ar"])
+ (ap_close - opening["ap"]))
cfi = -capex
cff = -debt_repayment - dividends
cash_close = opening["cash"] + cfo + cfi + cff
ppe_close = opening["ppe"] + capex - depreciation
debt_close = opening["debt"] - debt_repayment
assets = cash_close + ar_close + ppe_close
liabilities_equity = ap_close + debt_close + re_close
print(round(net_income, 2), round(re_close, 2))
print(round(cash_close, 2), round(assets, 2), round(liabilities_equity, 2))
assert abs(assets - liabilities_equity) < 1e-6Exercise
Dividends rise to 40 and all other inputs stay the same. What is closing retained earnings?
Show answer
200 + 67.8 - 40 = 227.8. Retained earnings fall by the extra 20 of dividends compared with 247.8.