Begin main content

Extracting invoice data from Billings

I use the excellent Billings 2 from MarketCircle for tracking my time and issuing invoices. There are some things it doesn't do well though, and one is exporting or interacting with external systems*

I knew from the also excellent Workload widget for Billings that all the billings data is in an sqlite3 database at the following path:

$HOME/Library/Application Support/Billings/Database/billings.bid

So getting my Q3 invoice data is as simple as:

echo "select date(invoiceDate, 'unixepoch', 'localtime'), '', invoiceNumber, company, totalCached from Invoice, Client where Client._rowid = Invoice.clientID and invoiceDate > strftime('%s', '2010-07-01') and invoiceDate < strftime('%s', '2010-10-01');" | sqlite3 -separator ' ' "$HOME/Library/Application Support/Billings/Database/billings.bid"

This gives me what I need to paste into my BAS spreadsheet (I've set the separator to the tab character). The tax fields in the Invoice table don't seem to be used, but I can easily calculate the flat 10% GST afterwards so I didn't bother investigating the Tax tables.

* I do note that their FAQ for Billings Pro says about any forthcoming API: "We do have the ability to run FScript scripts (or FScript wrapped within AppleScript), but we have not documented the potential calls and methods." which is pretty interesting, but I'm a little nervous about doing that with my billing system until they document which methods are safe!

11:02 PM, 21 Oct 2010 by Mark Aufflick Permalink | Comments (0)

XML

Blog Categories

software (41)
..cocoa (23)
  ..heads up 'tunes (5)
..ruby (6)
..lisp (4)
..perl (4)
..openacs (1)
mac (21)
embedded (2)
..microprocessor (2)
  ..avr (1)
electronics (3)
design (1)
photography (26)
..black and white (6)
..A day in Sydney (18)
..The Daily Shoot (6)
food (2)
Book Review (2)

Notifications

Icon of envelope Request notifications

Syndication Feed

XML

Recent Comments

  1. Mark Aufflick: Re: the go/Inbox go/Sent buttons
  2. Unregistered Visitor: How do make a button to jump to folder
  3. Unregistered Visitor: Note I've updated the gist
  4. Unregistered Visitor: umbrello is now an available port on macPorts
  5. Unregistered Visitor: Updated version on Github
  6. Unregistered Visitor: Modification request.
  7. Unregistered Visitor: Accents and labels with spaces
  8. Unregistered Visitor: Mel Kaye - additional info
  9. Unregistered Visitor: mmh
  10. Mark Aufflick: Thank you