Invoice PDF Generation

by Barry Flanagan · 8 years ago

Blesta creates the PDF invoice from scratch every time it is viewed or downloaded. This is not the correct thing to do with an invoice - it should really not change once it is generated. For example, if a logo is changed or the address, then the invoice shows these new details whereas it should not.

Status Timeline
In Progress — Jun 17, 2021
by Jonathan Reismueller
Completed — May 3, 2022
by Jonathan Reismueller
Comments (7)
Paul Phillips Staff 6 years ago

We have an option to cache/save the invoice to disk when it is generated, then it would first be downloaded from there if it exists. See https://dev.blesta.com/browse/CORE-923 Any comments on this task?

Emanuele Vedova 6 years ago

Yes , sometimes error correction have to be made , but them must be allowed only to administrators not clients, so no misuse can be done. If no change is allowed by an admin anymore, that's will be translated in a credit note generation of the incorrect invoice and generation of a new invoice. I think that's not the right way of doing it.

Paul Phillips Staff 6 years ago

So you want admins to be able to edit the invoice, and just re-cache an updated version of the invoice? Caching of invoice PDFs to disk will eventually use a fair amount of disk.

patrick moran 5 years ago

Invoices display a list of goods and services purchased alongside the total amount that a customer must pay. Important information such as the balance, due date, and payment status are in the invoice record itself. proofreading and editing services

Sebastian 5 years ago

Hi!
By default the invoice should be cached to disk (on initial generation).

If you want to implement editing the invoice, then i would suggest adding a "re-generate" button for the invoice. (So ppl that know what they are doing, can do it)

Generally:
A lot of Countries/Juristications have regulations against editing invoices that are sent out to a customer.
Local businesses here (for example) will generally leave the original invoice and then add a correction invoice/note. without editing the original one. (So: Wrong invoice amount (83 EUR) => Cancellation Invoice (-83 EUR) => New and Correct Invoice (45))

As tempering with invoices that are already sent out to a customer (via mail for example (default)) ends with the customer having two invoices for for 2 different amounts.

See https://smallbusiness.chron.com/fix-invoice-mistakes-80684.html for inspiration.

Sebastian 5 years ago

I would also like to add "fair amount of disk use".
The default invoice is around 80KB. Lets assume we add a logo and make it 200kb in total.
Lets assume 250 clients w. 2 invoices per month each. (500 invoices/month total)

2 invoices/client* 250 clients * 200kb => 100 megabytes /month in data gain.
12 months in a year: 1.2 gigabytes total per year
10 years: 12 gigabytes

shouldn't be an issue with most hosting services/plans.

Sebastian 5 years ago

Maybe set an invoice retention time ? Most countries regulations nequire to keep invoices for a certain amount of years. (usually between 7 and 10).
So you could add a limiter. And then remove historic invoices (older than the limit) from the system.
(remove from display in clientarea/adminarea, remove cached files)

15

15 voters

Status Completed
Category Billing