diff --git a/modules/logistics/AdminLogistics.php b/modules/logistics/AdminLogistics.php index 41013b19..7a60b148 100644 --- a/modules/logistics/AdminLogistics.php +++ b/modules/logistics/AdminLogistics.php @@ -231,10 +231,26 @@ class AdminLogistics extends AdminTab { } // Suppression PHILEA elseif ($delete = (int) Tools::getValue('delete_philea')) { - + Db::getInstance()->ExecuteS(' + DELETE FROM `'._DB_PREFIX_.'philea_parcel` + WHERE `id_order_detail` = '.$delete.' + AND `shipping_number` = "'.pSQL($delete_number).'" + '); + + if(!Db::getInstance()->getRow(' + SELECT `shipping_number` + FROM `'._DB_PREFIX_.'philea_parcel` + WHERE `shipping_number` = "'.pSQL($delete_number).'" + ')) { + Db::getInstance()->ExecuteS(' + DELETE FROM `'._DB_PREFIX_.'shipping_history` + WHERE `id_order` = '.(int) Tools::getValue('id_order').' + AND `shipping_number` = "'.pSQL($delete_number).'" + '); + } } - // Pour les commandes ... + // Pour les commandes et les articles mise à jours en commande non envoyé, simplement payé $id_order_details = array(); foreach(Db::getInstance()->ExecuteS(' SELECT `id_order_detail`