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.
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
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().
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 quantity argument as the factor, and ordered quantity as divisor
and true as the roundup parameter.
Parameters:
quantity - the quantity returned, null not allowed