austax: Do not generate transactions with zero amounts

This commit is contained in:
RunasSudo 2025-06-07 17:08:55 +10:00
parent 805cf4b319
commit 65d6a9bf05
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -446,6 +446,7 @@ function reporting.CalculateIncomeTax.execute(args, context, kinds_for_account,
end
-- Charge monthly tax
if this_month_tax ~= 0 then
table.insert(transactions, {
id = nil,
dt = libdrcr.date_to_dt(libdrcr.format_date(this_year, month, this_day)),
@ -472,7 +473,8 @@ function reporting.CalculateIncomeTax.execute(args, context, kinds_for_account,
},
})
end
else
end
elseif (tax_total - total_offset) ~= 0 then
-- Charge income tax expense in one transaction at EOFY
table.insert(transactions, {
id = nil,
@ -502,6 +504,7 @@ function reporting.CalculateIncomeTax.execute(args, context, kinds_for_account,
end
-- Mandatory study loan repayment
if study_loan_repayment ~= 0 then
table.insert(transactions, {
id = nil,
dt = libdrcr.date_to_dt(context.eofy_date),
@ -527,6 +530,7 @@ function reporting.CalculateIncomeTax.execute(args, context, kinds_for_account,
},
},
})
end
-- Transfer PAYGW balances to Income Tax Control
for account, kinds in pairs(kinds_for_account) do