wozniakpawel / cooltaxtool

UK Tax Calculator & Visualiser
https://cooltaxtool.com
MIT License
56 stars 14 forks source link

Clean up the pension pot and tax calculation functions #9

Open wozniakpawel opened 1 year ago

wozniakpawel commented 1 year ago

I am not completely happy with how the function is split up at the moment, the order of operations in the tax calculations, or the ugly workaround for pension pot calculations (which is there to tap into the printBreakdown() function). Additional steps need to be added, such as working out the net income.

wozniakpawel commented 1 year ago

I will use a naming convention from this ONS/HMRC article

Earnings refers to money earned from employment, whereas income is total money received, including from earnings, benefits and pensions, and so on. There are several different ways to calculate income:

  • earnings (also called gross earnings) refer to that remuneration received by employees in return for employment; most analyses of earnings consider only gross earnings, which is earnings before any benefits are added or tax deductions are made (including National Insurance contributions)
  • original income is obtained by combining employee earnings with those of the self-employed, along with private pensions and other sources of income such as income from investments
  • gross income is obtained by adding cash benefits, such as the state pension, child benefit or Jobseekers’ Allowance, to original income
  • disposable or net income is gross income after deductions from direct taxes (for example, Income Tax), employee National Insurance contributions and Council Tax or Northern Ireland Rates
  • post-tax income is obtained by further deducting indirect taxes (where the tax is typically levied on one entity but paid by another), for example, VAT and duties on alcohol or tobacco
  • lastly, final income is obtained by adding in benefits in kind paid by the state such as health and education which are allocated on the basis of household characteristics

In addition to income and earnings, there are other different measures of pay, for example, labour costs and take-home pay. These are:

  • labour costs refer to the costs experienced by the employer, rather than those received by the employee; labour costs include wages, national insurance contributions, employer pension contributions and benefits in kind paid by the employer
  • take-home pay refers to gross earnings minus employee deductions, for example income tax, employee national insurance contributions and pension contributions