Extracting invoice data from Billings
I knew from the also excellent Workload widget for Billings that all the billings data is in an sqlite3 database at the following path:
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