[-] BO: Fix some bugs on advanced stock management
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16446 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
09cb7eff9b
commit
a606873630
6 files changed
+81
-75
No files matched your search
@@ -127,27 +127,6 @@ class WarehouseCore extends ObjectModel
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the shops associated to the current warehouse
|
||||
*
|
||||
* @param array $ids_shop Ids to set
|
||||
*/
|
||||
public function setShops($ids_shop)
|
||||
{
|
||||
if (!is_array($ids_shop))
|
||||
$ids_shop = array();
|
||||
|
||||
$row_to_insert = array();
|
||||
foreach ($ids_shop as $id_shop)
|
||||
$row_to_insert[] = array($this->def['primary'] => $this->id, 'id_shop' => (int)$id_shop);
|
||||
|
||||
Db::getInstance()->execute('
|
||||
DELETE FROM '._DB_PREFIX_.'warehouse_shop
|
||||
WHERE '.$this->def['primary'].' = '.(int)$this->id);
|
||||
|
||||
Db::getInstance()->insert('warehouse_shop', $row_to_insert);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the carriers associated to the current warehouse
|
||||
*
|
||||
@@ -551,6 +530,13 @@ class WarehouseCore extends ObjectModel
|
||||
$res = call_user_func_array('array_intersect', $list);
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function resetStockAvailable()
|
||||
{
|
||||
$products = WarehouseProductLocation::getProducts((int)$this->id);
|
||||
foreach ($products as $product)
|
||||
StockAvailable::synchronize((int)$product['id_product']);
|
||||
}
|
||||
|
||||
/*********************************\
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user