Template Designer Printing Conditions
Printing conditions are a set of requirements for a template to print. These conditions are based on the use of logical operators to fill check against the set requirements. Conditional invoices do not appear in the "Print Specific Invoice" option from the drop down in open orders. The reason for this is Specific Invoices are designed to be independant, where as conditional invoices are designed to be printed based on a condition.
An example of when this is used is if there are two different websites and needs different invoices for each other. If the condition is fulfilled a template will be produced, if no conditions are met then the default template will be printed.
Note that Linnworks will try and match an order with an appropriate invoice by working down your list of invoices, and picking the first one that matches the conditions set.
Since the design of a template is based on variable information these are used to produce data where you know what the data, or in other words "Variables are symbolic names given to a an unknown piece of information". The available variables can be found in drop down boxes for the element being edited, once selected they will produce the variable in the editing panel. An example of a variable would be Source.
Unlike expressions printing conditions have no text output, they are simply used to evaluate a condition therefore there are not EVAL, IIF or ROUND formulae.
When creating conditions the value being checked needs to be exact, if there are any differences it will not evaluate.
Example - Simple Conditions
The above example is evaluating if the source of an order is AMAZON. If an order is other than Amazon this invoice won't be printed.
The above example is evaluating the Country of the order, when the order source is NOT United Kingdom the template will print.
Example - Multiple Conditions
With the use of AND and OR functions it's possible to use multiple conditions to evaluate multiple conditions for an invoice.
cCountry<>'United Kingdom' OR cCountry<>'Ireland'
The above condition will be true if the orders country is not from the United Kingdom OR from Ireland.
cCountry<>'United Kingdom' AND Source='AMAZON'
The above condition will be true if the orders country is not from the United Kingdom and the order source is AMAZON.
Example - Using Parentheses
Parentheses is grouping multiple conditions together as sets.
(cCountry<>'United Kingdom' OR cCountry<>'Ireland' ) OR (Source='AMAZON' AND SubSource='YourStore')
By using rounded brackets the conditions are being seperated and evaluated as a set before the Operator joining them is evaluated. For the above example if the first or second conditions return true the invoice will be printed, else the invoice won't be printed.
Example - Using LIKE conditions
Like conditions evaluate a variable based on an incomplete value. To do this wild cards are needed.
cPostCode LIKE 'AB12%'
The above condition will be true if the orders Post Code contains AB12 before the % (wildcard). So if the orders post code was AB12 3LW then the invoice will be printed.
cPostCode NOT LIKE 'AB12%'
The above condition will be true if the orders post code does not contain AB12 before the % (wildcard)
You cannot have one invoice with 'AB1%' and another with 'AB12%' as the first condition may evaluate before getting to the second condition.
Example - Using IN conditions
The in condition is useful if you are checking multiples of the same variable in a condition.
cCountry IN ('United Kingdom','France','Germany','Ireland','Italy')
The above will check if the order country is in the list, if it is the statement will be true.
cCountry NOT IN ('United Kingdom','France','Germany','Ireland','Italy')
The above will check if the county is NOT in the list, if the country is not one of the listed then it will return true.
Wild cards cannot be used with the IN operator