public class DetailedItemPriceInfo extends AmountInfo
Example:
Let's say there exists a CommerceItem whose sku is a red pair of shorts and whose quantity is 5. This is equivalent to saying that someone has put 5 pairs of red shorts in their virtual shopping cart. Let's also say that a user has a promotion good for 10 percent off up to 3 pairs of shorts. This is where DetailedItemPriceInfo comes in. A single ItemPriceInfo can't capture all of the information needed. The ItemPriceInfo will have two DetailedItemPriceInfo entries in its currentPriceDetails List:
quantity
or quantityWithFraction
must be greater than zero.
amount
by the quantity
.
ItemPriceInfo
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
FINAL_PRICE_MANUAL_ADJUSTMENT, mFinalReasonCode
Constructor and Description |
---|
DetailedItemPriceInfo()
Constructs an empty DetailedItemPriceInfo
|
DetailedItemPriceInfo(DetailedItemPriceInfo pDetailedItemPriceInfo)
Constructs a new DetailedItemPriceInfo that inherits the change history of the
input pDetailedItemPriceInfo.
|
Modifier and Type | Method and Description |
---|---|
void |
copyDetailProperties(DetailedItemPriceInfo pDetailedItemPriceInfo)
Copies the data from the given DetailedItemPriceInfo to this one.
|
double |
getDetailedUnitPrice()
the price for a quantity of one of this DetailedItemPriceInfo
Note: property is read - only.
|
ItemPriceInfo |
getItemPriceInfo()
the ItemPriceInfo to which this detailed info belongs
|
double |
getOrderDiscountShare()
The amount from all order discounts that apply to this item (and effect the taxable amount)
|
double |
getOrderManualAdjustmentShare()
The amount from all order manual adjustments that apply to this item (and effect the taxable amount)
|
long |
getQuantity()
how many of a commerceitem this object represents
|
long |
getQuantityAsQualifier()
the portion of this DetailedItemPriceInfo that has acted as a qualifier.
|
double |
getQuantityAsQualifierDerivedAsFloatingPoint()
The portion of this DetailedItemPriceInfo that has acted as a qualifier.
|
double |
getQuantityDerivedAsFloatingPoint()
This method will return a derived quantity value which this CommerceItem object represents.
|
double |
getQuantityWithFraction()
Returns the quantity of a commerceitem (fractional) this object represents
|
double |
getQuantityWithFractionAsQualifier()
The portion of this DetailedItemPriceInfo that has acted as a qualifier.
|
atg.core.util.Range |
getRange()
The range of items priced using this detail
|
double |
getTax()
The amount of tax paid for this item
|
boolean |
isFractional()
This returns
true if fractional quantity is set (i.e. |
void |
setItemPriceInfo(ItemPriceInfo pItemPriceInfo)
the ItemPriceInfo to which this detailed info belongs
|
void |
setOrderDiscountShare(double pOrderDiscountShare) |
void |
setOrderManualAdjustmentShare(double pOrderManualAdjustmentShare) |
void |
setQuantity(long pQuantity)
how many of a commerceitem this object represents
|
void |
setQuantityAsQualifier(long pQuantityAsQualifier)
the portion of this DetailedItemPriceInfo that has acted as a qualifier.
|
void |
setQuantityWithFraction(double pQuantityWithFraction)
Sets the quantity of a commerceitem (fractional) this object represents
|
void |
setQuantityWithFractionAsQualifier(double pQuantityWithFractionAsQualifier)
The portion of this DetailedItemPriceInfo that has acted as a qualifier.
|
void |
setRange(atg.core.util.Range pRange) |
void |
setTax(double pTax) |
java.lang.String |
toString()
produces a String representation of the DetailedItemPriceInfo
|
getAdjustments, getAmount, getClosenessQualifiers, getCurrencyCode, getFinalReasonCode, isAmountIsFinal, isDiscounted, markAsFinal, markAsFinal, markAsFinal, markAsFinal, setAmount, setAmountIsFinal, setClosenessQualifiers, setCurrencyCode, setDiscounted, setFinalReasonCode, unmarkAsFinal
public DetailedItemPriceInfo()
public DetailedItemPriceInfo(DetailedItemPriceInfo pDetailedItemPriceInfo)
pDetailedItemPriceInfo
- the details on which this new details will be basedpublic void setQuantity(long pQuantity)
pQuantity
- new value to set. Cannot be less than one.public long getQuantity()
public void setQuantityWithFraction(double pQuantityWithFraction)
pQuantityWithFraction
- new value to set. Cannot be less than zero.public double getQuantityWithFraction()
double
value.public double getQuantityDerivedAsFloatingPoint()
It will decide upon the correct quantity value to return, returning the first non null
value from the properties, quantityWithFraction
, quantity
, in that order.
The method should be used where there is a need to know the quantity of an item
but it is unknown to the caller as to which property (quantityWithFraction
or
quantity
holds the value.
public boolean isFractional()
true
if fractional quantity is set (i.e. it has the
fractional value which is greater than zero) for the item for which this relationship
represents, otherwise false
is returned.boolean
value.public void setTax(double pTax)
public double getTax()
public void setOrderDiscountShare(double pOrderDiscountShare)
public double getOrderDiscountShare()
public void setOrderManualAdjustmentShare(double pOrderManualAdjustmentShare)
public double getOrderManualAdjustmentShare()
public void setRange(atg.core.util.Range pRange)
public atg.core.util.Range getRange()
public void setItemPriceInfo(ItemPriceInfo pItemPriceInfo)
pItemPriceInfo
- new value to setpublic ItemPriceInfo getItemPriceInfo()
public void setQuantityAsQualifier(long pQuantityAsQualifier)
pItemPriceInfo
- new value to setpublic long getQuantityAsQualifier()
public void setQuantityWithFractionAsQualifier(double pQuantityWithFractionAsQualifier)
pQuantityWithFractionAsQualifier
- new value to setpublic double getQuantityWithFractionAsQualifier()
public double getQuantityAsQualifierDerivedAsFloatingPoint()
getQuantityWithFractionAsQualifier,
getQuantityAsQualifier
public double getDetailedUnitPrice()
public void copyDetailProperties(DetailedItemPriceInfo pDetailedItemPriceInfo)
pDetailedItemPriceInfo
- the details on which this new details will be basedpublic java.lang.String toString()
toString
in class AmountInfo