Archive for the ‘tax’ Category

Tax Project March Wrap up

So I cheat­ed a bit and pushed the dead­line out a week. While much of the check­list is done the project over­all is nowhere near where I hoped it would be. The issue I think was that I assumed that I would be pro­duc­tive for the whole week­end but it turns out I actu­al­ly do do social stuff and reg­u­lar main­te­nance like clean­ing or iron­ing. Look­ing back I think I com­mit­ted about half the time I expect­ed to.

Tax website screenshot showing layout

Tax web­site screen­shot

Target features

  • Tem­plat­ing sys­tem

    Check. Using TT2 as described ear­li­er. The tem­plat­ing isn’t com­plete but I was
    always plan­ning on grow­ing it as I went. Sad­ly it doesn’t prop­er­ly imple­ment the
    pri­ma­tives I’m using but It’s good to start with a win, even if you steal it.

  • Basic lay­out

    Check. To start off with I had a ghast­ly colour scheme of dif­fer­ent shades of red and rough­ly the lay­out I end­ed up with. I read on one of those innu­mer­able web­site design blogs that colour schemes are impor­tant. All the clas­sic mood stuff, red is firey and aggre­sive, white is seri­ous, bor­ing and reli­able. Reli­able seems like a good mood for a tax web­site but black and white is a bit too hard for some­one as inept as I to pull off. So I went with a cream back­ground and a yellow/browny sec­ondary colour.

  • Func­tion­al data entry

    Check. This works pret­ty well actu­al­ly, change an input box and it’s imme­di­ate­ly pushed to the serv­er. Not per­fect (none of the code is), notably it’s not ful­ly back­ground­ed so you get a slight delay.

  • Javascript data check­ing

    Fail. I didn’t get around to try­ing this.

  • Server­side stor­age

    Check. I went with Mon­goDB and it’s going well so far. End­ed up hav­ing to write a very sim­ple PHP script to expose the DB to the Javascript, pri­mar­i­ly authen­ti­ca­tion wrap­ping.

  • Basic cal­cu­la­tions

    Par­tial. I have some cal­cu­la­tions work­ing but it’s not a reusable struc­ture.

  • Inde­pen­dent domain name

    Fail. The project isn’t far along enough to be use­ful yet so the domain isn’t impor­tant, so I’m mark­ing this as a fail but don’t care. I also couldn’t find a free name I liked.

  • Pub­lic source repos­i­to­ry


Maybe features

  • Client side encryp­tion

    Fail. Didn’t start on this.

  • User login sys­tem

    Check. Pret­ty easy to imple­ment with the DB lay­er in place. I don’t have user
    cre­ation work­ing yet but that is actu­al­ly a fair­ly small amount of work.

  • Basic per­son­al tax pack cov­ered

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

  • Client side PDF gen­er­a­tion

    Fail. Didn’t start on this.

Templating system

I knew when I start­ed this project (which was a while ago, I kin­da cheat­ed on this one) that I didn’t want to write out all the HTML myself, I’m not THAT masochis­tic. What I want­ed to do was basi­cal­ly say “make a text box to write the address in”.

So I start­ed with a gener­ic pre­proces­sor. I’ve use pre­proces­sors such as CPP, TeX and Make so fig­ured I would take a gener­ic pre­proces­sor like M4 and define a few HTML macros… prob­lem solved. Unfor­tu­nate­ly it wasn’t that sim­ple and as I added com­plex­i­ty it got hard­er to keep it all straight, par­tic­u­lar­ly the quot­ing.

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=”$1ifelse($3, ‘’, ‘’, ‘size=”$3″’)>’

But when I tried to cre­ate option­al group­ings it start­ed to get messy. This is a snip­pit from TABULAR_OPTIONAL_ROWS and call­ing it.

    dnl Build the head­ing rows
    <tr class=“tabular_optional_rows_heading_row”>
    foreach(‘XXXXX’, (dquote(shift($@))), ‘XXXXX’)

    TEXT_Q(salary_abn, Pay­ers Aus­tralian busi­ness num­ber, 11), dnl TODO: Should be Payer’s

With TABULAR_OPTIONAL_ROWS I couldn’t fig­ure out how to have a vari­able num­ber of rows and I couldn’t fig­ure out how to pass it’s options with­out quot­ing so I decid­ed to throw in the tow­el and switch to some­thing else.

I had exper­i­ment­ed with Tem­plate Toolk­it at work using it to inject snip­pits of Javascript into HTML doc­u­ments. In the end I stopped using it and had a sta­t­ic HTML page which includ­ed a ful­ly gen­er­at­ed Javascript file but the short expo­sure I had impressed me and I tried it here. I found it much clean­er, the named para­me­ters cut out a lot of com­plex­i­ty and the abil­i­ty to just drop back to Perl if I want­ed to do some­thing real­ly hairy was nice.

This is the def­i­n­i­tion of a text box fol­lowed by the call­ing syn­tax of a radio box that tog­gles the vis­i­bil­i­ty of the text box.

<tr class=“text” id=[% name %]_row” 
    [%- IF hide -%]
        style=“dis­play: none”
    [%- END -%]
<td class=“ques­tion”>
    <label for=[% name %]_id”>[% text %]</label>
<td class=“answer”>
    <input type=“text” name=[% name %] id=[% name %]_id”>

[% INCLUDE tax/radio
    name = “surname_changed”
    text = “Has any part of your name changed since com­plet­ing your last tax return?”
    mod­i­fy = “previous_surname”
    options = [{name => “Yes”, action => “show”}, {name => “No”, action => “hide”}]

[% INCLUDE tax/text
    name = “previous_surname”
    text = “Pre­vi­ous sur­name”
    hide = “true”

The nor­mal syn­tax for options is sim­ply [“Yes”, “No”], the Perl fall­back I men­tioned ear­li­er allows me to have more com­plex syn­tax when I need it but keeps things sim­ple most of the time. I’ve since dis­cov­ered there’s a Tem­plate Toolk­it ver­sion three that’s a nice step for­ward but it’s list­ed as still in devel­op­ment and in a very Alpha state, it also smelt a bit like it was suf­fer­ing from clas­sic sec­ond project woes. I think I’m play­ing with enough new stuff not to add exper­i­men­tal Tem­plate Toolk­it ver­sions to the list.

Goal — Online tax returns

For my first project I am going to make a web based tax return cre­ator for Aus­tralian tax returns.

The Aus­tralian Tax Office (ATO) pro­duces E-Tax, a pro­gram for Win­dows com­put­ers that allows you to pro­duce a tax return and sub­mit it online. Sad­ly it’s very much Win­dows only though they sug­gest explor­ing run­ning Win­dows in a vir­tu­al machine. They are cur­rent­ly “inves­ti­gat­ing” sup­port­ing oth­er plat­forms, but they have been doing this for years now and I’ve seen third hand cor­re­spon­dence that sug­gests the inves­ti­ga­tion isn’t pro­gress­ing par­tic­u­lar­ly quick­ly.

You can also fill in the return by hand on paper, com­plete with explana­to­ry book­lets. In prac­tice the pro­ce­dure for both is basi­cal­ly the same, the advan­tage of doing it dig­i­tal­ly is that it’s eas­i­er to see the cal­cu­la­tions and make cor­rec­tions.

So the goal is to pro­duce a web­site to help enter tax returns. I’ll base it off the paper tax return and as out­put pro­duce a PDF that can be print­ed and post­ed in direct­ly. The ATO actu­al­ly accepts print­outs from E-Tax so I’m fair­ly con­fi­dent that they will accept these.

The sec­ondary goal is to improve my abil­i­ties with Javascript. I have toyed around with Javascript a lit­tle bit, enough to do small tasks for web­pages. In doing this I saw enough to know that Javascript had some fun­da­men­tal dif­fer­ences but not enough to real­ly under­stand or work with them. By doing a sub­stan­tial Javascript project I hope to get over that hur­dle and start to see how to prop­er­ly design with the lan­guage.

By April 4th I’ll have a pro­to­type site com­plete. Not a usable solu­tion, that will prob­a­bly hap­pen some­time after the new tax returns come out in July. The devel­op­ment site can be seen at

April 4th fea­tures

  • Tem­plat­ing sys­tem
  • Basic lay­out
  • Func­tion­al data entry
  • Javascript data check­ing
  • Server­side stor­age
  • Basic cal­cu­la­tions
  • Inde­pen­dent domain name
  • Pub­lic source repos­i­to­ry

Maybe fea­tures

  • Client side encryp­tion
  • User login sys­tem
  • Basic per­son­al tax pack cov­ered
  • Client side PDF gen­er­a­tion

Lat­er fea­tures

  • Gen­er­al pack­age refac­tor
  • Com­plete core tax pack cov­ered
  • Com­plete sup­ple­men­tary tax pack cov­ered
  • Retrieve pre­fill infor­ma­tion from ATO
  • Elec­tron­ic sub­mis­sion to ATO
  • Inte­grate with account­ing soft­ware
Return top