Class ReturnItem
An item of a Return, created using Return.createItem(String). Represents a physically returned order line item. Please refer to the documentation of ReturnHooks for further information.
When the related Return were set to status COMPLETED, only the the custom attributes of the return item can be changed.
Order post-processing APIs (gillian) are now inactive by default and will throw an exception if accessed. Activation needs preliminary approval by Product Management. Please contact support in this case. Existing customers using these APIs are not affected by this change and can use the APIs until further notice.
| Property | Description |
|---|---|
basePrice: Money (read-only) | Price of a single unit before discount application. |
| note: String | Return the note for this return item. |
| parentItem: ReturnItem | Returns null or the parent item. |
| reasonCode: EnumValue | Returns the reason code for return item. |
returnCaseItem: ReturnCaseItem (read-only) | Returns the return case item related to this item. |
returnNumber: String (read-only) | The mandatory returnNumber of the Return to which this item belongs. |
| returnedQuantity: Quantity | The Quantity returned. |
This class does not have a constructor, so you cannot create it directly.
| Method | Description |
|---|---|
| addTaxItem(Decimal, TaxGroup) | Create a new tax-item and add to this item. |
| applyPriceRate(Decimal, Decimal, Boolean) | Apply a rate of (factor / divisor) to the prices in this item, with the option to half round up or half round down to the nearest cent if necessary. |
| getBasePrice() | Price of a single unit before discount application. |
| getNote() | Return the note for this return item. |
| getParentItem() | Returns null or the parent item. |
| getReasonCode() | Returns the reason code for return item. |
| getReturnCaseItem() | Returns the return case item related to this item. |
| getReturnNumber() | The mandatory returnNumber of the Return to which this item belongs. |
| getReturnedQuantity() | The Quantity returned. |
| setNote(String) | Sets a note for this return item. |
| setParentItem(ReturnItem) | Set a parent item. |
| setReasonCode(String) | Set the reason code. |
| setReturnedQuantity(Quantity) | Set the Quantity returned. |
| setTaxBasis(Money) | Set the tax-basis price for this item. |
| setTaxItems(Collection) | Set the tax-items for this item. |
getGrossPrice, getItemID, getLineItem, getNetPrice, getOrderItem, getOrderItemID, getTax, getTaxBasis, getTaxItems
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
- basePrice: Money
(read-only) Price of a single unit before discount application.
- note: String
Return the note for this return item.
- parentItem: ReturnItem
Returns null or the parent item.
- reasonCode: EnumValue
Returns the reason code for return item. The list of reason codes can be updated by updating meta-data for ReturnItem.
- returnCaseItem: ReturnCaseItem
(read-only) Returns the return case item related to this item. Should never return null.
- returnNumber: String
(read-only) The mandatory returnNumber of the Return to which this item belongs.
- addTaxItem(amount: Decimal, taxGroup: TaxGroup): TaxItem
Create a new tax-item and add to this item.
Parameters:
- amount - amount to assign to the tax-item
- taxGroup - the TaxGroup to which the item belongs
Returns:
- the new tax-item
- applyPriceRate(factor: Decimal, divisor: Decimal, roundUp: Boolean): void
Apply a rate of (factor / divisor) to the prices in this item, with the option to half round up or half round down to the nearest cent if necessary.
Examples:
TaxBasis before factor divisor roundup Calculation TaxBasis after $10.00 1 2 true 10*1/2= $5.00 $10.00 9 10 true 10*9/10= $9.00 $10.00 1 3 true 10*1/3=3.3333= $3.33 $2.47 1 2 true 2.47*1/2=1.235= $1.24 $2.47 1 2 false 2.47*1/2=1.235= $1.23 Which prices are updated?:
The rate described above is applied to tax-basis and tax then the net-price and gross-price are recalculated by adding / subtracting depending on whether the order is based on net price.
Example (order based on net price)
New TaxBasis:$10.00, Tax:$1.00, NetPrice=TaxBasis=$10.00, GrossPrice=TaxBasis+Tax=$11.00
Example (order based on gross price)
New TaxBasis:$10.00, Tax:$1.00, NetPrice=TaxBasis-tax=$9.00, GrossPrice=TaxBasis=$10.00
Parameters:
- factor - factor used to calculate rate
- divisor - divisor used to calculate rate
- roundUp - whether to round up or down on 0.5
See Also:
- getBasePrice(): Money
Price of a single unit before discount application.
Returns:
- Price of a single unit before discount application.
- getNote(): String
Return the note for this return item.
Returns:
- the note or
null
- the note or
- getParentItem(): ReturnItem
Returns null or the parent item.
Returns:
- null or the parent item.
- getReasonCode(): EnumValue
Returns the reason code for return item. The list of reason codes can be updated by updating meta-data for ReturnItem.
Returns:
- the return reason code
- getReturnCaseItem(): ReturnCaseItem
Returns the return case item related to this item. Should never return null.
Returns:
- the return case item related to this item
- getReturnNumber(): String
The mandatory returnNumber of the Return to which this item belongs.
Returns:
- the returnNumber of the Return to which this item belongs
- getReturnedQuantity(): Quantity
The Quantity returned. This may return an N/A quantity.
Returns:
- the quantity returned, may be N/A
- setNote(note: String): void
Sets a note for this return item.
Parameters:
- note - the note for this return item to set
- setParentItem(parentItem: ReturnItem): void
Set a parent item. The parent item must belong to the same Return. An infinite parent-child loop is disallowed as is a parent-child depth greater than 10. Setting a parent item indicates a dependency of the child item on the parent item, and can be used to form a parallel structure to that accessed using ProductLineItem.getParent().
Parameters:
- parentItem - The parent item, null is allowed
- setReasonCode(reasonCode: String): void
Set the reason code. The list of reason codes can be updated by updating meta-data for ReturnItem.
Parameters:
- reasonCode - the reason code to set
- setReturnedQuantity(quantity: Quantity): void
Set the Quantity returned. Passing null results in an exception being thrown. The quantity must be higher than zero and not be higher than the remaining quantity to return.
The item prices are recalculated in this method as described in applyPriceRate(Decimal, Decimal, Boolean) with the
quantityargument as the factor, and ordered quantity as divisor andtrueas the roundup parameter.Parameters:
- quantity - the quantity returned, null not allowed
See Also:
- setTaxBasis(taxBasis: Money): void
Set the tax-basis price for this item.
Parameters:
- taxBasis - the tax basis value.
- setTaxItems(taxItems: Collection): void
Set the tax-items for this item.
Parameters:
- taxItems - items
See Also: