As a freelance contractor, it's certainly been a long road to building a successful business. What's more, I rarely have time to work on software for myself, as I've generally been too busy building software for clients or doing outreach to get more work. However, I've recently reached a point where I've become busy enough that manually creating my own invoices has become unfeasible. This is certainly not a bad problem to have, as it means that I am keeping busy, but it does come with its own challenges.
The way I manage my invoices is very detailed. I like for my clients to have a full breakdown of everything that I do. If I'm just working on one project for you, that's all well and good and fairly simple. However, if I am working on a bunch of projects for you, I want you to know where the hours went in an itemized receipt on your invoice. Furthermore, this gets even trickier with agencies that I am paired with, as not only does the invoice need to be itemized, but also broken down by sub-clients as well. Managing this manually had reached a point where, at the end of March, I spent an entire day just managing invoices, double- and triple-checking things in spreadsheets and calendars.
My solution to this was to automate the vast majority of the process. I use the Teamwork project management software to document my active projects and hours spent on said projects, and I've integrated with Teamwork before on behalf of another client a couple of years ago, so I figured I had a pretty good start. Now, the last time I did this was in Python, which I've since abandoned in favor of Rust. As such, I needed to build everything more or less from scratch. Thankfully, there are API docs readily available for Teamwork, and I've built countless server integrations over the years, so I wasn't starting with nothing.
The process was fairly simple, and it only took one weekend to knock out. First, I set up the connection to Teamwork. I pulled all of the records from the past month, ensuring that I batched the requests in such a way that I wasn't overwhelming Teamwork by asking for too much at a time, as well as time-limiting the requests, as you can only send so many requests within a certain time period. I probably don't have to worry about the latter bit, but you never know how much data I'll be pulling from Teamwork as my business continues to expand.
After pulling the data from Teamwork, I needed to sort the time entries by project so I could generate the itemized list for each client. This also meant being able to associate multiple projects with a client to accommodate the agencies I work with. I did this by creating a manual config file that I can easily update myself to include new projects as I add more down the line. If I run the software and a project is returned that isn't accounted for, the program gives me details about the project name and ID, and I can properly associate it with the client it belongs to and run the program again.
Next, after all the time entries are sorted by each client and their projects, I sort them by date within each project. This makes it easier to output to text files. I still want some level of oversight into what gets sent to each client, as sometimes I have projects that have an agreed-upon price that I don't want to charge over. For one-off projects, I give the estimate to the client ahead of time, and if I go over that time, it's on me for not scoping correctly. As such, I format all of the data so there is the total time at the top, then a list of clients, each client containing a list of dates I worked on their projects, with the time spent and the project I worked on under each date.
From here, things are simple. Each client has their own text file that this is output to, and I can easily copy and paste that to my invoicing software. I use Wave Payments for keeping track of invoices, and they have a section at the bottom where I can type out notes for the client. This is where I put in that itemized receipt. Then I send out invoices and wait for the money to roll in.
All in all, this was a pretty quick project, but it felt nice to be able to do something for myself for once. Furthermore, having used the system for April's invoices, my clients really seem to like it as well. Combining these wins with the fact that I don't need to triple-check everything with a calculator anymore, I'm glad I took the time to properly automate my invoices.
If this system sounds great to you, please reach out. I am always happy to take on new work, and I love automation and integration projects.