Open Source Tax Solver - TaxSolve.c

January 31, 2010
- Project - http://sourceforge.net/projects/opentaxsolver/
- Download 2009 version

OpenTaxSolver (OTS) is a free program for calculating Tax Form entries and tax-owed or refund-due, such as Federal or State personal income taxes.   The complete version of OTS for the 2009 tax year has been released. It contains the updated US 1040 with Schedules A, B, C, and D. It also contains the State Tax form updates for California, New York, Pennsylvania, New Jersey, North Carolina, Massachusetts, Ohio, and Virgina. New this year ... we have added precompiled downloads for Apple Macintosh (Mac) OSx.   To get instant email notification of new updates, click the Subscribe button under the Freshmeat project page (you must have a Freshmeat account to use that), or check the OTS Blog for status updates.   Contributions of other forms would be appreciated.     Special thanks again to all contributors.

Motivations:

Introduction:

The OTS tax package is intended to be used with the Tax booklets published by your government for determining what numbers you need to enter, and then it assists you in doing the calculations and showing the intermediate and final numbers. Consider it an open tax spreadsheet. OTS is particularly useful in combination with the new Adobe PDF Fill-In forms distributed by an ever growing list of government agencies. (This avoids the otherwise costly problem of producing official updated output forms, -- one of the major drawbacks to previous open-source tax efforts.)

The core of OTS is a text-program. Two optional graphical front-ends exist, OTS_GUI and OTS_tclgui-0.0. You can use OTS either by editing a text template file using your favorite text editor, and then processing it. Or, you can use the Graphical User Interface (GUI). Probably most people now days use the GUI, and that is the default mode according to instructions in the package. Since the GUI is rather self-explanatory, the following section focuses on how the core text program works.

How the Core Text-based Program Works:
An alternative to using the GUI, is to enter your input numbers directly in a commented text file, and then process your text file with the TaxSolve program. Starting text-templates exist for each tax program under the examples_and_templates directories. (The GUI uses the same templates, and processes the text-file in the same way, when you press the Compute Taxes button.) When you process the text file with OTS, it produces output to the screen, and a .out file, showing what you should enter on each line.
Example-1:

	cd examples_and_templates/US_Fed
	gedit fed1040_2009.dat
	  {Enter your numbers, income, interest, etc..}

	../../bin/taxsolve_usa_fed1040_2009  fed1040_2009.dat
	  {Runs tax program. View output lines, or print output file fed1040_2009.out.}
	  {Then copy numbers onto your tax forms, and mail them.}
Example-2:
	../../bin/taxsolve_usa_fed1040_2009  my_03_fed_tax.dat 
	more my_03_fed_tax.out
	   {View the results.}
	lpr my_03_fed_tax.out
	   {Print the results.}

Although originally created for US 1040 tax forms, the routines have also been used to solve other tax forms, and for other countries or states. Some error checking is included.

While the OTS programs developed over the last twelve years, results have been checked against commercial packages such as TurboTax (Intuit), TaxCut (HR Block), and TaxAct (2nd Story Software). The answers produced by OTS have matched to within a dollar, differing only by rounding differences. Certainly your mileage may vary. Always double-check your tax forms!


Example screen shot.

Usage:

After unpacking, see the 0_Readme.txt file for build and running instructions. You can use OTS either from the OTS_GUI, or directly from the command-line in text-mode. To use the GUI, invoke the appropriate Run_...{.sh/.bat} script, depending on your platform. The GUI has become fairly self-explanatory. Select a tax program and form-data file, fill-out fields, click Compute Taxes, and print your taxes.

Alternatively, you can edit the form-data file with your favorite text editor, and invoke the tax programs from the command-line. The following sections focus mostly on direct text-mode usage of OTS, as well as how it operates.

Input Format:

The format of the input file is line oriented. The lines correspond to the lines of your tax-form. For each line requiring input from you, state the line number (L#), and then enter the amount, or list the amounts which enter into that line, followed by a semi-colon. Comments can be placed anywhere by enclosing them in squiggly brackets ({}), usually at the end of each line to note what the entry is. A template file is included in each package for convenience.

Example:

	Title:  US Fed 1040 2009 Return for Molly Weber
	L7:     28,789.34 ;	{ Income }
	L13:	    		{ Interest }  
		    45.90	{  US Bank }
		    83.11	{  Credit Union }
			;
The first line, or Title line, of your input file is simply passed straight out to the output file without parsing. It serves as a way to identify the form, whom it is for, and the date or year. After the first line, the format is free-form. You can enter things anywhere, in any column, or any line you wish. The format shown above is recommended for clarity.

All entries for a given line number before a semicolon are added together. This is helpful when multiple items add into a single line. You can show each item separately with its own comment. OTS will add them together for you.

Program Structure:

The TaxSolve programs are divided into two parts:
  1. taxsolve_routines.c - Common routines for all tax forms.
  2. taxsolve_<formname>.c - Program for specific tax form. (ex. taxsolve_usa_fed1040_2009.c)
There are many variants of the second program for specific tax-years, states, countries, and auxiliary forms.

For example, supplied in the OTS package are:

  1. src / taxsolve_routines.c
  2. src / taxsolve_fed1040_2009.c - Configured for US federal 1040 for 2009.
  3. examples_and_templates / fed1040_2009_template.dat - Starting template for your tax data. A text file to place your earnings/interest/... numbers.
  4. examples_and_templates / fed1040_2009_example.dat - Example of a properly filled out input file that works with the source files above, for testing.
The most popular 1040 forms are presently available with this version. Cases handled include, single, married filing jointly, married filing separately, head of household, widow(er), with either standard deduction or itemized. Includes calculations for Schedules A, B, C, and D to calculate interest, dividends, capital gains/losses, and business taxes. Cases that go beyond are noted by stubs with warning messages saying "not presently handled". The package covers many people with common situations. Where it does not, it may require some slight and hopefully obvious/easy extension.

As currently configured the form-specific part (ex. taxsolve_.c) includes taxsolve_routines.c (with #include) and contains the main routine. You need only compile the one program.

To Compile:

Pre-compiled versions are posted for most major platforms. You should not need to re-compile unless you modify the program, or there is an incompatibility with your platform. To re-compile, normally you would invoke the Build-script at the top-level to compile the whole package. But you can also compile individual programs directly, as for example:
      cc   taxsolve_usa_fed1040_2009.c   -o   taxsolve_usa_fed1040_2009

To Run:

Normally, you would invoke the tax programs from the graphical interface (Run_taxsolve_GUI), but you could also invoke individual programs directly, as for example:
      taxsolve_usa_fed1040_2009     fed1040_2009.dat

... where fed1040_2009.dat is the name of -your- tax data file. (Two tax-data files are included for each form in OTS packages: an *example.dat and a blank *template.dat. The idea is to save the template to a personally meaningful file-name and fill in the lines with your numbers. You can maintain returns for multiple people over multiple years this way.) A file such as fed1040_2009.out is produced and is automatically listed to the screen. You can print the file or store it for your records.

Examples:


Program Design for Tax Rules:

For information about how OTS works and how it is written, see: Program Design for Tax Rules

Capital Gains/Losses are Recorded as:

	buy_cost	date
	sale_value	date
Buy cost is negative; it is a cost; an outlay. Date is xx-yy-zz, where xx is the two-digit month, yy is the day, and zz is the last two digits of the year. (Yes, this is Y2K proof.)
Example:
        -3658.22        12-15-99        { 100 Shares XOM }
         4209.95         1-25-02
The dates are required to apply the proper short-term or long-term capital gains rates on Federal taxes, but are not required for State tax forms.

The US Fed 1040, version includes the Schedule-A for itemized deductions, Schedule-B for interest, and Schedule-D for capital gains calculations, as well as the Alternative Minimum Tax (AMT) worksheet calculations. Schedule-C for business taxes, is also provided as a separate program. Versions for several State Income Taxes, including California, New York, Pennsylvania, Ohio, New Jersey, Virginia, Massachusetts, and North Carolina are included. As other forms are contributed, they will be posted.


Download OpenTaxSolver

Last year's OpenTaxSolver can be downloaded from:     Download OpenTaxSolver - OTS Download-Page

Both source code and compiled executables are available for download. Example form-data files are included. Typical package size is about 0.5 MB (fairly small).

Unpacking
Packages are tar-gzip (.tgz) or zip files. To unpack,   tar xfz package.tgz   or   unzip package.zip . Will unpack into a directory of the same name. (To see contents prior to unpacking, tar tfz package.tgz   or   zip -l package.zip .)

Tar packages contain precompiled executables for Linux. Zip contain precompiled executables for Microsoft PCs. Source code and compilation instructions are also provided in all versions. (Uninstall by simply deleting files in the directory. No registry entries are made.)

Other Links


Feedback welcome.

SourceForge.net Logo   .   .   .  

Aston Roberts - aston_roberts@yahoo.com