Add four AASB 16 lessee functions to the Financial group - #42
Merged
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Takes the library from 130 functions to 134. First coverage of an accounting standard rather than a tax rule.
oz.LeaseLiabilityλ(Payments, Rate, [InAdvance])oz.LeaseScheduleλ(Payments, Rate, [InAdvance])oz.ROUScheduleλ(Cost, Periods)oz.LeaseRemeasureλ(RevisedPayments, Rate, CarryingLiability, CarryingROU, [InAdvance])Rateis per period, not per year.InAdvancediscounts 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.pystill cannot run without the uncommitted upstream workbook, so this is a postbuild pass over the committedozzit.xlsxandsrc/, the same pattern asgst_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.pyonly ever wrote half the AFE store. The store holds module texts and a flatprojectNamesindex.verify_afe.pyhas 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.canonicalstrips_xlfn.,_xlpm.and_xlop.before comparing, so a round-trip through it passes even when the stored form has lost one. It did: an innerLAMBDAparameter came out bare, which makes Excel reject the whole definition.unmarked_names()checks for that class separately.Checks
verify_workbook.pyverify_sources.pyverify_signatures.pyverify_index.pyverify_previous_names.pyverify_afe.pypython -m unittest discover -s tools/testsexcel_selftest.ps1verify_cache.pyThe 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.