From 741b69f7339bf698aa20021cca5cf481e7960fb6 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 15 Jan 2018 16:27:03 +0100 Subject: [PATCH] Bad SQL --- modules/logistics/ajax.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/logistics/ajax.php b/modules/logistics/ajax.php index 466f5725..ffe20b7a 100644 --- a/modules/logistics/ajax.php +++ b/modules/logistics/ajax.php @@ -162,6 +162,7 @@ if(($id_order = (int) Tools::getValue('id_order')) WHERE `id_order_detail` = ' . (int) $p['id_order_detail'] . ' '); + // Image $p['id_image'] = 0; if((int) $p['product_attribute_id'] != 0) { @@ -265,7 +266,8 @@ if(($id_order = (int) Tools::getValue('id_order')) AND h.`id_order` = '.(int) $order->id.' '.(count($shipping_numbers) > 0? 'AND h.`shipping_number` NOT IN ('.implode(', ', $shipping_numbers).')': '').' ')) { - $p['product_quantity_sent'] = $p['product_quantity'] - ($p['product_quantity_return'] > 0? $p['product_quantity_return']: $p['product_quantity_refunded']); + $p['product_quantity_sent'] = $p['product_quantity'] - ( $p['product_quantity_return'] > 0 ? + $p['product_quantity_return']: $p['product_quantity_refunded'] ); } $products[] = $p; @@ -312,6 +314,7 @@ if(($id_order = (int) Tools::getValue('id_order')) FROM `'._DB_PREFIX_.'lapostews` l LEFT JOIN `'._DB_PREFIX_.'employee` e ON l.`id_employee` = e.`id_employee` LEFT JOIN `'._DB_PREFIX_.'order_detail` d ON d.`id_order_detail` = l.`id_order_detail` + LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = d.`id_order` LEFT JOIN `ps_carrier` c ON c.`id_carrier` = o.`id_carrier` WHERE l.`id_order_detail` IN ('.implode(', ', $id_order_details).') AND l.`quantity` > 0 @@ -327,6 +330,7 @@ if(($id_order = (int) Tools::getValue('id_order')) FROM `'._DB_PREFIX_.'exapaqws` l LEFT JOIN `'._DB_PREFIX_.'employee` e ON l.`id_employee` = e.`id_employee` LEFT JOIN `'._DB_PREFIX_.'order_detail` d ON d.`id_order_detail` = l.`id_order_detail` + LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = d.`id_order` LEFT JOIN `'._DB_PREFIX_.'carrier` c ON c.`id_carrier` = o.`id_carrier` WHERE l.`id_order_detail` IN ('.implode(', ', $id_order_details).') AND l.`quantity` > 0 @@ -342,6 +346,7 @@ if(($id_order = (int) Tools::getValue('id_order')) FROM `'._DB_PREFIX_.'mondialrelay_parcel` l LEFT JOIN `'._DB_PREFIX_.'employee` e ON l.`id_employee` = e.`id_employee` LEFT JOIN `'._DB_PREFIX_.'order_detail` d ON d.`id_order_detail` = l.`id_order_detail` + LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = d.`id_order` LEFT JOIN `ps_carrier` c ON c.`id_carrier` = o.`id_carrier` WHERE l.`id_order_detail` IN ('.implode(', ', $id_order_details).') AND l.`quantity` > 0 @@ -356,6 +361,7 @@ if(($id_order = (int) Tools::getValue('id_order')) "Dropshipping" as firstname, "0" as philea FROM `'._DB_PREFIX_.'ant_dropshipping_parcel` l LEFT JOIN `'._DB_PREFIX_.'order_detail` d ON d.`id_order_detail` = l.`id_order_detail` + LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = d.`id_order` LEFT JOIN `'._DB_PREFIX_.'carrier` c ON c.`id_carrier` = o.`id_carrier` WHERE l.`id_order_detail` IN ('.implode(', ', $id_order_details).') AND l.`quantity` > 0