Tax and accounting for lenders
A loan earns its income over its life, not on the day cash moves. Recognise interest and fees with the effective interest rate, and every tax line, from VAT on a fee to the deduction for a bad loan, hangs off a number you can recompute
L000043 is a ₦310,000 personal loan, paid out on 2026-06-20: 6 monthly instalments at 4.5% a month, a 1% fee of ₦3,100 taken at disbursement, and ₦306,900 reaching the borrower. In the lab's illustrative treatment, ₦216.28 of the fee is VAT. How much interest income does Owoleaf recognise on it for 21 to 30 June, ten days, under the effective interest method?
Three words first. Accrual accounting records income when it is earned, not when cash arrives. Amortised cost is the value a loan is carried at: what was lent, less repayments of principal, adjusted for the spreading of fees and costs. The gross carrying amount is the amortised cost before any loss allowance. This chapter assumes the earlier ones: the instalment and the rate come from interest, APR, fees and amortisation, the ledger from the amortisation engine and loan ledger project and the allowance from provisioning under IFRS 9. Statements as a whole belong to the Corporate Finance course; here you see only the loan book’s lines. Double entry is taught in double-entry bookkeeping for engineers.
Where a cash basis goes wrong
The project ledger is honest and simple: interest income is booked when the instalment is paid and fee income when the loan is paid out. Two things go wrong. A fee of ₦3,100 on a six-month loan is booked in one day, so the month a lender grows fastest shows the most profit, before any borrower has repaid. And a loan that is overdue earns nothing in the ledger while the borrower has not paid, although the lender is still carrying it as a performing asset.
The lab’s May 2026 shows both. On a cash basis the book earned ₦849,003.62 (interest paid, fees net of VAT at disbursement and late fees). By the effective interest method it earned ₦961,322.46, ₦112,318.84 more, because 119 new loans accrued interest for days that had not yet fallen due. September goes the other way: ₦668,796.59 on a cash basis and ₦623,381.86 effective, ₦45,414.73 less, because the cash received in September included interest the loans had earned earlier. Neither number is wrong arithmetic. They answer different questions, and only the second is what the loans earned in the month.
The effective interest rate
IFRS 9 measures a loan at amortised cost and recognises interest revenue by applying the effective interest rate to the gross carrying amount, with fees that are an integral part of the rate treated as an adjustment to it (application guidance B5.4.1) and spread over the expected life (B5.4.4). Commentary returned by search describes paragraph B5.4.6 as adjusting the gross carrying amount when estimated cash flows are revised, with the adjustment in profit or loss and interest continuing at the original rate. The standard’s own paragraph text was not in the results, so check the wording and numbering in the standardas of 2026-11. An IFRS Interpretations Committee agenda decision of March 2019 notes that paragraph 5.4.1(b) requires interest revenue on a credit-impaired asset to be calculated by applying the effective interest rate to amortised cost, which is net of the loss allowanceas of 2026-11..
The effective interest rate (EIR) is the rate that discounts the loan’s expected cash receipts to its carrying amount at the start. For Owoleaf’s loans the receipts are the schedule, and the starting amount is what the lender is out of pocket. You met the same idea as the APR in the first module. The difference is the point of view. An APR is a price quoted to a borrower. The EIR is a yield booked by the lender, and the two differ here because the VAT collected on the fee is held for the tax authority and is not the lender’s income.
The lab solves it by bisection for each loan, on a daily rate, because Owoleaf’s due dates are 30 days apart, not calendar months. Take L000043:
fee ₦3,100.00 (1% of ₦310,000.00)
VAT inside the fee ₦216.28 (3,100 x 7.5 / 107.5 = 216.279, rounded half up)
fee that is income ₦2,883.72
cash paid out ₦306,900.00 (₦310,000.00 less the fee)
amortised cost at start ₦307,116.28 (cash paid out + VAT collected = principal less the fee that is income)
daily EIR 0.15609503% (6 payments of ₦60,102.30 on days 30, 60 ... 180)
effective annual rate 76.70% ((1.0015609503)^365 - 1)
Check the Predict answer by hand. Ten days at that daily rate is 30,711,628 kobo x ((1.0015609503)^10 - 1) = 482,774.70 kobo, so ₦4,827.75. The simple answer, ₦4,650.00, takes 10/30 of the first instalment’s interest and leaves out the fee’s income, the part of the 76.70% that comes from receiving ₦307,116.28 and repaying ₦360,613.80.
Compare the salary advance L000002: ₦17,000 with a ₦170 fee, a ₦16,830 payout, ₦17,850 due after 30 days. Its VAT is ₦11.86 and its amortised cost ₦16,841.86, so its EIR is 0.19397474% a day, 102.86% a year compounded. The first module’s APR for the same loan was 104.6%. The borrower’s cost is higher than the lender’s yield because the VAT, if it applies, is collected for the tax authority and is not the lender’s income (the APR treated the whole fee as cost). A BNPL loan with no interest and no fee, L000001, has an EIR of exactly 0%: its income is the late fee and nothing else.
Which fees go inside the rate
A fee is integral to the loan when it is part of the price of having the money: an origination fee, a processing fee. It is spread over the loan’s life inside the EIR. A fee for a separate service, or one charged only when something happens, is recognised when the service is done or the event occurs, as IFRS 15 (the standard on revenue from contracts with customers) asks for revenue from services.
BDO’s note on fees charged by lenders, as returned by search, describes loan origination and set-up fees as the kind that sit inside the effective rate and a monthly administration fee for collecting repayments as the kind that falls under IFRS 15. The note was not read in full, its own tables appear inconsistent on direct debit fees, and the boundary for a particular fee is a judgement for the lender’s finance lead and auditoras of 2026-11.
The lab makes the choice an explicit, signed policy. The 1% fee at disbursement is integral. The late fee is not: it is charged only when a borrower pays late, so the lab books it as income when charged (when paid, in this data). Change the policy and the income changes by month, not by loan, which is why the policy must be written down before the first close.
A month, loan by loan
The engine works month by month and loan by loan. For each loan it starts the month at the carrying amount the previous month closed with, accrues the daily rate on the balance day by day, takes off each payment on its day (the instalment, not the late fee), and rounds the month’s income to a whole kobo. The closing amount is an integer: opening, plus income, less cash received. Income is therefore the only float that is ever converted, once per loan per month. A loan that starts the month in stage 3 is treated differently, as the next section shows.
Three rules keep this honest.
Rounding does not accumulate. The closing balance each month is an integer, and next month starts from that integer. When a loan settles in a month, the last month’s income is set so the loan closes at exactly zero. For the 217 settled loans that paid every instalment on time, the largest such correction is 2 kobo.
Overdue loans: the lab’s cap. IFRS 9 does not cap interest revenue at what a contract still asks for. It accrues the effective rate on the gross carrying amount. When a borrower is late, the expected cash flows change, and B5.4.6 asks for the gross carrying amount to be adjusted to the present value of the revised cash flows at the original rate, with the difference in profit or loss; the time value lost to a late payment is also part of the credit loss that an allowance measures. The lab has no stage 1 or stage 2 allowance, and its contracts charge nothing after the due date. A loan that kept accruing would be carried above what the borrower owes: L000002 would stand at ₦18,376.48 on 31 May, ₦526.48 more than the ₦17,850.00 it owes. So the lab stops accruing when the carrying amount reaches the total the contract still asks for. This cap is the lab’s simplification, not an IFRS 9 rule. It is a crude stand-in for revising the cash flows: it ignores discounting and takes the revision at the contractual total. Do not read it as “overdue loans earn nothing”. Without the cap they would accrue until the estimate is revised, and a stage 3 loan earns interest on its net amount, as below. The break step lets you switch the cap off.
Late payers settle cleanly, with the cap. A loan that pays late closes with a correction of 0 kobo, because the carrying amount equals what is owed on the day it is paid. Without the cap, the 71 loans that paid late close with a correction of up to 377,500 kobo, ₦3,775.00: income recognised for days on which no more was owed, taken back in one lump at settlement. That take-back is the adjustment B5.4.6 describes, booked late and all at once.
Stage 3: interest on the net amount
A loan in stage 3 is credit-impaired, which the lab, like provisioning under IFRS 9, takes as 90 or more days past due. Two things change. The loan carries a loss allowance, and interest revenue is recognised on the amortised cost, the gross carrying amount less the allowance, so the base shrinks. Any contractual interest the borrower may still owe is a legal claim, not revenue. The lab’s contracts charge none after the due date, so the gross amount does not grow.
The lab books the stage 3 interest by unwinding the allowance: debit the loss allowance, credit interest income. Interest is revenue on the net amount, so the net carrying amount accretes toward what is expected to be recovered. At the month-end the allowance is reset to 90% of the gross amount, which raises the impairment charge by the same amount. Profit is unchanged at a constant coverage, but both lines are visible. Lenders present this differently, and the choice is a policy for the finance lead and the auditor.
The lab sets the allowance at 90% of the carrying amount, an illustrative round figure. The earlier chapter measured 99.87% on this book, because borrowers in the generated data who stop paying do not pay again; a lender with real recoveries would estimate the loss from a recovery curve, as expected loss does. The break step lets you use 99.87%.
In September 2026, 20 loans are in stage 3 at the month-end and their allowance is ₦779,612.77. That is the ₦547,817.77 on the 11 loans that were already there, less ₦2,838.10 unwound as interest, plus an impairment charge of ₦234,633.10. Of the charge, ₦231,795.00 is new provision for loans crossing 90 days and ₦2,838.10 restores what the unwinding released. The charge is expense, and it falls on the month in which loans cross 90 days, not when they are written off.
The ₦2,838.10 is the interest on those 11 loans: one tenth of the ₦28,381.04 that the same rate on their gross amount would give, which is the share of the base left after a 90% allowance. At the measured 99.87% it would be ₦36.91. Stage 3 interest is small by construction, because most of the balance is not expected back, but it is not zero.
Write-offs
A write-off removes a loan from the balance sheet when there is no reasonable expectation of recovery. The lab’s policy follows the loan book: 180 days past due. The allowance is used first, and only the excess reaches the income statement, so a loan that was fully provided for in stage 3 costs nothing new on the day it is written off. The loss was booked month by month as the allowance grew.
The lab’s October has two write-offs. L000078, a BNPL loan, carries ₦10,500.00 and is provided at 90%, ₦9,450.00. The write-off debits the allowance ₦9,450.00 and the write-off loss ₦1,050.00 and credits loans receivable ₦10,500.00. L000026, an SME loan, carries ₦344,798.41, so the loss beyond the allowance is ₦34,479.84. Together that is ₦35,529.84 of loss beyond the allowance on ₦355,298.41 written off. Money received after a write-off is a recovery: the lab credits it to income, not to the loan, because the loan is no longer on the books.
Whether the tax authority allows the deduction at write-off, at provision, or never is a separate question, taken up next.
The tax lines
This chapter is not tax advice. It teaches how the lines connect to the accounts. The rates, the thresholds and the treatment of a given fee, a given lender or a given provision need a qualified adviser and the text of the law as it stands on the date you act. The sources behind this section are mostly law-firm and firm-of-accountants summaries found by search, plus press reports of the revenue service’s statements; the Act’s own text was not readable in this environment. Every rate below sits in an illustrative input at the top of eir.py that you can change.
VAT on the fee. Search summaries agree that the Nigeria Tax Act 2025 commenced on 1 January 2026. Press reports of a statement by the Nigeria Revenue Service around 15 January 2026 say that VAT, at 7.5% in the example they quote, applies to fees, commissions and charges for services by banks and other financial institutions, not to the amount transferred, and that interest on deposits is not a supply of goods or services and so does not attract VAT. One press report of a bank’s customer notice lists interest on loans and advances as outside VAT and loan processing and documentation charges as attracting it. None of these is the Act or the statement itself, the statement was reported on bank charges and deposit interest, and the Act’s exemption schedule was not in the resultsas of 2026-11. The reports lean towards VAT on a loan processing fee, but they are secondary, and whether an origination fee that is part of a loan’s price is a separate taxable service is for the lender’s adviser. The lab’s switch VAT_ON_FEES treats the fee as VAT-inclusive. With it on, May’s new loans carry ₦22,191.58 of VAT payable and income is ₦7,703.63 lower than with it off. The VAT is a liability to the authority, not income, and it is why the loan’s carrying amount starts above the cash paid out.
Withholding tax on interest. A borrower that is a withholding agent deducts tax from interest it pays and remits it, and the lender holds the amount as a credit against its own income tax. PwC’s highlights of the Deduction of Tax at Source (Withholding) Regulations 2024 give a 10% rate for interest for corporate and non-corporate, resident and non-resident recipients. Sources disagree on the start: PwC’s highlights say 1 July 2024, while a later PwC tax alert says a circular issued on 24 February 2025 made the regulations effective on 1 January 2025. No result confirmed their status after the Nigeria Tax Act 2025 took effect, or which payments to a financial institution are exemptas of 2026-11. The lab’s scenario is deliberately blunt: all SME borrowers (the only ones that are businesses) deduct 10% of the interest in each repayment. It reduces May’s cash by ₦42,588.67 and creates an equal credit. Whether a given lender is outside the rule is exactly the point to ask an adviser.
Company income tax and the development levy. PwC’s summary says company income tax stays at 30% for large businesses, with earlier proposals to cut it dropped; one other source reports 25% and another that the President may approve 25% for strategic sectors. Summaries describe a 4% development levy on assessable profits of companies other than small and non-resident ones, and 0% for small companies. Most sources give turnover up to ₦100 million and fixed assets up to ₦250 million for a small company, with professional-services firms excluded, while one analysis gives ₦50 million of turnover for the income tax test. Certified copies of the Acts were released in January 2026 and a KPMG note of January 2026 lists errors, gaps and omissions, so wording and section numbers differ between sourcesas of 2026-11. The lab uses 30% and 4% on a profit for the month. Whether a lender is small depends on a year’s turnover and fixed assets and on the exclusions. The lab’s default book is a tenth of Owoleaf’s scale and earns under ₦1 million a month, so the flat 30% shows the mechanics, not what a company of any given size pays. Tax is assessed on a year, not a month, and the lab ignores deferred tax and losses carried forward: a loss month posts no tax and no tax asset.
Is the allowance deductible? Summaries of the Nigeria Tax Act 2025 say that bad debts incurred in the course of trade are deductible, except debts arising from transactions with related parties, and one says doubtful debts from genuine business transactions are deductible if not owed by related parties. No result said whether an IFRS 9 allowance qualifies, or whether a stage 3 allowance counts as a bad or doubtful debt when it is booked, and section numbers differ between sources. Commentary under the earlier regime, from 2016 to 2019, treated the deductibility of IFRS 9 impairment as an open question and noted the tax authority’s discretion; it predates the 2025 Actas of 2026-11. The sources therefore do not settle whether a stage 3 allowance is deductible when it is booked. The lab has a switch, ALLOWANCE_DEDUCTIBLE. In September, with it on, taxable profit is ₦388,748.76 and income tax ₦116,624.63. With it off, the net charge of ₦234,633.10 is added back and tax is ₦187,014.56, ₦70,389.93 more. Of the switches in the lab, this one moves tax most.
A bank or a microfinance bank also follows the central bank’s prudential rules on provisioning, which provisioning under IFRS 9 outlines. This chapter does not cover them.
Posting it
The ledger has 15 accounts. The loans sit in one asset, loans receivable at amortised cost, so the fee income is inside it until it is amortised. The stage 3 allowance is a contra-asset. The tax accounts are a payable for VAT, a payable for income tax, a payable for the development levy and an asset for withholding tax recoverable.
| Event | Debit | Credit |
|---|---|---|
| Disbursement | Loans receivable: principal less the fee that is income | Cash: the net paid out. VAT payable: VAT in the fee |
| Month-end accrual | Loans receivable | Interest income (effective interest method) |
| Repayment | Cash. Withholding tax recoverable | Loans receivable: the instalment. Late-fee income |
| Stage 3 interest | Loss allowance | Interest income (unwinding) |
| Stage 3 movement | Impairment charge | Loss allowance |
| Write-off | Loss allowance. Write-off loss (the excess) | Loans receivable |
| Month-end tax | Income tax expense. Development levy expense. Income tax payable (the credit applied) | Income tax payable. Development levy payable. Withholding tax recoverable |
For L000043 the disbursement debits loans receivable ₦307,116.28 and credits cash ₦306,900.00 and VAT payable ₦216.28. The month-end accrual debits loans receivable and credits interest income ₦4,827.75. Each is one journal that must balance, and the posting function refuses one that does not. The tax journal is computed from the ledger’s own profit, not from the engine, so the tax follows what was posted.
What the proof shows and what it does not matters here. Every entry balances and the books sum to zero. The cash movement equals the loan tables’ disbursements, repayments and withholding. The VAT equals the fee column, recomputed. The balance of every loan that paid on time equals the present value of what remains, at the loan’s own EIR, within 2 kobo. Tax is recomputed by hand from profit. None of that shows that the EIR policy, the VAT treatment or the allowance rate is right. They are inputs. The lab shows how far the answer moves when they change.
Where it goes wrong
- Fee at disbursement, interest at payment. The cash-basis ledger. A growth month overstates profit and a month of late payers understates it.
- The VAT left in the income. A fee that carries VAT and books all of it as income overstates income and understates a liability.
- Accruing on an overdue loan and never revising. The carrying amount rises above what the borrower owes and the excess is taken back in one lump at settlement. Revise the expected cash flows, or let the allowance carry the shortfall. The lab’s cap is a stand-in, not the rule.
- Stage 3 interest at zero. IFRS 9 recognises it on the net amount: small, not nil.
- Interest on stage 3 at the gross rate. Income recognised on loans that will not pay. The base is the net amount.
- A written-off loan expensed twice. The allowance was already charged. Use it first.
- Tax computed on a month as if it were a year. The lab’s monthly tax is an estimate for the pack. The assessment is annual and the deductions have rules of their own.
- A rate copied from a summary. Every rate here is dated and sourced to a summary. The law and the adviser decide.
Back at Owoleaf
Alhassan and Kaltumi agree on the month-end. The policy: the 1% fee is inside the EIR, the late fee is booked when charged, the stage 3 base is the net amount, a loan is written off at 180 days, and the cap on overdue loans is recorded as a simplification. The job: one journal per loan per event, tax computed from the ledger. The questions for the adviser: which fees carry VAT, which borrowers withhold, and whether the stage 3 allowance is deductible on booking. They leave the answers as flagged inputs, rerun the pack with each, and show the tax difference to the adviser in naira.
You build three small files next to the lab’s scripts: eir.py (the engine), post_month.py (the ledger) and prove_month.py (the checks), then stage3.py for one table. Work in labs/finance. The scripts open the book read-only and write the ledger to a copy in your system’s temporary folder, so nothing in data/ changes. Do not open data/answers/loans_truth.csv: a lender has no such file. Money is integer kobo; the daily rate and a balance inside one month are floats, and each loan’s income is rounded to a whole kobo before it is posted. Every rate, share and policy is illustrative, set at the top of eir.py.
0. Check the book. The default book (scale 0.1) is enough. If data/finance.sqlite is missing, build it.
python3 generate.py && python3 loans.py
python3 check.pyloan book: 372 loans, 850,258,479 kobo of principal outstanding; checks 7-11 run
...
OK: all invariants holdThe first and last lines of check.py’s output. If you ran the later generators (cards, collections, signals) the middle lines list them; none of them touches the loan tables this chapter reads.
1. The engine. Save this as eir.py. It loads the loans, solves each loan’s daily effective rate by bisection, and runs a loan month by month. show_examples() prints three loans.
"""eir.py: the loan book at amortised cost, under the effective interest method (data/, scale 0.1).
Standard library only. Money is integer kobo; rates and in-month balances are floats, and every
month's income for a loan is rounded to a whole kobo before it touches the ledger.
Every rate, share and policy below is ILLUSTRATIVE: set it from your own advice, not from this file.
"""
import calendar
import collections
import datetime as dt
import sqlite3
DB = "data/finance.sqlite"
CUT_OFF = dt.date(2026, 10, 28) # the book is observed to here: the last month is a stub
VAT_BPS = 750 # VAT on a fee, in basis points (7.5%): see the chapter
VAT_ON_FEES = True # is the up-front fee a taxable supply? ILLUSTRATIVE: the chapter shows both
STAGE3_DPD, WRITE_OFF_DPD = 90, 180
ALLOWANCE_S3_BPS = 9_000 # loss allowance on a stage 3 loan, share of its carrying amount (ILLUSTRATIVE)
WHT_SME_BPS = 1_000 # share of interest that SME borrowers deduct at source (ILLUSTRATIVE scenario)
CIT_BPS, LEVY_BPS = 3_000, 400 # company income tax and development levy rates (see the chapter)
CAP_AT_CONTRACT = True # THE LAB'S SIMPLIFICATION, NOT AN IFRS 9 RULE: never carry a loan above what the contract still asks for
ALLOWANCE_DEDUCTIBLE = True # is the stage 3 allowance deductible when charged? ILLUSTRATIVE: the chapter shows both
def day(text):
return dt.date.fromisoformat(text[:10])
def month_bounds(ym):
y, m = map(int, ym.split("-"))
return dt.date(y, m, 1), dt.date(y, m, calendar.monthrange(y, m)[1])
def vat_on_fee(fee):
"""The VAT inside a fee that includes it, rounded half up to the kobo. The fee in the book is what the
borrower is charged, so cash paid out stays equal to the book whatever the tax treatment."""
if not VAT_ON_FEES:
return 0
return (fee * VAT_BPS * 2 + (10_000 + VAT_BPS)) // (2 * (10_000 + VAT_BPS)) # the fee already includes the VAT
def load(db_path=DB):
db = sqlite3.connect(f"file:{db_path}?mode=ro", uri=True)
loans = {}
for r in db.execute("""SELECT id, product, principal_kobo, fee_kobo, disbursed_at, repayment_rail
FROM loans ORDER BY id"""):
loans[r[0]] = dict(id=r[0], product=r[1], principal=r[2], fee=r[3], disbursed=day(r[4]), rail=r[5],
sched=[], pays=[])
for lid, n, due, total in db.execute("SELECT loan_id, instalment, due_date, total_kobo FROM schedule ORDER BY loan_id, instalment"):
loans[lid]["sched"].append((n, day(due), total))
for lid, n, when, amt, fee, it in db.execute(
"SELECT loan_id, instalment, paid_at, amount_kobo, late_fee_kobo, interest_kobo FROM repayments ORDER BY paid_at, id"):
loans[lid]["pays"].append(dict(n=n, when=day(when), amount=amt, late_fee=fee, interest=it))
for l in loans.values():
fee_vat = vat_on_fee(l["fee"])
l["vat"] = fee_vat
l["fee_net"] = l["fee"] - fee_vat # the part of the fee that is the lender's income
l["ca0"] = l["principal"] - l["fee_net"] # amortised cost at origination
l["net_paid_out"] = l["principal"] - l["fee"]
tot = {n: t for n, _, t in l["sched"]}
paid, cleared = collections.defaultdict(int), {}
for p in l["pays"]:
paid[p["n"]] += p["amount"] - p["late_fee"]
if p["n"] not in cleared and paid[p["n"]] >= tot[p["n"]]:
cleared[p["n"]] = p["when"]
l["cleared"] = cleared
l["eir_daily"] = solve_eir(l["ca0"], [((due - l["disbursed"]).days, t) for _, due, t in l["sched"]])
return loans
def solve_eir(ca0, flows):
"""The daily rate r at which the scheduled payments, discounted by their days from disbursement,
are worth ca0. Bisection: the present value falls as r rises."""
pv = lambda r: sum(t / (1 + r) ** d for d, t in flows)
if pv(0.0) <= ca0:
return 0.0
lo, hi = 0.0, 1.0
for _ in range(200):
mid = (lo + hi) / 2
lo, hi = (mid, hi) if pv(mid) > ca0 else (lo, mid)
return (lo + hi) / 2
def dpd_on(loan, on):
"""Days past due on a date: the oldest instalment due before it and not cleared by it."""
for n, due, _ in loan["sched"]:
if due >= on:
return 0
c = loan["cleared"].get(n)
if c is None or c > on:
return (on - due).days
return 0
def pct(kobo, bps):
"""kobo x basis points, rounded half up to the kobo (kobo and bps are integers)."""
return (kobo * bps * 2 + 10_000) // 20_000
def months_between(first, last):
y, m = first.year, first.month
while (y, m) <= (last.year, last.month):
yield f"{y}-{m:02d}"
y, m = (y + 1, 1) if m == 12 else (y, m + 1)
def run_loan(loan, upto_ym):
"""Month-by-month amortised cost for one loan, from disbursement to the month `upto_ym`.
Returns {ym: dict}. The only floats are the daily rate and the balance inside a month."""
out, ca, allow, written = {}, 0, 0, False
r = loan["eir_daily"]
first = loan["disbursed"]
for ym in months_between(first, month_bounds(upto_ym)[1]):
s, e = month_bounds(ym)
e = min(e, CUT_OFF)
rec = dict(open_ca=ca, open_allow=allow, disbursed=0, income=0, true_up=0, payments=0, late_fees=0,
recoveries=0, wht=0, impairment=0, unwind=0, write_off=0, write_off_loss=0)
pays = [p for p in loan["pays"] if s <= p["when"] <= e]
if written:
rec["recoveries"] = sum(p["amount"] for p in pays)
rec["pays"] = pays
rec.update(close_ca=0, close_allow=0, dpd=dpd_on(loan, e), stage3=False)
out[ym] = rec
continue
start = ca
if s <= first <= e:
start = loan["ca0"]
rec["disbursed"] = loan["ca0"]
by_day = collections.defaultdict(int)
for p in pays:
by_day[p["when"]] += p["amount"] - p["late_fee"]
bal = float(start)
aw, unwound = float(allow), 0.0 # the allowance in force and the discount it has unwound this month
owed = sum(t for _, _, t in loan["sched"]) - sum(p["amount"] - p["late_fee"] for p in loan["pays"] if p["when"] < s)
d = max(s, first + dt.timedelta(days=1)) if s <= first <= e else s
while d <= e:
if allow > 0:
# stage 3: interest revenue is the rate on the amortised cost (gross less allowance). The contract
# asks for no more than the schedule, so the gross amount does not grow: the interest is booked
# by unwinding the allowance, which is how a lender presents it.
u = r * max(bal - aw, 0.0)
aw -= u
unwound += u
else:
bal += r * bal
if CAP_AT_CONTRACT:
bal = min(bal, owed) # a crude stand-in for revising the expected cash flows: see the chapter
bal -= by_day.get(d, 0)
owed -= by_day.get(d, 0)
d += dt.timedelta(days=1)
paid_principal_interest = sum(by_day.values())
income = round(bal + paid_principal_interest - start)
all_cleared = all(n in loan["cleared"] and loan["cleared"][n] <= e for n, _, _ in loan["sched"])
close = start + income - paid_principal_interest
if all_cleared and s <= max(loan["cleared"].values()) <= e:
rec["true_up"] = -close # a settled loan closes at exactly zero: the residue goes to income (rounding; with the cap off, a take-back)
income += rec["true_up"]
close = 0
rec.update(income=income, payments=paid_principal_interest, late_fees=sum(p["late_fee"] for p in pays),
close_ca=close, pays=pays)
dpd = dpd_on(loan, e)
stage3 = dpd >= STAGE3_DPD and close > 0
new_allow = pct(close, ALLOWANCE_S3_BPS) if stage3 else 0
unwind = round(unwound)
rec.update(dpd=dpd, stage3=stage3, close_allow=new_allow, unwind=unwind, impairment=new_allow - (allow - unwind))
if dpd >= WRITE_OFF_DPD and close > 0:
rec.update(write_off=close, write_off_loss=close - new_allow, close_ca=0, close_allow=0)
written = True
ca, allow = 0, 0
else:
ca, allow = close, new_allow
out[ym] = rec
return out
def naira(kobo):
return f"₦{kobo // 100:,}.{kobo % 100:02d}" if kobo >= 0 else "-" + naira(-kobo)
def show_examples():
loans = load()
for lid, ym in (("L000043", "2026-06"), ("L000002", "2026-05"), ("L000001", "2026-05")):
l = loans[lid]
r = run_loan(l, ym)[ym]
eff = (1 + l["eir_daily"]) ** 365 - 1
print(f"{lid} {l['product']}: principal {naira(l['principal'])}, fee {naira(l['fee'])} "
f"(VAT inside {naira(l['vat'])}, income {naira(l['fee_net'])}), amortised cost at origination {naira(l['ca0'])}")
print(f" EIR {l['eir_daily'] * 100:.8f}% a day, {eff:.2%} a year compounded; "
f"{ym}: opening {naira(r['open_ca'] or r['disbursed'])}, income {naira(r['income'])}, "
f"paid in {naira(r['payments'])}, closing {naira(r['close_ca'])}")
l = loans["L000043"]
hand = l["ca0"] * ((1 + l["eir_daily"]) ** 10 - 1)
print(f"By hand for L000043, 21 to 30 June (10 days): {l['ca0']} x ((1 + r)^10 - 1) = {hand:.2f} kobo")python3 -c "import eir; eir.show_examples()"L000043 PL: principal ₦310,000.00, fee ₦3,100.00 (VAT inside ₦216.28, income ₦2,883.72), amortised cost at origination ₦307,116.28
EIR 0.15609503% a day, 76.70% a year compounded; 2026-06: opening ₦307,116.28, income ₦4,827.75, paid in ₦0.00, closing ₦311,944.03
L000002 SAL: principal ₦17,000.00, fee ₦170.00 (VAT inside ₦11.86, income ₦158.14), amortised cost at origination ₦16,841.86
EIR 0.19397474% a day, 102.86% a year compounded; 2026-05: opening ₦17,305.04, income ₦544.96, paid in ₦0.00, closing ₦17,850.00
L000001 BNPL: principal ₦31,000.00, fee ₦0.00 (VAT inside ₦0.00, income ₦0.00), amortised cost at origination ₦31,000.00
EIR 0.00000000% a day, 0.00% a year compounded; 2026-05: opening ₦31,000.00, income ₦0.00, paid in ₦15,500.00, closing ₦15,500.00
By hand for L000043, 21 to 30 June (10 days): 30711628 x ((1 + r)^10 - 1) = 482774.70 koboL000043 matches the chapter: the fee ₦3,100.00 splits into ₦216.28 of VAT and ₦2,883.72 of income, the amortised cost starts at ₦307,116.28, the daily rate is 0.15609503% and ten days of income is ₦4,827.75, the same as 482,774.70 kobo by hand. L000002 stops at ₦17,850.00, which is the total it owes, because of the lab’s cap (a simplification, see the cap rule above). The BNPL loan has an effective rate of exactly zero and earns only its late fee.
2. Post a month. Save this as post_month.py. It writes one journal per loan per event, then computes the month’s tax from the ledger’s own profit and posts that too.
"""post_month.py: post one month of the loan book into a ledger copy, with effective-interest income and tax lines.
python3 post_month.py 2026-09 # writes tax_ledger.sqlite in the system temp folder
Standard library only. Money is integer kobo. The book (data/finance.sqlite) is opened read-only.
"""
import os
import sqlite3
import sys
import tempfile
import eir
ACCOUNTS = [
(1100, "Cash", "asset"),
(1200, "Loans receivable at amortised cost", "asset"),
(1250, "Loss allowance, stage 3", "asset"), # a contra-asset: its balance is a credit
(1300, "Withholding tax recoverable", "asset"),
(2100, "VAT payable", "liability"),
(2200, "Income tax payable", "liability"),
(2300, "Development levy payable", "liability"),
(3000, "Opening equity", "equity"),
(4100, "Interest income, effective interest method", "income"),
(4300, "Late-fee income", "income"),
(4400, "Recoveries on written-off loans", "income"),
(5100, "Impairment charge", "expense"),
(5200, "Write-off loss beyond the allowance", "expense"),
(6100, "Income tax expense", "expense"),
(6200, "Development levy expense", "expense"),
]
LEDGER = os.path.join(tempfile.gettempdir(), "tax_ledger.sqlite")
def build(ym, ledger=LEDGER):
loans = eir.load()
s, e = eir.month_bounds(ym)
e = min(e, eir.CUT_OFF)
if os.path.exists(ledger):
os.remove(ledger)
db = sqlite3.connect(ledger)
db.executescript("""
CREATE TABLE accounts (code INTEGER PRIMARY KEY, name TEXT, kind TEXT);
CREATE TABLE journal (id INTEGER PRIMARY KEY, posted_on TEXT, loan_id TEXT, memo TEXT);
CREATE TABLE lines (journal_id INTEGER REFERENCES journal(id), account INTEGER REFERENCES accounts(code),
debit_kobo INTEGER NOT NULL DEFAULT 0, credit_kobo INTEGER NOT NULL DEFAULT 0,
CHECK (debit_kobo >= 0 AND credit_kobo >= 0 AND (debit_kobo = 0 OR credit_kobo = 0)));
""")
db.executemany("INSERT INTO accounts VALUES (?, ?, ?)", ACCOUNTS)
def post(when, loan_id, memo, lines):
"""lines: [(account, debit, credit)]. Refuses an entry that does not balance."""
lines = [l for l in lines if l[1] or l[2]]
if not lines:
return
if sum(l[1] for l in lines) != sum(l[2] for l in lines):
raise ValueError(f"{loan_id} {memo}: debits {sum(l[1] for l in lines)} != credits {sum(l[2] for l in lines)}")
cur = db.execute("INSERT INTO journal (posted_on, loan_id, memo) VALUES (?, ?, ?)", (when.isoformat(), loan_id, memo))
db.executemany("INSERT INTO lines VALUES (?, ?, ?, ?)", [(cur.lastrowid, *l) for l in lines])
def dr_cr(account, kobo):
"""A signed amount on a debit-normal posting: positive debits, negative credits."""
return (account, kobo, 0) if kobo >= 0 else (account, 0, -kobo)
written_prior = set()
allowance_used = 0
opening = s - eir.dt.timedelta(days=1)
for l in loans.values():
if l["disbursed"] > e:
continue
months = eir.run_loan(l, ym)
rec = months[ym]
lid = l["id"]
if rec["open_ca"] or rec["open_allow"]:
post(opening, lid, "opening position",
[(1200, rec["open_ca"], 0), (1250, 0, rec["open_allow"]), (3000, 0, rec["open_ca"] - rec["open_allow"])])
if rec["disbursed"]:
post(l["disbursed"], lid, "disbursement",
[(1200, l["ca0"], 0), (1100, 0, l["net_paid_out"]), (2100, 0, l["vat"])])
written_before = rec["open_ca"] == 0 and rec["recoveries"] > 0
for p in rec["pays"]:
if written_before:
post(p["when"], lid, f"recovery on written-off loan, instalment {p['n']}", [(1100, p["amount"], 0), (4400, 0, p["amount"])])
continue
wht = eir.pct(p["interest"], eir.WHT_SME_BPS) if l["product"] == "SME" else 0
post(p["when"], lid, f"repayment {p['n']}",
[(1100, p["amount"] - wht, 0), (1300, wht, 0), (1200, 0, p["amount"] - p["late_fee"]), (4300, 0, p["late_fee"])])
if rec["income"]:
post(e, lid, "effective interest income", [dr_cr(1200, rec["income"]), dr_cr(4100, -rec["income"])])
if rec["unwind"]:
post(e, lid, "stage 3 interest: unwinding of the allowance", [(1250, rec["unwind"], 0), (4100, 0, rec["unwind"])])
if rec["impairment"]:
post(e, lid, "stage 3 allowance movement", [dr_cr(5100, rec["impairment"]), dr_cr(1250, -rec["impairment"])])
if rec["write_off"]:
used = rec["write_off"] - rec["write_off_loss"]
allowance_used += used
post(e, lid, "write-off", [(1250, used, 0), (5200, rec["write_off_loss"], 0), (1200, 0, rec["write_off"])])
# ---- tax, computed from the ledger itself
bal = lambda acct: db.execute("SELECT COALESCE(SUM(credit_kobo - debit_kobo), 0) FROM lines WHERE account = ?", (acct,)).fetchone()[0]
pbt = bal(4100) + bal(4300) + bal(4400) + bal(5100) + bal(5200) # expenses carry negative balances here
impairment = -bal(5100)
addback = 0 if eir.ALLOWANCE_DEDUCTIBLE else impairment - allowance_used
taxable = max(0, pbt + addback)
cit, levy = eir.pct(taxable, eir.CIT_BPS), eir.pct(taxable, eir.LEVY_BPS)
wht_bal = -bal(1300)
credit = min(wht_bal, cit)
post(e, None, "income tax and development levy for the month",
[(6100, cit, 0), (2200, 0, cit), (6200, levy, 0), (2300, 0, levy), (2200, credit, 0), (1300, 0, credit)])
db.commit()
n_j, n_l = db.execute("SELECT (SELECT COUNT(*) FROM journal), (SELECT COUNT(*) FROM lines)").fetchone()
return db, dict(pbt=pbt, addback=addback, taxable=taxable, cit=cit, levy=levy, wht_credit=credit, journals=n_j, lines=n_l)
if __name__ == "__main__":
ym = sys.argv[1] if len(sys.argv) > 1 else "2026-09"
db, t = build(ym)
print(f"posted {t['journals']:,} journal entries and {t['lines']:,} lines for {ym} to {LEDGER}")
print(f"profit before tax {eir.naira(t['pbt'])}; add-back {eir.naira(t['addback'])}; taxable {eir.naira(t['taxable'])}")
print(f"income tax {eir.naira(t['cit'])}; development levy {eir.naira(t['levy'])}; WHT credit applied {eir.naira(t['wht_credit'])}")python3 post_month.py 2026-05posted 470 journal entries and 1,058 lines for 2026-05 to /tmp/tax_ledger.sqlite
profit before tax ₦961,322.46; add-back ₦0.00; taxable ₦961,322.46
income tax ₦288,396.74; development levy ₦38,452.90; WHT credit applied ₦42,588.67May has 119 disbursements, so the 470 journals are mostly one disbursement and one accrual per new loan, plus the opening position of every older loan. The path depends on your system’s temporary folder.
3. Prove it. Save this as prove_month.py. It posts the month again, then checks the ledger against the loan tables and against a present-value recomputation that does not use the ledger.
"""prove_month.py: check the month's ledger against things outside it.
python3 prove_month.py 2026-09
"""
import csv
import sys
import eir
import post_month
ym = sys.argv[1] if len(sys.argv) > 1 else "2026-09"
db, tax = post_month.build(ym)
s, e = eir.month_bounds(ym)
e = min(e, eir.CUT_OFF)
q = lambda sql, *a: db.execute(sql, a).fetchall()
rows = lambda name: list(csv.DictReader(open(f"data/{name}.csv")))
loans_csv, pays_csv = rows("loans"), rows("repayments")
product = {l["id"]: l["product"] for l in loans_csv}
print(f"month {ym}: {s} to {e}")
print("1. Entries that do not balance:",
q("SELECT COUNT(*) FROM (SELECT journal_id FROM lines GROUP BY journal_id HAVING SUM(debit_kobo) <> SUM(credit_kobo))")[0][0])
d, c = q("SELECT SUM(debit_kobo), SUM(credit_kobo) FROM lines")[0]
print(f"2. Total debits {d:,} kobo, total credits {c:,} kobo, difference {d - c}")
bal = dict(q("SELECT account, SUM(debit_kobo - credit_kobo) FROM lines GROUP BY account"))
get = lambda a: bal.get(a, 0)
# 3. cash against the loan tables, which the ledger code never reads as cash
in_month = lambda text: s <= eir.day(text) <= e
paid_out = sum(int(l["disbursed_net_kobo"]) for l in loans_csv if in_month(l["disbursed_at"]))
received = sum(int(p["amount_kobo"]) for p in pays_csv if in_month(p["paid_at"]))
wht = sum(eir.pct(int(p["interest_kobo"]), eir.WHT_SME_BPS) for p in pays_csv
if in_month(p["paid_at"]) and product[p["loan_id"]] == "SME")
print(f"3. Cash movement in the ledger {get(1100):,}; paid out {paid_out:,}, received {received:,}, "
f"withheld {wht:,}: difference {get(1100) - (received - wht - paid_out)}")
# 4. VAT on the fees of the month's new loans, worked out from the fee column
vat = sum(eir.vat_on_fee(int(l["fee_kobo"])) for l in loans_csv if in_month(l["disbursed_at"]))
print(f"4. VAT payable in the ledger {-get(2100):,}; from the fees {vat:,}: difference {-get(2100) - vat}")
# 5. performing loans: the ledger balance equals the present value of what is still due, at the loan's own EIR
loans = eir.load()
ledger_bal = dict(q("SELECT loan_id, SUM(debit_kobo - credit_kobo) FROM lines l JOIN journal j ON j.id = l.journal_id "
"WHERE account = 1200 GROUP BY loan_id"))
worst, n = 0, 0
for l in loans.values():
if l["disbursed"] > e or any(p["late_fee"] for p in l["pays"]):
continue
due_now = [(k, due, t) for k, due, t in l["sched"] if due <= e]
on_time = all(l["cleared"].get(k) == due for k, due, _ in due_now)
future = [(due, t) for _, due, t in l["sched"] if due > e]
if not on_time or not future:
continue
pv = sum(t / (1 + l["eir_daily"]) ** (due - e).days for due, t in future)
diff = abs(ledger_bal.get(l["id"], 0) - round(pv))
worst, n = max(worst, diff), n + 1
print(f"5. Performing loans paid on time: {n} checked; the largest gap between ledger balance and present value is {worst} kobo")
# 6. income by the effective interest method against income on a cash basis
cash_interest = sum(int(p["interest_kobo"]) for p in pays_csv if in_month(p["paid_at"]))
cash_fees = sum(int(l["fee_kobo"]) - eir.vat_on_fee(int(l["fee_kobo"])) for l in loans_csv if in_month(l["disbursed_at"]))
late = sum(int(p["late_fee_kobo"]) for p in pays_csv if in_month(p["paid_at"]))
cash_basis = cash_interest + cash_fees + late
effective = -get(4100) - get(4300) - get(4400)
print(f"6. Income on a cash basis (interest paid + fees net of VAT at disbursement + late fees) {cash_basis:,}; "
f"effective interest method {effective:,}; difference {effective - cash_basis:,}")
# 7. tax recomputed by hand from the profit
pbt = effective + get(5100) * -1 + get(5200) * -1
taxable = max(0, pbt + tax["addback"])
print(f"7. Profit before tax {pbt:,}; income tax at {eir.CIT_BPS / 100:.0f}%: ledger {get(6100):,}, "
f"recomputed {eir.pct(taxable, eir.CIT_BPS):,}; levy ledger {get(6200):,}, recomputed {eir.pct(taxable, eir.LEVY_BPS):,}")
print(f" WHT recoverable left {get(1300):,}; income tax payable {-get(2200):,}; levy payable {-get(2300):,}")
# 8. settled loans: rounding left in the last month's income, for loans that never paid late and for those that did
resid_on_time, resid_late, n_on, n_late = 0, 0, 0, 0
for l in loans.values():
if not all(k in l["cleared"] for k, _, _ in l["sched"]):
continue
last = max(l["cleared"].values())
tu = abs(eir.run_loan(l, f"{last.year}-{last.month:02d}")[f"{last.year}-{last.month:02d}"]["true_up"])
late_any = any(l["cleared"][k] > due for k, due, _ in l["sched"])
if late_any:
resid_late, n_late = max(resid_late, tu), n_late + 1
else:
resid_on_time, n_on = max(resid_on_time, tu), n_on + 1
print(f"8. Settled loans: {n_on} paid every instalment on its due date, largest closing true-up {resid_on_time} kobo; "
f"{n_late} paid at least one late, largest closing true-up {resid_late:,} kobo")
print("\nTrial balance (debit minus credit, kobo):")
for code, name, kind in post_month.ACCOUNTS:
print(f" {code} {name:<44}{get(code):>16,}")
print(f" {'sum of all balances':<49}{sum(get(a) for a, _, _ in post_month.ACCOUNTS):>16,}")python3 prove_month.py 2026-05month 2026-05: 2026-05-01 to 2026-05-31
1. Entries that do not balance: 0
2. Total debits 4,531,367,809 kobo, total credits 4,531,367,809 kobo, difference 0
3. Cash movement in the ledger -1,868,569,554; paid out 2,374,592,000, received 510,281,313, withheld 4,258,867: difference 0
4. VAT payable in the ledger 2,219,158; from the fees 2,219,158: difference 0
5. Performing loans paid on time: 123 checked; the largest gap between ledger balance and present value is 1 kobo
6. Income on a cash basis (interest paid + fees net of VAT at disbursement + late fees) 84,900,362; effective interest method 96,132,246; difference 11,231,884
7. Profit before tax 96,132,246; income tax at 30%: ledger 28,839,674, recomputed 28,839,674; levy ledger 3,845,290, recomputed 3,845,290
WHT recoverable left 0; income tax payable 24,580,807; levy payable 3,845,290
8. Settled loans: 217 paid every instalment on its due date, largest closing true-up 2 kobo; 71 paid at least one late, largest closing true-up 0 kobo
Trial balance (debit minus credit, kobo):
1100 Cash -1,868,569,554
1200 Loans receivable at amortised cost 3,474,511,352
1250 Loss allowance, stage 3 0
1300 Withholding tax recoverable 0
2100 VAT payable -2,219,158
2200 Income tax payable -24,580,807
2300 Development levy payable -3,845,290
3000 Opening equity -1,511,849,261
4100 Interest income, effective interest method -95,482,246
4300 Late-fee income -650,000
4400 Recoveries on written-off loans 0
5100 Impairment charge 0
5200 Write-off loss beyond the allowance 0
6100 Income tax expense 28,839,674
6200 Development levy expense 3,845,290
sum of all balances 0Checks 1 and 2: every journal balances and debits equal credits. Check 3: the ledger’s cash equals the loan tables’ repayments, less withholding, less the cash paid out. Check 4: VAT equals the fee column recomputed. Check 5: for the 123 loans that have paid every instalment on its due date and paid no late fee, the ledger balance is within 1 kobo of the present value of what remains, discounted at the loan’s own rate. Check 6 is the chapter’s May comparison: ₦849,003.62 on a cash basis and ₦961,322.46 by the effective interest method. Check 7 recomputes the tax from the profit. Check 8: the largest closing correction for settled loans that never paid late is 2 kobo. The trial balance sums to zero.
4. Read one loan’s journals. The posting for L000043, paid out in June.
python3 -c "
import post_month
db, t = post_month.build('2026-06')
sql = ('SELECT j.posted_on, j.memo, l.account, l.debit_kobo, l.credit_kobo FROM journal j '
'JOIN lines l ON l.journal_id = j.id WHERE j.loan_id = ? ORDER BY j.id, l.rowid')
for r in db.execute(sql, ('L000043',)):
print(r)
"('2026-06-20', 'disbursement', 1200, 30711628, 0)
('2026-06-20', 'disbursement', 1100, 0, 30690000)
('2026-06-20', 'disbursement', 2100, 0, 21628)
('2026-06-30', 'effective interest income', 1200, 482775, 0)
('2026-06-30', 'effective interest income', 4100, 0, 482775)Account 1200 is loans receivable, 1100 cash, 2100 VAT payable and 4100 interest income. Debits 30,711,628 equal credits 30,690,000 + 21,628. The accrual is 482,775 kobo: the ₦4,827.75 you computed by hand. There is no fee income line: the fee’s income is inside the loan until it is amortised.
5. A month with stage 3. September has 20 loans in stage 3 at the end, 11 of them since before the month began. Save this as stage3.py, a small table of what the net basis does to interest on those 11.
"""stage3.py: what the net-of-allowance basis does to interest income in a month.
python3 stage3.py 2026-09
"""
import sys
import eir
ym = sys.argv[1] if len(sys.argv) > 1 else "2026-09"
s, e = eir.month_bounds(ym)
days = (min(e, eir.CUT_OFF) - s).days + 1
loans = eir.load()
n = recognised = on_gross = carrying = allowance = 0
for l in loans.values():
if l["disbursed"] > e:
continue
r = eir.run_loan(l, ym)[ym]
if r["open_allow"] > 0 and r["close_ca"] + r["write_off"] > 0:
n += 1
recognised += r["income"] + r["unwind"]
carrying += r["open_ca"]
allowance += r["open_allow"]
on_gross += round(r["open_ca"] * ((1 + l["eir_daily"]) ** days - 1)) # the accrual on the gross amount, for comparison only
print(f"{ym}: {n} loans were stage 3 at the start of the month (allowance {eir.ALLOWANCE_S3_BPS / 100:g}% of carrying amount)")
print(f" carrying amount {eir.naira(carrying)}, allowance {eir.naira(allowance)}, cap on accrual {'on' if eir.CAP_AT_CONTRACT else 'off'}")
print(f" interest recognised, on the amortised cost (net) {eir.naira(recognised)}")
print(f" the same rate on the gross amount, for comparison {eir.naira(on_gross)}")Then post September and print the table.
python3 post_month.py 2026-09
python3 stage3.py 2026-09posted 281 journal entries and 613 lines for 2026-09 to /tmp/tax_ledger.sqlite
profit before tax ₦388,748.76; add-back ₦0.00; taxable ₦388,748.76
income tax ₦116,624.63; development levy ₦15,549.95; WHT credit applied ₦47,050.06
2026-09: 11 loans were stage 3 at the start of the month (allowance 90% of carrying amount)
carrying amount ₦608,686.41, allowance ₦547,817.77, cap on accrual on
interest recognised, on the amortised cost (net) ₦2,838.10
the same rate on the gross amount, for comparison ₦28,381.04The ledger ends September with an allowance of ₦779,612.77 on 20 loans, built from the opening ₦547,817.77, less ₦2,838.10 unwound as interest, plus an impairment charge of ₦234,633.10. The 11 loans that were in stage 3 at the start earn ₦2,838.10 on their net amount, one tenth of the ₦28,381.04 the same rate would give on the gross amount, which is not what IFRS 9 asks for and is there only to show the size of the base. Income tax is ₦116,624.63 and the levy ₦15,549.95 on a profit of ₦388,748.76, after ₦47,050.06 of withholding credit is applied.
Then run python3 prove_month.py 2026-09. Its check 6 reads cash basis ₦668,796.59 against effective ₦623,381.86, which includes the ₦2,838.10 of stage 3 interest: September’s cash included interest that had been earned earlier, so the cash basis is higher this time.
6. Write-offs. The book ends on 28 October, so October is a stub of 28 days. Two loans pass 180 days past due.
python3 post_month.py 2026-10
python3 -c "
import post_month
db, t = post_month.build('2026-10')
sql = ('SELECT j.posted_on, j.memo, l.account, l.debit_kobo, l.credit_kobo FROM journal j '
'JOIN lines l ON l.journal_id = j.id WHERE j.loan_id = ? ORDER BY j.id, l.rowid')
for r in db.execute(sql, ('L000078',)):
print(r)
"posted 244 journal entries and 530 lines for 2026-10 to /tmp/tax_ledger.sqlite
profit before tax -₦548,546.92; add-back ₦0.00; taxable ₦0.00
income tax ₦0.00; development levy ₦0.00; WHT credit applied ₦0.00
('2026-09-30', 'opening position', 1200, 1050000, 0)
('2026-09-30', 'opening position', 1250, 0, 945000)
('2026-09-30', 'opening position', 3000, 0, 105000)
('2026-10-28', 'write-off', 1250, 945000, 0)
('2026-10-28', 'write-off', 5200, 105000, 0)
('2026-10-28', 'write-off', 1200, 0, 1050000)L000078 is written off at 185 days past due with ₦10,500.00 carried and ₦9,450.00 already provided. The write-off debits the allowance 945,000 kobo and the loss 105,000 kobo, and credits loans receivable 1,050,000. The month shows a loss of ₦548,546.92 before tax, because the stage 3 pool grew: no tax is posted, and python3 prove_month.py 2026-10 shows ₦23,131.51 of withholding tax still recoverable.
Change one input at a time in eir.py, post the month named, and read what moves. Each number below is what the lab printed.
VAT_ON_FEES = False, thenpython3 post_month.py 2026-05. VAT payable falls to zero and profit rises.
posted 470 journal entries and 967 lines for 2026-05 to /tmp/tax_ledger.sqlite
profit before tax ₦969,026.09; add-back ₦0.00; taxable ₦969,026.09
income tax ₦290,707.83; development levy ₦38,761.04; WHT credit applied ₦42,588.67ALLOWANCE_DEDUCTIBLE = False, thenpython3 post_month.py 2026-09. The ₦234,633.10 charge is added back and tax rises by ₦70,389.93.
posted 281 journal entries and 613 lines for 2026-09 to /tmp/tax_ledger.sqlite
profit before tax ₦388,748.76; add-back ₦234,633.10; taxable ₦623,381.86
income tax ₦187,014.56; development levy ₦24,935.27; WHT credit applied ₦47,050.06CAP_AT_CONTRACT = False, thenpython3 post_month.py 2026-05andpython3 prove_month.py 2026-05. Overdue loans now accrue at the effective rate on the gross amount with nothing to stop them at what is owed. May’s profit rises by ₦20,323.70, and check 8 shows the take-back at settlement for the 71 late payers.
posted 472 journal entries and 1,062 lines for 2026-05 to /tmp/tax_ledger.sqlite
profit before tax ₦981,646.16; add-back ₦0.00; taxable ₦981,646.16
income tax ₦294,493.85; development levy ₦39,265.85; WHT credit applied ₦42,588.67
8. Settled loans: 217 paid every instalment on its due date, largest closing true-up 2 kobo; 71 paid at least one late, largest closing true-up 377,500 koboRun python3 -c "import eir; eir.show_examples()" with the cap off and L000002 closes May at ₦18,376.48, ₦526.48 more than it owes. That extra income is not earned in any sense a lender could collect, and the true-up is where the model takes it back. A real treatment would revise the expected cash flows and let the allowance carry the shortfall (B5.4.6). Put the cap back to True before the next step.
ALLOWANCE_S3_BPS = 9_987, the allowance the provisioning chapter measured on this book, thenpython3 post_month.py 2026-09andpython3 stage3.py 2026-09. Profit falls as the charge rises, and the net-basis interest shrinks to ₦36.91 against ₦28,381.04 on the gross amount.
posted 281 journal entries and 613 lines for 2026-09 to /tmp/tax_ledger.sqlite
profit before tax ₦363,328.57; add-back ₦0.00; taxable ₦363,328.57
income tax ₦108,998.57; development levy ₦14,533.14; WHT credit applied ₦47,050.06Which of the four moves tax most, and which is a fact about the law rather than about the loan book?
Template
# Month-end close: <lender>, <month>
Prepared by <accountant>. Signed by <finance lead>. Tax positions confirmed by <adviser>.
## 1. Policies in force
Fee policy, late-fee policy, stage 3 base, write-off point, any simplification (for example the cap): <one line each>
## 2. Income
| Line | Effective interest method | Cash basis | Difference |
Interest, fees net of VAT, late fees, recoveries, stage 3 unwinding: <kobo>
## 3. Tax lines (illustrative inputs, dated)
| Line | Rate or switch | Base | Amount | Confirmed by |
VAT on fees, withholding credit, income tax, development levy, allowance add-back.
## 4. Reconciliations
| Check | Ledger | Outside figure | Difference |
Entries balance; cash against loan tables; VAT against fees; loans against present value; tax recomputed; trial balance sums to zero.
## 5. Open items
| Item | Owner | Due |
## 6. How this could be wrong
<one way, and what would show it>
## 7. Decision and sign-off
Decision needed: <what, from whom, by when>. Out of scope: <what this close does not cover>.
Prepared <name, date>. Approved <name, date>. WORKED EXAMPLE
At a real lender the accountant prepares this on the first working day of each month and the finance lead signs it. Alhassan does so at Owoleaf, and this is May 2026, from the lab’s figures.
Policies. The 1% fee is inside the effective rate, the late fee is booked when charged, the stage 3 base is the net amount, and the cap on overdue loans is recorded as the lab’s simplification.
Income. Effective interest method ₦961,322.46; cash basis ₦849,003.62; difference ₦112,318.84, because 119 new loans accrued interest not yet due.
Tax lines. VAT payable ₦22,191.58 on the new loans’ fees, a liability and not income. Press reports of a Nigeria Revenue Service statement around 15 January 2026 say VAT at 7.5% applies to fees and charges for services by financial institutions, and one report lists loan processing charges as taxable. Neither the Act nor the statement was read; whether an origination fee is taxable is for the adviseras of 2026-11. Withholding: the lab assumes every SME borrower deducts 10% of interest. PwC’s highlights of the Deduction of Tax at Source Regulations 2024 give a 10% rate for interest. Sources disagree on the start date, and their standing after the Nigeria Tax Act 2025 is unconfirmedas of 2026-11 Income tax and levy: PwC’s summary says company income tax stays at 30% for large businesses, with a 4% development levy on assessable profits of companies other than small and non-resident ones; sources differ on the thresholdsas of 2026-11. The lab uses 30% and 4%: income tax ₦288,396.74, levy ₦38,452.90, with ₦42,588.67 of withholding credit applied, so ₦245,808.07 of income tax is payable. The adviser confirms the VAT and withholding positions.
Reconciliations. 0 entries unbalanced; debits equal credits at 4,531,367,809 kobo; cash difference 0; VAT difference 0; 123 performing loans within 1 kobo of present value; trial balance sums to 0.
Open items. None.
Could be wrong. Every rate is an illustrative input. If the adviser rules that the fee carries no VAT, profit before tax moves to ₦969,026.09.
Decision. The finance lead is asked to approve the May close. Out of scope: the annual tax assessment.
Now you
You are Alhassan’s colleague at Owoleaf and the book is now at September 2026. It is the first close with stage 3 loans carried from earlier months. Run python3 post_month.py 2026-09, python3 stage3.py 2026-09 and python3 prove_month.py 2026-09 in your copy of the lab. Write the close checklist for September. Use the figures the chapter prints: profit before tax ₦388,748.76, the stage 3 allowance of ₦779,612.77 on 20 loans, the ₦234,633.10 impairment charge, and the cash basis against effective income. Show the income tax both ways for the open question on whether the allowance is deductible when booked, and say which figure you would post until the adviser answers. The finance lead reads it and decides whether to approve the close or hold it for the adviser.
Self-check
Alhassan must fix how Owoleaf's 1% fee on personal loans is recognised before the next close. The fee is ₦3,100 on a ₦310,000 six-month loan; whether it carries VAT is not settled. The finance lead and the auditor will both read the policy. The lab shows the choice moves a growth month's profit by ₦112,318.84 in May and changes a quiet month in the other direction.
- DOC IFRS 9 Financial Instruments (IFRS Foundation, 2021 HTML edition) IFRS Foundation
The standard's text. Read paragraph 5.4.1 on interest revenue and the application guidance B5.4.1 to B5.4.7 on the effective interest rate and fees; skip the hedge accounting chapters. Check the current edition on the IFRS Foundation's site.
- DOC Amortised cost measurement and the effective interest method (IASB staff paper) IASB staff, 2022
A staff paper written for the Board on how the method is applied in practice. Read it for the worked cases on revising cash flows; skip the standard-setting questions at the end.
- DOC Curing of a credit-impaired financial asset (IFRS Interpretations Committee agenda decision) IFRS Interpretations Committee, 2019
A short official note that restates the interest rule for credit-impaired assets in paragraph 5.4.1(b). Read it for how interest is presented when a loan leaves stage 3.
- POST Fees charged to customers by lenders BDO, 2019
An accounting firm's note on which fees sit inside the effective rate and which are revenue from services. Read the fee examples; it is Australian firm guidance on an international standard, so check the boundary against your own fees.
- DOC Nigeria Tax Act 2025 (a hosted copy of the Act) Federal Republic of Nigeria, hosted by Africa Check, 2025
The law, as a third party hosts it. This chapter could not open an official copy and relies on summaries, so read the sections above yourself and compare against the certified copy your adviser cites; copies and section numbers differ between sources. Read: The parts on company income tax, deductions for bad and doubtful debts, small companies and value added tax.
- DOC The Nigeria Tax Reform Acts: top 20 changes to know PwC Nigeria, 2025
An accounting firm's summary of the reform acts, including the company rate and the small-company test. Read it for orientation; it is a summary, and the thresholds in it differ from other summaries.
- DOC Highlights of the Deduction of Tax at Source (Withholding) Regulations 2024 PwC Nigeria, 2024
A summary of the rates by payment type, including interest. Read the rate table and the start date, then confirm both and the regulations' standing under the 2025 acts with the revenue service.
- POST Tax implications of adoption of IFRS 9 KPMG Nigeria
A firm's note on how IFRS 9 impairment was treated for tax under the earlier regime. Read it for the questions it raises about deductibility; it predates the 2025 Act, so treat it as background and not as current law.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.