Class Return

The Return represents a physical customer return, and contains 1..n ReturnItems. The Return is associated with one ReturnCase, and each ReturnItem is associated with one ReturnCaseItem and (via the ReturnCaseItem) a single OrderItem usually representing an Order ProductLineItem.

The ReturnItem records the quantity returned.

The Return can have one of these status values:

  • NEW - the return is new, i.e. needs to undergo a check before it can be marked as COMPLETED
  • COMPLETED - the return is complete, this is a precondition for refunding the customer for a return.

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.

Constant Summary 

ConstantDescription
ORDERBY_ITEMID: ObjectSorting by item id.
ORDERBY_ITEMPOSITION: ObjectSorting by the position of the related oder item.
ORDERBY_UNSORTED: ObjectUnsorted , as it is.
QUALIFIER_PRODUCTITEMS: ObjectSelects the product items.
QUALIFIER_SERVICEITEMS: ObjectSelects for the service items.
STATUS_COMPLETED: String = “COMPLETED”Constant for Return Status COMPLETED
STATUS_NEW: String = “NEW”Constant for Return Status NEW

Property Summary 

PropertyDescription
invoice: Invoice (read-only)Returns null or the previously created Invoice.
invoiceNumber: String (read-only)Returns null or the invoice-number.
items: FilteringCollection (read-only)Returns the ReturnItems contained in the Return, created with method createItem(String).
note: StringA note for the return.
returnCase: ReturnCase (read-only)Returns the ReturnCase with which this Return is associated.
returnNumber: String (read-only)The return number identifying this return.
status: EnumValueGets the return status.

Constructor Summary 

This class does not have a constructor, so you cannot create it directly.

Method Summary 

MethodDescription
createInvoice()Creates a new Invoice based on this Return.
createInvoice(String)Creates a new Invoice based on this Return.
createItem(String)Create a ReturnItem based on a ReturnCaseItem.
getInvoice()Returns null or the previously created Invoice.
getInvoiceNumber()Returns null or the invoice-number.
getItems()Returns the ReturnItems contained in the Return, created with method createItem(String).
getNote()A note for the return.
getReturnCase()Returns the ReturnCase with which this Return is associated.
getReturnNumber()The return number identifying this return.
getStatus()Gets the return status.
setNote(String)Sets a note for the return.
setStatus(String)Sets the return status.

Methods inherited from class AbstractItemCtnr 

getCreatedBy, getCreationDate, getGrandTotal, getItems, getLastModified, getModifiedBy, getOrder, getProductSubtotal, getServiceSubtotal

Methods inherited from class Extensible 

describe, getCustom

Methods inherited from class Object 

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

Constant Details 

ORDERBY_ITEMID 

ORDERBY_ITEMID: Object

Sorting by item id. Use with method getItems() as an argument to method FilteringCollection.sort(Object).


ORDERBY_ITEMPOSITION 

ORDERBY_ITEMPOSITION: Object

Sorting by the position of the related oder item. Use with method getItems() as an argument to method FilteringCollection.sort(Object).


ORDERBY_UNSORTED 

ORDERBY_UNSORTED: Object

Unsorted , as it is. Use with method getItems() as an argument to method FilteringCollection.sort(Object).


QUALIFIER_PRODUCTITEMS 

QUALIFIER_PRODUCTITEMS: Object

Selects the product items. Use with method getItems() as an argument to method FilteringCollection.select(Object).


QUALIFIER_SERVICEITEMS 

QUALIFIER_SERVICEITEMS: Object

Selects for the service items. Use with method getItems() as an argument to method FilteringCollection.select(Object).


STATUS_COMPLETED 

STATUS_COMPLETED: String = "COMPLETED"

Constant for Return Status COMPLETED


STATUS_NEW 

STATUS_NEW: String = "NEW"

Constant for Return Status NEW


Property Details 

invoice 

invoice: Invoice (read-only)

Returns null or the previously created Invoice.

See Also:


invoiceNumber 

invoiceNumber: String (read-only)

Returns null or the invoice-number.

See Also:


items 

items: FilteringCollection (read-only)

Returns the ReturnItems contained in the Return, created with method createItem(String).

This FilteringCollection can be sorted / filtered using:

See Also:


note 

note: String

A note for the return.


returnCase 

returnCase: ReturnCase (read-only)

Returns the ReturnCase with which this Return is associated. The ReturnCase may represent an RMA (return merchandise authorization).


returnNumber 

returnNumber: String (read-only)

The return number identifying this return.


status 

status: EnumValue

Gets the return status.

Possible values are STATUS_NEW, STATUS_COMPLETED.


Method Details 

createInvoice() 

createInvoice(): Invoice

Creates a new Invoice based on this Return. The return-number will be used as the invoice-number. The Invoice can then be accessed using getInvoice() or its number using getInvoiceNumber(). The method must not be called more than once for a Return, nor may 2 Invoices exist with the same invoice-number.

The new Invoice is a credit-invoice with a Invoice.STATUS_NOT_PAID status, and will be passed to the refund payment-hook in a separate database transaction for processing.

Returns:

  • new invoice

createInvoice(String) 

createInvoice(invoiceNumber: String): Invoice

Creates a new Invoice based on this Return. The invoice-number must be specified as an argument. The Invoice can then be accessed using getInvoice() or its number using getInvoiceNumber(). The method must not be called more than once for a Return, nor may 2 Invoices exist with the same invoice-number.

The new Invoice is a credit-invoice with a Invoice.STATUS_NOT_PAID status, and will be passed to the refund payment-hook in a separate database transaction for processing.

Parameters:

  • invoiceNumber - the invoice-number to use

Returns:

  • the new invoice

createItem(String) 

createItem(returnCaseItemID: String): ReturnItem

Create a ReturnItem based on a ReturnCaseItem.

Parameters:

  • returnCaseItemID - the id of the return case item

Returns:

  • the created return item

getInvoice() 

getInvoice(): Invoice

Returns null or the previously created Invoice.

Returns:

  • null or the previously created invoice.

See Also:


getInvoiceNumber() 

getInvoiceNumber(): String

Returns null or the invoice-number.

Returns:

  • null or the previously created invoice.

See Also:


getItems() 

getItems(): FilteringCollection

Returns the ReturnItems contained in the Return, created with method createItem(String).

This FilteringCollection can be sorted / filtered using:

Returns:

  • the return items

See Also:


getNote() 

getNote(): String

A note for the return.

Returns:

  • the note or null

getReturnCase() 

getReturnCase(): ReturnCase

Returns the ReturnCase with which this Return is associated. The ReturnCase may represent an RMA (return merchandise authorization).

Returns:

  • the return case

getReturnNumber() 

getReturnNumber(): String

The return number identifying this return.

Returns:

  • the return number

getStatus() 

getStatus(): EnumValue

Gets the return status.

Possible values are STATUS_NEW, STATUS_COMPLETED.

Returns:

  • the status

setNote(String) 

setNote(note: String): void

Sets a note for the return.

Parameters:

  • note - the note

setStatus(String) 

setStatus(statusName: String): void

Sets the return status.

Possible values are STATUS_NEW, STATUS_COMPLETED

When set to status COMPLETED, only the the custom attributes of the return itself and its return items can be changed.

Parameters:

  • statusName - the status