How-to
Short answer: Add a Number field for each tax rate, entered as a whole percentage such as 20. Compute the tax as Unit_Price * VAT_Percent / 100 and add it to the line total.
Why it happens
- A rate typed as 20 means 20%, so divide by 100 before you multiply.
- Currency fields have their own rules: you can add or subtract the same currency, and multiply or divide a currency by a number. See number and currency expressions.
How to fix it
Replace the field IDs below with your own.
- Add a Number field for each rate, for example
VAT_PercentandGST_Percent. - Tax amount:
(Unit_Price * VAT_Percent) / 100 - Line total with both taxes:
Quantity * (Unit_Price + (Unit_Price * VAT_Percent / 100) + (Unit_Price * GST_Percent / 100)) - For one tax:
(Quantity * Unit_Price) + (Quantity * Unit_Price) * (Tax / 100) - To convert currency, use
Currency(Amount / Conversion_Rate, "GBP")whenAmountis a Number field, orAmount.convert(Conversion_Rate, "EUR")when it's a Currency field. Make the rate field required so it's never empty. - To round up to the nearest thousand, use
Number_field.ceil(1000), or(Number_field / 1000).roundup() * 1000.
If an integration fills the total, for example when a purchase request creates a purchase order, don't also put a formula on that field in the target process. Map the value in the integration instead.
Tip
For a live exchange rate instead of a typed one, use a remote lookup field.
