tax-ato-2024.1: Tax types and computations for Australia
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Tax.ATO

Description

Types and computations for taxes in Australia.

No guarantee that computations are correct, complete or current.

Lots of things are not implemented, including (but not limited to): ETPs, income from partnerships and trusts, superannuation income streams and lump payments, tax losses from previous years, Medicare levy reduction/exemption, adjustments, and variations based on family income and dependents.

Synopsis

Individual tax returns

data TaxReturnInfo y a Source #

Individual tax return information.

Use newTaxReturnInfo to construct. Alternatively, newTaxReturnInfoForTables can be used to coerce the type parameters to be the same as some TaxTables.

The following lenses are available:

mlsExemptionMedicare levy exemption
helpBalance HELP, VSL, SSL, ABSTUDY SSL, and TSL account balance
sfssBalanceSFSS account balance
paymentSummariesPAYG payment summaries
interestInterest income and tax withheld
dividendsDividend data
essEmployee Share Scheme statement
foreignIncomeForeign income
cgtEventsCapital gains and losses
deductionsDeductions
offsetsTax offsets
privateHealthInsurancePolicyDetails Private health insurance policy details
spouseDetailsSpouse Details (or Nothing)
incomeTestsIncome Tests

Instances

Instances details
Num a => HasTaxWithheld (TaxReturnInfo y :: Type -> Type) (a :: Type) a Source #

Includes PAYG withholding by employer or bank. Does not include franking credits.

Instance details

Defined in Data.Tax.ATO

RealFrac a => HasTaxableIncome (TaxReturnInfo y :: Type -> Type) (a :: Type) a Source #

Taxable income

Instance details

Defined in Data.Tax.ATO

HasCapitalLossCarryForward (TaxReturnInfo y) a Source # 
Instance details

Defined in Data.Tax.ATO

newTaxReturnInfo :: (FinancialYear y, Num a) => TaxReturnInfo y a Source #

Construct a new TaxReturnInfo.

All monetary fields and lists are initially empty.

The Medicare levy surcharge exemption field is initially set to the number of days in the year (i.e. the taxpayer is fully exempt).

newTaxReturnInfoForTables :: (FinancialYear y, Num a) => TaxTables y a -> TaxReturnInfo y a Source #

Construct a TaxReturnInfo per newTaxReturnInfo, coercing the type parameters to match the TaxTables argument (which is ignored).

Income

PAYG Payment Summaries

data PaymentSummary a Source #

PAYG payment summary - individual non-business

Instances

Instances details
HasTaxWithheld PaymentSummary (a :: Type) a Source # 
Instance details

Defined in Data.Tax.ATO

HasTaxableIncome PaymentSummary (a :: Type) a Source #

Gross income

Instance details

Defined in Data.Tax.ATO

type ABN = String Source #

Australian Business Number

Interest

Dividends

data Dividend a Source #

Dividend payment. Records net income, franked portion and amount of tax withheld.

Instances

Instances details
RealFrac a => HasTaxWithheld Dividend (a :: Type) a Source #

Rounds to whole cents

Instance details

Defined in Data.Tax.ATO

RealFrac a => HasTaxableIncome Dividend (a :: Type) a Source #

Rounds to whole cents

Instance details

Defined in Data.Tax.ATO

dividendFromGross Source #

Arguments

:: String

Source name (e.g. ticker)

-> Day

Dividend date

-> Money a

Gross payment

-> Money a

Tax withheld

-> Dividend a 

Construct a dividend from a gross payment, with explicit declaration of tax withheld.

Does not perform rounding.

dividendFromNet Source #

Arguments

:: Num a 
=> String

Source name (e.g. ticker)

-> Day

Dividend date

-> Money a

Net payment

-> Money a

Tax withheld

-> Dividend a 

Construct a dividend from a net payment, with explicit declaration of tax withheld.

Does not perform rounding.

dividendFromNetFranked Source #

Arguments

:: Fractional a 
=> String

Source name (e.g. ticker)

-> Day

Dividend date

-> Money a

Net payment

-> Proportion a

Franked proportion

-> Tax (Money a) (Money a)

Corporate tax rate (must be a flat rate)

-> Dividend a 

Construct a dividend from a net payment, with a proportion of the dividend franked at the given corporate tax rate (must be a flat rate).

Does not perform rounding.

dividendFromNetFranked30 Source #

Arguments

:: Fractional a 
=> String

Source name (e.g. ticker)

-> Day

Dividend date

-> Money a

Net payment

-> Proportion a

Franked proportion

-> Dividend a 

Construct a dividend from a net payment, with a proportion of the dividend franked at the 30% corporate tax rate.

Does not perform rounding.

Capital gains tax (CGT)

class HasCapitalLossCarryForward a b where Source #

Types that have a carry-forward capital loss (either as an input or an output).

Employee share schemes

data ESSStatement a Source #

Employee share scheme statement. Use newESSStatement to construct. The following lenses are available:

essTaxedUpfrontReduction D Discount from taxed up front schemes—eligible for reduction
essTaxedUpfrontNoReduction E Discount from taxed up front schemes—not eligible for reduction
essDeferralF Discount from taxed deferral schemes
essPre2009 G Discounts on ESS interests acquired pre 1 July 2009 and "cessation time" occurred during the financial year.
essTFNAmountsC TFN amounts withheld from discounts
essForeignSourceDiscountsA ESS foreign source discounts

Instances

Instances details
Num a => HasTaxableIncome ESSStatement (a :: Type) a Source #

Note: does not implement the reduction of taxed up front amounts eligible for reduction.

Instance details

Defined in Data.Tax.ATO

Num a => Monoid (ESSStatement a) Source # 
Instance details

Defined in Data.Tax.ATO

Num a => Semigroup (ESSStatement a) Source # 
Instance details

Defined in Data.Tax.ATO

newESSStatement :: Num a => ESSStatement a Source #

Construct an ESSStatement with all amounts at zero.

essTaxedUpfrontReduction :: Lens' (ESSStatement a) (Money a) Source #

Discount from taxed up front schemes—eligible for reduction. Item D in Employee share schemes section.

essTaxedUpfrontNoReduction :: Lens' (ESSStatement a) (Money a) Source #

Discount from taxed up front schemes—not eligible for reduction Item E in Employee share schemes section.

essDeferral :: Lens' (ESSStatement a) (Money a) Source #

Discount from taxed deferral schemes. Item F in Employee share schemes section.

essPre2009 :: Lens' (ESSStatement a) (Money a) Source #

discounts on ESS interests acquired pre 1 July 2009 and "cessation time" occurred during the finanical year. Item G in Employee share schemes section.

essTFNAmounts :: Lens' (ESSStatement a) (Money a) Source #

TFN amounts withheld from discounts. Item C in Employee share schemes section.

essForeignSourceDiscounts :: Lens' (ESSStatement a) (Money a) Source #

ESS foreign source discounts Item A in Employee share schemes section.

Foreign income

Medicare Levy Surcharge and Private Health Insurance

Student loan balances

helpBalance :: Lens' (TaxReturnInfo y a) (Money a) Source #

HELP, VSL, SSL, ABSTUDY SSL, and TSL account balance.

sfssBalance :: Lens' (TaxReturnInfo y a) (Money a) Source #

SFSS account balance. From 1 July 2019, all study and training loans are covered by one set of threshold and rates. Since then, you can specify your entire study and training loan balance via helpBalance. But it will still calculate correctly if you specify your SFSS balance separately.

Spouse details

Income Tests

Deductions

data Deductions a Source #

Deductions that individuals can claim.

workRelatedCarExpensesD1 Work-related car expenses
workRelatedTravelExpensesD2 Work-related travel expenses
workRelatedClothingLaundryAndDryCleaningExpensesD3 Work-related clothing, laundry and dry-cleaning expenses
workRelatedSelfEducationExpensesD4 Work-related self-education expenses
otherWorkRelatedExpensesD5 Other work-related expenses
lowValuePoolDeductionD6 Low-value pool deduction
interestDeductionsD7 Interest deductions
dividendDeductionsD8 Dividend deductions
giftsOrDonationsD9 Gifts or donations
costOfManagingTaxAffairsD10 Cost of managing tax affairs
deductibleAmountOfUndeductedPurchasePriceOfAForeignPensionOrAnnuityD11 Deductible amount of undeducted purchase price of a foreign pension or annuity
personalSuperannuationContributionsD12 Personal superannuation contributions
deductionForProjectPoolD13 Deduction for project pool
forestryManagedInvestmentSchemeDeductionD14 Forestry managed investment scheme deduction
otherDeductions D15 Other deductions — not claimable at D1 to D14 or elsewhere in your tax return
foreignIncomeDeductions Aggregate of deductions related to foreign income. The components making up this amount must be included in the other fields. This field is only used in calculating the Foreign Income Tax Offset Limit.

Instances

Instances details
Num a => Monoid (Deductions a) Source # 
Instance details

Defined in Data.Tax.ATO

Num a => Semigroup (Deductions a) Source # 
Instance details

Defined in Data.Tax.ATO

totalDeductions :: (Num a, Ord a) => Deductions a -> Money a Source #

Sum the deductions. Negative components are ignored.

workRelatedCarExpenses :: Lens' (Deductions a) (Money a) Source #

D1 Work-related car expenses

workRelatedTravelExpenses :: Lens' (Deductions a) (Money a) Source #

D2 Work-related travel expenses

workRelatedClothingLaundryAndDryCleaningExpenses :: Lens' (Deductions a) (Money a) Source #

D3 Work-related clothing, laundry and dry-cleaning expenses

workRelatedSelfEducationExpenses :: Lens' (Deductions a) (Money a) Source #

D4 Work-related self-education expenses

otherWorkRelatedExpenses :: Lens' (Deductions a) (Money a) Source #

D5 Other work-related expenses

lowValuePoolDeduction :: Lens' (Deductions a) (Money a) Source #

D6 Low-value pool deduction

interestDeductions :: Lens' (Deductions a) (Money a) Source #

D7 Interest deductions

dividendDeductions :: Lens' (Deductions a) (Money a) Source #

D8 Dividend deductions

giftsOrDonations :: Lens' (Deductions a) (Money a) Source #

D9 Gifts or donations

costOfManagingTaxAffairs :: Lens' (Deductions a) (Money a) Source #

D10 Cost of managing tax affairs

deductibleAmountOfUndeductedPurchasePriceOfAForeignPensionOrAnnuity :: Lens' (Deductions a) (Money a) Source #

D11 Deductible amount of undeducted purchase price of a foreign pension or annuity

personalSuperannuationContributions :: Lens' (Deductions a) (Money a) Source #

D12 Personal superannuation contributions

deductionForProjectPool :: Lens' (Deductions a) (Money a) Source #

D13 Deduction for project pool

forestryManagedInvestmentSchemeDeduction :: Lens' (Deductions a) (Money a) Source #

D14 Forestry managed investment scheme deduction

otherDeductions :: Lens' (Deductions a) (Money a) Source #

D15 Other deductions — not claimable at D1 to D14 or elsewhere in your tax return

foreignIncomeDeductions :: Lens' (Deductions a) (Money a) Source #

Aggregate of deductions related to foreign income, including:

  • Deductions that are reasonably related to amounts on which foreign income tax has been paid
  • Debt deductions attributable to your overseas permanent establishment
  • Amount of the foreign loss component of one or more tax losses deducted in the income year.

The components making up this amount must be included in other fields. This field is only used in calculating the Foreign Income Tax Offset Limit.

Tax offsets

data Offsets a Source #

Tax offsets that individuals can claim

The following lenses are available:

spouseContributionOffsetSpouse super contribution
foreignTaxOffsetForeign income tax offset
paygInstalmentsPAYG Instalments

Instances

Instances details
Num a => Monoid (Offsets a) Source # 
Instance details

Defined in Data.Tax.ATO

Methods

mempty :: Offsets a #

mappend :: Offsets a -> Offsets a -> Offsets a #

mconcat :: [Offsets a] -> Offsets a #

Num a => Semigroup (Offsets a) Source # 
Instance details

Defined in Data.Tax.ATO

Methods

(<>) :: Offsets a -> Offsets a -> Offsets a #

sconcat :: NonEmpty (Offsets a) -> Offsets a #

stimes :: Integral b => b -> Offsets a -> Offsets a #

spouseContributionOffset :: Lens' (Offsets a) (Money a) Source #

Spouse contribution offset. Maximum of $540 (not enforced).

foreignTaxOffset :: Lens' (Offsets a) (Money a) Source #

Offset for tax paid on foreign income.

Assessing tax

data TaxAssessment a Source #

A tax assessment. Use assessTax to compute a TaxAssessment.

Instances

Instances details
(Num a, Eq a) => HasCapitalLossCarryForward TaxAssessment a Source # 
Instance details

Defined in Data.Tax.ATO

HasTaxWithheld TaxAssessment (a :: Type) a Source # 
Instance details

Defined in Data.Tax.ATO

HasTaxableIncome TaxAssessment (a :: Type) a Source # 
Instance details

Defined in Data.Tax.ATO

assessTax :: (FinancialYear y, RealFrac a) => TaxTables y a -> TaxReturnInfo y a -> TaxAssessment a Source #

Assess a tax return, given tax tables and tax return info.

taxBalance :: Num a => Getter (TaxAssessment a) (Money a) Source #

What is the balance of the assessment? Positive means a refund (tax withheld exceeds obligation), negative means a bill.

Corporate tax

corporateTax :: Fractional a => Tax (Money a) (Money a) Source #

The corporate tax rate of 30%. In the future, different rates may be levied depending on business turnover/income.

Miscellaneous

data GrossAndWithheld a Source #

A gross income (first argument) and amount of tax withheld (second argument). The whole gross amount is considered taxable income.

Constructors

GrossAndWithheld (Money a) (Money a) 

class HasTaxWithheld a b c where Source #

Data that can have an amount of tax withheld

Methods

taxWithheld :: Getter (a b) (Money c) Source #

Instances

Instances details
RealFrac a => HasTaxWithheld Dividend (a :: Type) a Source #

Rounds to whole cents

Instance details

Defined in Data.Tax.ATO

HasTaxWithheld GrossAndWithheld (a :: Type) a Source # 
Instance details

Defined in Data.Tax.ATO

HasTaxWithheld PaymentSummary (a :: Type) a Source # 
Instance details

Defined in Data.Tax.ATO

HasTaxWithheld TaxAssessment (a :: Type) a Source # 
Instance details

Defined in Data.Tax.ATO

(Foldable t, HasTaxWithheld x a a, Num a) => HasTaxWithheld (t :: Type -> Type) (x a :: Type) a Source # 
Instance details

Defined in Data.Tax.ATO

Methods

taxWithheld :: Getter (t (x a)) (Money a) Source #

Num a => HasTaxWithheld (TaxReturnInfo y :: Type -> Type) (a :: Type) a Source #

Includes PAYG withholding by employer or bank. Does not include franking credits.

Instance details

Defined in Data.Tax.ATO

data Proportion a Source #

A proportion is a non-negative number in interval [0,1]. Use proportion to construct.

Instances

Instances details
Show a => Show (Proportion a) Source # 
Instance details

Defined in Data.Tax.ATO

Eq a => Eq (Proportion a) Source # 
Instance details

Defined in Data.Tax.ATO

Methods

(==) :: Proportion a -> Proportion a -> Bool #

(/=) :: Proportion a -> Proportion a -> Bool #

Ord a => Ord (Proportion a) Source # 
Instance details

Defined in Data.Tax.ATO

getProportion :: Proportion a -> a Source #

Return underlying figure, which is in interval [0,1]

proportion :: (Ord a, Num a) => a -> Proportion a Source #

Construct a proportion. Out of range numbers are clamped to 0 or 1 (no runtime errors).

module Data.Tax