In Sales orders, the VAT rate can be set dynamically based on the selected DealType in the header using the following rule.
You can get that information using this calculated attribute, which returns 'True' or 'False'.
Тo achieve this, a calculated attribute #VATBYDEALTYPE is used, which returns the VAT percentage based on the selected Deal type.
The BEFORERECALCULATE event is utilized, which occurs just before the calculation of additional amounts.
There are two conditions: one based on the code of the Document Type, for which the calculated attribute #DocType is used, and the other based on the ID of the additional amount type for VAT.