Monthyear in public note change invoices an quotes

Version ie <v5.11.71>

Environment Docker

Describe the bug

When sending an invoice, i use the :MONTHYEAR Var in the public notes for the billing period.

Today i must resend an older invoice again to a customer.
The public note was changed because of :MONTHYEAR

even when downloading an older invoice

Steps To Reproduce

Usu :MONTHYEAR in public note and resent an invoice a month later

Expected Behavior

Not change a public note when an older invoice send again or download

Additional context

Is there a way to relate MONTHYEAR to the invoice date? Currently it seems to be the current date

HI,

These variables are designed to be used with recurring invoices, when the invoice is generated the current date is saved. Maybe you can use $invoice.date instead?

Hi,
I use this in recurring invoices.
However, I consider it questionable if the content of the invoice changes in another month when it is sent or downloaded again.

For example, when a reminder is sent, the invoice is also sent and then something else appears in the public notes in the following month.

Is it possible to format $invoice.date so that the month and year are displayed?
Can it be calculated like :MONTHYEAR+11?

I think it would be better if variables with a date for public notes used the invoice date as input rather than the current date.

I’m not sure I understand. If you have a recurring invoice which has :MONTHYEAR in it when it runs and generates a standard invoice the invoice will have the date, not the variable. If the invoice is resent since it doesn’t have the variable the date won’t change.

Hi,
you´re right. when using it in recurring invoices it works fine.

I have used it in “normal” invoices and that runs into my problem above.

Is there a way to format the output of $invoice.date so it looks like :MONTHYEAR?

It may be possible using a template, I see examples of date formatting in the docs.

Thanks, i will try this