Is there a way to handle commissions when they need to include sales taxes and charges

ERPNext: v13.9.2 (version-13)
Frappe Framework: v13.9.1 (version-13)

We sell via contracts for a set amount. This means that when we enter items on the Sales Order, we have to calculate the item rate and round to the nearest value ERPNext accepts. Unfortunately, this means the the amount of the Sales Order frequently doesn’t match the amount of the contract. For example:


Contract Amount: $5493.00

Item Qty Rate Amount
an item 13 $422.54 $5493.02

With no other items on the Sales Order, the total contract value is $5493.02 (we do not currently need to calculate taxes on the Sales Order).


Because of the discrepancy, we need to add a round off charge under "Sales Taxes and Charges for (in this example) -$.02, which rounds off the Sales Order total to the correct amount.

Drop down to the commissions section and enter the Commission Rate of 50%:

Expected commission value: $2746.50
Actual commission value: $2746.51

It looks like the commission is being calculated on the pre-tax total rather than the total Sales Order value. Is there a way to control the way this is calculated, or better way to handle the round off amount so that the commissions are calculated properly?

Note: the Account Head for the Round Off charge is 4100 - Direct Income