Properties

$id_supplier

$id_supplier : integer

Type

integer — Supplier

$supplier_name

$supplier_name : string

Type

string — Supplier Name

$id_lang

$id_lang : integer

Type

integer — The language id used on the delivery note

$id_warehouse

$id_warehouse : integer

Type

integer — Warehouse where products will be delivered

$id_supply_order_state

$id_supply_order_state : integer

Type

integer — Current state of the order

$id_currency

$id_currency : integer

Type

integer — Currency used for the order

$id_ref_currency

$id_ref_currency : integer

Type

integer — Currency used by default in main global configuration (i.e. by default for all shops)

$reference

$reference : string

Type

string — Reference of the order

$date_add

$date_add : string

Type

string — Date when added

$date_upd

$date_upd : string

Type

string — Date when updated

$date_delivery_expected

$date_delivery_expected : string

Type

string — Expected delivery date

$total_te

$total_te : float

Type

float — Total price without tax

$total_with_discount_te

$total_with_discount_te : float

Type

float — Total price after discount, without tax

$total_ti

$total_ti : float

Type

float — Total price with tax

$total_tax

$total_tax : float

Type

float — Total tax value

$discount_rate

$discount_rate : float

Type

float — Supplier discount rate (for the whole order)

$discount_value_te

$discount_value_te : float

Type

float — Supplier discount value without tax (for the whole order)

$is_template

$is_template : integer

Type

integer — Tells if this order is a template

$definition

$definition : 

Type

$webserviceParameters

$webserviceParameters : 

Type

Methods

update()

update(  $null_values = false) 

Parameters

$null_values

add()

add(  $autodate = true,   $null_values = false) 

Parameters

$autodate
$null_values

getEntries()

getEntries(integer  $id_lang = null) : array

Retrieves the product entries for the current order

Parameters

integer $id_lang

Optional Id Lang - Uses Context::language::id by default

Returns

array

getEntriesCollection()

getEntriesCollection() : \PrestaShopCollection

Retrieves the details entries (i.e. products) collection for the current order

Returns

\PrestaShopCollection —

Collection of SupplyOrderDetail

hasEntries()

hasEntries() : boolean

Check if the order has entries

Returns

boolean —

Has/Has not

isEditable()

isEditable() : boolean

Check if the current state allows to edit the current order

Returns

boolean

isDeliveryNoteAvailable()

isDeliveryNoteAvailable() : boolean

Checks if the current state allows to generate a delivery note for this order

Returns

boolean

isInReceiptState()

isInReceiptState() : boolean

Checks if the current state allows to add products in stock

Returns

boolean

resetProducts()

resetProducts() 

Removes all products from the order

warehouseHasPendingOrders()

warehouseHasPendingOrders(integer  $id_warehouse) : boolean

For a given $id_warehouse, tells if it has pending supply orders

Parameters

integer $id_warehouse

Returns

boolean

supplierHasPendingOrders()

supplierHasPendingOrders(integer  $id_supplier) : boolean

For a given $id_supplier, tells if it has pending supply orders

Parameters

integer $id_supplier

Id Supplier

Returns

boolean

exists()

exists(integer|string  $match) : integer

For a given id or reference, tells if the supply order exists

Parameters

integer|string $match

Either the reference of the order, or the Id of the order

Returns

integer —

SupplyOrder Id

getSupplyOrderByReference()

getSupplyOrderByReference(string  $reference) : boolean|\SupplyOrder

For a given reference, returns the corresponding supply order

Parameters

string $reference

Reference of the order

Returns

boolean|\SupplyOrder

hydrate()

hydrate(array  $data,   $id_lang = null) 

Parameters

array $data
$id_lang

getReferenceById()

getReferenceById(integer  $id_supply_order) : boolean|string

Gets the reference of a given order

Parameters

integer $id_supply_order

Returns

boolean|string

getAllExpectedQuantity()

getAllExpectedQuantity() 

getAllReceivedQuantity()

getAllReceivedQuantity() 

getAllPendingQuantity()

getAllPendingQuantity() 

getWsSupplyOrderDetails()

getWsSupplyOrderDetails() : array

Webservice : gets the ids supply_order_detail associated to this order

Returns

array

calculatePrices()

calculatePrices() 

Checks all products in this order and calculate prices Applies the global discount if necessary

addHistory()

addHistory() 

Historizes the order : its id, its state, and the employee responsible for the current action