austax: Implement tax offsets

This commit is contained in:
RunasSudo 2023-09-10 20:54:47 +10:00
parent 9555da387c
commit 339de57a1f
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
2 changed files with 22 additions and 1 deletions

View File

@ -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'))

View File

@ -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
)