Submitted Invoices show updated contract number
Symptoms
After creating invoices through the batch invoice process, information such as contract number on the engagement was changed. This changed the contract number on the previously created invoices as well.
Reason
Batch invoice creation does not create a snapshot of the invoice in the invoice table, htmltext field. Therefore any information on the engagement changed after the batch creation, but before the invoice has been opened for viewing, the information on the invoice will be the updated information from the engagement.
Resolution
When an invoice is created using the batch process it does not create an html snapshot in the database which is what would "freeze" the contract number. The only thing that can create the snapshot is to open the invoice up as an invoice and then the snapshot will be put in this field, regardless of the process used to create the invoice. Therefore if you change the contract number before the snapshot is taken, before the htmltext field has a snapshot of the contract number as it was, it will take the number from the field in the engagement at the time of the snapshot (opening of the invoice). If you change the number after the snapshot has been created it will not change the contract number on the invoice.
A workaround may be that before the number on the contract is changed, to ensure that the invoice has been opened for viewing in order to have the snapshot created.