After finishing a paid project, ideally a formal looking invoice would be sent to the client. I know there are many commercial products available, but I couldn't find a good open source alternative especially with the standard Finnish formatting. I was happy to find jheusala/finnish-invoice-template from GitHub which had all of the tricky LaTeX stuff done.
The template usage is very simple and minimizes repetition when storing and referencing information on the company and the client. There is a one file for each company and one for each client. Each invoice.tex file must start by importing the invoice_header.tex file, which consists mostly of usepackage declarations. Next company and client files are imported, and other invoice details are defined. Header can be seen in the Figure 1. Sample company information:
- \newcommand{\CompanyName}{Yritys ABC}
- \newcommand{\CompanyStreetAddress}{Osoite 123 A 4}
- \newcommand{\CompanyPostcode}{12345}
- \newcommand{\CompanyCity}{Kaupunki 1}
- \newcommand{\CompanyWebsite}{https://example.com}
- \newcommand{\CompanyEmail}{email@example.com}
- \newcommand{\CompanyPhone}{040-1234567}
- \newcommand{\CompanyId}{5555555-5}
- \newcommand{\CompanyBank}{Pankki}
- \newcommand{\CompanyIBAN}{FI56 1111 2222 3333 44}
- \newcommand{\CompanyBIC}{NDEAFIHH}
And sample client information:
- \newcommand{\ClientNumber}{101}
- \newcommand{\ClientName}{Asiakas XYZ}
- \newcommand{\ClientAddress}{Osoite 234 B 5}
- \newcommand{\ClientPostcode}{23456}
- \newcommand{\ClientCity}{Kaupunki 2}
At the moment it is still quite verbose to define individual invoice rows, and having to do all tax and total calculations manually. Unfortunately this is also very error prone, so perhaps a simple Python script should be written to generate the invoice file based on most primitive facts. There is also an embedded two-line Python script to calculate the invoice's reference id's check digit.
After all details have been described the 250 lines long invoice_body.text is imported. It is just slightly modified version of the original jheusala/finnish-invoice-template/invoice.tex. The main difference is that it only contains information on the formatting of the document, and all information on the company, client and the invoice is read via pre-defined commands. The result is shown in Figure 2.
Main information is listed in the footer, as shown in Figure 3. On the top it lists company details such as street address, web address and email address. Next are IBAN and BIC numbers of the company's bank account, naturally it is crucial to have the correct information here or it would be a huge inconvenience to both parties. In the middle left the name and address of the company and client are shown, and on the right the client's id and invoice's id is shown. Finally on the bottom right the invoice's reference id, due date and total amount to be paid are shown. The full sample document can be found from GitHub.
The original template used code128 to create a barcode to the footer as well, but I didn't get it to work on Windows TeXworks so I had to disable it for now. I'm not sure if those are widely used nowadays, maybe not by Finnish individuals but by larger companies.
Related blog posts:
|
|
|
|
|
|
|
|
|