public abstract class AbstractPriceFactory extends Extension implements PriceFactory
A PriceFactory is responsible for calculating product price quotes as well as order prices. This may include the calcuation of taxes and discounts.
The Hybris Platform core does not have any default price model implemented but usually ships one PriceFactory implementation (in form of an extension) within the installation package. So please refer to the available extension documentation about which features this price model provides.
To implement a PriceFactory at least the following methods have to be implemented:
getBasePrice(AbstractOrderEntry) - provides the base price for a
order entrygetProductPriceInformations(Product, Date, boolean) - provides all prices which apply to a
ProductgetProductTaxInformations(Product, Date) - provides all taxes which apply to a
ProductgetProductDiscountInformations(Product, Date, boolean) - provides all discounts which apply to a
ProductExtension.RestrictedLanguagesProvider, Extension.RightsProviderManager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator| Constructor and Description |
|---|
AbstractPriceFactory() |
| Modifier and Type | Method and Description |
|---|---|
ProductPriceInformations |
getAllPriceInformations(Product product,
Date date,
boolean net)
Deprecated.
please use
getAllPriceInformations(SessionContext, Product, Date, boolean) instead |
ProductPriceInformations |
getAllPriceInformations(SessionContext ctx,
Product product,
Date date,
boolean net)
Calculates a product price quote containing all applicable prices, discounts and taxes for the given product and
net/gross state.
|
abstract PriceValue |
getBasePrice(AbstractOrderEntry entry)
override to define the base price of an order entry
|
List |
getDiscountValues(AbstractOrder order)
override to define (global) discounts for an order.
|
List |
getDiscountValues(AbstractOrderEntry entry)
override to define discount values for an order entry.
|
static AbstractPriceFactory |
getInstance() |
List |
getProductDiscountInformations(Product product,
Date date,
boolean net)
Deprecated.
please use
getProductDiscountInformations(SessionContext, Product, Date, boolean) instead |
abstract List |
getProductDiscountInformations(SessionContext ctx,
Product product,
Date date,
boolean net)
override this to show all discounts which may apply to the given product
|
List |
getProductPriceInformations(Product product,
Date date,
boolean net)
Deprecated.
please use
getProductPriceInformations(SessionContext, Product, Date, boolean) instead |
abstract List |
getProductPriceInformations(SessionContext ctx,
Product product,
Date date,
boolean net)
Override this to show all prices available for the given product
|
List |
getProductTaxInformations(Product product,
Date date)
Deprecated.
please use
getProductTaxInformations(SessionContext, Product, Date) instead |
abstract List |
getProductTaxInformations(SessionContext ctx,
Product product,
Date date)
override this to show all taxes which apply to the given product
|
Collection |
getTaxValues(AbstractOrderEntry entry)
override to define tax values for an order entry.
|
boolean |
isNetUser(User user)
override to define whether a user should be treated as net or gross customer.
|
checkBeforeItemRemoval, createEssentialData, createProjectData, createSampleData, getCreatorDescription, getCreatorName, getCreatorParameterDefault, getCreatorParameterNames, getCreatorParameterPossibleValues, getDefaultAttributeModes, getName, getRemote, isCreatorDisabled, notifyInitializationEnd, notifyInitializationStart, notifyItemRemoval, onFirstSessionCreation, writeReplaceafterItemCreation, beforeItemCreation, destroy, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemoteManagerClass, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, init, setAttribute, setTenant, setTransientObject, unwrap, unwrap, wrappublic static AbstractPriceFactory getInstance()
@Deprecated public final ProductPriceInformations getAllPriceInformations(Product product, Date date, boolean net) throws JaloPriceFactoryException
getAllPriceInformations(SessionContext, Product, Date, boolean) insteadJaloPriceFactoryException - if a calculation error occuredpublic ProductPriceInformations getAllPriceInformations(SessionContext ctx, Product product, Date date, boolean net) throws JaloPriceFactoryException
This default implementation just calls getProductPriceInformations(Product, Date, boolean),
getProductTaxInformations(Product, Date) and
getProductDiscountInformations(Product, Date, boolean) and wraps the results inside a
ProductPriceInformations object.
Override to define the prices, taxes and discounts for all occasions when no order or order entry is available,
e.g. for product lists. Please take care also to override
getProductPriceInformations(Product, Date, boolean), getProductTaxInformations(Product, Date)
and getProductDiscountInformations(Product, Date, boolean) since these methods are called by
Product directly.
getAllPriceInformations in interface PriceFactoryJaloPriceFactoryException - if a calculation error occured@Deprecated public final List getProductPriceInformations(Product product, Date date, boolean net) throws JaloPriceFactoryException
getProductPriceInformations(SessionContext, Product, Date, boolean) insteadproduct - the productnet - the net/gross state of the requested pricesPriceInformation objectsJaloPriceFactoryException - if price calculation error occuredpublic abstract List getProductPriceInformations(SessionContext ctx, Product product, Date date, boolean net) throws JaloPriceFactoryException
getProductPriceInformations in interface PriceFactoryproduct - the productnet - the net/gross state of the requested pricesPriceInformation objectsJaloPriceFactoryException - if price calculation error occured@Deprecated public final List getProductTaxInformations(Product product, Date date) throws JaloPriceFactoryException
getProductTaxInformations(SessionContext, Product, Date) insteadproduct - the productTaxInformation objectsJaloPriceFactoryException - if price calculation error occuredpublic abstract List getProductTaxInformations(SessionContext ctx, Product product, Date date) throws JaloPriceFactoryException
getProductTaxInformations in interface PriceFactoryproduct - the productTaxInformation objectsJaloPriceFactoryException - if price calculation error occured@Deprecated public final List getProductDiscountInformations(Product product, Date date, boolean net) throws JaloPriceFactoryException
getProductDiscountInformations(SessionContext, Product, Date, boolean) insteadproduct - the productDiscountInformation objectsJaloPriceFactoryException - if price calculation error occuredpublic abstract List getProductDiscountInformations(SessionContext ctx, Product product, Date date, boolean net) throws JaloPriceFactoryException
getProductDiscountInformations in interface PriceFactoryproduct - the productDiscountInformation objectsJaloPriceFactoryException - if price calculation error occuredpublic boolean isNetUser(User user)
isNetUser in interface PriceFactorypublic Collection getTaxValues(AbstractOrderEntry entry) throws JaloPriceFactoryException
getTaxValues in interface PriceFactoryJaloPriceFactoryExceptionpublic abstract PriceValue getBasePrice(AbstractOrderEntry entry) throws JaloPriceFactoryException
getBasePrice in interface PriceFactoryJaloPriceFactoryExceptionpublic List getDiscountValues(AbstractOrderEntry entry) throws JaloPriceFactoryException
getDiscountValues in interface PriceFactoryJaloPriceFactoryExceptionpublic List getDiscountValues(AbstractOrder order) throws JaloPriceFactoryException
getDiscountValues(AbstractOrderEntry)getDiscountValues in interface PriceFactoryJaloPriceFactoryExceptionCopyright © 2017 SAP SE. All Rights Reserved.