How to create a macro for an invoice that uses a combination of ANDs and ORs

How to create a macro for an invoice that uses a combination of ANDs and ORs

You can use multiple value tests in a macro (on the screen or in an invoice/packing slip etc.).

The following example shows how this can be done.

if you want to display the text

NO VAT TO PAY

If someone pays in US dollars AND the shipping cost is zero (0.0) and the shipping method is either UPS, Air Mail or Standard.

This is made up of 3 different tests and can be written as 3 separate macros.

Pays in US dollars
#[%CURRENCY%][=]#$[TRUE][FALSE]

Shipping cost is zero (0.0)
[%ORD_TOTAL_TAX%][=]0.00[TRUE][FALSE]

Shipping method is either UPS, Air Mail or Standard
#UPS#Air Mail#Standard[?]#[%POSTAL_SERVICE%][TRUE][FALSE]

To use all these tests together you put the 2nd test in the TRUE component of the test, the final one being the NO VAT TO PAY text. If you leave the FALSE component as blank, nothing will be displayed if any of the values is not true.

So this macro would be:

#[%CURRENCY%][=]#$[[%ORD_TOTAL_TAX%][=]0.00[#UPS#Air Mail#Standard[?]#[%POSTAL_SERVICE%][NO VAT TO PAY][]][]][]

To use this in an Invoice (in the HTML) you need to put #!# around the macro so this macro would become

#!##[%CURRENCY%][=]#$[[%ORD_TOTAL_TAX%][=]0.00[#UPS#Air Mail#Standard[?]#[%POSTAL_SERVICE%][NO VAT TO PAY][]][]][]#!#

For more information on writing macros if you use the following link:

(In the Advanced Macros section at the end of the document)


    • Related Articles

    • "How to use ANDs and ORs when displaying values"

      There isn't a direct representation of AND or OR. However, this can be achieved in different ways. For example, To use an OR To see if a postage type is first class or expedited you can use the following #Expedited#first class#[?][%Shipping ...
    • How to add the return address onto your invoice in One Stop Order Processing

      The following guide explains how to add a return address label onto your invoices. This feature is available in the Lite, Professional, Premium and Managed subscriptions of One Stop Order Processing. To add your company address to the delivery label ...
    • How to resize your logo so that it fits on your invoice

      If you want to include a logo on your integrated label, you will need to make sure it is the correct size to fit on the label. This feature is available in the Lite, Professional, Premium and Managed subscriptions of One Stop Order Processing. To do ...
    • Keeping invoice numbers in sequence when using on a network

      When you create an order (manually or when importing) the next available invoice number is used. If you change the invoice number format you should do this on all the networked PCs. If you add a new PC to a networked version you should update these ...
    • How to change the size of the image on the invoice (or label)

      To change the size of the image on the invoice (or label) follow the steps below. If you are using a Printing Macro (e.g. [%LABEL_LOGO%]) add the following to the end of the Value: " width="{width}" height="{height} Change the {width} and {height} ...