Class DefaultB2BCostCenterService
- java.lang.Object
-
- de.hybris.platform.b2b.services.impl.DefaultB2BCostCenterService
-
- All Implemented Interfaces:
B2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>
public class DefaultB2BCostCenterService extends java.lang.Object implements B2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>
Default implementation of theB2BCostCenterService- Spring Bean ID:
- b2bCostCenterService
-
-
Constructor Summary
Constructors Constructor Description DefaultB2BCostCenterService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.Set<CurrencyModel>findAvailableCurrencies(B2BUnitModel unit)Deprecated.Since 4.4.java.util.Set<CurrencyModel>findAvailableCurrencies(UserModel user)Deprecated.Since 4.4.B2BCostCenterModelfindByCode(java.lang.String code)Deprecated.Since 4.4.java.util.List<B2BCostCenterModel>findCostCenters(B2BUnitModel unit, CurrencyModel currency)Deprecated.Since 4.4.java.util.List<B2BCostCenterModel>findCostCentersForUnitBranch(B2BCustomerModel employee, CurrencyModel currency)Deprecated.Since 4.4.java.util.List<B2BCostCenterModel>findCostCentersForUnitBranch(B2BUnitModel unit, CurrencyModel currency)Deprecated.Since 4.4.java.util.List<B2BCostCenterModel>getAllCostCenters()Returns all B2B Cost Centers to which the caller has visibilityjava.util.Set<CurrencyModel>getAvailableCurrencies(B2BUnitModel unit)Get available currencies based on a unit and cost centers associated to the unit.java.util.Set<CurrencyModel>getAvailableCurrencies(UserModel user)Get available currencies based on a userprotected DefaultB2BBookingLineEntryDaogetB2bBookingLineEntryDao()protected B2BBudgetDaogetB2bBudgetDao()B2BBudgetModelgetB2BBudgetForCode(java.lang.String code)Deprecated.Since 6.0.java.util.Set<B2BBudgetModel>getB2BBudgets()Deprecated.Since 6.0.protected B2BCostCenterDaogetB2bCostCenterDao()B2BCostCenterModelgetB2BCostCenterForCode(java.lang.String code)Deprecated.Since 4.4.java.util.Set<B2BCostCenterModel>getB2BCostCenters(java.util.List<AbstractOrderEntryModel> entries)Collects all the cost centers linked to order entries into a single collection.protected B2BUnitService<B2BUnitModel,B2BCustomerModel>getB2bUnitService()B2BCostCenterModelgetCostCenterForCode(java.lang.String code)Get cost center for a code.java.util.List<B2BCostCenterModel>getCostCentersForUnitBranch(B2BCustomerModel employee, CurrencyModel currency)Gets all cost centers for given currency by looking at each unit of the branch and their cost centers.java.util.List<B2BCostCenterModel>getCostCentersForUnitBranch(B2BUnitModel unit, CurrencyModel currency)Gets all cost centers for given currency by looking at each unit of the branch and their cost centers.java.util.Collection<B2BBudgetModel>getCurrentBudgets(B2BCostCenterModel costCenter)Deprecated.Since 4.4.protected SearchRestrictionServicegetSearchRestrictionService()protected SessionServicegetSessionService()java.lang.DoublegetTotalCost(B2BCostCenterModel costCenter, java.util.Date startDate, java.util.Date endDate)Calculates the total cost for a cost center with a data rangebooleanisCostCenterExisting(java.lang.String code)Checks whether the cost center exists regardless of visibility constraintsvoidsetB2bBookingLineEntryDao(DefaultB2BBookingLineEntryDao b2bBookingLineEntryDao)voidsetB2bBudgetDao(B2BBudgetDao b2bBudgetDao)voidsetB2bCostCenterDao(B2BCostCenterDao b2bCostCenterDao)voidsetB2bUnitService(B2BUnitService<B2BUnitModel,B2BCustomerModel> b2bUnitService)voidsetSearchRestrictionService(SearchRestrictionService searchRestrictionService)voidsetSessionService(SessionService sessionService)
-
-
-
Method Detail
-
findCostCentersForUnitBranch
@Deprecated(since="4.4") public java.util.List<B2BCostCenterModel> findCostCentersForUnitBranch(B2BCustomerModel employee, CurrencyModel currency)
Deprecated.Since 4.4. UsegetCostCentersForUnitBranch(B2BCustomerModel, CurrencyModel)insteadDescription copied from interface:B2BCostCenterServiceGets all cost centers for given currency by looking at each unit of the branch and their cost centers.- Specified by:
findCostCentersForUnitBranchin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
employee- The logged in b2b customercurrency- The sessions currency- Returns:
- A collection of cost centers for the users branch.
-
getCostCentersForUnitBranch
public java.util.List<B2BCostCenterModel> getCostCentersForUnitBranch(B2BCustomerModel employee, CurrencyModel currency)
Description copied from interface:B2BCostCenterServiceGets all cost centers for given currency by looking at each unit of the branch and their cost centers.- Specified by:
getCostCentersForUnitBranchin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
employee- The logged in b2b customercurrency- The sessions currency- Returns:
- A collection of cost centers for the users branch.
-
findCostCentersForUnitBranch
@Deprecated(since="4.4") public java.util.List<B2BCostCenterModel> findCostCentersForUnitBranch(B2BUnitModel unit, CurrencyModel currency)
Deprecated.Since 4.4. UsegetCostCentersForUnitBranch(B2BUnitModel, CurrencyModel)insteadDescription copied from interface:B2BCostCenterServiceGets all cost centers for given currency by looking at each unit of the branch and their cost centers.- Specified by:
findCostCentersForUnitBranchin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
unit- A b2b unitcurrency- The sessions currency- Returns:
- A collection of cost centers for the users branch
-
getCostCentersForUnitBranch
public java.util.List<B2BCostCenterModel> getCostCentersForUnitBranch(B2BUnitModel unit, CurrencyModel currency)
Description copied from interface:B2BCostCenterServiceGets all cost centers for given currency by looking at each unit of the branch and their cost centers.- Specified by:
getCostCentersForUnitBranchin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
unit- A b2b unitcurrency- The sessions currency- Returns:
- A collection of cost centers for the users branch.
-
findCostCenters
@Deprecated(since="4.4") public java.util.List<B2BCostCenterModel> findCostCenters(B2BUnitModel unit, CurrencyModel currency)
Deprecated.Since 4.4.Description copied from interface:B2BCostCenterServiceFind cost centers assigned to a given unit and currency.- Specified by:
findCostCentersin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
unit- the unitcurrency- the currency- Returns:
- the list
-
getCurrentBudgets
@Deprecated(since="4.4") public java.util.Collection<B2BBudgetModel> getCurrentBudgets(B2BCostCenterModel costCenter)
Deprecated.- Specified by:
getCurrentBudgetsin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
costCenter- the cost center- Returns:
- the current budgets
-
findAvailableCurrencies
@Deprecated(since="4.4") public java.util.Set<CurrencyModel> findAvailableCurrencies(UserModel user)
Deprecated.Since 4.4. UsegetAvailableCurrencies(UserModel)insteadDescription copied from interface:B2BCostCenterServiceFind available currencies based on a user- Specified by:
findAvailableCurrenciesin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
user- the session user.- Returns:
- A collection of currencies available to a unit.
-
getAvailableCurrencies
public java.util.Set<CurrencyModel> getAvailableCurrencies(UserModel user)
Description copied from interface:B2BCostCenterServiceGet available currencies based on a user- Specified by:
getAvailableCurrenciesin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
user- the session user.- Returns:
- A collection of currencies available to a unit.
-
findAvailableCurrencies
@Deprecated(since="4.4") public java.util.Set<CurrencyModel> findAvailableCurrencies(B2BUnitModel unit)
Deprecated.Since 4.4. UsegetAvailableCurrencies(B2BUnitModel)insteadDescription copied from interface:B2BCostCenterServiceFind available currencies based on a unit and cost centers associated to the unit.- Specified by:
findAvailableCurrenciesin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
unit- the unit- Returns:
- A collection of currencies available to a unit.
-
getAvailableCurrencies
public java.util.Set<CurrencyModel> getAvailableCurrencies(B2BUnitModel unit)
Description copied from interface:B2BCostCenterServiceGet available currencies based on a unit and cost centers associated to the unit.- Specified by:
getAvailableCurrenciesin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
unit- the unit- Returns:
- A collection of currencies available to a unit.
-
isCostCenterExisting
public boolean isCostCenterExisting(java.lang.String code)
Description copied from interface:B2BCostCenterServiceChecks whether the cost center exists regardless of visibility constraints- Specified by:
isCostCenterExistingin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Returns:
- true if budget with this code exists
-
getB2BCostCenterForCode
@Deprecated(since="4.4") public B2BCostCenterModel getB2BCostCenterForCode(java.lang.String code)
Deprecated.Since 4.4. UseB2BCostCenterService.getCostCenterForCode(String)instead- Specified by:
getB2BCostCenterForCodein interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Returns:
- B2BCostCenterModel
- See Also:
B2BCostCenterService.getB2BCostCenterForCode(java.lang.String)
-
getTotalCost
public java.lang.Double getTotalCost(B2BCostCenterModel costCenter, java.util.Date startDate, java.util.Date endDate)
Description copied from interface:B2BCostCenterServiceCalculates the total cost for a cost center with a data range- Specified by:
getTotalCostin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
costCenter- the cost centerstartDate- the start dateendDate- the end date- Returns:
- the total cost
-
findByCode
@Deprecated(since="4.4") public B2BCostCenterModel findByCode(java.lang.String code)
Deprecated.Since 4.4. UsegetCostCenterForCode(String)insteadDescription copied from interface:B2BCostCenterServiceGet cost center for a code.- Specified by:
findByCodein interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
code- the code- Returns:
- the b2b cost center model
-
getCostCenterForCode
public B2BCostCenterModel getCostCenterForCode(java.lang.String code)
Description copied from interface:B2BCostCenterServiceGet cost center for a code.- Specified by:
getCostCenterForCodein interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
code- the code- Returns:
- the b2b cost center model
-
getAllCostCenters
public java.util.List<B2BCostCenterModel> getAllCostCenters()
Description copied from interface:B2BCostCenterServiceReturns all B2B Cost Centers to which the caller has visibility- Specified by:
getAllCostCentersin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Returns:
- true if budget with this code exists
-
getB2BBudgets
@Deprecated(since="4.4") public java.util.Set<B2BBudgetModel> getB2BBudgets()
Deprecated.Since 6.0. UseB2BBudgetService.getB2BBudgets()- Specified by:
getB2BBudgetsin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Returns:
B2BBudgetModelall B2BBudgets to which the caller has visiblity
-
getB2BBudgetForCode
@Deprecated(since="6.0") public B2BBudgetModel getB2BBudgetForCode(java.lang.String code)
Deprecated.Since 6.0. UseB2BBudgetService.getB2BBudgetForCode(String)Description copied from interface:B2BCostCenterServiceFindB2BBudgetModelof specified code. Returns null if none found.- Specified by:
getB2BBudgetForCodein interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
code- the code- Returns:
- the B2BBudget model
-
getB2BCostCenters
public java.util.Set<B2BCostCenterModel> getB2BCostCenters(java.util.List<AbstractOrderEntryModel> entries)
Description copied from interface:B2BCostCenterServiceCollects all the cost centers linked to order entries into a single collection.- Specified by:
getB2BCostCentersin interfaceB2BCostCenterService<B2BCostCenterModel,B2BCustomerModel>- Parameters:
entries- Entries of an order- Returns:
- A collections of all cost cetners associated to all order entries.
-
setB2bBookingLineEntryDao
public void setB2bBookingLineEntryDao(DefaultB2BBookingLineEntryDao b2bBookingLineEntryDao)
-
setB2bUnitService
public void setB2bUnitService(B2BUnitService<B2BUnitModel,B2BCustomerModel> b2bUnitService)
-
getB2bUnitService
protected B2BUnitService<B2BUnitModel,B2BCustomerModel> getB2bUnitService()
-
getB2bBookingLineEntryDao
protected DefaultB2BBookingLineEntryDao getB2bBookingLineEntryDao()
-
getSessionService
protected SessionService getSessionService()
-
setSessionService
public void setSessionService(SessionService sessionService)
-
getSearchRestrictionService
protected SearchRestrictionService getSearchRestrictionService()
-
setSearchRestrictionService
public void setSearchRestrictionService(SearchRestrictionService searchRestrictionService)
-
setB2bCostCenterDao
public void setB2bCostCenterDao(B2BCostCenterDao b2bCostCenterDao)
-
getB2bCostCenterDao
protected B2BCostCenterDao getB2bCostCenterDao()
-
setB2bBudgetDao
public void setB2bBudgetDao(B2BBudgetDao b2bBudgetDao)
-
getB2bBudgetDao
protected B2BBudgetDao getB2bBudgetDao()
-
-