[-] BO: delete the carrier on the warehouse from the id_reference

This commit is contained in:
rGaillard
2012-11-06 15:09:00 +00:00
parent 02177e6b1a
commit 5be92db59e
@@ -556,14 +556,20 @@ class AdminCarriersControllerCore extends AdminController
if (Tools::isSubmit('delete'.$this->table))
{
$id = (int)Tools::getValue('id_'.$this->table);
Warehouse::removeCarrier($id);
// Delete from the reference_id and not from the carrier id
$carrier = new Carrier((int)$id);
Warehouse::removeCarrier($carrier->id_reference);
}
else if (Tools::isSubmit($this->table.'Box') && count(Tools::isSubmit($this->table.'Box')) > 0)
{
$ids = Tools::getValue($this->table.'Box');
array_walk($ids, 'intval');
foreach ($ids as $id)
Warehouse::removeCarrier($id);
{
// Delete from the reference_id and not from the carrier id
$carrier = new Carrier((int)$id);
Warehouse::removeCarrier($carrier->id_reference);
}
}
parent::postProcess();
Carrier::cleanPositions();