Morning all. I'm working through our new PDF templ...
# taxes
t
Morning all. I'm working through our new PDF templates in preperation for upgrading to SuiteTax. I want to show the Subsidiary tax number for the transaction, so I'm using:
record.subsidiarytaxregnum
As per the netsuite docs. However, this is pulling back not just the VAT number, but also stuff in brackets about the nexus (see below)
a
First thing I would do is try a couple of the join fields here in the Records Catalog for Tax Registrations, which is what record.subsidiarytaxregnum seems to point to. So try things like record.subsidiarytaxregnum.taxRegistrationNumber (I don't know whether capitalization matters, so try it both with capital R and N and with all lowercase letters) or record.subsidiarytaxregnum.id, and see if either of those gives the correct value.
I don't know much about taxes in NetSuite, but I know a bit about Advanced PDF Templates and how to reference join fields. If none of those join fields work, then you could try chopping off the end of the text starting with the open parentheses, assuming you're using Advanced PDF Templates, try
record.subsidiarytaxregnum?keep_before("(")
-- That keeps only the part of the text string that occurs before the open parenthesis, if I remember the syntax correctly. If you want to also remove the "VAT: " part then you can also use the ?keep_after freemarker helper:
record.subsidiarytaxregnum?keep_after("VAT: ")?keep_before("(")
-- However, I don't recommend doing that unless you can guarantee that every
record.subsidiarytaxregnum
that you need to display starts with "VAT ". Anything else would show up completely blank if you did that since those things don't have a "VAT: " so they won't keep anything after what isn't there. So make sure to test this on some things that don't have parentheses, or have important parentheses about things other than the Nexus, if any such exist in your NetSuite account.
t
Thanks @Aaron McCausland this is super helpful. In the end I took the approach you suggested with manipulating the string to remove the unwanted stuff!
👍 1
a
You're welcome!