when I add an extrafield for invoices inserting e.g. the global substitution variable __YEAR__ it prints the year onto the generated pdf. When I do the same for the invoice line item, it does not print the year but the expression__YEAR__ on the generated pdf.
Does anyone have an idea how to resolve this? May it be a bug?
thank you - I tried as you suggested {YEAR} but this does not work either. I think the syntax for the global substitution variables is like this: __YEAR__
this is what I did but it does not work in the line extrafield. It only works for the invoice extrafield, but not on the invoice (line) extrafield. It prints __YEAR__instead of “2022” on the item line in the pdf…
I just modified one of my invoice odt:
a) opened a new column
b) just typed (repeat typed not copy pasted to avoid any hidden char) {__YEAR__}
c) saved and uploaded into setup
d) run the invoice using new template
the __YEAR__ is just an example for a substitution variable, so the code won’t help me.
I THINK the problem is not to load the extra field itsself, the problem is that on the line level the substitution variable’s content is not loaded within the extra field.
Doing the same on the invoice header works as expected (also with the substitution variable __YEAR__ behind it). This screenshot shows the web interface:
Hello @unrat
I’m late to the party, but do you still have the issue?
As I needed this myself, I investigated and came to realize that variables in invoice line items are only substituted when using the ODT templates, not the PDF template.
And the correct syntax is {object_date} for the date of the invoice.