canadian-income-tax: Canadian income tax calculation

[ gpl, library, productivity, program, tax ] [ Propose Tags ] [ Report a vulnerability ]

This package provides a library and executable to fill out incomplete Canadian tax forms in FDF format and to populate all fields therein that can be automatically calculated from the rest of the form.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 2022.1, 2022.2, 2022.2.0.1, 2022.2.1, 2023.0
Change log CHANGELOG.md
Dependencies base (>=4 && <5), bytestring (>=0.10.4 && <1), ca-province-codes (>=1.0 && <1.1), canadian-income-tax, containers (>=0.5 && <0.7), directory (>=1.2 && <1.4), filepath (>=1.3 && <1.5), forms-data-format (>=0.2 && <0.3), monoid-subclasses (>=1 && <2), optparse-applicative (>=0.15 && <0.18), rank2classes (>=1.5 && <1.6), tar (>=0.4 && <0.6), template-haskell (>=2 && <3), text (>=1.0 && <2.1), time (>=1 && <2), transformers (>=0.1 && <0.7) [details]
Tested with ghc ==9.4.4
License GPL-3.0-or-later
Copyright (c) 2023 Mario Blažević
Author Mario Blažević
Maintainer blamario@protonmail.com
Category tax, productivity
Bug tracker https://github.com/blamario/canadian-income-tax/issues
Source repo head: git clone https://github.com/blamario/canadian-income-tax
Uploaded by MarioBlazevic at 2023-04-10T02:46:41Z
Distributions
Executables complete-canadian-taxes
Downloads 253 total (17 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for canadian-income-tax-2022.2.0.1

[back to package description]

Canadian Income Tax

Manual

Use for Canadians outside Ontario

This Haskell package consists of a library and executable to fill out the Canadian T1 tax form. The way to use it is as follows:

  1. Download the fillable PDF form from the canada.ca Web site.

  2. Fill in the downloaded T1 form; don't bother with any fields that are calculated from other fields in the same form, that part will be performed automatically.

  3. Save the filled-out PDF form.

  4. Run

    pdftk 5006-r-fill-22e.pdf generate_fdf output 5006-r-fill-22e-filled.fdf
    

where 5006-r-fill-22e.pdf is the file you previously saved and 5006-r-fill-22e-filled.fdf is the name of the output file; feel free to change them.

  1. Run

    mkdir completed/
    complete-canadian-taxes --t1 5006-r-fill-22e-filled.fdf -o completed/
    

    to complete all the field calculations and store the result in the output file completed/5006-r-fill-22e-filled.fdf.

  2. Run

    pdftk 5006-r-fill-22e.pdf fill_form completed/5006-r-fill-22e-filled.fdf output 5006-r-fill-22e-filled.pdf
    

to transfer the FDF field values from the previous step to the new PDF file, 5006-r-fill-22e-filled.pdf.

  1. Carefully examine the final PDF. The executable comes with no warranty and has not been verified by CRA. The reponsibility for the correctness of the tax return is still yours.

  2. Print and sign the tax return, then send it to CRA by mail along with your other documents. At some point they'll hopefully leave the 19th century and let us digitally file the same information they accept on paper, but their EFILE protocol is so far not open to the public.

Use for Ontario tax returns

  1. Download the fillable federal (T1) and provincial (ON428) PDF forms from the canada.ca Web site

  2. Fill in the two downloaded forms; don't bother with any fields that are copied or calculated from other fields in the two forms, that part will be performed automatically.

  3. Save the filled-out PDF forms.

  4. Run

    pdftk 5006-r-fill-22e.pdf generate_fdf output 5006-r-fill-22e-filled.fdf
    pdftk 5006-c-fill-22e.pdf generate_fdf output 5006-c-fill-22e-filled.fdf
    

where 5006-r-fill-22e.pdf and 5006-c-fill-22e.pdf are the two PDFs you previously saved and *-filled.fdf are the names of the output FDF files; feel free to change them.

  1. Run

    mkdir completed/
    complete-canadian-taxes --t1 5006-r-fill-22e-filled.fdf --on428 5006-c-fill-22e-filled.fdf -o completed/
    

    to complete all the field calculations and store the result in the output directory completed/.

  2. Run

    pdftk 5006-r-fill-22e.pdf fill_form completed/5006-r-fill-22e-filled.fdf output completed/5006-r-fill-22e.pdf
    pdftk 5006-c-fill-22e.pdf fill_form completed/5006-c-fill-22e-filled.fdf output completed/5006-c-fill-22e.pdf
    

to transfer the FDF field values from the previous step to the new PDF files in the completed/ directory.

  1. Carefully examine the final PDF outputs. The executable comes with no warranty and has not been verified by CRA. The reponsibility for the tax returns' correctness is still yours.

  2. Print the PDFs, sign the tax return, then send it to CRA by mail along with the rest of your documents. At some point they'll hopefully open a way to digitally file the same information they accept on paper, but their EFILE protocol is so far not open to the public.

Installation

As you can see from the above instructions, you'll need to install the free pdftk executable to deal with PDF <-> FDF conversion. See their instructions. On Ubuntu you can simply run

sudo apt install pdftk

To install the complete-canadian-t1-form executable, you'll need Haskell development tools. The simplest procedure overall is to install ghcup, then use it to install ghc (version 9.4 or greater) and cabal, then to run

cabal install canadian-income-tax

Design notes and hints

The executable complete-canadian-taxes follows the Unix philosphy of doing one well-defined thing. It doesn't attempt to guide you, the user, through the entire process of filing the taxes. It merely performs the task that is easy to automate, and therefore also the most boring. It's not likely to make the tax-filing process a joy, but at least it's going to reduce the drudgery.

If at any point you find you made a mistake in your initial form entry, or you want to adjust it for any reason, you can make the adjustments either on the forms you kept from step #2 or on the final forms, and feed them back in step #3. The executable will overwrite all calculated fields with theit proper values.

The FDF files are almost text files, which makes them diffable. You can use this to quickly compare the effect of different changes without eyeballing through the PDF forms.