Get shipping tax

Vote:
 

Hi,

I have a project with prices including tax and I can't seem to be able to get the total tax amount (database field "Epi_ShippingTax" in Shipment table) for the shipment. The only way I can find is to use the internal inteface IShipmentCalculatedAmount to get the tax value from the shipment. Is there another way that is not internal? We send prices without tax back to the backend system so we need the calculated tax for the shipment.

/Viktor

#218114
Edited, Mar 06, 2020 13:33
Vote:
 

I would assume the IShippingCalculator would give you the value you want:

/// <summary>
/// Gets the shipping tax of an <see cref="T:EPiServer.Commerce.Order.IShipment" />.
/// </summary>
/// <param name="shipment">The shipment.</param>
/// <param name="market">The market to be used in the calculation.</param>
/// <param name="currency">The currency to be used in the calculation.</param>
/// <example>
/// <code source="../CodeSamples/EPiServer.Commerce/Orders/OrderCalculatorsSample.cs" region="ShippingGetShippingTax" lang="cs" />
/// </example>
/// <returns>The shipping tax amount of the shipment.</returns>
Money GetShippingTax(IShipment shipment, IMarket market, Currency currency);

The MarketId and currency should be available on the IOrderGroup.

#218153
Mar 06, 2020 15:55
Vote:
 

Ahh, thanks!

/Viktor

#218156
Mar 06, 2020 16:40
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.