From 339de57a1fb3bda30345b139a59d3e5f7b8db5c6 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sun, 10 Sep 2023 20:54:47 +1000 Subject: [PATCH] austax: Implement tax offsets --- austax/__init__.py | 1 + austax/reports.py | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/austax/__init__.py b/austax/__init__.py index 14bd247..814f608 100644 --- a/austax/__init__.py +++ b/austax/__init__.py @@ -38,6 +38,7 @@ def plugin_init(): drcr.plugins.account_kinds.append(('austax.d4', 'Work-related self-education expenses (D4)')) drcr.plugins.account_kinds.append(('austax.d5', 'Other work-related expenses (D5)')) drcr.plugins.account_kinds.append(('austax.d9', 'Gifts or donations (D9)')) + drcr.plugins.account_kinds.append(('austax.offset', 'Tax offset')) drcr.plugins.account_kinds.append(('austax.paygw', 'PAYG withheld amounts')) drcr.plugins.account_kinds.append(('austax.cgtasset', 'CGT asset')) drcr.plugins.account_kinds.append(('austax.rfb', 'Reportable fringe benefit')) diff --git a/austax/reports.py b/austax/reports.py index 635a526..bcf038b 100644 --- a/austax/reports.py +++ b/austax/reports.py @@ -36,6 +36,18 @@ def base_income_tax(year, taxable_income): lower_limit = base_tax[year][i - 1][0] return Amount(flat_amount * (10**AMOUNT_DPS) + marginal_rate * (taxable_income.quantity - lower_limit * (10**AMOUNT_DPS)), '$') +def lito(taxable_income): + """Get the amount of low income tax offset""" + + if taxable_income.quantity <= 3750000: + return Amount(70000, '$') + if taxable_income.quantity <= 4500000: + return Amount(70000 - 0.05 * (taxable_income.quantity - 3750000), '$') + if taxable_income.quantity <= 6666700: + return Amount(32500 - int(0.015 * (taxable_income.quantity - 4500000)), '$') + + return Amount(0, '$') + def medicare_levy(taxable_income): if taxable_income.quantity < 2920700: raise NotImplementedError('Medicare levy reduction is not implemented') @@ -153,6 +165,14 @@ def tax_summary_report(): ] ), Spacer(), + Section( + title='Tax offsets', + entries=entries_for_kind(account_configurations, accounts, 'austax.offset', neg=True) + [ + Calculated('Low income tax offset', lambda _: lito(report.by_id('taxable').amount)), + Subtotal('Total tax offsets', id='offsets') + ] + ), + Spacer(), Section( entries=[ Calculated( @@ -181,7 +201,7 @@ def tax_summary_report(): Spacer(), Calculated( 'ATO liability payable (refundable)', - lambda _: report.by_id('total_tax').amount - report.by_id('paygw').amount + report.by_id('loan_repayment').amount, + lambda _: report.by_id('total_tax').amount - report.by_id('offsets').amount - report.by_id('paygw').amount + report.by_id('loan_repayment').amount, heading=True, bordered=True )