diff --git a/modules/ant_dropshippingtracking/AdminAntDropshippingtracking.php b/modules/ant_dropshippingtracking/AdminAntDropshippingtracking.php index 1409c971..87d577c2 100644 --- a/modules/ant_dropshippingtracking/AdminAntDropshippingtracking.php +++ b/modules/ant_dropshippingtracking/AdminAntDropshippingtracking.php @@ -73,8 +73,9 @@ class AdminAntDropshippingtracking extends AdminTab } $fully_sent = false; + + // Calcul des produits déjà envoyés par LaPoste $products_sent = array(); - foreach(Db::getInstance()->ExecuteS(' SELECT d.`id_order_detail`, IF( (d.`product_quantity` - IF( @@ -87,11 +88,12 @@ class AdminAntDropshippingtracking extends AdminTab WHERE d.`id_order` = '.(int) $order->id.' GROUP BY d.`id_order_detail` ') as $quantity_remain) { - if((int) $quantity_remain['remain'] == 0) { + if ((int) $quantity_remain['remain'] == 0) { $products_sent[] = (int) $quantity_remain['id_order_detail']; } } + // Calcul des produits retourné / remboursé foreach(Db::getInstance()->ExecuteS(' SELECT d.`id_order_detail`, IF( (d.`product_quantity` - IF( @@ -104,7 +106,7 @@ class AdminAntDropshippingtracking extends AdminTab WHERE d.`id_order` = '.(int) $order->id.' GROUP BY d.`id_order_detail` ') as $quantity_remain) { - if((int) $quantity_remain['remain'] == 0) { + if ((int) $quantity_remain['remain'] == 0) { $products_sent[] = (int) $quantity_remain['id_order_detail']; } } @@ -121,7 +123,7 @@ class AdminAntDropshippingtracking extends AdminTab WHERE d.`id_order` = '.(int) $order->id.' GROUP BY d.`id_order_detail` ') as $quantity_remain) { - if((int) $quantity_remain['remain'] == 0) { + if ((int) $quantity_remain['remain'] == 0) { $products_sent[] = (int) $quantity_remain['id_order_detail']; } } @@ -138,7 +140,7 @@ class AdminAntDropshippingtracking extends AdminTab WHERE d.`id_order` = '.(int) $order->id.' GROUP BY d.`id_order_detail` ') as $quantity_remain) { - if((int) $quantity_remain['remain'] == 0) { + if ((int) $quantity_remain['remain'] == 0) { $products_sent[] = (int) $quantity_remain['id_order_detail']; } } @@ -155,7 +157,7 @@ class AdminAntDropshippingtracking extends AdminTab WHERE d.`id_order` = '.(int) $order->id.' GROUP BY d.`id_order_detail` ') as $quantity_remain) { - if((int) $quantity_remain['remain'] == 0) { + if ((int) $quantity_remain['remain'] == 0) { $products_sent[] = (int) $quantity_remain['id_order_detail']; } } @@ -201,7 +203,7 @@ class AdminAntDropshippingtracking extends AdminTab $history = new OrderHistory(); $history->id_order = (int) $order->id; - $history->changeIdOrderState(($fully_sent? Configuration::get('PS_OS_SHIPPING'): 17), (int) $order->id); + $history->changeIdOrderState(($fully_sent ? Configuration::get('PS_OS_SHIPPING') : 17), (int) $order->id); $history->id_employee = 0; $history->add();