Icon

A simple tool for generating monthly invoices automatically

April 26, 2023 - 376 words - 2 mins #go #invoice-pdf in tools

Invoice-generator is a simple tool for automatically generating invoices. No need to fill anything out every month, you set it up once, and it works.

It can be used for multiple projects simultaneously: just create different configuration files and place them in separate folders where you want the invoices to be saved.

Source Code: https://github.com/sesav/invoice-generator


The idea behind the tool is very simple: after the one-time step of filling in the generated configuration file, I never have to enter a single line again as long as I keep using the same invoice details. Now I can generate invoices in just a couple of seconds without worrying about mistakes, since everything is done fully automatically.

You can find instalation instructions here.


If you run the invoice generation for the first time, the program will ask you a question:

The file invoice-generator.toml was not found in the current directory. Want to create it? (Y/n)

Type Y, then open the generated invoice-generator.toml file and fill in your invoice parameters.

Once this is done, the configuration setup is complete and you can start generating invoices.

# Invoice data with SE-DDMMYY number and due date +10 days
Fullname = "Bob Sanders"
MyAddress = """Lorem ipsum amet, 221, 42
Aenean ligula, 129104 City, Country."""

MyEmail = "[email protected]"
TaxId = "400424221"
InvoiceTo = "World JSC"
CompanyAddress = """
c/o Alice Henderson
Nam quam nunc, blandit vel 11
Sed fringilla mauris, 68
409118, Middle-earth"""

ServiceDescription = "Backend development services for the period of {xx.xx.xxxx} to {yy.yy.yyyy}"
Price = 1500
Currency = "USD"
Quantity = 2
VAT = 10
PaymentDetails = "Please transfer the due amount according to the following payment details."
BeneficiaryName = "IE Bob Sanders"
BeneficiaryAddress = "FARFROMPOOPEN ROAD TURN 5, CITY, COUNTRY"
BankName = "Bank of the Middle-earth"
BankAddress = "42c GAGARIN STREET, Mars 0160, Middle-earth"
IBAN = "XXXXLX11100003168990YY"
SwiftBIC = "XXXXXX11"

Have you filled out the file? That’s it, the configuration setup is complete, and you can now generate monthly invoices!

Here’s a simple example of what the structure of two different projects should look like:

# cd /home/user/Projects/
β”œβ”€β”€ Project1
β”‚Β Β  β”œβ”€β”€ ...
β”‚   β”œβ”€β”€ invoices/
β”‚   β”‚Β Β  β”œβ”€β”€ SE-010123.pdf
β”‚   β”‚Β Β  β”œβ”€β”€ SE-010223.pdf
β”‚   β”‚Β Β  └── invoice-generator.toml <-- config for Porject1
β”‚Β Β  └── ...
β”œβ”€β”€ Project2
β”‚Β Β  β”œβ”€β”€ ...
β”‚   β”œβ”€β”€ invoices/
β”‚   β”‚Β Β  β”œβ”€β”€ SE-010123.pdf
β”‚   β”‚Β Β  β”œβ”€β”€ SE-010223.pdf
β”‚   β”‚Β Β  └── invoice-generator.toml <-- config for Project2
β”‚Β Β  └── ...

Once a month, you’ll need to go to the invoices/ folder for each project and run the program there:

invoice-generator g

You’ll get an invoice (example) for the current month, with the dates automatically calculated from the beginning to the end of the month and a due date set 10 days later.

Additionally, you can specify the date (month.year) of the desired service period by passing it as an argument, as follows:

invoice-generator g 10.2023

You’ll get an invoice for the desired period with the correct dates in all relevant fields. πŸ€“

That’s basically it. I’m not sure if the program will suit everyone, but I use it actively and it meets all my needs.

If you find it useful too, please consider giving it a star on GitHub. Thank you!