Interface B2BCostCenterService<T,​U extends UserModel>

    • Method Detail

      • findCostCentersForUnitBranch

        @Deprecated(since="4.4")
        java.util.List<T> findCostCentersForUnitBranch​(U customer,
                                                       CurrencyModel currency)
        Deprecated.
        Gets all cost centers for given currency by looking at each unit of the branch and their cost centers.
        Parameters:
        customer - The logged in b2b customer
        currency - The sessions currency
        Returns:
        A collection of cost centers for the users branch.
      • getCostCentersForUnitBranch

        java.util.List<T> getCostCentersForUnitBranch​(U customer,
                                                      CurrencyModel currency)
        Gets all cost centers for given currency by looking at each unit of the branch and their cost centers.
        Parameters:
        customer - The logged in b2b customer
        currency - The sessions currency
        Returns:
        A collection of cost centers for the users branch.
      • findCostCentersForUnitBranch

        @Deprecated(since="4.4")
        java.util.List<T> findCostCentersForUnitBranch​(B2BUnitModel unit,
                                                       CurrencyModel currency)
        Deprecated.
        Gets all cost centers for given currency by looking at each unit of the branch and their cost centers.
        Parameters:
        unit - A b2b unit
        currency - The sessions currency
        Returns:
        A collection of cost centers for the users branch
      • getCostCentersForUnitBranch

        java.util.List<T> getCostCentersForUnitBranch​(B2BUnitModel unit,
                                                      CurrencyModel currency)
        Gets all cost centers for given currency by looking at each unit of the branch and their cost centers.
        Parameters:
        unit - A b2b unit
        currency - The sessions currency
        Returns:
        A collection of cost centers for the users branch.
      • findByCode

        @Deprecated(since="4.4")
        T findByCode​(java.lang.String code)
        Deprecated.
        As of hybris 4.4, replaced by getCostCenterForCode(String)
        Get cost center for a code.
        Parameters:
        code - the code
        Returns:
        the b2b cost center model
      • getCostCenterForCode

        T getCostCenterForCode​(java.lang.String code)
        Get cost center for a code.
        Parameters:
        code - the code
        Returns:
        the b2b cost center model
      • findAvailableCurrencies

        @Deprecated(since="4.4")
        java.util.Set<CurrencyModel> findAvailableCurrencies​(B2BUnitModel unit)
        Deprecated.
        As of hybris 4.4, replaced by getAvailableCurrencies(B2BUnitModel)
        Find available currencies based on a unit and cost centers associated to the unit.
        Parameters:
        unit - the unit
        Returns:
        A collection of currencies available to a unit.
      • getAvailableCurrencies

        java.util.Set<CurrencyModel> getAvailableCurrencies​(B2BUnitModel unit)
        Get available currencies based on a unit and cost centers associated to the unit.
        Parameters:
        unit - the unit
        Returns:
        A collection of currencies available to a unit.
      • findAvailableCurrencies

        @Deprecated(since="4.4")
        java.util.Set<CurrencyModel> findAvailableCurrencies​(UserModel user)
        Deprecated.
        As of hybris 4.4, replaced by getAvailableCurrencies(UserModel)
        Find available currencies based on a user
        Parameters:
        user - the session user.
        Returns:
        A collection of currencies available to a unit.
      • getAvailableCurrencies

        java.util.Set<CurrencyModel> getAvailableCurrencies​(UserModel user)
        Get available currencies based on a user
        Parameters:
        user - the session user.
        Returns:
        A collection of currencies available to a unit.
      • getTotalCost

        java.lang.Double getTotalCost​(T costCenter,
                                      java.util.Date startDate,
                                      java.util.Date endDate)
        Calculates the total cost for a cost center with a data range
        Parameters:
        costCenter - the cost center
        startDate - the start date
        endDate - the end date
        Returns:
        the total cost
      • findCostCenters

        @Deprecated(since="4.4")
        java.util.List<T> findCostCenters​(B2BUnitModel unit,
                                          CurrencyModel currency)
        Deprecated.
        As of hybris 4.4
        Find cost centers assigned to a given unit and currency.
        Parameters:
        unit - the unit
        currency - the currency
        Returns:
        the list
      • getB2BCostCenterForCode

        @Deprecated(since="4.4")
        B2BCostCenterModel getB2BCostCenterForCode​(java.lang.String code)
        Deprecated.
        Since 4.4. Use getCostCenterForCode(String) Returns B2BCostCenterMode of specified code. Returns null if none is found.
        Parameters:
        code -
        Returns:
        B2BCostCenterModel
      • isCostCenterExisting

        boolean isCostCenterExisting​(java.lang.String code)
        Checks whether the cost center exists regardless of visibility constraints
        Parameters:
        code -
        Returns:
        true if budget with this code exists
      • getB2BCostCenters

        java.util.Set<B2BCostCenterModel> getB2BCostCenters​(java.util.List<AbstractOrderEntryModel> entries)
        Collects all the cost centers linked to order entries into a single collection.
        Parameters:
        entries - Entries of an order
        Returns:
        A collections of all cost cetners associated to all order entries.
      • getAllCostCenters

        java.util.List<B2BCostCenterModel> getAllCostCenters()
        Returns all B2B Cost Centers to which the caller has visibility
        Returns:
        true if budget with this code exists