If there any way to do some conditional statements in a report? I would like to highlight if one of my customers is from the United States (because we charge them using a non-local USD credit card machine).
I have tried:
[Sales Tickets:.8,3,1,1,1,1,1,1,1,1,1,1]
>#|Name|Total
@{REPORT TICKET DETAILS:T.Id:(TY=Sales Ticket)::,}
{REPORT TICKET DETAILS:T.TicketNumber,EC.Full Name,EC.Country,T.TotalAmount:T.Id=$1:{0}|{1} [='{2}' == 'United States' ? '(USA) : '']|{3}}
AND
[Sales Tickets:.8,3,1,1,1,1,1,1,1,1,1,1]
>#|Name|Total
@{REPORT TICKET DETAILS:T.Id:(TY=Sales Ticket)::,}
{REPORT TICKET DETAILS:T.TicketNumber,EC.Full Name,EC.Country,T.TotalAmount:T.Id=$1:{0}|{1} {CALL:tkt.isUSA('{2}')|{3}}
In the second example I am trying to offload the if statement to a separate script, but the problem is that it seems that {2}
is what is passed to the script (rather than the name of the country itself).
Any way I could achieve this?