Class DefaultReturnOrderFormCalculator
The default return order form calculator.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Commerce.Order.Calculator
Assembly: EPiServer.Business.Commerce.dll
Version: 13.30.0Syntax
public class DefaultReturnOrderFormCalculator : IReturnOrderFormCalculator
Constructors
DefaultReturnOrderFormCalculator(IShippingCalculator)
Initializes a new instance of the DefaultReturnOrderFormCalculator class.
Declaration
public DefaultReturnOrderFormCalculator(IShippingCalculator shippingCalculator)
Parameters
Type | Name | Description |
---|---|---|
IShippingCalculator | shippingCalculator | The shipping calculator. |
DefaultReturnOrderFormCalculator(IShippingCalculator, ITaxCalculator)
Initializes a new instance of the DefaultReturnOrderFormCalculator class.
Declaration
[Obsolete("This constructor is no longer used, use constructor without ITaxCalculator instead. Will remain at least until May 2019.")]
public DefaultReturnOrderFormCalculator(IShippingCalculator shippingCalculator, ITaxCalculator taxCalculator)
Parameters
Type | Name | Description |
---|---|---|
IShippingCalculator | shippingCalculator | The shipping calculator. |
ITaxCalculator | taxCalculator | The tax calculator. |
Methods
CalculateHandlingTotal(IReturnOrderForm, Currency)
Calculates the handling total for the return order form. It's intended be overridden.
Declaration
protected virtual Money CalculateHandlingTotal(IReturnOrderForm returnOrderForm, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
IReturnOrderForm | returnOrderForm | The return order form. |
Currency | currency | The currency to be used in the calculations. |
Returns
Type | Description |
---|---|
Money | The handling total for the return order form. |
CalculateReturnTaxTotal(IReturnOrderForm, IMarket, Currency)
Calculates the sales tax total of the returnOrderForm
.
Declaration
protected virtual Money CalculateReturnTaxTotal(IReturnOrderForm returnOrderForm, IMarket market, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
IReturnOrderForm | returnOrderForm | The return order form. |
IMarket | market | The market to be used in the calculation. |
Currency | currency | The currency to be used in the calculations. |
Returns
Type | Description |
---|---|
Money | The sales tax total of the return order form. |
CalculateSubtotal(IReturnOrderForm, Currency)
Calculates the total of all shipments in the return order form.
Declaration
protected virtual Money CalculateSubtotal(IReturnOrderForm returnOrderForm, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
IReturnOrderForm | returnOrderForm | The return order form. |
Currency | currency | The currency to be used in the calculation. |
Returns
Type | Description |
---|---|
Money | The subtotal for the return order form. |
CalculateTotal(IReturnOrderForm, IMarket, Currency)
Calculates the total for the return order form.
Declaration
protected virtual Money CalculateTotal(IReturnOrderForm returnOrderForm, IMarket market, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
IReturnOrderForm | returnOrderForm | The return order form. |
IMarket | market | The market to be used in the calculation. |
Currency | currency | The currency to be used in the calculation. |
Returns
Type | Description |
---|---|
Money | The total for the return order form. |
GetDiscountTotal(IReturnOrderForm, Currency)
Gets the discount total of an IReturnOrderForm.
Declaration
public Money GetDiscountTotal(IReturnOrderForm returnOrderForm, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
IReturnOrderForm | returnOrderForm | The return order form. |
Currency | currency | The currency. |
Returns
Type | Description |
---|---|
Money | The discount total from all return items in the return order form, excepts shipment discount. |
Examples
public void GetDiscountTotal(IReturnOrderForm returnOrderForm, Currency currency, IReturnOrderFormCalculator returnOrderFormCalculator)
{
var discountTotal = returnOrderFormCalculator.GetDiscountTotal(returnOrderForm, currency);
Debug.WriteLine("Discount total for return order form '{0}': {1}", returnOrderForm.OrderFormId, discountTotal);
}
GetHandlingTotal(IReturnOrderForm, Currency)
Gets the handling total for an IReturnOrderForm.
Declaration
public Money GetHandlingTotal(IReturnOrderForm returnOrderForm, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
IReturnOrderForm | returnOrderForm | The return order form. |
Currency | currency | The currency to be used in the calculation. |
Returns
Type | Description |
---|---|
Money | return 0. |
Examples
public void GetHandlingTotal(IReturnOrderForm returnOrderForm, Currency currency, IReturnOrderFormCalculator returnOrderFormCalculator)
{
var handlingTotal = returnOrderFormCalculator.GetHandlingTotal(returnOrderForm, currency);
Debug.WriteLine("Handling total for return order form '{0}': {1}", returnOrderForm.OrderFormId, handlingTotal);
}
GetOrderDiscountTotal(IReturnOrderForm, Currency)
Gets the discount price of an IReturnOrderForm.
Declaration
public Money GetOrderDiscountTotal(IReturnOrderForm returnOrderForm, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
IReturnOrderForm | returnOrderForm | The return order form. |
Currency | currency | The currency. |
Returns
Type | Description |
---|---|
Money | The discount price of the return order form. |
Examples
public void GetOrderDiscountTotal(IReturnOrderForm returnOrderForm, Currency currency, IReturnOrderFormCalculator returnOrderFormCalculator)
{
var orderDiscountTotal = returnOrderFormCalculator.GetOrderDiscountTotal(returnOrderForm, currency);
Debug.WriteLine("Order discount total for return order form '{0}': {1}", returnOrderForm.OrderFormId, orderDiscountTotal);
}
GetReturnOrderFormTotals(IReturnOrderForm, IMarket, Currency)
Gets the order form totals for an IReturnOrderForm.
Declaration
public OrderFormTotals GetReturnOrderFormTotals(IReturnOrderForm returnOrderForm, IMarket market, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
IReturnOrderForm | returnOrderForm | The return order form. |
IMarket | market | The market to be used in the calculation. |
Currency | currency | The currency. |
Returns
Type | Description |
---|---|
OrderFormTotals | An order form totals. |
GetReturnTaxTotal(IReturnOrderForm, IMarket, Currency)
Gets sales tax total for the return order form.
Declaration
public Money GetReturnTaxTotal(IReturnOrderForm returnOrderForm, IMarket market, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
IReturnOrderForm | returnOrderForm | The return order form. |
IMarket | market | The market to be used in the calculation. |
Currency | currency | The currency to be used in the calculation. |
Returns
Type | Description |
---|---|
Money | The sales tax total for the return order form. |
Examples
public void GetReturnTaxTotal(IReturnOrderForm returnOrderForm, IMarket market, Currency currency, IReturnOrderFormCalculator returnOrderFormCalculator)
{
var returnTaxTotal = returnOrderFormCalculator.GetReturnTaxTotal(returnOrderForm, market, currency);
Debug.WriteLine("Tax total for return order form '{0}': {1}", returnOrderForm.OrderFormId, returnTaxTotal);
}
GetSubTotal(IReturnOrderForm, Currency)
Gets the total of all shipments in an IReturnOrderForm.
Declaration
public Money GetSubTotal(IReturnOrderForm returnOrderForm, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
IReturnOrderForm | returnOrderForm | The return order form. |
Currency | currency | The currency to be used in the calculation. |
Returns
Type | Description |
---|---|
Money | The subtotal for the return order form. |
Examples
public void GetSubTotal(IReturnOrderForm returnOrderForm, Currency currency, IReturnOrderFormCalculator returnOrderFormCalculator)
{
var subTotal = returnOrderFormCalculator.GetSubTotal(returnOrderForm, currency);
Debug.WriteLine("Subtotal for return order form '{0}': {1}", returnOrderForm.OrderFormId, subTotal);
}
GetTotal(IReturnOrderForm, IMarket, Currency)
Gets the total for an IReturnOrderForm.
Declaration
public Money GetTotal(IReturnOrderForm returnOrderForm, IMarket market, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
IReturnOrderForm | returnOrderForm | The return order form. |
IMarket | market | The market to be used in the calculation. |
Currency | currency | The currency to be used in the calculation. |
Returns
Type | Description |
---|---|
Money | The total for the return order form. |
Examples
public void GetTotal(IReturnOrderForm returnOrderForm, IMarket market, Currency currency, IReturnOrderFormCalculator returnOrderFormCalculator)
{
var total = returnOrderFormCalculator.GetTotal(returnOrderForm, market, currency);
Debug.WriteLine("Total for return order form '{0}': {1}", returnOrderForm.OrderFormId, total);
}
ValidateHandlingTotal(Money)
Validates the handling total
Declaration
protected virtual void ValidateHandlingTotal(Money money)
Parameters
Type | Name | Description |
---|---|---|
Money | money | The calculated value |
ValidateReturnTaxTotal(Money)
Validates the tax total.
Declaration
protected virtual void ValidateReturnTaxTotal(Money money)
Parameters
Type | Name | Description |
---|---|---|
Money | money | The calculated value. |
ValidateSubtotal(Money)
Validates the subtotal.
Declaration
protected virtual void ValidateSubtotal(Money money)
Parameters
Type | Name | Description |
---|---|---|
Money | money | The calculated value. |