When the name or the address of a Thirdpary is modified, when regenerating validated linked document, the new info is used. This should not be the case and info specified when the document has been validated should be preserved and used instead of the new ones.
I think info (name and address) about the Thirdparty should be historized and preserved as soon as it is link to at least one validated invoice for the thirdparty.
If you need to change a data from a Thirdparty, for example adress, it's usually because:
1) the previus data was incorrect and you need to correct it
or
2) the previous data is obsolete and you need to introduce the new and fresh info
In both cases, it's a good practice that Dolibarr update thirdparty information in every step of invoice creation (even between validate and payment states) because it wouldn't make sense to put in a new invoice (no mather if it's validate same day or if it was validated months ago) obsolete info about the thirdparty.
We can barely think in a case that would be necessary. But if you need to put different info in differents invoices, it's always an option create a new thirdparty to keep separate old and new data and have references on which invoice corresponds to each third party without confusion.
Legally, a validated invoice should not be modified (in France at least).
@RubenRuCh I dot not know what country you live in but I think this is a basic requirement for multiple countries.
@aspangaro What do you think ?
We live in Spanish, but here it's a think called amending invoice. If the company change the info, a copy of the validated invoice with the new information can be delivered along with the invoice to be paid / already paid.
Anyway, I think there's an hidden option that desactivate the automatic generation of PDF (user have to click manually on Generate invoice). That migh solve the problem, since if the new invoice is not autogenerate, you will still have access to the old one. I'm gonna search if I can find these hidden variable.
https://wiki.dolibarr.org/index.php/Roadmap_and_Release_3.2.0
- New: Add hidden option MAIN_DISABLE_PDF_AUTOUPDATE to avoid generating pdf each time data change.
There it's. Go to Setup, Other settings, introduce MAIN_DISABLE_PDF_AUTOUPDATE with a value != 0 and check if it's works for the purpose you need.
I am aware of this option but it only disable automatic generation of the PDF. The PDF can and should be updated with the payment info to reflect that the invoice has been partly or entierly paid but should preserve original thirdparty info. That's two different things.
Situation is not so easy.
In most cases, use discover the address is wrong because he as generated the PDF or as sent it by email. In such a case we must be able to fix address and regenerate it.
When the french government say "once generated, an invoice must not be modified", like in most legal text text, we must think the "goal" of the law and not the "text strictly". So we must not use same invoice to invoice 2 different companies (so 1 invoice become "invisible") or change amount (this will allow to hack the accounting or vat reports), but if we have a typo we are still allowed to fix it.
The most important problem here in fact is when the company change its professional id (siren, siret france) and we change it on invoice. Here, we do not keep the old one on invoice. But this occurs, in most cases, after that the invoice has been paid.
A good agreement here could be to lock generation once invoice is "paid" or just "validated". But this may lead to other problem too. Priority is to think to integrate an "history" of any change in database like do some external modules.
Note also, that if using the "inalterable log" module, all thirdparty information are saved in inalterable log at any step so are kept even if you change them later.
This is really a difficult topic because both use cases are very relevant.
I would prefer an option, where you can set an archive state of invoices
(and maybe for other documents like orders ...).
Maybe with the setup option of automatic or manual status setting / archiving.
So a new state "archive" can be set - automatic after paid or manually
(with list selection -> set archive).
This new state needs an extra user permission.
And in special cases, authorized persons can reset the state for individual invoices to "not archive"
and it is possible to pull changed data / print again.
But how to handle?
The "archive" state set a flag to save the pdf (?)
Or to write the archived data to into an extra file (xml?) or copy to an extra table
with real datas - not with the foreign keys!?
Most helpful comment
Situation is not so easy.
In most cases, use discover the address is wrong because he as generated the PDF or as sent it by email. In such a case we must be able to fix address and regenerate it.
When the french government say "once generated, an invoice must not be modified", like in most legal text text, we must think the "goal" of the law and not the "text strictly". So we must not use same invoice to invoice 2 different companies (so 1 invoice become "invisible") or change amount (this will allow to hack the accounting or vat reports), but if we have a typo we are still allowed to fix it.
The most important problem here in fact is when the company change its professional id (siren, siret france) and we change it on invoice. Here, we do not keep the old one on invoice. But this occurs, in most cases, after that the invoice has been paid.
A good agreement here could be to lock generation once invoice is "paid" or just "validated". But this may lead to other problem too. Priority is to think to integrate an "history" of any change in database like do some external modules.
Note also, that if using the "inalterable log" module, all thirdparty information are saved in inalterable log at any step so are kept even if you change them later.