isAvailable()
isAvailable() : \StockManagerInterface
Checks if the StockManager is available
StockManagerInterface : defines a way to manage stock
isAvailable() : \StockManagerInterface
Checks if the StockManager is available
addProduct(integer $id_product, integer $id_product_attribute, \Warehouse $warehouse, integer $quantity, integer $id_stock_movement_reason, float $price_te, boolean $is_usable = true, integer $id_supply_order = null) : boolean
For a given product, adds a given quantity
integer | $id_product | |
integer | $id_product_attribute | |
\Warehouse | $warehouse | |
integer | $quantity | |
integer | $id_stock_movement_reason | |
float | $price_te | |
boolean | $is_usable | |
integer | $id_supply_order | optionnal |
removeProduct(integer $id_product, $id_product_attribute, \Warehouse $warehouse, integer $quantity, integer $id_stock_movement_reason, boolean $is_usable = true, integer $id_order = null) : array
For a given product, removes a given quantity
integer | $id_product | |
$id_product_attribute | ||
\Warehouse | $warehouse | |
integer | $quantity | |
integer | $id_stock_movement_reason | |
boolean | $is_usable | |
integer | $id_order | Optionnal |
getProductPhysicalQuantities(integer $id_product, integer $id_product_attribute, array|integer $ids_warehouse = null, boolean $usable = false) : integer
For a given product, returns its physical quantity If the given product has combinations and $id_product_attribute is null, returns the sum for all combinations
integer | $id_product | |
integer | $id_product_attribute | |
array|integer | $ids_warehouse | optional |
boolean | $usable | false default - in this case we retrieve all physical quantities, otherwise we retrieve physical quantities flagged as usable |
getProductRealQuantities(integer $id_product, integer $id_product_attribute, array|integer $ids_warehouse = null, boolean $usable = false) : integer
For a given product, returns its real quantity If the given product has combinations and $id_product_attribute is null, returns the sum for all combinations Real quantity : (physical_qty + supply_orders_qty - client_orders_qty) If $usable is defined, real quantity: usable_qty + supply_orders_qty - client_orders_qty
integer | $id_product | |
integer | $id_product_attribute | |
array|integer | $ids_warehouse | optional |
boolean | $usable | false by default |
transferBetweenWarehouses(integer $id_product, integer $id_product_attribute, integer $quantity, integer $warehouse_from, integer $warehouse_to, boolean $usable_from = true, boolean $usable_to = true) : boolean
For a given product, transfers quantities between two warehouses By default, it manages usable quantities It is also possible to transfer a usable quantity from warehouse 1 in an unusable quantity to warehouse 2 It is also possible to transfer a usable quantity from warehouse 1 in an unusable quantity to warehouse 1
integer | $id_product | |
integer | $id_product_attribute | |
integer | $quantity | |
integer | $warehouse_from | |
integer | $warehouse_to | |
boolean | $usable_from | Optional, true by default |
boolean | $usable_to | Optional, true by default |
getProductCoverage(integer $id_product, integer $id_product_attribute, integer $coverage, integer $id_warehouse = null) : integer
For a given product, returns the time left before being out of stock.
By default, for the given product, it will use sum(quantities removed in all warehouses)
integer | $id_product | |
integer | $id_product_attribute | |
integer | $coverage | |
integer | $id_warehouse | Optional |
time