Producing billing reports using MantisBT
Each quarter I do my VAT (Value Added Tax) return. This is the tax that gets added on to each purchase in the UK. It's a little reminder that I must do my billing. Honestly, I have so much fun doing the work I do, that I forget to bill people sometimes!
Using my current technology, it's a little long winded so I thought I'd document how I do it, to remind me to find a way to do it better. Obviously this method is going to be terribly geeky, but hay - I am who I am :)
All my time accounting is handled by MantisBT which is the issue tracker I use. I wrote the current implementation of the billing feature so I thought I'd better use that! I have it on good authority that I'm not the only one!
The applications needed for this work are: web browser, PuTTY and Open Office, so load then in now!
- Login to MantisBT.
- Select Billing from navigation bar.
- Select the Project you are going to prepare the billing for. The page will automatically reload.
- Select the data period you are billing for. Leave the Cost as zero.
- Click Get TimeTracking Information
- Cut the text in the results page; starting before the first issue identifier and drag down to the end of the time on the last issue line.
- In PuTTY and jump to you nearest unix box.
- Load Vi.
- Paste copied text into Vi's session.
- Remove all references to my user name.
:%s/David Newcomb//
- Jump to the top of the page.
gg
- From the start of the line create a macro to format the data.
qawr,lxJr,0jq
- Do control+g to get the number of lines. Divide it by 2 then, to give say 20. Then repeat macro for each line: 20@a.
- Clean up additional spaces:
:%s/, \([0-9]\)/,\1/
- Select all the text and paste it into Open Office spread sheet.
- The Text Import dialogue will appear, so select Separated by Comma and click Ok.
- Highlight the column containing the time information.
- Right click and select Format Cells...
- Set category to Time and choose 13:37 which is HH:MM.
- Hit Ok and the cells will be changed to the correct format.
- Select the cell underneath the last time.
- Enter:
=SUM(
- After the opening bracket the cursor changes so you can select all the cells you want to be in the summation. Hit return when you have finished selecting them.
- Select the cell again and add the formatting.
- Now you can cut and paste the report anywhere you like.
I have used some Vi macro's. Take a look at my article Vi's super commands to see an example of how to set up a Vi macro.
No feedback yet
Form is loading...