ecstore oms系统仓库的库存更新及初始化
#更新仓库库存
function updateBranchProduct($num, $product_id, $branch_id, $operator=’-‘)
{
$libBranchProduct = kernel::single(‘ome_branch_product’);#基础物料 ExBOY
#初始化仓库库存
$libBranchProduct->initNullStore($product_id, $branch_id);
#更新仓库库存
$result = $libBranchProduct->change_store($branch_id, $product_id, $num, $operator, false);
return $result;
}
#获取基础物料对应仓库库存
function get_branch_store($branch_id, $product_id)
{
$libBranchProduct = kernel::single(‘ome_branch_product’);#基础物料 ExBOY
$store = $libBranchProduct->getStoreByBranch($product_id, $branch_id);
return $store;
}