Properties

$id_supply_order

$id_supply_order : integer

Type

integer — Supply order

$id_product

$id_product : integer

Type

integer — Product ordered

$id_product_attribute

$id_product_attribute : integer

Type

integer — Product attribute ordered

$reference

$reference : string

Type

string — Product reference

$supplier_reference

$supplier_reference : string

Type

string — Product supplier reference

$name

$name : integer

Type

integer — Product name

$ean13

$ean13 : integer

Type

integer — Product EAN13

$upc

$upc : string

Type

string — UPC

$id_currency

$id_currency : integer

Type

integer — Currency used to buy this particular product

$exchange_rate

$exchange_rate : float

Type

float — Exchange rate between $id_currency and SupplyOrder::$id_ref_currency, at the time

$unit_price_te

$unit_price_te : float

Type

float — Unit price without discount, without tax

$quantity_expected

$quantity_expected : integer

Type

integer — Quantity ordered

$quantity_received

$quantity_received : integer

Type

integer — Quantity received

$price_te

$price_te : float

Type

float — This defines the price of the product, considering the number of units to buy. ($unit_price_te * $quantity), without discount, without tax

$discount_rate

$discount_rate : float

Type

float — Supplier discount rate for a given product

$discount_value_te

$discount_value_te : float

Type

float — Supplier discount value (($discount_rate / 100) * $price_te), without tax

$price_with_discount_te

$price_with_discount_te : float

Type

float — ($price_te - $discount_value_te), with discount, without tax

$tax_rate

$tax_rate : integer

Type

integer — Tax rate for the given product

$tax_value

$tax_value : float

Type

float — Tax value for the given product

$price_ti

$price_ti : float

Type

float — ($price_with_discount_te + $tax_value)

$tax_value_with_order_discount

$tax_value_with_order_discount : float

Type

float — Tax value of the given product after applying the global order discount (i.e. if SupplyOrder::discount_rate is set)

$price_with_order_discount_te

$price_with_order_discount_te : float

Type

float — This is like $price_with_discount_te, considering the global order discount. (i.e. if SupplyOrder::discount_rate is set)

$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

applyGlobalDiscount()

applyGlobalDiscount(  $discount_rate) 

Applies a global order discount rate, for the current product (i.e detail) Calls ObjectModel::update()

Parameters

$discount_rate

The discount rate in percent (Ex. 5 for 5 percents)

validateController()

validateController(  $htmlentities = true) : \$errors

Parameters

$htmlentities

Optional

Returns

\$errors —

If any..

hydrate()

hydrate(array  $data,   $id_lang = null) 

Parameters

array $data
$id_lang

calculatePrices()

calculatePrices() 

Calculates all prices for this product based on its quantity and unit price Applies discount if necessary Calculates tax value, function of tax rate