Greetings Friends,
I keep having trouble when I call a script.
I have made the following template, for listing a ticket:
[LAYOUT]
<L00><SIZE 20><bold>Ticket:[=TN('{TICKET NO}'.substr(12))-2000]</bold></SIZE> <SIZE 16><bold>[='{DEPARTMENT}' == 'Rolly Poli Takeaway' ? 'Parcel' : 'Eat In']</bold></SIZE>
<L00><SIZE 20><bold>Ticket:{CALL:rfqs.ReduceTicketNumber(TN('{TICKET NO}'.substr(12)))}</bold></SIZE> <SIZE 16><bold>[='{DEPARTMENT}' == 'Rolly Poli Takeaway' ? 'Parcel' : 'Eat In']</bold></SIZE>
<L00>{TICKET STATE:Delivery}
<F>-
<L00><SIZE 14>T:{TICKET TIME} D:{TICKET DATE}</SIZE>
<EB>
{ORDERS}
<DB>
<F>-
[ORDERS]
<F>-
<L00><SIZE 16><bold>- {QUANTITY} x {NAME}</bold></SIZE>
{ORDER TAGS}
[ORDERS:Void]
<J00>- {QUANTITY} x {NAME}|**Void**
{ORDER TAGS}
[ORDER TAGS]
-- Format for order tags
<L00><SIZE 14> * {ORDER TAG NAME}</SIZE>
The code of my script is as follows:
function ReduceTicketNumber(nTicketNo) {
if (nTicketNo) > 2000 {
nTicketNo = nTicketNo - 2000;
}
return (nTicketNo);
}
When I deduct 2000 from the Ticket No within the template, it shows the right result.
But, the script, which is supposed to do the same, is not returning any value at all. Where am I going wrong? Please do help…
Regards,
Somil