public class ReturnItem
extends java.lang.Object
implements java.io.Serializable
The loadReturnItem(RepositoryItem)
is used to load return item properties from repository item.
if you add additional properties to return item and it needs to be loaded to the return item object, you need
to extend this method.
The #loadReturnItem(MutableRepositoryItem)
is used to save return item properties to repository item.
if you add additional properties to return item and it needs to be saved in the repository, you need
to extend this method.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected java.util.Collection |
mItemCostAdjustments |
Constructor and Description |
---|
ReturnItem(CommerceItem pCommerceItem)
Initialize a ReturnItem based on the given commerce item
|
Modifier and Type | Method and Description |
---|---|
void |
addItemCostAdjustment(ItemCostAdjustment pItemCostAdjustment)
Adds a new
ItemCostAdjustment to the return. |
void |
addItemCostAdjustments(java.util.Collection pItemCostAdjustments)
Adds a collection of
ItemCostAdjustment objects to the return. |
void |
clearItemCostAdjustments()
Clears all the
ItemCostAdjustment objects from the return |
double |
getActualShippingRefundShare() |
double |
getActualTaxRefundShare() |
CommerceItem |
getCommerceItem() |
java.lang.String |
getDisposition()
Returns the disposition for this item
|
java.lang.String |
getId()
Returns the id of this return item
|
static ReturnItem |
getInstance(CommerceItem pCommerceItem)
Deprecated.
|
java.util.Collection |
getItemCostAdjustments()
Returns the collection of
ItemCostAdjustment objects
that are used to determine the suggested refund amounts for the
return. |
long |
getQuantityAvailable() |
double |
getQuantityAvailableDerivedAsFloatingPoint()
This method will return a derived quantity that is available, not to return.
|
long |
getQuantityReceived()
Returns the quantity that has been received
|
double |
getQuantityReceivedDerivedAsFloatingPoint()
This method will return a derived quantity that has been received, which this ReturnItem object represents.
|
long |
getQuantityReturned() |
double |
getQuantityReturnedDerivedAsFloatingPoint()
This method will return a derived quantity of this item that has previously been returned,
which this ReturnItem object represents.
|
long |
getQuantityShipped() |
double |
getQuantityShippedDerivedAsFloatingPoint()
This method will return a derived quantity of this item that was originally shipped, which this ReturnItem object represents.
|
long |
getQuantityToExchange() |
double |
getQuantityToExchangeDerivedAsFloatingPoint()
This method will return a derived quantity that should be exchanged, which this ReturnItem object represents.
|
long |
getQuantityToProcess() |
double |
getQuantityToProcessDerivedAsFloatingPoint()
This method will return a derived total quantity to process (i.e.
|
long |
getQuantityToReturn()
Returns the quantity that should be returned
|
double |
getQuantityToReturnDerivedAsFloatingPoint()
This method will return a derived quantity to be returned, which this ReturnItem object represents.
|
double |
getQuantityWithFractionAvailable()
Returns the quantity that is available to return.
|
double |
getQuantityWithFractionReceived()
Returns the quantity of an item (fractional) that has been received
|
double |
getQuantityWithFractionReturned()
Returns the quantity of this item (fractional) that has previously been returned
|
double |
getQuantityWithFractionShipped()
Returns the quantity of this item (fractional) that was originally shipped.
|
double |
getQuantityWithFractionToExchange()
Returns the quantity (fractional) that should be exchanged.
|
double |
getQuantityWithFractionToProcess()
Returns the total quantity (fractional) to process (i.e.
|
double |
getQuantityWithFractionToReturn()
Returns the quantity (fractional) that should be returned.
|
double |
getRefundAmount() |
java.lang.String |
getReturnReason()
Returns the reason that this item was returned
|
java.lang.String |
getShippingGroupId()
Returns the id of the shipping group that this record is related to
|
java.lang.String |
getState()
Returns the state of this return item
|
java.lang.String |
getStateAsUserResource()
returns the ReturnItem state as a user resource
|
java.lang.String |
getStateDetailAsUserResource()
returns the ReturnItem state detail as a user resource
|
double |
getSuggestedRefundAmount() |
double |
getSuggestedShippingRefundShare() |
double |
getSuggestedTaxRefundShare() |
boolean |
isEditable()
Returns a
boolean value that will decide, if this item can be edited. |
boolean |
isReturnShipmentRequired()
Returns the switch that indicates if the item must be returned
|
void |
loadReturnItem(RepositoryItem pSource)
This method is used to copy the information from the source return item repository item to
return item instance.
|
void |
saveReturnItem(MutableRepositoryItem pDestination)
This method is used to copy the information from return item instance to
repository item.
|
void |
setActualShippingRefundShare(double pActualShippingRefundShare) |
void |
setActualTaxRefundShare(double pActualTaxRefundShare) |
void |
setDisposition(java.lang.String pDisposition)
Sets the disposition for this item
|
protected void |
setId(java.lang.String pId)
Sets the id of this return item
|
void |
setQuantityReceived(long pQuantityReceived)
Sets the quantity that has been received
|
void |
setQuantityReturned(long pQuantityReturned)
Sets the quantity of this item that has previously been returned
|
void |
setQuantityShipped(long pQuantityShipped)
Sets the quantity of this item that was originally shipped
|
void |
setQuantityToExchange(long pQuantityToExchange)
Sets the quantity that should be exchanged
|
void |
setQuantityToReturn(long pQuantityToReturn)
Sets the quantity that should be returned
|
void |
setQuantityWithFractionReceived(double pQuantityWithFractionReceived)
Sets the quantity of an item (fractional) that has been received
|
void |
setQuantityWithFractionReturned(double pQuantityWithFractionReturned)
Sets the quantity of this item (fractional) that has previously been returned
|
void |
setQuantityWithFractionShipped(double pQuantityWithFractionShipped)
Sets the fractional quantity of this item that was originally shipped
|
void |
setQuantityWithFractionToExchange(double pQuantityWithFractionToExchange)
Sets the quantity (fractional) that should be exchanged
|
void |
setQuantityWithFractionToReturn(double pQuantityWithFractionToReturn)
Sets the quantity (fractional) that should be returned
|
void |
setRefundAmount(double pRefundAmount)
Sets the refund amount for this item
|
void |
setReturnReason(java.lang.String pReturnReason)
Sets the reason that this item was returned
|
void |
setReturnShipmentRequired(boolean pReturnShipmentRequired)
Sets the switch that indicates if the item must be returned
|
protected void |
setShippingGroupId(java.lang.String pShippingGroupId)
Sets the id of the shipping group that this record is related to
|
protected void |
setState(java.lang.String pState)
Sets the state of this return item
|
void |
setSuggestedRefundAmount(double pSuggestedRefundAmount)
Sets the suggested refund amount
|
void |
setSuggestedShippingRefundShare(double pSuggestedShippingRefundShare) |
void |
setSuggestedTaxRefundShare(double pSuggestedTaxRefundShare) |
java.lang.String |
toString() |
public static final java.lang.String CLASS_VERSION
protected java.util.Collection mItemCostAdjustments
public ReturnItem(CommerceItem pCommerceItem)
setCommerceItem(CommerceItem)
public CommerceItem getCommerceItem()
public void setDisposition(java.lang.String pDisposition)
pDisposition
- the disposition for this itempublic java.lang.String getDisposition()
protected void setId(java.lang.String pId)
pId
- the id of this return itempublic java.lang.String getId()
public void setQuantityReceived(long pQuantityReceived)
pQuantityReceived
- the quantity that has been receivedpublic long getQuantityReceived()
public void setQuantityWithFractionReceived(double pQuantityWithFractionReceived)
pQuantityWithFractionReceived
- the quantity that has been receivedpublic double getQuantityWithFractionReceived()
public double getQuantityReceivedDerivedAsFloatingPoint()
It will decide upon the correct quantity value to return, returning the first non zero
value from the properties, quantityWithFractionReceived
, quantityReceived
, in that order.
The method should be used where there is a need to know the quantity that has been received,
but it is unknown to the caller as to which property (quantityWithFractionReceived
or
quantityReceived
holds the value.
public void setQuantityReturned(long pQuantityReturned)
pQuantityReturned
- the quantity of this item that has previously been returnedpublic long getQuantityReturned()
public void setQuantityWithFractionReturned(double pQuantityWithFractionReturned)
pQuantityWithFractionReturned
- the quantity of this item (fractional) that has previously been returnedpublic double getQuantityWithFractionReturned()
public double getQuantityReturnedDerivedAsFloatingPoint()
It will decide upon the correct quantity value to return, returning the first non zero
value from the properties, quantityWithFractionReturned
, quantityReturned
, in that order.
The method should be used where there is a need to know the quantity of this item that has previously been returned,
but it is unknown to the caller as to which property (quantityWithFractionReturned
or
quantityReturned
holds the value.
public void setQuantityShipped(long pQuantityShipped)
pQuantityShipped
- the quantity of this item that was originally shippedpublic long getQuantityShipped()
public void setQuantityWithFractionShipped(double pQuantityWithFractionShipped)
pQuantityWithFractionShipped
- the quantity of this item (fractional) that was originally shippedpublic double getQuantityWithFractionShipped()
public double getQuantityShippedDerivedAsFloatingPoint()
It will decide upon the correct quantity value to return, returning the first non zero
value from the properties, quantityWithFractionShipped
, quantityShipped
, in that order.
The method should be used where there is a need to know the quantity of this item that was originally shipped,
but it is unknown to the caller as to which property (quantityWithFractionShipped
or
quantityShipped
holds the value.
public void setQuantityToExchange(long pQuantityToExchange)
pQuantityToExchange
- the quantity that should be exchangedpublic long getQuantityToExchange()
public void setQuantityWithFractionToExchange(double pQuantityWithFractionToExchange)
pQuantityWithFractionToExchange
- the quantity (fractional) that should be exchangedpublic double getQuantityWithFractionToExchange()
public double getQuantityToExchangeDerivedAsFloatingPoint()
It will decide upon the correct quantity value to return, returning the first non zero
value from the properties, quantityWithFractionToExchange
, quantityToExchange
, in that order.
The method should be used where there is a need to know the quantity of an item that should be exchanged,
but it is unknown to the caller as to which property (quantityWithFractionToExchange
or
quantityToExchange
holds the value.
public void setQuantityToReturn(long pQuantityToReturn)
pQuantityToReturn
- the quantity that should be returnedpublic long getQuantityToReturn()
public void setQuantityWithFractionToReturn(double pQuantityWithFractionToReturn)
pQuantityWithFractionToReturn
- the quantity (fractional) that should be returnedpublic double getQuantityWithFractionToReturn()
public double getQuantityToReturnDerivedAsFloatingPoint()
It will decide upon the correct quantity value that should be returned, returning the first non zero
value from the properties, quantityWithFractionToReturn
, quantityToReturn
, in that order.
The method should be used where there is a need to know the quantity of an item that should be returned,
but it is unknown to the caller as to which property quantityWithFractionToReturn
or
quantityToReturn
holds the value.
public void setRefundAmount(double pRefundAmount)
pRefundAmount
- the refund amount for this itempublic double getRefundAmount()
public void setReturnReason(java.lang.String pReturnReason)
pReturnReason
- the reason that this item was returnedpublic java.lang.String getReturnReason()
public void setReturnShipmentRequired(boolean pReturnShipmentRequired)
pReturnShipmentRequired
- boolean indicating if the item must be returnedpublic boolean isReturnShipmentRequired()
protected void setShippingGroupId(java.lang.String pShippingGroupId)
pShippingGroupId
- the id of the shipping group that this record is related topublic java.lang.String getShippingGroupId()
protected void setState(java.lang.String pState)
pState
- the state of this return itempublic java.lang.String getState()
public java.lang.String getStateAsUserResource()
public java.lang.String getStateDetailAsUserResource()
public void setSuggestedRefundAmount(double pSuggestedRefundAmount)
pSuggestedRefundAmount
- the suggested refund amount based on the original price of the itempublic double getSuggestedRefundAmount()
public double getSuggestedShippingRefundShare()
public void setSuggestedShippingRefundShare(double pSuggestedShippingRefundShare)
public double getSuggestedTaxRefundShare()
public void setSuggestedTaxRefundShare(double pSuggestedTaxRefundShare)
public double getActualShippingRefundShare()
public void setActualShippingRefundShare(double pActualShippingRefundShare)
public double getActualTaxRefundShare()
public void setActualTaxRefundShare(double pActualTaxRefundShare)
public long getQuantityAvailable()
public double getQuantityWithFractionAvailable()
It will return double
value of quantity that is available to return, by subtracting the value
that is returned by getQuantityWithFractionReturned
, from
the value that is returned by getQuantityWithFractionShipped
double
the quantity that is available to return.public double getQuantityAvailableDerivedAsFloatingPoint()
It will return double
value of quantity that is available, not to return, by subtracting the value
that is returned by getQuantityReturnedDerivedAsFloatingPoint
, from
the value that is returned by getQuantityShippedDerivedAsFloatingPoint
public long getQuantityToProcess()
public double getQuantityWithFractionToProcess()
It will return double
value, the total quantity of an item (fractional) to process (i.e. return and exchange),
by adding the value that is returned from getQuantityWithFractionToReturn
, and
the value that is returned from getQuantityWithFractionToExchange
double
the total quantity (fractional) to process (i.e. return and exchange).public double getQuantityToProcessDerivedAsFloatingPoint()
It will return double
value, the total fractional quantity to process (i.e. return and exchange),
by adding the value that is returned from getQuantityToReturnDerivedAsFloatingPoint
, and
the value that is returned from getQuantityToExchangeDerivedAsFloatingPoint
public boolean isEditable()
boolean
value that will decide, if this item can be edited.
It will return true
value, if the value returned from getQuantityReceivedDerivedAsFloatingPoint
is less
than the value that is returned from getQuantityToProcessDerivedAsFloatingPoint
, which indicates the item is editable,
otherwise, this will return false
, which represents that item is not editable.
boolean
value.public java.util.Collection getItemCostAdjustments()
ItemCostAdjustment
objects
that are used to determine the suggested refund amounts for the
return.public void addItemCostAdjustment(ItemCostAdjustment pItemCostAdjustment)
ItemCostAdjustment
to the return.pItemCostAdjustment
- public void addItemCostAdjustments(java.util.Collection pItemCostAdjustments)
ItemCostAdjustment
objects to the return.pItemCostAdjustments
- public void clearItemCostAdjustments()
ItemCostAdjustment
objects from the returnpublic java.lang.String toString()
toString
in class java.lang.Object
public static ReturnItem getInstance(CommerceItem pCommerceItem)
public void loadReturnItem(RepositoryItem pSource) throws ReturnException
pSource
- The information to be copied from.ReturnException
public void saveReturnItem(MutableRepositoryItem pDestination) throws ReturnException
pDestination
- The information to be copiedReturnException