Archive for the ‘tax’ Category

Tax Project March Wrap up

So I cheated a bit and pushed the deadline out a week. While much of the checklist is done the project overall is nowhere near where I hoped it would be. The issue I think was that I assumed that I would be productive for the whole weekend but it turns out I actually do do social stuff and regular maintenance like cleaning or ironing. Looking back I think I committed about half the time I expected to.

Tax website screenshot showing layout

Tax website screenshot

Target features

  • Templating system

    Check. Using TT2 as described earlier. The templating isn’t complete but I was
    always planning on growing it as I went. Sadly it doesn’t properly implement the
    primatives I’m using but It’s good to start with a win, even if you steal it.

  • Basic layout

    Check. To start off with I had a ghastly colour scheme of different shades of red and roughly the layout I ended up with. I read on one of those innumerable website design blogs that colour schemes are important. All the classic mood stuff, red is firey and aggresive, white is serious, boring and reliable. Reliable seems like a good mood for a tax website but black and white is a bit too hard for someone as inept as I to pull off. So I went with a cream background and a yellow/browny secondary colour.

  • Functional data entry

    Check. This works pretty well actually, change an input box and it’s immediately pushed to the server. Not perfect (none of the code is), notably it’s not fully backgrounded so you get a slight delay.

  • Javascript data checking

    Fail. I didn’t get around to trying this.

  • Serverside storage

    Check. I went with MongoDB and it’s going well so far. Ended up having to write a very simple PHP script to expose the DB to the Javascript, primarily authentication wrapping.

  • Basic calculations

    Partial. I have some calculations working but it’s not a reusable structure.

  • Independent domain name

    Fail. The project isn’t far along enough to be useful yet so the domain isn’t important, so I’m marking this as a fail but don’t care. I also couldn’t find a free name I liked.

  • Public source repository

    Check.http://github.com/lod/Australian-Tax-Return

Maybe features

  • Client side encryption

    Fail. Didn’t start on this.

  • User login system

    Check. Pretty easy to implement with the DB layer in place. I don’t have user
    creation working yet but that is actually a fairly small amount of work.

  • Basic personal tax pack covered

    Fail. I’m nowhere near achieving this, it’s crazy how much they cram into a few pages.

  • Client side PDF generation

    Fail. Didn’t start on this.

Templating system

I knew when I started this project (which was a while ago, I kinda cheated on this one) that I didn’t want to write out all the HTML myself, I’m not THAT masochistic. What I wanted to do was basically say “make a text box to write the address in”.

So I started with a generic preprocessor. I’ve use preprocessors such as CPP, TeX and Make so figured I would take a generic preprocessor like M4 and define a few HTML macros… problem solved. Unfortunately it wasn’t that simple and as I added complexity it got harder to keep it all straight, particularly the quoting.

The basic text box wasn’t too bad.

dnl TEXT_Q(name, label, [length])
define(`TEXT_Q’, `indir(LAYOUT, `$1,
    `<label for="$1_text">$2</label>’,
    `<input id="$1_text" name="$1" ifelse($3, `’, `’, `size="$3"’)>’

But when I tried to create optional groupings it started to get messy. This is a snippit from TABULAR_OPTIONAL_ROWS and calling it.

    dnl Build the heading rows
    <tr class="tabular_optional_rows_heading_row">
    pushdef(`LAYOUT’, “TABULAR_OPTIONAL_ROWS_HEADING_LAYOUT”)
    foreach(`XXXXX’, (dquote(shift($@))), `XXXXX’)
    popdef(`LAYOUT’)
    </tr>


TABULAR_OPTIONAL_ROWS(3,
    `TEXT_Q(salary_abn, Payers Australian business number, 11), dnl TODO: Should be Payer’s
    

With TABULAR_OPTIONAL_ROWS I couldn’t figure out how to have a variable number of rows and I couldn’t figure out how to pass it’s options without quoting so I decided to throw in the towel and switch to something else.

I had experimented with Template Toolkit at work using it to inject snippits of Javascript into HTML documents. In the end I stopped using it and had a static HTML page which included a fully generated Javascript file but the short exposure I had impressed me and I tried it here. I found it much cleaner, the named parameters cut out a lot of complexity and the ability to just drop back to Perl if I wanted to do something really hairy was nice.

This is the definition of a text box followed by the calling syntax of a radio box that toggles the visibility of the text box.


<tr class="text" id="[% name %]_row" 
    [%- IF hide -%]
        style="display: none"
    [%- END -%]
>
<td class="question">
    <label for="[% name %]_id">[% text %]</label>
</td>
<td class="answer">
    <input type="text" name="[% name %]" id="[% name %]_id">
</td>
</tr>


[% INCLUDE tax/radio
    name = "surname_changed"
    text = "Has any part of your name changed since completing your last tax return?"
    modify = "previous_surname"
    options = [{name => "Yes", action => "show"}, {name => "No", action => "hide"}]
%]

[% INCLUDE tax/text
    name = "previous_surname"
    text = "Previous surname"
    hide = "true"
%]

The normal syntax for options is simply [“Yes”, “No”], the Perl fallback I mentioned earlier allows me to have more complex syntax when I need it but keeps things simple most of the time. I’ve since discovered there’s a Template Toolkit version three that’s a nice step forward but it’s listed as still in development and in a very Alpha state, it also smelt a bit like it was suffering from classic second project woes. I think I’m playing with enough new stuff not to add experimental Template Toolkit versions to the list.

Goal – Online tax returns

For my first project I am going to make a web based tax return creator for Australian tax returns.

The Australian Tax Office (ATO) produces E-Tax, a program for Windows computers that allows you to produce a tax return and submit it online. Sadly it’s very much Windows only though they suggest exploring running Windows in a virtual machine. They are currently “investigating” supporting other platforms, but they have been doing this for years now and I’ve seen third hand correspondence that suggests the investigation isn’t progressing particularly quickly.

You can also fill in the return by hand on paper, complete with explanatory booklets. In practice the procedure for both is basically the same, the advantage of doing it digitally is that it’s easier to see the calculations and make corrections.

So the goal is to produce a website to help enter tax returns. I’ll base it off the paper tax return and as output produce a PDF that can be printed and posted in directly. The ATO actually accepts printouts from E-Tax so I’m fairly confident that they will accept these.

The secondary goal is to improve my abilities with Javascript. I have toyed around with Javascript a little bit, enough to do small tasks for webpages. In doing this I saw enough to know that Javascript had some fundamental differences but not enough to really understand or work with them. By doing a substantial Javascript project I hope to get over that hurdle and start to see how to properly design with the language.

By April 4th I’ll have a prototype site complete. Not a usable solution, that will probably happen sometime after the new tax returns come out in July. The development site can be seen at http://taxreturn.projects.david.tulloh.id.au/

April 4th features

  • Templating system
  • Basic layout
  • Functional data entry
  • Javascript data checking
  • Serverside storage
  • Basic calculations
  • Independent domain name
  • Public source repository

Maybe features

  • Client side encryption
  • User login system
  • Basic personal tax pack covered
  • Client side PDF generation

Later features

  • General package refactor
  • Complete core tax pack covered
  • Complete supplementary tax pack covered
  • Retrieve prefill information from ATO
  • Electronic submission to ATO
  • Integrate with accounting software
Return top