Is there a way to add invoice “conditions/extra page” in a template?
Workflow:
- An Invoice is printed into PP
- The workflow determens the current language for the invoice and sets the correct overlay to a variable
- Datamapper extracts this variable
- A Template applys the correct overlay from a pdf file to all pages in the invoice
Know I just want to add an extra page to the invoice in the Template with invoice conditions, can that be done ?
These conditions is also located in an variable and whitch set by the flow ?
Know I can do this in the workflow, but can I be done in the template in “one strike”
You simply need to add a section, which content will be whatever you wish to have on your extra page. Then, make that section conditional.
Simply right-click on your section and choose Make Conditional. Or you can control when it will print in a Control script
Thanks.
Did it with this script, had to use the current page index = Totalpages to control the condition page. Or else i did not get i only in the end of the document.
// Page_Control Script
var VarMedia = record.fields.Overlay;
var VarBetingelser = record.fields.Betingelser;
var VarCurrentRecord = record.fields.CurrentPage;
var VarTotalPages = record.fields.TotalPages;
//All Sections Disabled
merge.template.contexts.print.sections.Media_BV.enabled = false;
merge.template.contexts.print.sections.Media_Creadore.enabled = false;
merge.template.contexts.print.sections.Betingelser_BV_UK.enabled = false;
merge.template.contexts.print.sections.Betingelser_Creadore.enabled = false;
if (VarMedia == “BREVPAPIR_DK_UK_DE”)
{merge.template.contexts.print.sections.Media_BV.enabled = true;}
if (VarMedia == “CREADORE_FAKTURA”)
{merge.template.contexts.print.sections.Media_Creadore.enabled = true;}
if ((VarBetingelser == “BV_BETINGELSER_UK”) & (VarCurrentRecord == VarTotalPages))
{merge.template.contexts.print.sections.Betingelser_BV_UK.enabled = true;}
if ((VarBetingelser == “CREADORE_FAKTURA_BAGSIDE_GB”) & (VarCurrentRecord == VarTotalPages))
{merge.template.contexts.print.sections.Betingelser_Creadore.enabled = true;}