I have some doubts about the solution suggested by Scott and I'd like to get some feedback.
I will try to clarify the context with an example
Enter a sales order for the customer "DemoCustomer" for 20 units of WG-1111.
Check out the order.
Go to Webtools>Entity Data Maintenance>OrderAdjustemnt and filter by orderId and orderAdjustmentTypeId="SALES_TAX"
The sales taxes adjustments will look like the following ones:
Tax Geo and Authority || order item seq id || amount
Utah County / Sales Tax || NA || -0.096
Utah County / Sales Tax || 00001 || 0.960
Utah State / Sales Tax || 00001 || 45.592
NA / NA || 00001 || 9.598
Apart from the weird taxes, what it is interesting to note is that we have one order header adjustments (the first one) and a few order item adjustments. Also note that taxes are approximated to 3 decimals
Following Scott's suggestion (if I am interpreting it in the right way) we will have taxes summed up by the same Tax Geo and Authority:
Utah County / Sales Tax || 0.864
Utah State / Sales Tax || 45.592
NA / NA || 9.598
and then we approximate them to 2 decimals (I'm approximating using round half up, but this is just an example):
Utah County / Sales Tax || 0.86
Utah State / Sales Tax || 45.59
NA / NA || 9.60
The final result is that, starting from a set of order header and order item tax adjustments we have transformed them in a set of order header tax adjustment, one for each tax geo and authority.
These are the numbers that will be posted into the GL.
My main question is: when do we do this calculation? In the service that generates the accounting transaction or in the order/invoice (when the adjustments are stored in the db)?
If we do this only in the service that generate the accounting transaction the problem is that there will be differences between the amount s in gl and the numbers in orders, invoices and payments.
If we do this in the order and invoice the problem that I see is that we loose the ability to associate the tax adjustments to the order items (that is a very important feature, in my opinion).