[-] BO: delete the carrier on the warehouse from the id_reference
This commit is contained in:
@@ -556,14 +556,20 @@ class AdminCarriersControllerCore extends AdminController
|
|||||||
if (Tools::isSubmit('delete'.$this->table))
|
if (Tools::isSubmit('delete'.$this->table))
|
||||||
{
|
{
|
||||||
$id = (int)Tools::getValue('id_'.$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)
|
else if (Tools::isSubmit($this->table.'Box') && count(Tools::isSubmit($this->table.'Box')) > 0)
|
||||||
{
|
{
|
||||||
$ids = Tools::getValue($this->table.'Box');
|
$ids = Tools::getValue($this->table.'Box');
|
||||||
array_walk($ids, 'intval');
|
array_walk($ids, 'intval');
|
||||||
foreach ($ids as $id)
|
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();
|
parent::postProcess();
|
||||||
Carrier::cleanPositions();
|
Carrier::cleanPositions();
|
||||||
|
|||||||
Reference in New Issue
Block a user