Archive for the ‘tax’ Category

Tax Project March Wrap up

So I cheated a bit and pushed the dead­line out a week. While much of the check­list is done the pro­ject over­all is nowhere near where I hoped it would be. The issue I think was that I assumed that I would be pro­duct­ive for the whole week­end but it turns out I actu­ally do do social stuff and reg­u­lar main­ten­ance like clean­ing or iron­ing. Look­ing back I think I com­mit­ted about half the time I expec­ted to.

Tax website screenshot showing layout

Tax web­site screenshot

Tar­get features

  • Tem­plat­ing system

    Check. Using TT2 as described earlier. The tem­plat­ing isn’t com­plete but I was
    always plan­ning on grow­ing it as I went. Sadly it doesn’t prop­erly imple­ment the
    prim­at­ives 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 ghastly col­our scheme of dif­fer­ent shades of red and roughly the lay­out I ended up with. I read on one of those innu­mer­able web­site design blogs that col­our schemes are import­ant. All the clas­sic mood stuff, red is firey and aggres­ive, white is ser­i­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 someone as inept as I to pull off. So I went with a cream back­ground and a yellow/browny sec­ond­ary colour.

  • Func­tional data entry

    Check. This works pretty well actu­ally, change an input box and it’s imme­di­ately pushed to the server. Not per­fect (none of the code is), not­ably it’s not fully back­groun­ded so you get a slight delay.

  • Javas­cript data checking

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

  • Server­side storage

    Check. I went with Mon­goDB and it’s going well so far. Ended up hav­ing to write a very simple PHP script to expose the DB to the Javas­cript, primar­ily authen­tic­a­tion wrapping.

  • Basic cal­cu­la­tions

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

  • Inde­pend­ent domain name

    Fail. The pro­ject isn’t far along enough to be use­ful yet so the domain isn’t import­ant, 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 repository

    Check.http://​git​hub​.com/​l​o​d​/​A​u​s​t​r​a​l​i​a​n​-​T​a​x​-​R​e​t​urn

Maybe fea­tures

  • Cli­ent side encryption

    Fail. Didn’t start on this.

  • User login system

    Check. Pretty easy to imple­ment with the DB layer in place. I don’t have user
    cre­ation work­ing yet but that is actu­ally a fairly small amount of work.

  • Basic per­sonal tax pack covered

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

  • Cli­ent side PDF generation

    Fail. Didn’t start on this.

Templating system

I knew when I star­ted this pro­ject (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 mas­ochistic. What I wanted to do was basic­ally say “make a text box to write the address in”.

So I star­ted with a gen­eric pre­pro­cessor. I’ve use pre­pro­cessors such as CPP, TeX and Make so figured I would take a gen­eric pre­pro­cessor like M4 and define a few HTML mac­ros… prob­lem solved. Unfor­tu­nately it wasn’t that simple and as I added com­plex­ity it got harder to keep it all straight, par­tic­u­larly 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=”$1ifelse($3, ‘’, ‘’, ‘size=”$3″’)>’

But when I tried to cre­ate optional group­ings it star­ted 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”>
push­def(LAYOUT, TABULAR_OPTIONAL_ROWS_HEADING_LAYOUT)
foreach(‘XXXXX’, (dquote(shift($@))), ‘XXXXX’)
pop­def(LAYOUT)
</tr>


TABULAR_OPTIONAL_ROWS(3,
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 without quot­ing so I decided to throw in the towel and switch to some­thing else.

I had exper­i­mented with Tem­plate Toolkit at work using it to inject snip­pits of Javas­cript into HTML doc­u­ments. In the end I stopped using it and had a static HTML page which included a fully gen­er­ated Javas­cript file but the short expos­ure I had impressed me and I tried it here. I found it much cleaner, the named para­met­ers cut out a lot of com­plex­ity and the abil­ity to just drop back to Perl if I wanted to do some­thing really hairy was nice.

This is the defin­i­tion of a text box fol­lowed by the call­ing syn­tax of a radio box that toggles the vis­ib­il­ity 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>
<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 com­plet­ing your last tax return?“
modify = “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 simply [“Yes”, “No”], the Perl fall­back I men­tioned earlier allows me to have more com­plex syn­tax when I need it but keeps things simple most of the time. I’ve since dis­covered there’s a Tem­plate Toolkit ver­sion three that’s a nice step for­ward but it’s lis­ted 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 second pro­ject woes. I think I’m play­ing with enough new stuff not to add exper­i­mental Tem­plate Toolkit ver­sions to the list.

Goal — Online tax returns

For my first pro­ject 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­puters that allows you to pro­duce a tax return and sub­mit it online. Sadly it’s very much Win­dows only though they sug­gest explor­ing run­ning Win­dows in a vir­tual machine. They are cur­rently “invest­ig­at­ing” sup­port­ing other plat­forms, but they have been doing this for years now and I’ve seen third hand cor­res­pond­ence that sug­gests the invest­ig­a­tion isn’t pro­gress­ing par­tic­u­larly quickly.

You can also fill in the return by hand on paper, com­plete with explan­at­ory book­lets. In prac­tice the pro­ced­ure for both is basic­ally the same, the advant­age of doing it digit­ally is that it’s easier to see the cal­cu­la­tions and make corrections.

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 prin­ted and pos­ted in dir­ectly. The ATO actu­ally accepts prin­touts from E-Tax so I’m fairly con­fid­ent that they will accept these.

The sec­ond­ary goal is to improve my abil­it­ies with Javas­cript. I have toyed around with Javas­cript a little bit, enough to do small tasks for webpages. In doing this I saw enough to know that Javas­cript had some fun­da­mental dif­fer­ences but not enough to really under­stand or work with them. By doing a sub­stan­tial Javas­cript pro­ject I hope to get over that hurdle and start to see how to prop­erly design with the language.

By April 4th I’ll have a pro­to­type site com­plete. Not a usable solu­tion, that will prob­ably hap­pen some­time after the new tax returns come out in July. The devel­op­ment site can be seen at http://​taxre​turn​.pro​jects​.david​.tul​loh​.id​.au/

April 4th features

  • Tem­plat­ing system
  • Basic lay­out
  • Func­tional data entry
  • Javas­cript data checking
  • Server­side storage
  • Basic cal­cu­la­tions
  • Inde­pend­ent domain name
  • Pub­lic source repository

Maybe fea­tures

  • Cli­ent side encryption
  • User login system
  • Basic per­sonal tax pack covered
  • Cli­ent side PDF generation

Later fea­tures

  • Gen­eral pack­age refactor
  • Com­plete core tax pack covered
  • Com­plete sup­ple­ment­ary tax pack covered
  • Retrieve pre­fill inform­a­tion from ATO
  • Elec­tronic sub­mis­sion to ATO
  • Integ­rate with account­ing software
Return top