We are using Commerce 12.17.2, we have a custom shipping gateway which implements IShippingPlugin. The expectation is that we compute custom shipping total using this implementation (which it does). But the issue arises when I see 2 different shipping totals; upon digging this further I see that the shipping total is calculated accuratley by the custom shipping gateway. But we also call the OrderGroup GetShippingSubTotal() method when displaying the shipping total which seems to be the culprit.
Our logic is to provide the shipping cost based on the order total percentage.
Order total: 84.50
Shipping cost percentage: 15%
So the shipping cost should be 15% of 84.50, which is 12.68 (After rounding 12.675).
The custom shipping gateway does give the right value of 12.68. But the GetShippingSubTotal() gives a value of 13.01, and this value is used to display the shipping cost on the checkout page of ours.
Below is a screen shot where you can see 2 different shipping calculations:
I also looked into the database to double check if the total in any of the the tables is different, which is causing this price difference. But all the tables have the correct order subtotal (84.5)
As a temporary fix I am overriding the CalculateShippingSubTotal from DefaultOrderGroupCalculator and I see it fixes the issue. But shouldnt the OrderGroup shipping total get updated in this scenario?
I can see in your screenshot there is only one OrderForm for this OrderGroup, so I'd be double-checking the implementation of your;
Here's the official doco on these;
Lastly, can you let us know if there are any currency or markets in play?