Hi
This was my pseudo code, which I used CDRTool as a base, and then together with what serweb had I created a complete tool, since then I have changed it alot to do diff prices per customer type etc.
As for tax scripts, thats just 17.5% here in the UK, if it varies youy can just add a field per rate defined
Iqbal