Class DefaultC4CCalculationService
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.service.AbstractService
-
- de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
-
- de.hybris.platform.order.impl.DefaultCalculationService
-
- de.hybris.platform.sap.c4c.order.impl.DefaultC4CCalculationService
-
- All Implemented Interfaces:
CalculationService,java.io.Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
public class DefaultC4CCalculationService extends DefaultCalculationService
Calculations Service implementation C4C Quote Calculation- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManager
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant
-
-
Constructor Summary
Constructors Constructor Description DefaultC4CCalculationService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcalculate(AbstractOrderModel order)Calculates the given order and all its entries unless they're already calculated and the order has not been modified.voidcalculateTotals(AbstractOrderModel order, boolean recalculate)(re)calculates all totals for the given order.protected voidcalculateTotals(AbstractOrderModel order, boolean recalculate, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)calculates all totals.voidrecalculate(AbstractOrderModel order)recalculates the whole order and all its entries.voidsetOrderRequireCalculationStrategy(OrderRequiresCalculationStrategy orderRequireCalculationStrategy)voidsetQuoteRequiresCalculationStrategy(C4CQuoteRequiresCalculationStrategy quoteRequiresCalculationStrategy)-
Methods inherited from class de.hybris.platform.order.impl.DefaultCalculationService
addAbsoluteEntryTaxValue, addRelativeEntryTaxValue, applyGrossMixedRate, applyNetMixedRate, calculate, calculateAbsoluteTotalTaxValue, calculateDiscountValues, calculateEntries, calculateSubtotal, calculateTotals, calculateTotalTaxValues, calculateTotalTaxValues, convertDiscountValues, convertPriceIfNecessary, findBasePrice, findDiscountValues, findGlobalDiscounts, findTaxValues, getTaxCorrectionFactor, getTaxFreeEntrySupport, getTaxFreeSubTotal, getUnappliedRelativeTaxValues, hasJaloStrategies, isAllEntriesTaxed, isTaxFreeEntrySupport, mustHandleTaxFreeEntries, recalculate, recalculate, recalculateOrderEntryIfNeeded, refreshOrder, requiresCalculation, resetAdditionalCosts, resetAllValues, resetAllValues, saveOrder, setCalculatedStatus, setCalculatedStatus, setCommonI18NService, setFindDeliveryCostStrategy, setFindDiscountsStrategies, setFindPaymentCostStrategy, setFindPriceStrategy, setFindTaxesStrategies, setOrderRequiresCalculationStrategy, setTaxFreeEntrySupport
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManager
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
-
-
-
Method Detail
-
calculate
public void calculate(AbstractOrderModel order) throws CalculationException
Description copied from interface:CalculationServiceCalculates the given order and all its entries unless they're already calculated and the order has not been modified.So this method will fetch prices, taxes and discounts (using spring configurable strategies) for uncalculated or modified entries only - all other will remain unchanged. If at least one entry has been calculated or the order itself has been modified the totals will be calculated as well.
if you merely like to adjust totals while keeping prices, taxes and discounts you should call
CalculationService.calculateTotals(AbstractOrderModel, boolean)instead (e.g. if just a quantity has changed or prices have been imported and cannot be found via price factory ).- Specified by:
calculatein interfaceCalculationService- Overrides:
calculatein classDefaultCalculationService- Parameters:
order- targetAbstractOrderModel- Throws:
CalculationException- if a pricefactory error occurred.
-
recalculate
public void recalculate(AbstractOrderModel order) throws CalculationException
Description copied from interface:CalculationServicerecalculates the whole order and all its entries. this includes finding prices, taxes, discounts, payment and delivery costs by calling the currently installed price factory.if you merely like to adjust totals while keeping prices, taxes and discounts you should call
CalculationService.calculateTotals(AbstractOrderModel, boolean)instead (e.g. if just a quantity has changed or prices have been imported and cannot be found via price factory ).- Specified by:
recalculatein interfaceCalculationService- Overrides:
recalculatein classDefaultCalculationService- Parameters:
order- targetAbstractOrderModel- Throws:
CalculationException- if a pricefactory error occurred.
-
calculateTotals
public void calculateTotals(AbstractOrderModel order, boolean recalculate) throws CalculationException
Description copied from interface:CalculationService(re)calculates all totals for the given order. This does not trigger price, tax and discount calculation but takes all currently set price, tax and discount values as base.- Specified by:
calculateTotalsin interfaceCalculationService- Overrides:
calculateTotalsin classDefaultCalculationService- Parameters:
order- targetAbstractOrderModelrecalculate- forces setting total even if order is marked as calculated- Throws:
CalculationException
-
calculateTotals
protected void calculateTotals(AbstractOrderModel order, boolean recalculate, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap) throws CalculationException
Description copied from class:DefaultCalculationServicecalculates all totals. this does not trigger price, tax and discount calculation but takes all currently set price, tax and discount values as base. this method requires the correct subtotal to be set before and the correct tax value map.- Overrides:
calculateTotalsin classDefaultCalculationServicerecalculate- if false calculation is done only if the calculated flag is not settaxValueMap- the map { tax value -> Double( sum of all entry totals for this tax ) } obtainable viaDefaultCalculationService.calculateSubtotal(AbstractOrderModel, boolean)- Throws:
CalculationException
-
setOrderRequireCalculationStrategy
public void setOrderRequireCalculationStrategy(OrderRequiresCalculationStrategy orderRequireCalculationStrategy)
-
setQuoteRequiresCalculationStrategy
public void setQuoteRequiresCalculationStrategy(C4CQuoteRequiresCalculationStrategy quoteRequiresCalculationStrategy)
-
-