JSMA order

Overview

The JSMA order provides functionality for handling orders

What can JSMA order do for me?

You could easily use the JSMA order to edit an order

Index

Usage

writing data

Here is an example on how to write data to a JSMA order:

...
order.addHistoryEntry(content, [user])
...

reading data

Here is an example on how to read data from a JSMA order:

... 
order.backendUuid()
...

Methods

The JSMA order provides the following methods:

order.addHistoryEntry(content, [user])

Adds the content as a history entry to the order

Example

... 
order.addHistoryEntry(content, [user])
...

Parameter content (required)

Parameter user (optional)

orderItem order.addItem(product_id, [project], [custom_price])

Adds an item to the order

Example

... 
order.addItem(product_id, [project], [custom_price])
...

Parameter product_id (required)

Parameter project (optional)

Parameter custom_price (optional)

orderItem order.addVoucher(token, [value], [title])

Adds the token as voucher to the order

Example

... 
order.addVoucher(token, [value], [title])
...

Parameter token (required)

Parameter value (optional)

Parameter title (optional)

order.backendState

Returns the backend-state of the order

Example

... 
order.backendState
...

order.backendUuid

Returns the backend uuid of the order

Example

... 
order.backendUuid
...

Pathname order.bill

Returns the bill of the order

Example

... 
order.bill
...

String order.bookingState

Returns the booking state of the order

Example

... 
order.bookingState
...

String order.creationDate

Returns the date of when the order was created.

Example

... 
order.creationDate
...

order.customerHint

Returns the customer hint of the order

Example

... 
order.customerHint
...

order.delete()

Deletes the order

Example

... 
order.delete()
...

order.financeState

Returns the finance state of the order

Example

... 
order.financeState
...

String[] order.flexAttributes

Returns an array of the flex attributes of an order

Example

... 
order.flexAttributes
...

string order.get(key)

Returns the value of key as string or null if no value is set under the key.

Example

... 
order.get(key)
...

Parameter key:string (required)

The key to be looked up in the flexAttributes of the order.

boolean order.has(key)

Returns a boolean value depending on whether key is present for a given order

Example

... 
order.has(key)
...

Parameter key:string (required)

The key to be looked up in the flexAttributes of the order.

int order.id

Returns the id of the order

Example

... 
order.id
...

int order.increment(key)

Increments the vale of a given key by one.

Example

... 
order.increment(key)
...

Parameter key:string (required)

The key to be incremented in the flexAttributes of the order.

address order.invoiceAddress

Returns the invoice address of the order

Example

... 
order.invoiceAddress
...

orderItem[] order.items

Returns the items of the order as an array of orderItems

Example

... 
order.items
...

String order.orderId

Returns the order id

Example

... 
order.orderId
...

int order.payed

Returns how much has benn payed

Example

... 
order.payed
...

String order.paymentDate

Returns the payment date of the order

Example

... 
order.paymentDate
...

string order.paymentMethod

Returns the payment method of the order

Example

... 
order.paymentMethod
...

portal order.portal

Returns the portal the order belongs to

Example

... 
order.portal
...

int order.price

Returns the price of the order

Example

... 
order.price
...

string order.productionState

Returns the productions state of the order

Example

... 
order.productionState
...

order.remove(key)

Removes the key from the flexAttributes of the order

Example

... 
order.remove(key)
...

Parameter key:string (required)

The key to be removed from the flexAttributes of the order.

void order.sanitizePiceds()

Calls sanitizePiced on all orderItems of the order. This opens the picedstore of each of the order's orderItems and runs ImageMagick convert over the images to repair images with broken pixels.

Example

... 
order.sanitizePiceds()
...

order.scheduleForPrint()

Schedules the order for printing

Example

... 
order.scheduleForPrint()
...

order.set(key, value)

Sets the value of a specified key for a given order.

Example

... 
order.set(key, value, [options])
...

Parameter key:string (required)

The key to be set in the flexAttributes of the order.

Parameter value:string (required)

The value to be set for the key

bool order.setBackendState(status)

Sets the backend state

Example

... 
order.setBackendState(status)
...

Parameter status (required)

bool order.setBackendUuid(uuid)

Sets the backend uuid

Example

... 
order.setBackendUuid(uuid)
...

Parameter uuid (required)

bool order.setBookingState(status)

Sets the booking state

Example

... 
order.setBookingState(status)
...

Parameter status (required)

bool order.setCustomerHint(hint)

Sets the customer hint

Example

... 
order.setCustomerHint(hint)
...

Parameter hint (required)

bool order.setFinanceState(status)

Sets the finance state

Example

... 
order.setFinanceState(status)
...

Parameter status (required)

bool order.setPayed(cent)

Sets how much has been payed in cent

Example

... 
order.setPayed(cent)
...

Parameter cent (required)

bool order.setPaymentDate(date)

Sets the day of the payment

Example

... 
order.setPaymentDate(date)
...

Parameter date (required)

bool order.setProductionState(status)

Sets the prodution state to status

Example

... 
order.setProductionState(status)
...

Parameter status (required)

bool order.setScheduledDate(date)

Sets the schedules date

Example

... 
order.setScheduledDate(date)
...

Parameter date (required)

bool order.setShipping(cent)

Sets the shipping costs in cent

Example

... 
order.setShipping(cent)
...

Parameter cent (required)

bool order.setSupportState(status)

Sets the support state to status

Example

... 
order.setSupportState(status)
...

Parameter status (required)

int order.shipping

Returns the shipping costs in cent

Example

... 
order.shipping
...

address order.shippingAddress

Returns the shipping address

Example

... 
order.shippingAddress
...

string order.supportState

Returns the support state

Example

... 
order.supportState
...

int order.tax

Returns the tax in cent

Example

... 
order.tax
...

order.undelete()

Undeletes an order

Example

... 
order.undelete()
...

String order.uuid

Returns the uuid of the order

Example

... 
order.uuid
...

orderItem order.voucher

Returns the voucher as orderItem

Example

... 
order.voucher
...