Skip to content

Add four AASB 16 lessee functions to the Financial group - #42

Merged
ryanduguid merged 1 commit into
mainfrom
feat/aasb16-leases
Aug 23, 2026
Merged

Add four AASB 16 lessee functions to the Financial group#42
ryanduguid merged 1 commit into
mainfrom
feat/aasb16-leases

Conversation

@ryanduguid

Copy link
Copy Markdown
Owner

Takes the library from 130 functions to 134. First coverage of an accounting standard rather than a tax rule.

Function Purpose
oz.LeaseLiabilityλ(Payments, Rate, [InAdvance]) Present value of the lease payments not paid at the commencement date
oz.LeaseScheduleλ(Payments, Rate, [InAdvance]) Opening, payment, interest and closing rows for each period
oz.ROUScheduleλ(Cost, Periods) Opening, depreciation and closing rows for the right-of-use asset
oz.LeaseRemeasureλ(RevisedPayments, Rate, CarryingLiability, CarryingROU, [InAdvance]) Revised liability, adjustment, revised asset, and the remainder taken to profit or loss

Rate is per period, not per year. InAdvance discounts each payment one period less, which is the timing most property leases use and the one most often set wrong.

How it was built

transform_from_upstream.py still cannot run without the uncommitted upstream workbook, so this is a postbuild pass over the committed ozzit.xlsx and src/, the same pattern as gst_help_text.py.

One spec per function generates both the published source and the stored defined name, rather than the two being written in parallel and left to drift. Every generated definition is round-tripped through verify_sources.py's own comparison before anything is written.

No worksheet is added. That is deliberate: it is what keeps all 20,228 cached values untouched.

Two bugs this turned up

sync_afe_store.py only ever wrote half the AFE store. The store holds module texts and a flat projectNames index. verify_afe.py has always gated both, but only the texts were synchronised, so adding any function failed that gate with the index short. Fixed here: a name still shipping keeps its place, a new one is filed after the last name from its own module, and a name that no longer ships is dropped. This would have blocked any future addition, not just this one.

The source comparison cannot see a missing marker. verify_sources.canonical strips _xlfn., _xlpm. and _xlop. before comparing, so a round-trip through it passes even when the stored form has lost one. It did: an inner LAMBDA parameter came out bare, which makes Excel reject the whole definition. unmarked_names() checks for that class separately.

Checks

Gate Result
verify_workbook.py OK, 134 functions, 211 parts
verify_sources.py OK, 134 reproduced
verify_signatures.py OK, 121 signatures, 126 tables, 123 example blocks
verify_index.py OK, 134 rows
verify_previous_names.py OK, 4 recording no previous name
verify_afe.py OK
python -m unittest discover -s tools/tests OK, 63 tests
excel_selftest.ps1 438 assertions, 0 failed (was 259)
verify_cache.py OK, 20,228 values unchanged

The liability is checked against Excel's own NPV, an independent oracle rather than a restatement of the same arithmetic. The schedule is checked by identity across four rates, four term lengths and both timings: it closes to nil, each opening is the closing before it, and every period reconciles. Both identities name a row, because a whole-block total cancels the row under test.

The pass is idempotent: a second run reports "already applied" and writes nothing. Registered in test_idempotency.py.

Scope

Paragraph references were read against the AASB 16 compilation on 24 August 2026: paragraphs 23, 24, 26, 27, 39, 42(b) and 43. Nothing was carried across from a search result summary.

These are schedules, not determinations. They do not decide the lease term, decide what counts as a lease payment, decide whether an arrangement contains a lease, or apply the short-term and low-value recognition exemptions. No lessor accounting.

oz.LeaseLiabilityλ discounts the lease payments not paid at the
commencement date, oz.LeaseScheduleλ unwinds that liability into
opening, payment, interest and closing rows, oz.ROUScheduleλ
depreciates the right-of-use asset in a straight line, and
oz.LeaseRemeasureλ restates the liability for an index or rate
review and adjusts the asset, taking the remainder to profit or
loss once the asset reaches nil.

The pass generates the published source and the stored defined
name from one spec each, then round-trips every definition through
verify_sources.py's own comparison before writing. That comparison
strips the _xlfn./_xlpm./_xlop. markers, so it cannot see a missing
one; unmarked_names() checks for those separately, which is what
caught an inner LAMBDA parameter that would have made Excel reject
the whole definition.

sync_afe_store.py now writes the projectNames index as well as the
module texts. verify_afe.py has always gated both, but only the
texts were ever synchronised, so adding any function failed that
gate with the index short.

No worksheet is added, so all 20,228 cached values are unchanged.
excel_selftest.ps1 goes from 259 assertions to 438: the liability
is checked against Excel's own NPV, and the schedule by identity
across four rates, four term lengths and both payment timings.

Paragraph references read against the AASB 16 compilation on
24 August 2026.
@ryanduguid
ryanduguid merged commit cc7376e into main Aug 23, 2026
4 checks passed
@ryanduguid
ryanduguid deleted the feat/aasb16-leases branch August 23, 2026 20:37
ryanduguid added a commit that referenced this pull request Aug 29, 2026
oz.LeaseLiabilityλ discounts the lease payments not paid at the commencement
date, oz.LeaseScheduleλ unwinds that liability into opening, payment, interest
and closing rows, oz.ROUScheduleλ depreciates the right-of-use asset in a
straight line, and oz.LeaseRemeasureλ restates the liability for an index or
rate review and adjusts the asset, taking the remainder to profit or loss once
the asset reaches nil. The library goes from 130 functions to 134.

tools/postbuild/aasb16_leases.py generates the published source and the stored
defined name from one spec each, then round-trips every definition through
verify_sources.py's own comparison before writing. That comparison strips the
_xlfn., _xlpm. and _xlop. markers, so it cannot see a missing one;
unmarked_names() checks for those separately, which is what caught an inner
LAMBDA parameter that would have made Excel reject the whole definition.

sync_afe_store.py now writes the projectNames index as well as the module
texts. verify_afe.py has always gated both, but only the texts were ever
synchronised, so adding any function failed that gate with the index short.

No worksheet is added, so all 20,228 cached values are unchanged.
excel_selftest.ps1 goes from 259 assertions to 438: the liability is checked
against Excel's own NPV, and the schedule by identity across four rates, four
term lengths and both payment timings.

Paragraph references read against the AASB 16 compilation on 24 August 2026.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant