I'm working with the advanced pdf templates for an invoice and running into an annoying issue when I try to save.
My goal is to conditionally display a block of text dependent on the billing country and the amount remaining on the invoice.
Currently I have the line
<#if record.billcountry=="US" && record.amountremaining!=0>
followed by the code for the required text for that scenario. If I have only this condition in the code then the file will save fine and prints properly on a test invoice.I run into the problem when I attempt to write the condition for the alternative text. I am trying to use the line <#if record.billcountry!="US" && record.amountremaining!=0>
then I get an error saying that the left and right sides of a comparison must be the same type.It seems to be that on save the code is verified but the "&&" conditions are only evaluated until a false result is found. If the second line is removed and the first switched to be amountremaining!=0 && billcountry=="US" then I get the same save error but given the nature of the && operator the order shouldn't matter.I've also tried the second line of code modified to <#if record.billcountry!="US" && (record.amountremaining=="" || record.amountremaining!=0)>
and this will save without an issue, again pointing to my thought that && and || operators are only evaluated as far as they need to be to determine the result, but when I try to print an invoice it fails to generate because of the mismatched left and right value types.I'm at my wits end with this, please help!