public class CalculateContractPricesCmdImpl extends TaskCommandImpl implements CalculateContractPricesCmd
If the command is successful in retrieving offers, it will return a list of qualified offers. It provides the offer prices which have been adjusted according the corresponding Ts&Cs defined in the trading agreements.
If unsuccessful, it will return an empty list.
Behaviour
Obtain all the qualified offers for each catalog entries. Each offer to be retrieved, to find the price of a catalog entry must satisfy certain criteria.
If no valid offer can be found, the parent product offers will be searched, for providing the catalog entry. And the parent product is not excluded from the trading agreements.
Select the best adjustments for each of the offers. The price adjustments are retrieved from those Ts&Cs which references the price list containing the offer.
Calculate the price adjustments for each of the offers.
This command calls the following TaskCommands:
This command uses the following AccessBeans:Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
CalculateContractPricesCmdImpl()
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected QualifyingOfferInfo | calculatePriceAdjustment(QualifyingOfferInfo aOfferInfo, PriceTC aBestPriceTC)
Calculates the result price by applying the best T&C price adjustment to the offer price.
|
protected java.lang.String | getCurrency()
Returns the currency to be used for the price.
|
ItemPriceInfo[] | getItemPriceInfo()
Returns the internal item info structure.
|
protected java.util.Vector | getOfferPrices(java.lang.Long anOfferId)
Returns the OfferPrices of the specified Offer.
|
void | performExecute()
Executes main business logic of the command.
|
protected PriceTC | selectPriceAdjustment(java.lang.Long aItem, java.util.Vector aTcInfoVec)
Selects the best adjustments for a catalog entry.
|
void | setCurrency(java.lang.String astrCurrency)
Sets the currency to be used for finding the price (Optional).
|
void | setErrorMode(boolean aErrorMode)
Sets the flag to indicate if exception will be thrown when the price cannot be found for the input catentry (Optional).
|
void | setItemPriceInfo(ItemPriceInfo[] aItemPriceInfo)
Sets the item info structure for internal use on calculating the prices.
|
void | setMasterCatalogPriceListIds(java.lang.Long[] aMasterpriceListIds)
Sets the ids the price list associated with the Master Catalog (Optional).
|
void | setPriceListIds(java.lang.Long[] aPriceListIds)
Sets the ids of the input price lists to be used for retrieving the offers.
|
void | setStoreId(java.lang.Integer aStoreId)
Sets the id of the input store to be used for calculating the price (Optional).
|
void | setTradingABs(TradingAgreementAccessBean[] aTradingABs)
Sets the input trading agreement access beans for determining the contract prices.
|
void | setUseGlobalPriceList(boolean aUseGlobalPriceList)
Sets the flag, to indicate if the list of input price lists can be used globally, for retrieving the offers for all of the input catentries (Optional).
|
void | validateParameters()
Checks mandatory parameters.
|
public static final java.lang.String COPYRIGHT
public CalculateContractPricesCmdImpl()
protected QualifyingOfferInfo calculatePriceAdjustment(QualifyingOfferInfo aOfferInfo, PriceTC aBestPriceTC) throws ECException
protected java.lang.String getCurrency()
public ItemPriceInfo[] getItemPriceInfo()
public void performExecute() throws ECException
protected PriceTC selectPriceAdjustment(java.lang.Long aItem, java.util.Vector aTcInfoVec) throws ECException
public void setCurrency(java.lang.String astrCurrency)
public void setErrorMode(boolean aErrorMode)
public void setItemPriceInfo(ItemPriceInfo[] aItemPriceInfo)
public void setMasterCatalogPriceListIds(java.lang.Long[] aMasterpriceListIds)
public void setPriceListIds(java.lang.Long[] aPriceListIds)
public void setStoreId(java.lang.Integer aStoreId)
public void setTradingABs(TradingAgreementAccessBean[] aTradingABs)
public void setUseGlobalPriceList(boolean aUseGlobalPriceList)
public void validateParameters() throws ECException
protected java.util.Vector getOfferPrices(java.lang.Long anOfferId) throws ECException