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 class
Europe1PriceFactory.CachedTax
protected static class
Europe1PriceFactory.CachedTaxValue
protected class
Europe1PriceFactory.DiscountRowMatchComparator
Used for ordering discount rows in discount priority order.protected class
Europe1PriceFactory.PriceRowInfoComparator
Used for ordering price rows in best match order.protected class
Europe1PriceFactory.PriceRowMatchComparator
Used for ordering price rows in best match order.protected class
Europe1PriceFactory.TaxRowMatchComparator
Used 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 long
MATCH_ANY
static long
MATCH_BY_PRODUCT_ID
static java.lang.String
USE_FAST_ALGORITHMS
Enables/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.Date
adjustDate(java.util.Date date)
Cut (set to zero) specific parts of a Date field to allow caching of time based pricing.protected void
appendProductConditions(java.lang.StringBuilder query, java.lang.String alias, Product product, EnumerationValue productGroup, java.util.Map values, java.lang.String pgConstant)
protected void
appendUserConditions(java.lang.StringBuilder query, java.lang.String alias, User user, EnumerationValue userGroup, java.util.Map values, java.lang.String ugConst)
void
beforeItemCreation(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 assignedvoid
checkAllDiscountRows()
Deprecated.since agesvoid
checkAllDiscountRows(SessionContext ctx)
Deprecated.since agesvoid
checkAllGlobalDiscountRows()
Deprecated.since agesvoid
checkAllGlobalDiscountRows(SessionContext ctx)
Deprecated.since agesvoid
checkAllPriceRows()
Deprecated.since agesvoid
checkAllPriceRows(SessionContext ctx)
Deprecated.since agesvoid
checkAllTaxRows()
Deprecated.since agesvoid
checkAllTaxRows(SessionContext ctx)
Deprecated.since agesprotected void
checkBeforeItemRemoval(SessionContext ctx, Item item)
Superclass method overridden to avoid call to EJB layerDiscountRow
createDiscountRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Currency currency, java.lang.Double value, DateRange dateRange, Discount discount)
Creates a new DiscountRow.DiscountRow
createDiscountRow(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.void
createEssentialData(java.util.Map params, JspContext jspc)
GlobalDiscountRow
createGlobalDiscountRow(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.GlobalDiscountRow
createGlobalDiscountRow(User user, EnumerationValue userPriceGroup, Currency currency, java.lang.Double value, DateRange dateRange, Discount discount)
Creates a new global DiscountRow.PriceRow
createPriceRow(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.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)
Overloaded method to support Channel dimension to PriceRow.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)
Same ascreatePriceRow(Product, EnumerationValue, User, EnumerationValue, long, Currency, Unit, int, boolean, DateRange, double)
but with specific SessionContext.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)
Same ascreatePriceRow(Product, EnumerationValue, User, EnumerationValue, long, Currency, Unit, int, boolean, DateRange, double, EnumerationValue)
but with specific SessionContext.EnumerationValue
createProductTaxGroup(java.lang.String code)
void
createProjectData(java.util.Map params, JspContext jspc)
TaxRow
createTaxRow(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
)TaxRow
createTaxRow(Product product, EnumerationValue productPriceGroup, User user, EnumerationValue userPriceGroup, Tax tax, DateRange dateRange, java.lang.Double value)
Creates a new TaxRow.TaxRow
createTaxRow(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.EnumerationValue
createUserPriceGroup(java.lang.String code)
EnumerationValue
createUserTaxGroup(java.lang.String code)
protected java.lang.String
extractProductId(Product product)
protected java.lang.String
extractProductId(SessionContext ctx, Product product)
protected void
fillTaxCache()
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.ProductPriceInformations
getAllPriceInformations(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.PriceValue
getBasePrice(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 DiscountRow
getCounterpartItem(SessionContext ctx, DiscountRow discountrow, CatalogVersion targetVersion)
protected PriceRow
getCounterpartItem(SessionContext ctx, PriceRow pricerow, CatalogVersion targetVersion)
protected TaxRow
getCounterpartItem(SessionContext ctx, TaxRow taxrow, CatalogVersion targetVersion)
protected java.util.List
getDiscountInformations(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency curr, java.util.Date date)
java.util.List
getDiscountValues(AbstractOrder order)
override to define (global) discounts for an order.java.util.List
getDiscountValues(AbstractOrderEntry entry)
override to define discount values for an order entry.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.protected EnumerationValue
getEnumFromGroups(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 Europe1PriceFactory
getInstance()
protected EnumerationValue
getPDG(SessionContext ctx, AbstractOrderEntry entry)
EnumerationValue
getPDG(SessionContext ctx, Product product)
protected PDTRowsQueryBuilder
getPDTRowsQueryBuilderFor(java.lang.String type)
Creates query builder for given PDT row typeprotected EnumerationValue
getPPG(SessionContext ctx, AbstractOrderEntry entry)
EnumerationValue
getPPG(SessionContext ctx, Product product)
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)
java.util.List
getProductDiscountInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)
override this to show all discounts which may apply to the given productjava.util.Collection
getProductDiscountRows(Product product, EnumerationValue productGroup)
java.util.Collection
getProductDiscountRows(SessionContext ctx, Product product, EnumerationValue productGroup)
java.util.Collection
getProductDiscountRowsFast(SessionContext ctx, Product product, EnumerationValue productGroup)
java.util.List
getProductPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)
Override this to show all prices available for the given productjava.util.Collection
getProductPriceRows(Product product, EnumerationValue productGroup)
Returns collection of all price rows for the specified product and price group.java.util.Collection
getProductPriceRows(SessionContext ctx, Product product, EnumerationValue productGroup)
Returns collection of all price rows for the specified product and price group.java.util.Collection
getProductPriceRowsFast(SessionContext ctx, Product product, EnumerationValue productGroup)
Returns collection of all price rows for the specified product and price group.EnumerationValue
getProductTaxGroup(java.lang.String code)
java.util.List
getProductTaxInformations(SessionContext ctx, Product product, java.util.Date date)
override this to show all taxes which apply to the given productjava.util.Collection
getProductTaxRows(Product product, EnumerationValue productGroup)
java.util.Collection
getProductTaxRows(SessionContext ctx, Product product, EnumerationValue productGroup)
java.util.Collection
getProductTaxRowsFast(SessionContext ctx, Product product, EnumerationValue productGroup)
protected EnumerationValue
getPTG(SessionContext ctx, AbstractOrderEntry entry)
EnumerationValue
getPTG(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.List
getTaxInformations(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, java.util.Date date)
java.util.Collection
getTaxValues(AbstractOrderEntry entry)
override to define tax values for an order entry.protected EnumerationValue
getUDG(SessionContext ctx, AbstractOrder order)
protected EnumerationValue
getUDG(SessionContext ctx, AbstractOrderEntry entry)
EnumerationValue
getUDG(SessionContext ctx, User user)
protected EnumerationValue
getUPG(SessionContext ctx, AbstractOrder order)
protected EnumerationValue
getUPG(SessionContext ctx, AbstractOrderEntry entry)
EnumerationValue
getUPG(SessionContext ctx, User user)
java.util.Collection
getUserGlobalDiscountRows(User user, EnumerationValue userGroup)
EnumerationValue
getUserPriceGroup(java.lang.String code)
EnumerationValue
getUserTaxGroup(java.lang.String code)
protected EnumerationValue
getUTG(SessionContext ctx, AbstractOrder order)
protected EnumerationValue
getUTG(SessionContext ctx, AbstractOrderEntry entry)
EnumerationValue
getUTG(SessionContext ctx, User user)
void
init()
called once for each tenant, so this method fits best to perform some initialization stuffprotected void
invalidateTaxCache()
protected boolean
isCachingTaxes()
boolean
isCreatorDisabled()
Part ofDataCreator
interface.java.util.List
matchDiscountRows(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, Currency curr, java.util.Date date, int maxCount)
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)
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.List
matchTaxRows(Product product, EnumerationValue productGroup, User user, EnumerationValue userGroup, java.util.Date date, int maxCount)
protected void
notifyItemRemoval(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 void
removeRowsFor(SessionContext ctx, Currency currency)
protected void
removeRowsFor(SessionContext ctx, EnumerationValue enumerationValue)
protected void
removeRowsFor(SessionContext ctx, Discount discount)
protected void
removeRowsFor(SessionContext ctx, Tax tax)
protected void
removeRowsFor(SessionContext ctx, Product product)
protected void
removeRowsFor(SessionContext ctx, Unit unit)
protected void
removeRowsFor(SessionContext ctx, User user)
void
setEurope1Discounts(Product product, java.util.Collection discounts)
void
setEurope1Discounts(SessionContext ctx, Product item, java.util.Collection discounts)
Attribute setter for Product.europe1discounts.void
setEurope1Discounts(SessionContext ctx, User user, java.util.Collection discounts)
Attribute setter for User.europe1discounts.void
setEurope1Discounts(User user, java.util.Collection discounts)
void
setEurope1Prices(Product item, java.util.Collection<PriceRow> value)
void
setEurope1Prices(SessionContext ctx, Product item, java.util.Collection prices)
Attribute setter for Product.europe1prices.void
setEurope1Taxes(Product item, java.util.Collection<TaxRow> value)
void
setEurope1Taxes(SessionContext ctx, Product item, java.util.Collection taxes)
Attribute setter for Product.europe1taxes.void
setRetrieveChannelStrategy(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:Manager
called 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:
checkBeforeItemRemoval
in 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:
notifyItemRemoval
in 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. Allnull
values 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 / unitFactor
net
- 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
null
values 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 / unitFactor
net
- 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. Allnull
values 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. Allnull
values 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;null
means 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. Allnull
values 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. Allnull
values 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 JaloPriceFactoryException
Deprecated.since agesChecks allPriceRows
for 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 JaloPriceFactoryException
Deprecated.since agesChecks allTaxRows
for 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 JaloPriceFactoryException
Deprecated.since agesChecks allDiscountRows
for 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 JaloPriceFactoryException
Deprecated.since agesChecks all globalDiscountRows
for 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:AbstractPriceFactory
override to define tax values for an order entry.- Specified by:
getTaxValues
in interfacePriceFactory
- Overrides:
getTaxValues
in classAbstractPriceFactory
- Returns:
- empty list as default
- Throws:
JaloPriceFactoryException
-
getBasePrice
public PriceValue getBasePrice(AbstractOrderEntry entry) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactory
override to define the base price of an order entry- Specified by:
getBasePrice
in interfacePriceFactory
- Specified by:
getBasePrice
in 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:AbstractPriceFactory
override to define discount values for an order entry.- Specified by:
getDiscountValues
in interfacePriceFactory
- Overrides:
getDiscountValues
in classAbstractPriceFactory
- Returns:
- empty list as default
- Throws:
JaloPriceFactoryException
-
getDiscountValues
public java.util.List getDiscountValues(AbstractOrder order) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactory
override 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:
getDiscountValues
in interfacePriceFactory
- Overrides:
getDiscountValues
in 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:AbstractPriceFactory
Calculates 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 aProductPriceInformations
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
AbstractPriceFactory.getProductPriceInformations(Product, Date, boolean)
,AbstractPriceFactory.getProductTaxInformations(Product, Date)
andAbstractPriceFactory.getProductDiscountInformations(Product, Date, boolean)
since these methods are called byProduct
directly.- Specified by:
getAllPriceInformations
in interfacePriceFactory
- Overrides:
getAllPriceInformations
in 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:AbstractPriceFactory
override this to show all discounts which may apply to the given product- Specified by:
getProductDiscountInformations
in interfacePriceFactory
- Specified by:
getProductDiscountInformations
in classAbstractPriceFactory
product
- the product- Returns:
- a list of
DiscountInformation
objects - 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:AbstractPriceFactory
Override this to show all prices available for the given product- Specified by:
getProductPriceInformations
in interfacePriceFactory
- Specified by:
getProductPriceInformations
in classAbstractPriceFactory
product
- the productnet
- the net/gross state of the requested prices- Returns:
- a list of
PriceInformation
objects - 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:AbstractPriceFactory
override this to show all taxes which apply to the given product- Specified by:
getProductTaxInformations
in interfacePriceFactory
- Specified by:
getProductTaxInformations
in classAbstractPriceFactory
product
- the product- Returns:
- a list of
TaxInformation
objects - 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:Extension
Part ofDataCreator
interface. This default implementation returnsfalse
- Overrides:
isCreatorDisabled
in classExtension
- Returns:
false
-
createProjectData
public void createProjectData(java.util.Map params, JspContext jspc)
- Overrides:
createProjectData
in 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:
createEssentialData
in 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:Manager
This method will be called before an item is created BUT AFTER the default values of this type are assigned- Overrides:
beforeItemCreation
in 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)
-
-