Apr 02 2020

Invoice Generation

Billing is a core part of a running a freelance or consultancy. Without it, you would not get paid! I am of the opinion that an invoice does not need to look pretty. An invoice only needs to clearly convey the details of the bill. Bonus points are given for a small file size with searchability.

My invoices tend to have a “brutalist” nature. Part of this is because most of my work comes from close friends and family. Branding simply takes the back burner.

How do I begin the creation of my invoice? A text file of course! A text file can be tracked through git and allow for pretty diffs. This is the template that I typically work off of.

We can generate the invoice with enscript and ps2pdf. I wrote a quick script to do this for me. We can run the script given some text file: ./generate_invoice invoice_0000.txt

The generated pdf documents are placed into the ./out/ directory of $(cwd). Ideally I would add a -o flag to specify a separate destination. This way I could move the script into the PATH instead. In any case, here is what the generated pdf looks like.

Invoice generated

The next step would be to make another bash script that calls mutt. This would send over the invoice as an attachment to the client. The email could also include the txt file as the body.