You are currently viewing documentation for Linnworks Desktop, if you are looking for Linnworks.net documentation, click here.






Template Designer Printing Conditions

Overview

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 independent, 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 : Linnworks will try and match an order with an appropriate invoice by working through the list of invoices, and picking the first one that matches the conditions set. Where there is a degree of ambiguity and a specific order meets multiple condition sets it is not possible to guarantee the same condition set will always be used. Therefore it is advisable to use condition sets with multiple conditions to ensure the correct invoice is printed

Printing Conditions

Variables

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.

Operators

AND

The AND operator can be used when using multiple variables within a condition. When using the AND operator all conditions have to be true for the output to display.

Source='EBAY' AND SubSource='EBAY0'

It is not possible to use an AND for multiples of the same variable, i.e. an order cannot have source AMAZON and EBAY.

OR

The OR operator can be used when using multiple variables within a condition. When using the OR operator only one of the conditions has to be true for the output to display.

Source='EBAY' OR Source='AMAZON'

LIKE

The LIKE operator is used to evaluate if a value is LIKE but not exactly like another. This can be useful if you are evaluating postcodes. In conjunction with a wildcard in the form of  a percentage sign. 

cPostCode LIKE 'AB12%'

NOT

The NOT operator is used to evaluate if a value is NOT the given value. This needs to be used in conjunction with LIKE or IN, e.g. NOT LIKE, NOT IN. This can be useful if you are evaluating postcodes. In conjunction with a wildcard in the form of  a percentage sign. 

cPostCode NOT LIKE 'AB12%'

IN

The IN operator is used to evaluate if a value is IN a given list. This can be used in conjuction with the NOT  operator to create NOT IN

cCountry IN ('United Kingdom','France','Germany','Ireland','Italy')

IN cannot be used in conjunction with wild cards and therefore relies on a full list of exact values.

Therefore due the methods required to save Folder Collections In can not be used to search these and LIKE must be used instead

=

The equals sign is used to evaluate the variable against the given text. The text provided must match the variable exactly for the condition to be true

Source='EBAY'

<>

This operator means NOT EQUAL or in other words does not equal.

Source<>'EBAY'

The above condition will be true when the source of an order is not ebay.

>

This operator means GREATER THAN. This can be used when evaluating numerical values.

fTax>10

This will mean that anything with tax above 10 will be true. If tax is 10.00 then the condition is false as it is greater than, not greatern than or equal to.

<

This operator means LESS THAN. This can be used when evaluating numerical values.

fTax<10
This will mean that anything with tax below 10 will be true. If tax is 10.00 then the condition is false as it is less than, not less than or equal to.

>=

This operator means GREATER THAN or EQUAL TO. This can be used when evaluating numerical values.

fTax>=10
This will mean that anything with tax above or equal to 10.00 will be true.

<=

This operator means LESS THAN or EQUAL TO. This can be used when evaluating numerical values.

Tax>=10
This will mean that anything with tax below or equal to 10.00 will be true.

Creating Conditions

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

Source='AMAZON'

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.

cCountry<>'United Kingdom'

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)

FolderCollection LIKE '%MyFolder%'
When working with Folders a LIKE condition must be used as the collection contains a list of folder names that need to be searched for the required folder

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