StockManagerInterface : defines a way to manage stock
- Interface name: StockManagerInterface
- This is an interface
- Source: classes/stock/StockManagerInterface.php line 31
- addProduct
- getProductCoverage
- getProductPhysicalQuantities
- getProductRealQuantities
- isAvailable
- removeProduct
- transferBetweenWarehouses
boolean StockManagerInterface::addProduct(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)
For a given product, adds a given quantity
- Visibility: public
- Source: classes/stock/StockManagerInterface.php line 54
- $id_product integer
- $id_product_attribute integer
- $warehouse Warehouse
- $quantity integer
- $id_stock_movement_reason integer
- $price_te float
- $is_usable boolean
- $id_supply_order integer - optionnal
integer StockManagerInterface::getProductCoverage(integer $id_product, integer $id_product_attribute, integer $coverage, integer $id_warehouse)
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)
- Visibility: public
- Source: classes/stock/StockManagerInterface.php line 123
- $id_product integer
- $id_product_attribute integer
- $coverage integer
- $id_warehouse integer - Optional
integer StockManagerInterface::getProductPhysicalQuantities(integer $id_product, integer $id_product_attribute, array|integer $ids_warehouse, boolean $usable)
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
- Visibility: public
- Source: classes/stock/StockManagerInterface.php line 80
- $id_product integer
- $id_product_attribute integer
- $ids_warehouse array|integer - optional
- $usable boolean - false default - in this case we retrieve all physical quantities, otherwise we retrieve physical quantities flagged as usable
integer StockManagerInterface::getProductRealQuantities(integer $id_product, integer $id_product_attribute, array|integer $ids_warehouse, boolean $usable)
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
- Visibility: public
- Source: classes/stock/StockManagerInterface.php line 94
- $id_product integer
- $id_product_attribute integer
- $ids_warehouse array|integer - optional
- $usable boolean - false by default
\StockManagerInterface StockManagerInterface::isAvailable()
Checks if the StockManager is available
- Visibility: public
- This method is static.
- Source: classes/stock/StockManagerInterface.php line 39
array StockManagerInterface::removeProduct(integer $id_product, $id_product_attribute, \Warehouse $warehouse, integer $quantity, integer $id_stock_movement_reason, boolean $is_usable, integer $id_order)
For a given product, removes a given quantity
- Visibility: public
- Source: classes/stock/StockManagerInterface.php line 68
- $id_product integer
- $id_product_attribute mixed
- $warehouse Warehouse
- $quantity integer
- $id_stock_movement_reason integer
- $is_usable boolean
- $id_order integer - Optionnal
boolean StockManagerInterface::transferBetweenWarehouses(integer $id_product, integer $id_product_attribute, integer $quantity, integer $warehouse_from, integer $warehouse_to, boolean $usable_from, boolean $usable_to)
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
- Visibility: public
- Source: classes/stock/StockManagerInterface.php line 111
- $id_product integer
- $id_product_attribute integer
- $quantity integer
- $warehouse_from integer
- $warehouse_to integer
- $usable_from boolean - Optional, true by default
- $usable_to boolean - Optional, true by default