Hi, I'm attempting to write a script that will mar...
# suitescript
p
Hi, I'm attempting to write a script that will mark an order as non-taxable under certain circumstances. After submit, I'm setting
taxable
to
false
,
taxitem
to
-7
( the -Not Taxable item), and
taxrate
to 0. When saving, I'm getting the error:
Copy code
"TRANS_UNBALNCD","message":"Transaction was not in balance."
with the same amount as the tax I'm trying to remove. Anyone know how to resolve this? Changing to before submit just throws an unexpected error
m
Is the error message giving you two numbers that are a penny off from each other? It can happen with rounding issues that come from script handling any pricing or discounts being used.
p
It gives me the full amount of tax I'm trying to remove. Ex/
"name":"TRANS_UNBALNCD","message":"Transaction was not in balance. Total = 3.48"
The record is loaded in dynamic mode
m
Are there any other changes to the record besides the tax thing being made? Dynamic mode can be tricky sometimes as some changes need to be made in a certain order. If any other changes affect any pricing they may need to be done before messing with the taxable. Have you tried doing it in standard mode?
p
Currently I'm setting the 3 fields in that order:
istaxable
,
taxitem
,
taxrate
. In the UI, unchecking Taxable and selecting the -Not Taxable- item automatically sets the Tax Rate to 0
r
See if there is anything reflecting tax on the GL?
To Matt's point, if you can do exactly what you're trying to do via script via the UI in the same order, that's probably not your problem.
p
Standard mode throws the same error, unfortunately
m
Are you using Acalara AvaTax by chance?
p
Yes, we're using Avalara
Seems there might be an issue with AvaTax you need to sort out
r
now you're wearing your thinking cap (not your drinking cap)
p
Of course the Avalara article linked isn't there anymore... why would they make this easy 😖
m
Sounds like they did what SuiteAnswers did when they updated their site
Another option is to try what you have and also change each line item to be non-taxed also. AvaTax may not be able to reconcile that the header is non-tax but the line items are still tax
p
Of course, the real issue is PEBKAC
The field is
istaxable
, not
taxable
🤭 1
facepalm
Thank you @Matt Carter & @reptar for your help! Going to put my drinking cap on later today
💯 2