Complete Shipment - Incorrect authorization total

Vote:
 

Hi!

When we try to complete shipment we get the following error "Incorrect authorization total. Expected: 43.600000000, but Actual is: 54.500000000".

Our solution required us to override the DefaultTaxCalculator, which have worked well and we don't come aqross any issues until trying to complete a shipment.

Parts of the implementation of the overrideing DefaultTaxCalculator can be seen below

public class OverrideDefaultTaxCalculator : DefaultTaxCalculator
{
    protected override Money CalculateTaxTotal(IOrderForm orderForm, IMarket market, Currency currency)
    {
        if (!ShouldTax(orderForm, currency))
        {
            return new Money(0, currency);
        }

        return base.CalculateTaxTotal(orderForm, market, currency);
    }

    protected override Money CalculateTaxTotal(IOrderGroup orderGroup, IMarket market, Currency currency)
    {
        if (!ShouldTax(orderGroup, currency))
        {
            return new Money(0, currency);
        }

        return base.CalculateTaxTotal(orderGroup, market, currency);
    }

    protected override Money CalculateShippingTaxTotal(IShipment shipment, IMarket market, Currency currency)
    {
        if (!ShouldTax(shipment, currency))
        {
            return new Money(0, currency);
        }

        return base.CalculateShippingTaxTotal(shipment, market, currency);
    }

    protected override Money CalculateShippingReturnTaxTotal(IShipment shipment, IMarket market, Currency currency)
    {
        if (!ShouldTax(shipment, currency))
        {
            return new Money(0, currency);
        }

        return base.CalculateShippingReturnTaxTotal(shipment, market, currency);
    }
}

This example is an order which is treated with the exception of not following the standard tax rules in the system. 

All the summaries seems to be correct, it does not add the tax on the order.

However we still get the error stated above. I can see the OverrideDefaultTaxCalculator gets called and is returning as expected.

Is there more tax calculators that I'm not aware of that does its final check on "Complete Shipment"?

#192155
May 08, 2018 14:56
Vote:
 

That's strange - how do you "complete" your shipment? By Commerce Manager I suppose? 

#192156
May 08, 2018 15:29
Vote:
 

That is correct,

Commerce Manger->Shipping/Receiving->(when put into pick list)->Pick Lists->Fill Tracking number and Complete shipment->Error

Is there other ways the Tax get's calculated on the Order except the DefaultTaxCalculator?

#192157
May 08, 2018 15:34
Vote:
 

You didn't mention Commerce version you are using, but I guess it was 11.x or before.

Well, the problem is in Commerce prior to 12.2 (which is being tested), the activities were still using the old way to calculate taxes. I.e. you are probably using OrderFormHelper.CalculateSalesTaxTotal (and related) method in the activities which are used internally by Commerce Manager. 

If you want to fix that, you can try to update the activitity to use your new implementation, or, you can wait for 12.2 where we fix that problem for you.

#192158
May 08, 2018 15:51
Vote:
 

Commerce 12.2 was released, that supposed to fix your issue.

#192313
May 15, 2018 4:44
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.