The team I'm part of manage a number of software projects - and most of the stuff we do is end to end, from requirements tracking, to project management to purchasing and setup - a big pain is tracking of financials as we have a whole process to go through for our financials. At the moment we use a spreadsheet and store all the invoices and purchase orders in a shared folder. Its difficult to capture expenses and relate them back to projects that are ongoing or completed. Anyone got better ideas? Hope this topic is relevant.
I'm just throwing this out there but Scrum seems like a methodology that might lend itself to tracking this kind of stuff easily.
You're talking about bookkeeping. Your best bet is probably to talk to accountant who organised books for a software company before. Alternatively you could read up on bookkeeping basics.
This question is not strictly software development related, although software business has some traits that make it different, i.e. absence of raw materials.
Best of luck with your question, I personally find it interesting, but I don't believe it belongs on stackoverflow.
I use the time tracking aspects of JIRA with a bunch of custom fields that let me note issues as having been billed for (complete with storing the invoice number details against the JIRA issue). It's easy to relate hours worked to time billed. Might not work if you're billing for functionality rather than hours, but for $/hr work it's perfect.