mercredi 1 mars 2017

IF Statement with Number Range on Netsuite PDF/HTML Template

I need to specify default shipping method, for when none is provided on the entry form in Netsuite. For various reasons I have to do this within the PDF/HTML template. This is the code I have so far, but it doesn't seem to work;

<#function toNumber val>
<#if val?has_content && val?length gt 0 >
<#return val?html?replace('[^0-9.]','','r')?number >
<#else><#return 0 ></#if></#function>

<#if record.shipmethod?has_content>

${record.shipmethod}  <!-- if a courier is selected -->

<#else>               <!-- else -->
<#list 2000..2560 as pcx>  <!-- Sydney Metro postcodes -->
<#if toNumber(record.shipzip)==pcx> 

Courier1              <!-- Standard Sydney Metro Courier -->

<#else>               <!-- else -->

Courier2              <!-- Standard Interstate Courier -->

</#if></#list></#if>

Aucun commentaire:

Enregistrer un commentaire