Class CommerceDiscountLocalServiceUtil

java.lang.Object
com.liferay.commerce.discount.service.CommerceDiscountLocalServiceUtil

public class CommerceDiscountLocalServiceUtil extends Object
Provides the local service utility for CommerceDiscount. This utility wraps com.liferay.commerce.discount.service.impl.CommerceDiscountLocalServiceImpl and is an access point for service operations in application layer code running on the local server. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
See Also:
Generated:
  • Constructor Details

    • CommerceDiscountLocalServiceUtil

      public CommerceDiscountLocalServiceUtil()
  • Method Details

    • addCommerceDiscount

      public static CommerceDiscount addCommerceDiscount(CommerceDiscount commerceDiscount)
      Adds the commerce discount to the database. Also notifies the appropriate model listeners.

      Important: Inspect CommerceDiscountLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      commerceDiscount - the commerce discount
      Returns:
      the commerce discount that was added
    • addCommerceDiscount

      public static CommerceDiscount addCommerceDiscount(long userId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addCommerceDiscount

      public static CommerceDiscount addCommerceDiscount(long userId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, String level, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, boolean rulesConjunction, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addCommerceDiscount

      @Deprecated public static CommerceDiscount addCommerceDiscount(long userId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, String level, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, boolean rulesConjunction, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, String externalReferenceCode, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addCommerceDiscount

      @Deprecated public static CommerceDiscount addCommerceDiscount(long userId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, String level, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, int limitationTimesPerAccount, boolean rulesConjunction, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, String externalReferenceCode, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Deprecated.
      As of Cavanaugh (7.4.x), replaced by #addCommerceDiscount(String, long, String, String, boolean, String, boolean, BigDecimal, String, BigDecimal, BigDecimal, BigDecimal, BigDecimal, BigDecimal, String, int, int, boolean, boolean, int, int, int, int, int, int, int, int, int, int, boolean, ServiceContext)
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addCommerceDiscount

      public static CommerceDiscount addCommerceDiscount(String externalReferenceCode, long userId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, String level, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, boolean rulesConjunction, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addCommerceDiscount

      public static CommerceDiscount addCommerceDiscount(String externalReferenceCode, long userId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, String level, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, int limitationTimesPerAccount, boolean rulesConjunction, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addOrUpdateCommerceDiscount

      public static CommerceDiscount addOrUpdateCommerceDiscount(String externalReferenceCode, long userId, long commerceDiscountId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addOrUpdateCommerceDiscount

      public static CommerceDiscount addOrUpdateCommerceDiscount(String externalReferenceCode, long userId, long commerceDiscountId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, String level, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, boolean rulesConjunction, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • addOrUpdateCommerceDiscount

      public static CommerceDiscount addOrUpdateCommerceDiscount(String externalReferenceCode, long userId, long commerceDiscountId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, String level, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, int limitationTimesPerAccount, boolean rulesConjunction, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • checkCommerceDiscounts

      public static void checkCommerceDiscounts() throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • createCommerceDiscount

      public static CommerceDiscount createCommerceDiscount(long commerceDiscountId)
      Creates a new commerce discount with the primary key. Does not add the commerce discount to the database.
      Parameters:
      commerceDiscountId - the primary key for the new commerce discount
      Returns:
      the new commerce discount
    • createPersistedModel

      public static com.liferay.portal.kernel.model.PersistedModel createPersistedModel(Serializable primaryKeyObj) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • deleteCommerceDiscount

      public static CommerceDiscount deleteCommerceDiscount(CommerceDiscount commerceDiscount) throws com.liferay.portal.kernel.exception.PortalException
      Deletes the commerce discount from the database. Also notifies the appropriate model listeners.

      Important: Inspect CommerceDiscountLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      commerceDiscount - the commerce discount
      Returns:
      the commerce discount that was removed
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • deleteCommerceDiscount

      public static CommerceDiscount deleteCommerceDiscount(long commerceDiscountId) throws com.liferay.portal.kernel.exception.PortalException
      Deletes the commerce discount with the primary key from the database. Also notifies the appropriate model listeners.

      Important: Inspect CommerceDiscountLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      commerceDiscountId - the primary key of the commerce discount
      Returns:
      the commerce discount that was removed
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a commerce discount with the primary key could not be found
    • deleteCommerceDiscounts

      public static void deleteCommerceDiscounts(long companyId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • deletePersistedModel

      public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(com.liferay.portal.kernel.model.PersistedModel persistedModel) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • dslQuery

      public static <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
    • dslQueryCount

      public static int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
    • dynamicQuery

      public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery()
    • dynamicQuery

      public static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
      Performs a dynamic query on the database and returns the matching rows.
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the matching rows
    • dynamicQuery

      public static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end)
      Performs a dynamic query on the database and returns a range of the matching rows.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.commerce.discount.model.impl.CommerceDiscountModelImpl.

      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      Returns:
      the range of matching rows
    • dynamicQuery

      public static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator)
      Performs a dynamic query on the database and returns an ordered range of the matching rows.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.commerce.discount.model.impl.CommerceDiscountModelImpl.

      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the ordered range of matching rows
    • dynamicQueryCount

      public static long dynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
      Returns the number of rows matching the dynamic query.
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the number of rows matching the dynamic query
    • dynamicQueryCount

      public static long dynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, com.liferay.portal.kernel.dao.orm.Projection projection)
      Returns the number of rows matching the dynamic query.
      Parameters:
      dynamicQuery - the dynamic query
      projection - the projection to apply to the query
      Returns:
      the number of rows matching the dynamic query
    • fetchCommerceDiscount

      public static CommerceDiscount fetchCommerceDiscount(long commerceDiscountId)
    • fetchCommerceDiscountByExternalReferenceCode

      public static CommerceDiscount fetchCommerceDiscountByExternalReferenceCode(String externalReferenceCode, long companyId)
    • fetchCommerceDiscountByUuidAndCompanyId

      public static CommerceDiscount fetchCommerceDiscountByUuidAndCompanyId(String uuid, long companyId)
      Returns the commerce discount with the matching UUID and company.
      Parameters:
      uuid - the commerce discount's UUID
      companyId - the primary key of the company
      Returns:
      the matching commerce discount, or null if a matching commerce discount could not be found
    • fetchDefaultCommerceDiscount

      public static CommerceDiscount fetchDefaultCommerceDiscount(long commerceChannelAccountEntryRelId, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getAccountAndChannelAndOrderTypeCommerceDiscounts

      public static List<CommerceDiscount> getAccountAndChannelAndOrderTypeCommerceDiscounts(long commerceAccountId, long commerceChannelId, long commerceOrderTypeId, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getAccountAndChannelAndOrderTypeCommerceDiscounts

      public static List<CommerceDiscount> getAccountAndChannelAndOrderTypeCommerceDiscounts(long commerceAccountId, long commerceChannelId, long commerceOrderTypeId, String target)
    • getAccountAndChannelCommerceDiscounts

      public static List<CommerceDiscount> getAccountAndChannelCommerceDiscounts(long commerceAccountId, long commerceChannelId, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getAccountAndChannelCommerceDiscounts

      public static List<CommerceDiscount> getAccountAndChannelCommerceDiscounts(long commerceAccountId, long commerceChannelId, String target)
    • getAccountAndOrderTypeCommerceDiscounts

      public static List<CommerceDiscount> getAccountAndOrderTypeCommerceDiscounts(long commerceAccountId, long commerceOrderTypeId, String target)
    • getAccountCommerceAndOrderTypeDiscounts

      public static List<CommerceDiscount> getAccountCommerceAndOrderTypeDiscounts(long commerceAccountId, long commerceOrderTypeId, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getAccountCommerceDiscounts

      public static List<CommerceDiscount> getAccountCommerceDiscounts(long commerceAccountId, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getAccountCommerceDiscounts

      public static List<CommerceDiscount> getAccountCommerceDiscounts(long commerceAccountId, String target)
    • getAccountGroupAndChannelAndOrderTypeCommerceDiscount

      public static List<CommerceDiscount> getAccountGroupAndChannelAndOrderTypeCommerceDiscount(long[] commerceAccountGroupIds, long commerceChannelId, long commerceOrderTypeId, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getAccountGroupAndChannelAndOrderTypeCommerceDiscount

      public static List<CommerceDiscount> getAccountGroupAndChannelAndOrderTypeCommerceDiscount(long[] commerceAccountGroupIds, long commerceChannelId, long commerceOrderTypeId, String target)
    • getAccountGroupAndChannelCommerceDiscount

      public static List<CommerceDiscount> getAccountGroupAndChannelCommerceDiscount(long[] commerceAccountGroupIds, long commerceChannelId, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getAccountGroupAndChannelCommerceDiscount

      public static List<CommerceDiscount> getAccountGroupAndChannelCommerceDiscount(long[] commerceAccountGroupIds, long commerceChannelId, String target)
    • getAccountGroupAndOrderTypeCommerceDiscount

      public static List<CommerceDiscount> getAccountGroupAndOrderTypeCommerceDiscount(long[] commerceAccountGroupIds, long commerceOrderTypeId, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getAccountGroupAndOrderTypeCommerceDiscount

      public static List<CommerceDiscount> getAccountGroupAndOrderTypeCommerceDiscount(long[] commerceAccountGroupIds, long commerceOrderTypeId, String target)
    • getAccountGroupCommerceDiscount

      public static List<CommerceDiscount> getAccountGroupCommerceDiscount(long[] commerceAccountGroupIds, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getAccountGroupCommerceDiscount

      public static List<CommerceDiscount> getAccountGroupCommerceDiscount(long[] commerceAccountGroupIds, String target)
    • getActionableDynamicQuery

      public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery()
    • getActiveCommerceDiscount

      public static CommerceDiscount getActiveCommerceDiscount(long companyId, String couponCode, boolean active) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getActiveCommerceDiscountsCount

      public static int getActiveCommerceDiscountsCount(long companyId, String couponCode, boolean active)
    • getChannelAndOrderTypeCommerceDiscounts

      public static List<CommerceDiscount> getChannelAndOrderTypeCommerceDiscounts(long commerceChannelId, long commerceOrderTypeId, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getChannelAndOrderTypeCommerceDiscounts

      public static List<CommerceDiscount> getChannelAndOrderTypeCommerceDiscounts(long commerceChannelId, long commerceOrderTypeId, String target)
    • getChannelCommerceDiscounts

      public static List<CommerceDiscount> getChannelCommerceDiscounts(long commerceChannelId, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getChannelCommerceDiscounts

      public static List<CommerceDiscount> getChannelCommerceDiscounts(long commerceChannelId, String target)
    • getCommerceDiscount

      public static CommerceDiscount getCommerceDiscount(long commerceDiscountId) throws com.liferay.portal.kernel.exception.PortalException
      Returns the commerce discount with the primary key.
      Parameters:
      commerceDiscountId - the primary key of the commerce discount
      Returns:
      the commerce discount
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a commerce discount with the primary key could not be found
    • getCommerceDiscountByExternalReferenceCode

      public static CommerceDiscount getCommerceDiscountByExternalReferenceCode(String externalReferenceCode, long companyId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getCommerceDiscountByUuidAndCompanyId

      public static CommerceDiscount getCommerceDiscountByUuidAndCompanyId(String uuid, long companyId) throws com.liferay.portal.kernel.exception.PortalException
      Returns the commerce discount with the matching UUID and company.
      Parameters:
      uuid - the commerce discount's UUID
      companyId - the primary key of the company
      Returns:
      the matching commerce discount
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a matching commerce discount could not be found
    • getCommerceDiscounts

      public static List<CommerceDiscount> getCommerceDiscounts(int start, int end)
      Returns a range of all the commerce discounts.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.commerce.discount.model.impl.CommerceDiscountModelImpl.

      Parameters:
      start - the lower bound of the range of commerce discounts
      end - the upper bound of the range of commerce discounts (not inclusive)
      Returns:
      the range of commerce discounts
    • getCommerceDiscounts

      @Deprecated public static List<CommerceDiscount> getCommerceDiscounts(long companyId, String couponCode)
      Deprecated.
      As of Athanasius (7.3.x)
    • getCommerceDiscounts

      public static List<CommerceDiscount> getCommerceDiscounts(long companyId, String level, boolean active, int status)
    • getCommerceDiscountsCount

      public static int getCommerceDiscountsCount()
      Returns the number of commerce discounts.
      Returns:
      the number of commerce discounts
    • getCommerceDiscountsCount

      @Deprecated public static int getCommerceDiscountsCount(long companyId, String couponCode)
      Deprecated.
      As of Athanasius (7.3.x)
    • getCommerceDiscountsCountByPricingClassId

      public static int getCommerceDiscountsCountByPricingClassId(long commercePricingClassId, String title)
    • getExportActionableDynamicQuery

      public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext)
    • getIndexableActionableDynamicQuery

      public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
    • getOrderTypeCommerceDiscounts

      public static List<CommerceDiscount> getOrderTypeCommerceDiscounts(long commerceOrderTypeId, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getOrderTypeCommerceDiscounts

      public static List<CommerceDiscount> getOrderTypeCommerceDiscounts(long commerceOrderTypeId, String target)
    • getOSGiServiceIdentifier

      public static String getOSGiServiceIdentifier()
      Returns the OSGi service identifier.
      Returns:
      the OSGi service identifier
    • getPersistedModel

      public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(Serializable primaryKeyObj) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getPriceListCommerceDiscounts

      public static List<CommerceDiscount> getPriceListCommerceDiscounts(long[] commerceDiscountIds, long cpDefinitionId)
    • getUnqualifiedCommerceDiscounts

      public static List<CommerceDiscount> getUnqualifiedCommerceDiscounts(long companyId, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getUnqualifiedCommerceDiscounts

      public static List<CommerceDiscount> getUnqualifiedCommerceDiscounts(long companyId, String target)
    • getValidCommerceDiscountsCount

      public static int getValidCommerceDiscountsCount(long commerceDiscountId, long cpDefinitionId, long cpInstanceId, String unitOfMeasureKey)
    • getValidCommerceDiscountsCount

      public static int getValidCommerceDiscountsCount(long commerceAccountId, long[] commerceAccountGroupIds, long commerceChannelId, long commerceDiscountId)
    • incrementCommerceDiscountNumberOfUse

      public static CommerceDiscount incrementCommerceDiscountNumberOfUse(long commerceDiscountId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • searchByCommercePricingClassId

      public static List<CommerceDiscount> searchByCommercePricingClassId(long commercePricingClassId, String title, int start, int end)
    • searchCommerceDiscounts

      public static com.liferay.portal.kernel.search.BaseModelSearchResult<CommerceDiscount> searchCommerceDiscounts(long companyId, long[] groupIds, String keywords, int status, int start, int end, com.liferay.portal.kernel.search.Sort sort) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • searchCommerceDiscounts

      public static com.liferay.portal.kernel.search.BaseModelSearchResult<CommerceDiscount> searchCommerceDiscounts(com.liferay.portal.kernel.search.SearchContext searchContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateCommerceDiscount

      public static CommerceDiscount updateCommerceDiscount(CommerceDiscount commerceDiscount)
      Updates the commerce discount in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

      Important: Inspect CommerceDiscountLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      commerceDiscount - the commerce discount
      Returns:
      the commerce discount that was updated
    • updateCommerceDiscount

      public static CommerceDiscount updateCommerceDiscount(long commerceDiscountId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateCommerceDiscount

      public static CommerceDiscount updateCommerceDiscount(long commerceDiscountId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, String level, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, boolean rulesConjunction, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateCommerceDiscount

      public static CommerceDiscount updateCommerceDiscount(long commerceDiscountId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, String level, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, int limitationTimesPerAccount, boolean rulesConjunction, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateCommerceDiscountExternalReferenceCode

      @Deprecated public static CommerceDiscount updateCommerceDiscountExternalReferenceCode(long commerceDiscountId, String externalReferenceCode) throws com.liferay.portal.kernel.exception.PortalException
      Deprecated.
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateCommerceDiscountExternalReferenceCode

      public static CommerceDiscount updateCommerceDiscountExternalReferenceCode(String externalReferenceCode, long commerceDiscountId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • updateStatus

      public static CommerceDiscount updateStatus(long userId, long commerceDiscountId, int status, com.liferay.portal.kernel.service.ServiceContext serviceContext, Map<String,Serializable> workflowContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • upsertCommerceDiscount

      @Deprecated public static CommerceDiscount upsertCommerceDiscount(long userId, long commerceDiscountId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, String externalReferenceCode, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • upsertCommerceDiscount

      @Deprecated public static CommerceDiscount upsertCommerceDiscount(long userId, long commerceDiscountId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, String level, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, boolean rulesConjunction, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, String externalReferenceCode, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • upsertCommerceDiscount

      @Deprecated public static CommerceDiscount upsertCommerceDiscount(long userId, long commerceDiscountId, String title, String target, boolean useCouponCode, String couponCode, boolean usePercentage, BigDecimal maximumDiscountAmount, String level, BigDecimal level1, BigDecimal level2, BigDecimal level3, BigDecimal level4, String limitationType, int limitationTimes, int limitationTimesPerAccount, boolean rulesConjunction, boolean active, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute, String externalReferenceCode, boolean neverExpire, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • getService

      public static CommerceDiscountLocalService getService()