Class Europe1PriceFactory
- java.lang.Object
-
- de.hybris.platform.jalo.Manager
-
- de.hybris.platform.jalo.extension.Extension
-
- de.hybris.platform.jalo.order.price.AbstractPriceFactory
-
- de.hybris.platform.europe1.jalo.GeneratedEurope1PriceFactory
-
- de.hybris.platform.europe1.jalo.Europe1PriceFactory
-
- All Implemented Interfaces:
ItemLifecycleListener,PriceFactory,java.io.Serializable
- Direct Known Subclasses:
CatalogAwareEurope1PriceFactory
public class Europe1PriceFactory extends GeneratedEurope1PriceFactory
The Europe1 price factory extension. This extension provides price, tax and discount assignment by using pricerow, taxrow and discountrow objects. Each object represents an assignment of a price (or tax, or discount ) to a product, or user or both in combination.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classEurope1PriceFactory.CachedTaxprotected static classEurope1PriceFactory.CachedTaxValueprotected classEurope1PriceFactory.DiscountRowMatchComparatorUsed for ordering discount rows in discount priority order.protected classEurope1PriceFactory.PriceRowInfoComparatorUsed for ordering price rows in best match order.protected classEurope1PriceFactory.PriceRowMatchComparatorUsed for ordering price rows in best match order.protected classEurope1PriceFactory.TaxRowMatchComparatorUsed for ordering discount rows in discount priority order.-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.extension.Extension
Extension.RestrictedLanguagesProvider, Extension.RightsProvider
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.Manager
Manager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator
-
-
Field Summary
Fields Modifier and Type Field Description static longMATCH_ANYstatic longMATCH_BY_PRODUCT_IDstatic java.lang.StringUSE_FAST_ALGORITHMSEnables/disabled fast query mode for getting product price, tax and discount rows.-
Fields inherited from class de.hybris.platform.europe1.jalo.GeneratedEurope1PriceFactory
DEFAULT_INITIAL_ATTRIBUTES, PRODUCT2OWNEUROPE1DISCOUNTSOWNEUROPE1DISCOUNTSHANDLER, PRODUCT2OWNEUROPE1PRICESOWNEUROPE1PRICESHANDLER, PRODUCT2OWNEUROPE1TAXESOWNEUROPE1TAXESHANDLER, USER2OWNEUROPE1DISCOUNTSOWNEUROPE1DISCOUNTSHANDLER
-
-
Constructor Summary
Constructors Constructor Description Europe1PriceFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.util.DateadjustDate(java.util.Date date)Cut (set to zero) specific parts of a Date field to allow caching of time based pricing.protected voidappendProductConditions(java.lang.StringBuilder query, java.lang.String alias, Product product, EnumerationValue productGroup, java.util.Map values, java.lang.String pgConstant)protected voidappendUserConditions(java.lang.StringBuilder query, java.lang.String alias, User user, EnumerationValue userGroup, java.util.Map values, java.lang.String ugConst)voidbeforeItemCreation(SessionContext ctx, ComposedType type, Item.ItemAttributeMap attributes)This method will be called before an item is created BUT AFTER the default values of this type are assignedvoidcheckAllDiscountRows()Deprecated.since agesvoidcheckAllDiscountRows(SessionContext ctx)Deprecated.since agesvoidcheckAllGlobalDiscountRows()Deprecated.since agesvoidcheckAllGlobalDiscountRows(SessionContext ctx)Deprecated.since agesvoidcheckAllPriceRows()Deprecated.since agesvoidcheckAllPriceRows(SessionContext ctx)Deprecated.since agesvoidcheckAllTaxRows()Deprecated.since agesvoidcheckAllTaxRows(SessionContext ctx)Deprecated.since agesprotected voidcheckBeforeItemRemoval(SessionContext ctx, Item item)Superclass method overridden to avoid call to EJB layerDiscountRowcreateDiscountRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Currency currency, java.lang.Double value, DateRange dateRange, Discount discount)Creates a new DiscountRow.DiscountRowcreateDiscountRow(SessionContext ctx, Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Currency currency, java.lang.Double value, DateRange dateRange, Discount discount)Same as createDiscountRow(Product,String,User,String,Currency,boolean,double,DateRange,Discount)} but for a specific SessionContext.voidcreateEssentialData(java.util.Map params, JspContext jspc)GlobalDiscountRowcreateGlobalDiscountRow(SessionContext ctx, User user, EnumerationValue userPriceGroup, Currency currency, java.lang.Double value, DateRange dateRange, Discount discount)Same as createGlobalDiscountRow(User,String,Currency,boolean,double,DateRange,Discount)} but for a specific SessionContext.GlobalDiscountRowcreateGlobalDiscountRow(User user, EnumerationValue userPriceGroup, Currency currency, java.lang.Double value, DateRange dateRange, Discount discount)Creates a new global DiscountRow.PriceRowcreatePriceRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, long minQuantity, Currency currency, Unit unit, int unitFactor, boolean net, DateRange dateRange, double price)Creates a new PriceRow.PriceRowcreatePriceRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, long minQuantity, Currency currency, Unit unit, int unitFactor, boolean net, DateRange dateRange, double price, EnumerationValue channel)Overloaded method to support Channel dimension to PriceRow.PriceRowcreatePriceRow(SessionContext ctx, Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, long minQuantity, Currency currency, Unit unit, int unitFactor, boolean net, DateRange dateRange, double price)Same ascreatePriceRow(Product, EnumerationValue, User, EnumerationValue, long, Currency, Unit, int, boolean, DateRange, double)but with specific SessionContext.PriceRowcreatePriceRow(SessionContext ctx, Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, long minQuantity, Currency currency, Unit unit, int unitFactor, boolean net, DateRange dateRange, double price, EnumerationValue channel)Same ascreatePriceRow(Product, EnumerationValue, User, EnumerationValue, long, Currency, Unit, int, boolean, DateRange, double, EnumerationValue)but with specific SessionContext.EnumerationValuecreateProductTaxGroup(java.lang.String code)voidcreateProjectData(java.util.Map params, JspContext jspc)TaxRowcreateTaxRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Tax tax)Deprecated.since ages - please usecreateTaxRow(Product, EnumerationValue, User, EnumerationValue, Tax, DateRange, Double)to specify all values ( here DateRange and Value are set tonull)TaxRowcreateTaxRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Tax tax, DateRange dateRange, java.lang.Double value)Creates a new TaxRow.TaxRowcreateTaxRow(SessionContext ctx, Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Tax tax, DateRange dateRange, java.lang.Double value)Same as createTaxRow(Product,String,User,String,Tax,boolean)} but for a specific SessionContext.EnumerationValuecreateUserPriceGroup(java.lang.String code)EnumerationValuecreateUserTaxGroup(java.lang.String code)protected java.lang.StringextractProductId(Product product)protected java.lang.StringextractProductId(SessionContext ctx, Product product)protected voidfillTaxCache()Fills private cache with catalog version aware tax entriesprotected java.util.List<? extends AbstractDiscountRow>filterDiscountRows4Price(java.util.Collection<? extends AbstractDiscountRow> rows, java.util.Date date)Filters discount rows which do not match the given parameters.protected java.util.List<PriceRow>filterPriceRows(java.util.List<PriceRow> priceRows)Removes price rows from set of matching rows if they will never be applicable.protected java.util.List<PriceRow>filterPriceRows4Info(java.util.Collection<PriceRow> rows, Currency curr, java.util.Date date, PriceRowChannel channel)Filters price rows which do not match the given parameters.protected java.util.List<PriceRow>filterPriceRows4Price(java.util.Collection<PriceRow> rows, long _quantity, Unit unit, Currency curr, java.util.Date date, boolean giveAwayMode, PriceRowChannel channel)Filters price rows which do not match the given parameters.protected java.util.List<TaxRow>filterTaxRows4Price(java.util.Collection<TaxRow> rows, java.util.Date date)Filters tax rows which do not match the given parameters.ProductPriceInformationsgetAllPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)Calculates a product price quote containing all applicable prices, discounts and taxes for the given product and net/gross state.PriceValuegetBasePrice(AbstractOrderEntry entry)override to define the base price of an order entryprotected java.util.Collection<Europe1PriceFactory.CachedTaxValue>getCachedTaxes(Product product, EnumerationValue productTaxGroup, User user, EnumerationValue userTaxGroup, java.util.Date date)Reads the private cache of catalog version aware tax entries.protected DiscountRowgetCounterpartItem(SessionContext ctx, DiscountRow discountrow, CatalogVersion targetVersion)protected PriceRowgetCounterpartItem(SessionContext ctx, PriceRow pricerow, CatalogVersion targetVersion)protected TaxRowgetCounterpartItem(SessionContext ctx, TaxRow taxrow, CatalogVersion targetVersion)protected java.util.ListgetDiscountInformations(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency curr, java.util.Date date)java.util.ListgetDiscountValues(AbstractOrder order)override to define (global) discounts for an order.java.util.ListgetDiscountValues(AbstractOrderEntry entry)override to define discount values for an order entry.protected EnumerationValuegetEnumFromContextOrItem(SessionContext ctx, ExtensibleItem item, java.lang.String qualifier)Helper method to fetch a (price)group enumeration value from context and as fallback from the provided item.protected EnumerationValuegetEnumFromGroups(User user, java.lang.String attribute)java.util.Collection<DiscountRow>getEurope1Discounts(Product item)java.util.Collection<DiscountRow>getEurope1Discounts(SessionContext ctx, Product product)Attribute getter for Product.europe1discounts.java.util.Collection<GlobalDiscountRow>getEurope1Discounts(SessionContext ctx, User user)Attribute getter for User.europe1discounts.java.util.Collection<GlobalDiscountRow>getEurope1Discounts(User user)java.util.Collection<PriceRow>getEurope1Prices(Product item)java.util.Collection<PriceRow>getEurope1Prices(SessionContext ctx, Product product)Attribute getter for Product.europe1prices.java.util.Collection<TaxRow>getEurope1Taxes(Product item)java.util.Collection<TaxRow>getEurope1Taxes(SessionContext ctx, Product product)Attribute getter for Product.europe1taxes.static Europe1PriceFactorygetInstance()protected EnumerationValuegetPDG(SessionContext ctx, AbstractOrderEntry entry)EnumerationValuegetPDG(SessionContext ctx, Product product)protected PDTRowsQueryBuildergetPDTRowsQueryBuilderFor(java.lang.String type)Creates query builder for given PDT row typeprotected EnumerationValuegetPPG(SessionContext ctx, AbstractOrderEntry entry)EnumerationValuegetPPG(SessionContext ctx, Product product)protected java.util.ListgetPriceInformations(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency curr, boolean net, java.util.Date date, java.util.Collection taxValues)java.util.ListgetProductDiscountInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)override this to show all discounts which may apply to the given productjava.util.CollectiongetProductDiscountRows(Product product, EnumerationValue productGroup)java.util.CollectiongetProductDiscountRows(SessionContext ctx, Product product, EnumerationValue productGroup)java.util.CollectiongetProductDiscountRowsFast(SessionContext ctx, Product product, EnumerationValue productGroup)java.util.ListgetProductPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)Override this to show all prices available for the given productjava.util.CollectiongetProductPriceRows(Product product, EnumerationValue productGroup)Returns collection of all price rows for the specified product and price group.java.util.CollectiongetProductPriceRows(SessionContext ctx, Product product, EnumerationValue productGroup)Returns collection of all price rows for the specified product and price group.java.util.CollectiongetProductPriceRowsFast(SessionContext ctx, Product product, EnumerationValue productGroup)Returns collection of all price rows for the specified product and price group.EnumerationValuegetProductTaxGroup(java.lang.String code)java.util.ListgetProductTaxInformations(SessionContext ctx, Product product, java.util.Date date)override this to show all taxes which apply to the given productjava.util.CollectiongetProductTaxRows(Product product, EnumerationValue productGroup)java.util.CollectiongetProductTaxRows(SessionContext ctx, Product product, EnumerationValue productGroup)java.util.CollectiongetProductTaxRowsFast(SessionContext ctx, Product product, EnumerationValue productGroup)protected EnumerationValuegetPTG(SessionContext ctx, AbstractOrderEntry entry)EnumerationValuegetPTG(SessionContext ctx, Product product)java.util.Collection<PriceRow>getRealPartOfPriceRows(SessionContext ctx, Product product, EnumerationValue productGroup)Returns collection of all price rows for the specified product and price group.protected java.util.Collection<Europe1PriceFactory.CachedTaxValue>getSuperCachedTaxes(Product product, EnumerationValue productTaxGroup, User user, EnumerationValue userTaxGroup, java.util.Date date)protected java.util.ListgetTaxInformations(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, java.util.Date date)java.util.CollectiongetTaxValues(AbstractOrderEntry entry)override to define tax values for an order entry.protected EnumerationValuegetUDG(SessionContext ctx, AbstractOrder order)protected EnumerationValuegetUDG(SessionContext ctx, AbstractOrderEntry entry)EnumerationValuegetUDG(SessionContext ctx, User user)protected EnumerationValuegetUPG(SessionContext ctx, AbstractOrder order)protected EnumerationValuegetUPG(SessionContext ctx, AbstractOrderEntry entry)EnumerationValuegetUPG(SessionContext ctx, User user)java.util.CollectiongetUserGlobalDiscountRows(User user, EnumerationValue userGroup)EnumerationValuegetUserPriceGroup(java.lang.String code)EnumerationValuegetUserTaxGroup(java.lang.String code)protected EnumerationValuegetUTG(SessionContext ctx, AbstractOrder order)protected EnumerationValuegetUTG(SessionContext ctx, AbstractOrderEntry entry)EnumerationValuegetUTG(SessionContext ctx, User user)voidinit()called once for each tenant, so this method fits best to perform some initialization stuffprotected voidinvalidateTaxCache()protected booleanisCachingTaxes()booleanisCreatorDisabled()Part ofDataCreatorinterface.java.util.ListmatchDiscountRows(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency curr, java.util.Date date, int maxCount)PriceRowmatchPriceRowForPrice(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, long qtd, Unit unit, Currency currency, java.util.Date date, boolean net, boolean giveAwayMode)matches price rows by product or product group, user or user group, min quantity, currency and daterange.java.util.List<PriceRow>matchPriceRowsForInfo(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency currency, java.util.Date date, boolean net)java.util.ListmatchTaxRows(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, java.util.Date date, int maxCount)protected voidnotifyItemRemoval(SessionContext ctx, Item item)Avoids calls to ejb layer exceptprotected java.util.Collection<? extends AbstractDiscountRow>queryDiscounts4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup)Runs database query for fetching discount rows for calculating entry and order discount values.protected java.util.Collection<PriceRow>queryPriceRows4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup)protected java.util.Collection<PriceRow>queryPriceRows4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, java.util.Date date, Currency currency, boolean giveAwayMode)Runs database query for fetching price rows for calculating base prices.protected java.util.Collection<TaxRow>queryTax4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup)protected voidremoveRowsFor(SessionContext ctx, Currency currency)protected voidremoveRowsFor(SessionContext ctx, EnumerationValue enumerationValue)protected voidremoveRowsFor(SessionContext ctx, Discount discount)protected voidremoveRowsFor(SessionContext ctx, Tax tax)protected voidremoveRowsFor(SessionContext ctx, Product product)protected voidremoveRowsFor(SessionContext ctx, Unit unit)protected voidremoveRowsFor(SessionContext ctx, User user)voidsetEurope1Discounts(Product product, java.util.Collection discounts)voidsetEurope1Discounts(SessionContext ctx, Product item, java.util.Collection discounts)Attribute setter for Product.europe1discounts.voidsetEurope1Discounts(SessionContext ctx, User user, java.util.Collection discounts)Attribute setter for User.europe1discounts.voidsetEurope1Discounts(User user, java.util.Collection discounts)voidsetEurope1Prices(Product item, java.util.Collection<PriceRow> value)voidsetEurope1Prices(SessionContext ctx, Product item, java.util.Collection prices)Attribute setter for Product.europe1prices.voidsetEurope1Taxes(Product item, java.util.Collection<TaxRow> value)voidsetEurope1Taxes(SessionContext ctx, Product item, java.util.Collection taxes)Attribute setter for Product.europe1taxes.voidsetRetrieveChannelStrategy(RetrieveChannelStrategy retrieveChannelStrategy)protected java.util.Collection<TaxRow>superQueryTax4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup)Runs database query for fetching tax rows for calculating entry and order discount values.-
Methods inherited from class de.hybris.platform.europe1.jalo.GeneratedEurope1PriceFactory
addToOwnEurope1Discounts, addToOwnEurope1Discounts, addToOwnEurope1Discounts, addToOwnEurope1Discounts, addToOwnEurope1Prices, addToOwnEurope1Prices, addToOwnEurope1Taxes, addToOwnEurope1Taxes, createDiscountRow, createDiscountRow, createGlobalDiscountRow, createGlobalDiscountRow, createPriceRow, createPriceRow, createTaxRow, createTaxRow, getDefaultAttributeModes, getEurope1PriceFactory_PDG, getEurope1PriceFactory_PDG, getEurope1PriceFactory_PDG, getEurope1PriceFactory_PDG, getEurope1PriceFactory_PPG, getEurope1PriceFactory_PPG, getEurope1PriceFactory_PPG, getEurope1PriceFactory_PPG, getEurope1PriceFactory_PTG, getEurope1PriceFactory_PTG, getEurope1PriceFactory_PTG, getEurope1PriceFactory_PTG, getEurope1PriceFactory_UDG, getEurope1PriceFactory_UDG, getEurope1PriceFactory_UDG, getEurope1PriceFactory_UDG, getEurope1PriceFactory_UPG, getEurope1PriceFactory_UPG, getEurope1PriceFactory_UPG, getEurope1PriceFactory_UPG, getEurope1PriceFactory_UTG, getEurope1PriceFactory_UTG, getEurope1PriceFactory_UTG, getEurope1PriceFactory_UTG, getName, getOwnEurope1Discounts, getOwnEurope1Discounts, getOwnEurope1Discounts, getOwnEurope1Discounts, getOwnEurope1Prices, getOwnEurope1Prices, getOwnEurope1Taxes, getOwnEurope1Taxes, getUserDiscountGroup, getUserDiscountGroup, getUserPriceGroup, getUserPriceGroup, getUserTaxGroup, getUserTaxGroup, removeFromOwnEurope1Discounts, removeFromOwnEurope1Discounts, removeFromOwnEurope1Discounts, removeFromOwnEurope1Discounts, removeFromOwnEurope1Prices, removeFromOwnEurope1Prices, removeFromOwnEurope1Taxes, removeFromOwnEurope1Taxes, setEurope1PriceFactory_PDG, setEurope1PriceFactory_PDG, setEurope1PriceFactory_PDG, setEurope1PriceFactory_PDG, setEurope1PriceFactory_PPG, setEurope1PriceFactory_PPG, setEurope1PriceFactory_PPG, setEurope1PriceFactory_PPG, setEurope1PriceFactory_PTG, setEurope1PriceFactory_PTG, setEurope1PriceFactory_PTG, setEurope1PriceFactory_PTG, setEurope1PriceFactory_UDG, setEurope1PriceFactory_UDG, setEurope1PriceFactory_UDG, setEurope1PriceFactory_UDG, setEurope1PriceFactory_UPG, setEurope1PriceFactory_UPG, setEurope1PriceFactory_UPG, setEurope1PriceFactory_UPG, setEurope1PriceFactory_UTG, setEurope1PriceFactory_UTG, setEurope1PriceFactory_UTG, setEurope1PriceFactory_UTG, setOwnEurope1Discounts, setOwnEurope1Discounts, setOwnEurope1Discounts, setOwnEurope1Discounts, setOwnEurope1Prices, setOwnEurope1Prices, setOwnEurope1Taxes, setOwnEurope1Taxes, setUserDiscountGroup, setUserDiscountGroup, setUserPriceGroup, setUserPriceGroup, setUserTaxGroup, setUserTaxGroup
-
Methods inherited from class de.hybris.platform.jalo.order.price.AbstractPriceFactory
getAllPriceInformations, getProductDiscountInformations, getProductPriceInformations, getProductTaxInformations, isNetUser
-
Methods inherited from class de.hybris.platform.jalo.extension.Extension
createSampleData, getCreatorDescription, getCreatorName, getCreatorParameterDefault, getCreatorParameterNames, getCreatorParameterPossibleValues, getRemote, notifyInitializationEnd, notifyInitializationStart, onFirstSessionCreation, writeReplace
-
Methods inherited from class de.hybris.platform.jalo.Manager
afterItemCreation, destroy, extractNonRequiredRemoteFromItem, extractRequiredRemoteFromItem, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemoteManagerClass, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, setAttribute, setTenant, setTransientObject, wrap
-
-
-
-
Field Detail
-
MATCH_ANY
public static final long MATCH_ANY
-
MATCH_BY_PRODUCT_ID
public static final long MATCH_BY_PRODUCT_ID
-
USE_FAST_ALGORITHMS
public static final java.lang.String USE_FAST_ALGORITHMS
Enables/disabled fast query mode for getting product price, tax and discount rows. Use as session context parameter. Default istrue- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static Europe1PriceFactory getInstance()
-
init
public void init()
Description copied from class:Managercalled once for each tenant, so this method fits best to perform some initialization stuff
-
invalidateTaxCache
protected void invalidateTaxCache()
-
checkBeforeItemRemoval
protected void checkBeforeItemRemoval(SessionContext ctx, Item item) throws ConsistencyCheckException
Superclass method overridden to avoid call to EJB layer- Overrides:
checkBeforeItemRemovalin classExtension- Parameters:
ctx- the current session contextitem- the item which should be removed- Throws:
ConsistencyCheckException- thrown to abort removal due to consistency errors- Since:
- 2.10
-
notifyItemRemoval
protected void notifyItemRemoval(SessionContext ctx, Item item)
Avoids calls to ejb layer except- Overrides:
notifyItemRemovalin classExtension- Parameters:
ctx- the currency session contextitem- the item which is going to be removed- Since:
- 2.10
-
removeRowsFor
protected void removeRowsFor(SessionContext ctx, Product product) throws ConsistencyCheckException
- Throws:
ConsistencyCheckException
-
removeRowsFor
protected void removeRowsFor(SessionContext ctx, User user) throws ConsistencyCheckException
- Throws:
ConsistencyCheckException
-
removeRowsFor
protected void removeRowsFor(SessionContext ctx, Currency currency) throws ConsistencyCheckException
- Throws:
ConsistencyCheckException
-
removeRowsFor
protected void removeRowsFor(SessionContext ctx, Unit unit) throws ConsistencyCheckException
- Throws:
ConsistencyCheckException
-
removeRowsFor
protected void removeRowsFor(SessionContext ctx, Tax tax) throws ConsistencyCheckException
- Throws:
ConsistencyCheckException
-
removeRowsFor
protected void removeRowsFor(SessionContext ctx, Discount discount) throws ConsistencyCheckException
- Throws:
ConsistencyCheckException
-
removeRowsFor
protected void removeRowsFor(SessionContext ctx, EnumerationValue enumerationValue) throws ConsistencyCheckException
- Throws:
ConsistencyCheckException
-
createPriceRow
public PriceRow createPriceRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, long minQuantity, Currency currency, Unit unit, int unitFactor, boolean net, DateRange dateRange, double price) throws JaloPriceFactoryException
Creates a new PriceRow. Allnullvalues mean all resp. allways. Please note that either user or userPriceGroup will be applied but never both. So it makes no sense to specify a group is the user is already present. Same thing with product and productPriceGroup.- Parameters:
product- the product which will be priced by this row (may be null)productPriceGroup- the product price group which will be priced by this row (may be null)user- the user whose special price is represented by this row (may be null)userPriceGroup- the user price group which special price is represented by this row (may be null)minQuantity- the minimum quantity for which this price is applicable ( > 0 )currency- the Currency for which this price is applicable (not null)unit- the Unit for which this price is applicable (not null)unitFactor- parameter to handle small prices:baseprice = price / unitFactornet- defines if this price should be seen as including or excluding taxesdateRange- the DateRange when this price is applicable (may be null)price- the price (may contain more digits than actually possible with this currency)- Returns:
- the new
PriceRow - Throws:
JaloPriceFactoryException
-
createPriceRow
public PriceRow createPriceRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, long minQuantity, Currency currency, Unit unit, int unitFactor, boolean net, DateRange dateRange, double price, EnumerationValue channel) throws JaloPriceFactoryException
Overloaded method to support Channel dimension to PriceRow.Creates a new PriceRow. All
nullvalues mean all resp. allways. Please note that either user or userPriceGroup will be applied but never both. So it makes no sense to specify a group is the user is already present. Same thing with product and productPriceGroup.- Parameters:
product- the product which will be priced by this row (may be null)productPriceGroup- the product price group which will be priced by this row (may be null)user- the user whose special price is represented by this row (may be null)userPriceGroup- the user price group which special price is represented by this row (may be null)minQuantity- the minimum quantity for which this price is applicable ( > 0 )currency- the Currency for which this price is applicable (not null)unit- the Unit for which this price is applicable (not null)unitFactor- parameter to handle small prices:baseprice = price / unitFactornet- defines if this price should be seen as including or excluding taxesdateRange- the DateRange when this price is applicable (may be null)price- the price (may contain more digits than actually possible with this currency)channel- the channel which special price is represented by this row (may be null)- Returns:
- the new
PriceRow - Throws:
JaloPriceFactoryException
-
createPriceRow
public PriceRow createPriceRow(SessionContext ctx, Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, long minQuantity, Currency currency, Unit unit, int unitFactor, boolean net, DateRange dateRange, double price, EnumerationValue channel) throws JaloPriceFactoryException
Same ascreatePriceRow(Product, EnumerationValue, User, EnumerationValue, long, Currency, Unit, int, boolean, DateRange, double, EnumerationValue)but with specific SessionContext.- Parameters:
ctx-product-productPriceGroup-user-userPriceGroup-minQuantity-currency-unit-unitFactor-net-dateRange-price-channel-- Returns:
- the new
PriceRow - Throws:
JaloPriceFactoryException
-
createPriceRow
public PriceRow createPriceRow(SessionContext ctx, Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, long minQuantity, Currency currency, Unit unit, int unitFactor, boolean net, DateRange dateRange, double price) throws JaloPriceFactoryException
Same ascreatePriceRow(Product, EnumerationValue, User, EnumerationValue, long, Currency, Unit, int, boolean, DateRange, double)but with specific SessionContext.- Parameters:
ctx-product-productPriceGroup-user-userPriceGroup-minQuantity-currency-unit-unitFactor-net-dateRange-price-- Returns:
- the new
PriceRow - Throws:
JaloPriceFactoryException
-
createTaxRow
@Deprecated public TaxRow createTaxRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Tax tax) throws JaloPriceFactoryException
Deprecated.since ages - please usecreateTaxRow(Product, EnumerationValue, User, EnumerationValue, Tax, DateRange, Double)to specify all values ( here DateRange and Value are set tonull)Creates a new TaxRow. Allnullvalues mean all resp. allways. Please note that either user or userPriceGroup will be applied but never both. So it makes no sense to specify a group if the user is already present. Same thing with product and productPriceGroup.- Parameters:
product- the product which will be priced by this row (may be null)productPriceGroup- the product price group which will be priced by this row (may be null)user- the user whose special price is represented by this row (may be null)userPriceGroup- the user price group which special price is represented by this row (may be null)tax- the Tax for this rule (not null>)- Returns:
- the new row
- Throws:
JaloPriceFactoryException
-
createTaxRow
public TaxRow createTaxRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Tax tax, DateRange dateRange, java.lang.Double value) throws JaloPriceFactoryException
Creates a new TaxRow. Allnullvalues mean all resp. allways. Please note that either user or userPriceGroup will be applied but never both. So it makes no sense to specify a group is the user is already present. Same thing with product and productPriceGroup.- Parameters:
product- the product which will be priced by this row (may be null)productPriceGroup- the product price group which will be priced by this row (may be null)user- the user whose special price is represented by this row (may be null)userPriceGroup- the user price group which special price is represented by this row (may be null)tax- the Tax for this rule (not null>)dateRange- (optional) the timeframe which the new row is valid withinvalue- (optional) overrides the value of the tax object- Returns:
- the new
TaxRow - Throws:
JaloPriceFactoryException
-
createTaxRow
public TaxRow createTaxRow(SessionContext ctx, Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Tax tax, DateRange dateRange, java.lang.Double value) throws JaloPriceFactoryException
Same as createTaxRow(Product,String,User,String,Tax,boolean)} but for a specific SessionContext.- Parameters:
ctx-product- the product which will be priced by this row (may be null)productPriceGroup- the product price group which will be priced by this row (may be null)user- the user whose special price is represented by this row (may be null)userPriceGroup- the user price group which special price is represented by this row (may be null)tax- the Tax for this rule (not null>)dateRange- the timeframe which the new row is valid within;nullmeans allwaysvalue- (optional) overrides the value of the tax object- Returns:
- the new
TaxRow - Throws:
JaloPriceFactoryException
-
createDiscountRow
public DiscountRow createDiscountRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Currency currency, java.lang.Double value, DateRange dateRange, Discount discount) throws JaloPriceFactoryException
Creates a new DiscountRow. Allnullvalues mean all resp. allways. Please note that either user or userPriceGroup will be applied but never both. So it makes no sense to specify a group is the user is already present. Same thing with product and productPriceGroup.- Parameters:
product- the product which will be priced by this row (may be null)productPriceGroup- the product price group which will be priced by this row (may be null)user- the user whose special price is represented by this row (may be null)userPriceGroup- the user price group which special price is represented by this row (may be null)currency- the Currency for which this price is applicable (not null)value- a optional value which overrides the value provieded by discountdateRange- the DateRange when this price is applicable (may be null)discount- the Discount object which defines the value of this rule (not null)- Returns:
- the new
DiscountRow - Throws:
JaloPriceFactoryException
-
createDiscountRow
public DiscountRow createDiscountRow(SessionContext ctx, Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Currency currency, java.lang.Double value, DateRange dateRange, Discount discount) throws JaloPriceFactoryException
Same as createDiscountRow(Product,String,User,String,Currency,boolean,double,DateRange,Discount)} but for a specific SessionContext.- Parameters:
ctx-product-productPriceGroup-user-userPriceGroup-currency-value-dateRange-discount-- Returns:
- the new
DiscountRow - Throws:
JaloPriceFactoryException
-
createGlobalDiscountRow
public GlobalDiscountRow createGlobalDiscountRow(User user, EnumerationValue userPriceGroup, Currency currency, java.lang.Double value, DateRange dateRange, Discount discount) throws JaloPriceFactoryException
Creates a new global DiscountRow. Allnullvalues mean all resp. allways. Please note that either user or userPriceGroup will be applied but never both. So it makes no sense to specify a group is the user is already present. Same thing with product and productPriceGroup.- Parameters:
user- the user whose special price is represented by this row (may be null)userPriceGroup- the user price group which special price is represented by this row (may be null)currency- the Currency for which this price is applicable (not null)value- a optional value which overrides the value provieded by discountdateRange- the DateRange when this price is applicable (may be null)discount- the Discount object which defines the value of this rule (not null)- Returns:
- the new
DiscountRow - Throws:
JaloPriceFactoryException
-
createGlobalDiscountRow
public GlobalDiscountRow createGlobalDiscountRow(SessionContext ctx, User user, EnumerationValue userPriceGroup, Currency currency, java.lang.Double value, DateRange dateRange, Discount discount) throws JaloPriceFactoryException
Same as createGlobalDiscountRow(User,String,Currency,boolean,double,DateRange,Discount)} but for a specific SessionContext.- Parameters:
ctx-user-userPriceGroup-currency-value-dateRange-discount-- Returns:
- the new
DiscountRow - Throws:
JaloPriceFactoryException
-
checkAllPriceRows
@Deprecated public void checkAllPriceRows() throws JaloPriceFactoryExceptionDeprecated.since agesChecks allPriceRowsfor consistency errors.- Throws:
JaloRowConsistencyCheckException- if two or more rows clashJaloPriceFactoryException
-
checkAllPriceRows
@Deprecated public void checkAllPriceRows(SessionContext ctx) throws JaloPriceFactoryException
Deprecated.since agesSame ascheckAllPriceRows()but for a specific SessionContext.- Parameters:
ctx-- Throws:
JaloRowConsistencyCheckException- if two or more rows clashJaloPriceFactoryException
-
checkAllTaxRows
@Deprecated public void checkAllTaxRows() throws JaloPriceFactoryExceptionDeprecated.since agesChecks allTaxRowsfor consistency errors.- Throws:
JaloRowConsistencyCheckException- if two or more rows clashJaloPriceFactoryException
-
checkAllTaxRows
@Deprecated public void checkAllTaxRows(SessionContext ctx) throws JaloPriceFactoryException
Deprecated.since agesSame ascheckAllTaxRows()but for a specific SessionContext.- Parameters:
ctx-- Throws:
JaloRowConsistencyCheckException- if two or more rows clashJaloPriceFactoryException
-
checkAllDiscountRows
@Deprecated public void checkAllDiscountRows() throws JaloPriceFactoryExceptionDeprecated.since agesChecks allDiscountRowsfor consistency errors.- Throws:
JaloRowConsistencyCheckException- if two or more rows clashJaloPriceFactoryException
-
checkAllDiscountRows
@Deprecated public void checkAllDiscountRows(SessionContext ctx) throws JaloPriceFactoryException
Deprecated.since agesSame ascheckAllDiscountRows()but for a specific SessionContext.- Parameters:
ctx-- Throws:
JaloRowConsistencyCheckException- if two or more rows clashJaloPriceFactoryException
-
checkAllGlobalDiscountRows
@Deprecated public void checkAllGlobalDiscountRows() throws JaloPriceFactoryExceptionDeprecated.since agesChecks all globalDiscountRowsfor consistency errors.- Throws:
JaloRowConsistencyCheckException- if two or more rows clashJaloPriceFactoryException
-
checkAllGlobalDiscountRows
@Deprecated public void checkAllGlobalDiscountRows(SessionContext ctx) throws JaloPriceFactoryException
Deprecated.since agesSame ascheckAllGlobalDiscountRows()but for a specific SessionContext.- Parameters:
ctx-- Throws:
JaloRowConsistencyCheckException- if two or more rows clashJaloPriceFactoryException
-
getEurope1Prices
public java.util.Collection<PriceRow> getEurope1Prices(SessionContext ctx, Product product)
Attribute getter for Product.europe1prices.- Since:
- 3.0M2
-
getRealPartOfPriceRows
public java.util.Collection<PriceRow> getRealPartOfPriceRows(SessionContext ctx, Product product, EnumerationValue productGroup)
Returns collection of all price rows for the specified product and price group.- Parameters:
product- the productproductGroup- the price group- Returns:
- a collection of all price rows for the specified product and price group.
-
setEurope1Prices
public void setEurope1Prices(SessionContext ctx, Product item, java.util.Collection prices)
Attribute setter for Product.europe1prices.- Since:
- 3.0M2
-
getEurope1Taxes
public java.util.Collection<TaxRow> getEurope1Taxes(SessionContext ctx, Product product)
Attribute getter for Product.europe1taxes.- Since:
- 3.0M2
-
setEurope1Taxes
public void setEurope1Taxes(SessionContext ctx, Product item, java.util.Collection taxes)
Attribute setter for Product.europe1taxes.- Since:
- 3.0M2
-
getEurope1Discounts
public java.util.Collection<DiscountRow> getEurope1Discounts(SessionContext ctx, Product product)
Attribute getter for Product.europe1discounts.- Since:
- 3.0M2
-
getEurope1Discounts
public java.util.Collection<DiscountRow> getEurope1Discounts(Product item)
-
setEurope1Discounts
public void setEurope1Discounts(SessionContext ctx, Product item, java.util.Collection discounts)
Attribute setter for Product.europe1discounts.- Since:
- 3.0M2
-
getEurope1Discounts
public java.util.Collection<GlobalDiscountRow> getEurope1Discounts(User user)
-
setEurope1Discounts
public void setEurope1Discounts(Product product, java.util.Collection discounts)
-
getEurope1Discounts
public java.util.Collection<GlobalDiscountRow> getEurope1Discounts(SessionContext ctx, User user)
Attribute getter for User.europe1discounts.- Since:
- 3.0M2
-
setEurope1Discounts
public void setEurope1Discounts(User user, java.util.Collection discounts)
-
setEurope1Discounts
public void setEurope1Discounts(SessionContext ctx, User user, java.util.Collection discounts)
Attribute setter for User.europe1discounts.- Since:
- 3.0M2
-
getTaxValues
public java.util.Collection getTaxValues(AbstractOrderEntry entry) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryoverride to define tax values for an order entry.- Specified by:
getTaxValuesin interfacePriceFactory- Overrides:
getTaxValuesin classAbstractPriceFactory- Returns:
- empty list as default
- Throws:
JaloPriceFactoryException
-
getBasePrice
public PriceValue getBasePrice(AbstractOrderEntry entry) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryoverride to define the base price of an order entry- Specified by:
getBasePricein interfacePriceFactory- Specified by:
getBasePricein classAbstractPriceFactory- Returns:
- a price with the order's currency iso code, 0.0 as value and the order's net status
- Throws:
JaloPriceFactoryException
-
getDiscountValues
public java.util.List getDiscountValues(AbstractOrderEntry entry) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryoverride to define discount values for an order entry.- Specified by:
getDiscountValuesin interfacePriceFactory- Overrides:
getDiscountValuesin classAbstractPriceFactory- Returns:
- empty list as default
- Throws:
JaloPriceFactoryException
-
getDiscountValues
public java.util.List getDiscountValues(AbstractOrder order) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryoverride to define (global) discounts for an order. these discounts are applied to the whole order, not just to one entry likeAbstractPriceFactory.getDiscountValues(AbstractOrderEntry)- Specified by:
getDiscountValuesin interfacePriceFactory- Overrides:
getDiscountValuesin classAbstractPriceFactory- Returns:
- empty list as default
- Throws:
JaloPriceFactoryException
-
getAllPriceInformations
public ProductPriceInformations getAllPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryCalculates a product price quote containing all applicable prices, discounts and taxes for the given product and net/gross state.This default implementation just calls
AbstractPriceFactory.getProductPriceInformations(Product, Date, boolean),AbstractPriceFactory.getProductTaxInformations(Product, Date)andAbstractPriceFactory.getProductDiscountInformations(Product, Date, boolean)and wraps the results inside aProductPriceInformationsobject.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
AbstractPriceFactory.getProductPriceInformations(Product, Date, boolean),AbstractPriceFactory.getProductTaxInformations(Product, Date)andAbstractPriceFactory.getProductDiscountInformations(Product, Date, boolean)since these methods are called byProductdirectly.- Specified by:
getAllPriceInformationsin interfacePriceFactory- Overrides:
getAllPriceInformationsin classAbstractPriceFactory- Throws:
JaloPriceFactoryException- if a calculation error occured
-
getProductDiscountInformations
public java.util.List getProductDiscountInformations(SessionContext ctx, Product product, java.util.Date date, boolean net) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryoverride this to show all discounts which may apply to the given product- Specified by:
getProductDiscountInformationsin interfacePriceFactory- Specified by:
getProductDiscountInformationsin classAbstractPriceFactoryproduct- the product- Returns:
- a list of
DiscountInformationobjects - Throws:
JaloPriceFactoryException- if price calculation error occured
-
getProductPriceInformations
public java.util.List getProductPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryOverride this to show all prices available for the given product- Specified by:
getProductPriceInformationsin interfacePriceFactory- Specified by:
getProductPriceInformationsin classAbstractPriceFactoryproduct- the productnet- the net/gross state of the requested prices- Returns:
- a list of
PriceInformationobjects - Throws:
JaloPriceFactoryException- if price calculation error occured
-
getProductTaxInformations
public java.util.List getProductTaxInformations(SessionContext ctx, Product product, java.util.Date date) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryoverride this to show all taxes which apply to the given product- Specified by:
getProductTaxInformationsin interfacePriceFactory- Specified by:
getProductTaxInformationsin classAbstractPriceFactoryproduct- the product- Returns:
- a list of
TaxInformationobjects - Throws:
JaloPriceFactoryException- if price calculation error occured
-
getDiscountInformations
protected java.util.List getDiscountInformations(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency curr, java.util.Date date) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException
-
getPriceInformations
protected java.util.List getPriceInformations(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency curr, boolean net, java.util.Date date, java.util.Collection taxValues) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException
-
getTaxInformations
protected java.util.List getTaxInformations(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, java.util.Date date) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException
-
filterPriceRows
protected java.util.List<PriceRow> filterPriceRows(java.util.List<PriceRow> priceRows)
Removes price rows from set of matching rows if they will never be applicable. This may be the case if two rows have different match values (e.g. product only vs. user+product) but same unit and minimum quantity - only the better matching will ever apply so we omit the second one. We expect the price rows ordered as follows:- unit - order unimportant
- minimum quantity - ascending
- match value - greatest at top
- currency - requested currency on top ; only if requested currency is not base currency )
- net - requested net state is on top
- date range - non-null date ranges at top
-
matchDiscountRows
public java.util.List matchDiscountRows(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency curr, java.util.Date date, int maxCount) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException
-
filterDiscountRows4Price
protected java.util.List<? extends AbstractDiscountRow> filterDiscountRows4Price(java.util.Collection<? extends AbstractDiscountRow> rows, java.util.Date date)
Filters discount rows which do not match the given parameters.- Parameters:
rows- the query result rowsdate- the requested date
-
queryDiscounts4Price
protected java.util.Collection<? extends AbstractDiscountRow> queryDiscounts4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup)
Runs database query for fetching discount rows for calculating entry and order discount values. Please note that this method may return more rows than allowed so make sure they're filtered afterwards!- Parameters:
ctx-product- the product to get discounts forproductGroup- the product group to get discounts foruser- the user to get discounts foruserGroup- the user price group to get discounts for- Throws:
JaloPriceFactoryException
-
matchPriceRowForPrice
public PriceRow matchPriceRowForPrice(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, long qtd, Unit unit, Currency currency, java.util.Date date, boolean net, boolean giveAwayMode) throws JaloPriceFactoryException
matches price rows by product or product group, user or user group, min quantity, currency and daterange. the result is ordered the following way:match value - greates at top ( currency - requested currency on top ; only if requested currency is not base currency ) net - requested net state is on top ( unit - requested unit at top ; only if convertible units exists for requested unit ) min quantity - greatest quantity at top daterange - non-null dateranges at top- Parameters:
product- the product which the rows have to match; rows without product and group match too !productGroup- the product group which the rows have to match; rows without product and group match too !user- the user which the rows have to match; rows without user and user match too !userGroup- the user group which the rows have to match; rows without user and user match too !qtd- the quantity which rows must not exceedunit- the unit which the rows have to match, its convertible units are included in the search toocurrency- the currency which the rows have to match, the base currency is included toodate- the date to match; rows without daterange always matchnet-- Returns:
- the price row
- Throws:
JaloPriceFactoryException- if any of the parameters isnull
-
filterPriceRows4Price
protected java.util.List<PriceRow> filterPriceRows4Price(java.util.Collection<PriceRow> rows, long _quantity, Unit unit, Currency curr, java.util.Date date, boolean giveAwayMode, PriceRowChannel channel)
Filters price rows which do not match the given parameters.- Parameters:
rows- the query result rowsunit- the requested unitcurr- the requested currencydate- the requested dategiveAwayMode- the requested give-away modechannel- the requested channel
-
queryPriceRows4Price
@Deprecated protected java.util.Collection<PriceRow> queryPriceRows4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup)
Deprecated.Runs database query for fetching price rows for calculating base prices. Please note that this method may return more rows than allowed so make sure they're filtered afterwards!- Parameters:
ctx-product- the product to get prices forproductGroup- the product group to get prices foruser- the user to get prices foruserGroup- the user price group to get prices for- Throws:
JaloPriceFactoryException
-
queryPriceRows4Price
protected java.util.Collection<PriceRow> queryPriceRows4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, java.util.Date date, Currency currency, boolean giveAwayMode)
Runs database query for fetching price rows for calculating base prices. The result is preliminary filtered by date, currency and giveAwayMode. Please note that this method may still return more rows than allowed so make sure they're filtered afterwards!- Parameters:
ctx-product-productGroup-user-userGroup-date-currency-giveAwayMode-- Returns:
-
getPDTRowsQueryBuilderFor
protected PDTRowsQueryBuilder getPDTRowsQueryBuilderFor(java.lang.String type)
Creates query builder for given PDT row type- Parameters:
type- PDT row type
-
matchPriceRowsForInfo
public java.util.List<PriceRow> matchPriceRowsForInfo(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency currency, java.util.Date date, boolean net) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException
-
filterPriceRows4Info
protected java.util.List<PriceRow> filterPriceRows4Info(java.util.Collection<PriceRow> rows, Currency curr, java.util.Date date, PriceRowChannel channel)
Filters price rows which do not match the given parameters.- Parameters:
rows- the query result rowscurr- the requested currencydate- the requested datechannel- the requested channel
-
getProductPriceRows
public java.util.Collection getProductPriceRows(Product product, EnumerationValue productGroup)
Returns collection of all price rows for the specified product and price group.- Parameters:
product- the productproductGroup- the price group- Returns:
- a collection of all price rows for the specified product and price group.
-
getProductPriceRows
public java.util.Collection getProductPriceRows(SessionContext ctx, Product product, EnumerationValue productGroup)
Returns collection of all price rows for the specified product and price group.- Parameters:
product- the productproductGroup- the price group- Returns:
- a collection of all price rows for the specified product and price group.
-
getProductPriceRowsFast
public java.util.Collection getProductPriceRowsFast(SessionContext ctx, Product product, EnumerationValue productGroup)
Returns collection of all price rows for the specified product and price group. This implementation should work faster since it does not order.- Parameters:
product- the productproductGroup- the price group- Returns:
- a collection of all price rows for the specified product and price group.
-
getProductTaxRows
public java.util.Collection getProductTaxRows(Product product, EnumerationValue productGroup)
-
getProductTaxRows
public java.util.Collection getProductTaxRows(SessionContext ctx, Product product, EnumerationValue productGroup)
-
getProductTaxRowsFast
public java.util.Collection getProductTaxRowsFast(SessionContext ctx, Product product, EnumerationValue productGroup)
-
getProductDiscountRows
public java.util.Collection getProductDiscountRows(Product product, EnumerationValue productGroup)
-
getProductDiscountRows
public java.util.Collection getProductDiscountRows(SessionContext ctx, Product product, EnumerationValue productGroup)
-
getProductDiscountRowsFast
public java.util.Collection getProductDiscountRowsFast(SessionContext ctx, Product product, EnumerationValue productGroup)
-
extractProductId
protected java.lang.String extractProductId(SessionContext ctx, Product product)
-
extractProductId
protected java.lang.String extractProductId(Product product)
-
getUserGlobalDiscountRows
public java.util.Collection getUserGlobalDiscountRows(User user, EnumerationValue userGroup) throws JaloInvalidParameterException
- Throws:
JaloInvalidParameterException- Since:
- 2.10
-
matchTaxRows
public java.util.List matchTaxRows(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, java.util.Date date, int maxCount) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException
-
filterTaxRows4Price
protected java.util.List<TaxRow> filterTaxRows4Price(java.util.Collection<TaxRow> rows, java.util.Date date)
Filters tax rows which do not match the given parameters.- Parameters:
rows- the query result rowsdate- the requested date
-
superQueryTax4Price
protected java.util.Collection<TaxRow> superQueryTax4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup)
Runs database query for fetching tax rows for calculating entry and order discount values. Please note that this method may return more rows than allowed so make sure they're filtered afterwards!- Parameters:
ctx-product- the product to get taxes forproductGroup- the product group to get taxes foruser- the user to get taxes foruserGroup- the user price group to get taxes for- Throws:
JaloPriceFactoryException
-
queryTax4Price
protected java.util.Collection<TaxRow> queryTax4Price(SessionContext ctx, Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup)
-
appendProductConditions
protected void appendProductConditions(java.lang.StringBuilder query, java.lang.String alias, Product product, EnumerationValue productGroup, java.util.Map values, java.lang.String pgConstant)
-
appendUserConditions
protected void appendUserConditions(java.lang.StringBuilder query, java.lang.String alias, User user, EnumerationValue userGroup, java.util.Map values, java.lang.String ugConst)
-
getEnumFromContextOrItem
protected EnumerationValue getEnumFromContextOrItem(SessionContext ctx, ExtensibleItem item, java.lang.String qualifier)
Helper method to fetch a (price)group enumeration value from context and as fallback from the provided item.- Since:
- 2.10
-
getPTG
protected EnumerationValue getPTG(SessionContext ctx, AbstractOrderEntry entry)
- Since:
- 2.10
-
getPTG
public EnumerationValue getPTG(SessionContext ctx, Product product)
- Since:
- 2.10
-
getPDG
protected EnumerationValue getPDG(SessionContext ctx, AbstractOrderEntry entry)
- Since:
- 2.10
-
getPDG
public EnumerationValue getPDG(SessionContext ctx, Product product)
- Since:
- 2.10
-
getPPG
protected EnumerationValue getPPG(SessionContext ctx, AbstractOrderEntry entry)
- Since:
- 2.10
-
getPPG
public EnumerationValue getPPG(SessionContext ctx, Product product)
- Since:
- 2.10
-
getUTG
protected EnumerationValue getUTG(SessionContext ctx, AbstractOrderEntry entry) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException- Since:
- 2.10
-
getUTG
protected EnumerationValue getUTG(SessionContext ctx, AbstractOrder order) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException- Since:
- 2.10
-
getUTG
public EnumerationValue getUTG(SessionContext ctx, User user) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException- Since:
- 2.10
-
getUDG
public EnumerationValue getUDG(SessionContext ctx, User user) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException- Since:
- 2.10
-
getUDG
protected EnumerationValue getUDG(SessionContext ctx, AbstractOrderEntry entry) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException- Since:
- 2.10
-
getUDG
protected EnumerationValue getUDG(SessionContext ctx, AbstractOrder order) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException- Since:
- 2.10
-
getUPG
public EnumerationValue getUPG(SessionContext ctx, User user) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException- Since:
- 2.10
-
getUPG
protected EnumerationValue getUPG(SessionContext ctx, AbstractOrderEntry entry) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException- Since:
- 2.10
-
getUPG
protected EnumerationValue getUPG(SessionContext ctx, AbstractOrder order) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException- Since:
- 2.10
-
getEnumFromGroups
protected EnumerationValue getEnumFromGroups(User user, java.lang.String attribute) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException- Since:
- 2.10
-
getUserPriceGroup
public EnumerationValue getUserPriceGroup(java.lang.String code)
- Parameters:
code-- Returns:
- userpricegroup
-
createUserPriceGroup
public EnumerationValue createUserPriceGroup(java.lang.String code) throws ConsistencyCheckException
- Parameters:
code- the code of the new user price group- Returns:
- the new UserPriceGroup
- Throws:
ConsistencyCheckException
-
getProductTaxGroup
public EnumerationValue getProductTaxGroup(java.lang.String code)
-
createProductTaxGroup
public EnumerationValue createProductTaxGroup(java.lang.String code) throws ConsistencyCheckException
- Throws:
ConsistencyCheckException
-
getUserTaxGroup
public EnumerationValue getUserTaxGroup(java.lang.String code)
-
createUserTaxGroup
public EnumerationValue createUserTaxGroup(java.lang.String code) throws ConsistencyCheckException
- Throws:
ConsistencyCheckException
-
isCreatorDisabled
public boolean isCreatorDisabled()
Description copied from class:ExtensionPart ofDataCreatorinterface. This default implementation returnsfalse- Overrides:
isCreatorDisabledin classExtension- Returns:
false
-
createProjectData
public void createProjectData(java.util.Map params, JspContext jspc)- Overrides:
createProjectDatain classExtension
-
adjustDate
protected java.util.Date adjustDate(java.util.Date date)
Cut (set to zero) specific parts of a Date field to allow caching of time based pricing. the europe1 Price factory is using this method whenever dealing with Date's. The value can be configured with the "europe1.price.accuracy" project.properties setting. allowed values are - "full" (DEFAULT in hybris 3.0 - "second" - "minute" - "hour" (DEFAULT starting with hybris 3.1) - "day" (DEFAULT starting with hybris 3.1-u4)- Parameters:
date- the input date- Returns:
- the adjusted date
-
getSuperCachedTaxes
protected java.util.Collection<Europe1PriceFactory.CachedTaxValue> getSuperCachedTaxes(Product product, EnumerationValue productTaxGroup, User user, EnumerationValue userTaxGroup, java.util.Date date)
-
isCachingTaxes
protected boolean isCachingTaxes()
-
fillTaxCache
protected void fillTaxCache()
Fills private cache with catalog version aware tax entries
-
getCachedTaxes
protected java.util.Collection<Europe1PriceFactory.CachedTaxValue> getCachedTaxes(Product product, EnumerationValue productTaxGroup, User user, EnumerationValue userTaxGroup, java.util.Date date)
Reads the private cache of catalog version aware tax entries.
-
createEssentialData
public void createEssentialData(java.util.Map params, JspContext jspc) throws java.lang.Exception- Overrides:
createEssentialDatain classExtension- Throws:
java.lang.Exception
-
getCounterpartItem
protected PriceRow getCounterpartItem(SessionContext ctx, PriceRow pricerow, CatalogVersion targetVersion)
-
getCounterpartItem
protected TaxRow getCounterpartItem(SessionContext ctx, TaxRow taxrow, CatalogVersion targetVersion)
-
getCounterpartItem
protected DiscountRow getCounterpartItem(SessionContext ctx, DiscountRow discountrow, CatalogVersion targetVersion)
-
beforeItemCreation
public void beforeItemCreation(SessionContext ctx, ComposedType type, Item.ItemAttributeMap attributes) throws JaloBusinessException
Description copied from class:ManagerThis method will be called before an item is created BUT AFTER the default values of this type are assigned- Overrides:
beforeItemCreationin classManager- Parameters:
ctx- the currency session contexttype- the type of the item which will be createdattributes- the attribute values to be used for creation- Throws:
JaloBusinessException- See Also:
This method does nothing and may be overridden. CAUTION: This method will be called inside a transaction !!!
-
setRetrieveChannelStrategy
public void setRetrieveChannelStrategy(RetrieveChannelStrategy retrieveChannelStrategy)
-
-