Open mildred opened 9 months ago
@mildred perhaps Form Customization would allow you to add the field (without additional functionality).
Else, you can read the doc.submitted
field if Submitting the invoice in your workflow counts as confirming it.
doc.submitted
would be what I was looking for , except I cannot see when this value would be true. On all my invoices, it is false.
Additional form customization would not work for what I was thinking, the goal is to show clearly on the invoice if it is a final invoice that will never change (submitted invoices cannot be modified) or if it is a draft invoice that is just provisional and should not be treated as an official document.
{{JSON.stringify(doc)}}
on version 0.18 (august 22 this year) does not show any submitted
field.
the submited
field is ignored in the template values because it is a meta field:
To include it, either we don't skip meta fields or we add it specifically around here:
something like:
values.doc.submitted = doc.submitted;
values.doc.cancelled = doc.cancelled;
Apologies for pointing you towards doc.submitted
, it'd missed me that submitted
is a meta field and so is not included as template values (or hints).
It's cause of this printTemplates.ts#L182
for values, and printTemplates.ts#L141
for hints.
Considering your use case, I see no reason to exclude, so if you'd like to raise a PR to make the change I'd be more than happy to merge it.
It would be great to have a
doc.confirmed
boolean field in the invoice templates to know if the invoice is confirmed or not. It would allow to display unconfirmed invoices as such and ensure invoices are always confirmed before sent to the client.