hello, is it possible to override tax total in the...
# suitescript
k
hello, is it possible to override tax total in the Invoice record via a UE script? we have Avalara Integration, but its turned off to load legacy sales order and invoices. I am trying to set tax total in the invoice using a script, but I keep on getting the following error:
An unexpected error has occurred. Please click here to notify support and provide your contact information.
Is it possible to override tax total?
b
basic answer is no
the desperate advanced answer is taxamountoverride
✔️ 1
👍 1
keep in mind that if there was any chance of me having to use taxamountoverride I would answer no
s
I was able to override the tax total on Return Authorizations and Cash Refunds using this as @battk mentioned: currentRecord.setValue('taxamountoverride', taxTotal) In the case where I was using it, the tax we wanted to apply to these transactions was from our CRM and not NetSuite's built-in tax.
✔️ 1
k
@battk I was able to override tax total using that field, but I am not sure if I understand this comment 😄 "keep in mind that if there was any chance of me having to use taxamountoverride I would answer no"
b
that field requires heavy scripting to make it work correctly
you can probably take a look at the user events Avalara had to deploy to all your transactions to make it work
i believe the entrypoints to the user events are hidden, but the libraries are unlocked and visible
k
so I disabled Avalara in their configuration level. and then in the script, I still mark Tax Code as AvaTax per line, because they are basically calculated in Avalara from a different system. Then I set the taxamountoverride to the value I want and there seems to be no issue with that.
thank you for the help! @battk and @Stefan Holodnick
e
For existing transactions that have already charged tax, the Tax Override checkbox doesn't work as expected. Avalara "remembers" the tax and no matter what you do, it won't override the tax if you need to so you'll need to script it.
k
Thank you for the information @Eric B! however, the transaction that I am updating are legacy transactions that do not have Avalara called up on before.