public class DefaultB2BCreditLimitEvaluationStrategy extends AbstractEvaluationStrategy<B2BCreditLimitModel> implements EvaluateStrategy<Set<B2BMerchantCheckResultModel>,AbstractOrderModel,B2BCustomerModel>
AbstractService.SerializableDTOmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultB2BCreditLimitEvaluationStrategy() |
getTypeService, setTypeServicegetModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, setTenantScope, writeReplacepublic DefaultB2BCreditLimitEvaluationStrategy()
public Set<B2BMerchantCheckResultModel> evaluate(AbstractOrderModel order, B2BCustomerModel customer)
EvaluateStrategyevaluate in interface EvaluateStrategy<Set<B2BMerchantCheckResultModel>,AbstractOrderModel,B2BCustomerModel>order - the AbstractOrderModelcustomer - the B2BCustomerModelprotected B2BCreditLimitModel getCreditLimitForCostCenter(B2BCostCenterModel costCenter, CurrencyModel currency)
protected List<B2BCostCenterModel> getCostCentersForUnitWithCreditLimit(B2BUnitModel unit, CurrencyModel currency)
protected BigDecimal getTotalOfEntriesWithCostCenter(B2BCostCenterModel costCenter, List<AbstractOrderEntryModel> entries)
protected BigDecimal getOrderEntryTotal(AbstractOrderEntryModel entry)
protected BigDecimal getTotalTax(AbstractOrderEntryModel orderEntry)
protected Double getTotalCost(List<B2BCostCenterModel> costCenters, StandardDateRange standardDateRange)
public Set<B2BCreditLimitModel> getTypesToEvaluate(B2BCustomerModel customer, AbstractOrderModel order)
getTypesToEvaluate in class AbstractEvaluationStrategy<B2BCreditLimitModel>protected boolean shouldCreditLimitTriggerAlert(BigDecimal orderTotals, B2BCreditLimitModel creditLimit, StandardDateRange creditLimitDateRange)
orderTotals - the total amount of all orderscreditLimit - the limit type (currency or percentage) which also provides the limit amountprotected boolean alertSent(B2BCreditLimitModel creditLimit, StandardDateRange creditLimitDateRange)
creditLimit - Current credit limit to work oncreditLimitDateRange - Date range for current credit limitprotected StandardDateRange getDateRangeForCreditLimit(B2BCreditLimitModel creditLimit)
protected BigDecimal toMoney(Double orderTotal)
public void setB2bUnitService(B2BUnitService<B2BUnitModel,B2BCustomerModel> b2bUnitService)
public void setB2bCurrencyConversionService(B2BCurrencyConversionService b2bCurrencyConversionService)
protected B2BCurrencyConversionService getB2bCurrencyConversionService()
protected B2BUnitService<B2BUnitModel,B2BCustomerModel> getB2bUnitService()
protected B2BOrderDao getB2bOrderDao()
public void setB2bOrderDao(B2BOrderDao b2bOrderDao)
public B2BCostCenterService getB2bCostCenterService()
public void setB2bCostCenterService(B2BCostCenterService b2bCostCenterService)
protected B2BDateUtils getB2bDateUtils()
public void setB2bDateUtils(B2BDateUtils b2bDateUtils)
Copyright © 2017 SAP SE. All Rights Reserved.