i've got an Invoice field `shippingtax1amt` that i...
# advancedpdf
r
i've got an Invoice field
shippingtax1amt
that is coming back without a currency symbol and also negative within the advanced pdf, but using the NetSuite Explorer, I clearly see the value is positive (still no currency symbol). Anyone experience this or have an idea how to get around it?
k
try ${record.shippingtax1amt?abs?string.currency}
r
I just did a replace('-','')
Second part, how do I get the currency "displaySymbol" (not the ISO code)? As this field is missing that
k
${currencySymbol}
r
Copy code
The following has evaluated to null or missing:
==> currencySymbol
$record.currencySymbol
returns the ISO code, i.e. USD instead of $
k
Apologies, you need to define currencySymbol. Symbol returns the ISO code. currrencySymbol is something you need to define in your PDF:
<#assign currencySymbol = "$" />
r
Wish I could use the currency symbol that's defined in the list. Looks like I'll need to keep a table and do the assign based off the currencyId. I've got over 10 currencies to support
k
Is the symbol on the transaction same as the base currency?
r
Or, having to store it on the form to pull. No, it also depends on the subsidiary.
In this case, it's Sales order based and it is in the transaction currency
k
Try this. On the Currency record, set "Override Currency Format" to TRUE, and see if you can use displaysymbol. Never tried it myself.
r
was thinking that too, but seeing as it's not available unless overridden. I'll give it a try regardless
nope
Copy code
ERROR: Field
'currency.displaySymbol' Not
Found
k
Damn. Too bad. I've only had to do this once and they only deal with 3 currencies so I used:
<#assign currencySymbol = "$" /><#if record.currency="Swiss Franc"><#assign currencySymbol = "₣" /><#elseif record.currency="Euro"><#assign currencySymbol = "€" /></#if> then used ${currencySymbol}
r
I think that's my only option here too
n
@Robert Vice Took me an age to find this but if you head to help in NS and search "FreeMarker Formatting Method" the first result may have details that help with this. (describes ns specific builtins)
🙌 1
This result:
k
Will definitely save this for future reference. @Robert Vice That solution may work as long as your PDF doesn't fall victim to Defect # 549317 Foreign Currency Expense Reports > Print > Advanced Printing Type, Standard Expense Report PDF/HTML Template > Wrong currency symbol. https://suiteanswers.custhelp.com/app/answers/detail/a_id/105146/loc/en_US Which mine did :(
r
worked for my USD invoice, let me check our Kr and Rnd
Worked for Nkr too
Copy code
${nsformat_currency(record.shippingtax1amt?replace('-',''), record.currencySymbol)}
👍 1
n
Hopefully that saved you a bunch of messy IF statements and having to update if any new currencies are introduced 😄
r
100%
it's bad enough our Tax integration has different "fields" depending on the locations
And they don't seem to have all the "translations" done either
n
Do you ever use checkbox values logically in pdfs? I recently discovered there's a simple solution to the fact it prints as "Yes / Ja / Oui" etc etc
r
We don't have any bool's printing there. But I saw that in the format section too really helpful in the future.
n
Yeah that ?c is a bit of a lifesaver 😄
although it's still "true" not true when you evaluate it 😄
r
😉 making our programming life a heck of a lot nicer
🤭 1
Oh boy, Rand uses a different '-' that USD hilarious
Copy code
${nsformat_currency(record.shippingtax1amt?replace('-','')?replace('-',''), record.currencySymbol)}