diff --git a/adm/tabs/AdminOrders.php b/adm/tabs/AdminOrders.php index a291324c..24918eb9 100755 --- a/adm/tabs/AdminOrders.php +++ b/adm/tabs/AdminOrders.php @@ -234,6 +234,16 @@ class AdminOrders extends AdminTab ) '); $id_order_return = Db::getInstance()->Insert_ID(); + Db::getInstance()->ExecuteS(' + INSERT INTO `'._DB_PREFIX_.'order_return_history` + VALUES ( + DEFAULT, + '.(int) $cookie->id_employee.', + '.(int) $id_order_return.', + 2, + NOW() + ) + '); foreach($return_reasons as $return_reason) { Db::getInstance()->Execute(' INSERT INTO `'._DB_PREFIX_.'order_return_detail_qty` (`id_order_return`, `id_order_detail`, `qty`, `reason`, `instruction`) diff --git a/adm/tabs/AdminReturn.php b/adm/tabs/AdminReturn.php index c531040d..b00d40dc 100755 --- a/adm/tabs/AdminReturn.php +++ b/adm/tabs/AdminReturn.php @@ -99,6 +99,16 @@ class AdminReturn extends AdminTab if ($orderReturn->save()) { $orderReturnState = new OrderReturnState($orderReturn->state); + Db::getInstance()->ExecuteS(' + INSERT INTO `'._DB_PREFIX_.'order_return_history` + VALUES ( + DEFAULT, + '.(int) $cookie->id_employee.', + '.(int) $orderReturn->id.', + '.(int) $orderReturn->state.', + NOW() + ) + '); $vars = array( '{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, diff --git a/modules/ant_returnprocess/AdminAntReturnprocess.php b/modules/ant_returnprocess/AdminAntReturnprocess.php index f3f13178..e962d535 100644 --- a/modules/ant_returnprocess/AdminAntReturnprocess.php +++ b/modules/ant_returnprocess/AdminAntReturnprocess.php @@ -110,6 +110,16 @@ class AdminAntReturnprocess extends AdminTab if ($orderReturn->save()) { $orderReturnState = new OrderReturnState($orderReturn->state); + Db::getInstance()->ExecuteS(' + INSERT INTO `'._DB_PREFIX_.'order_return_history` + VALUES ( + DEFAULT, + '.(int) $cookie->id_employee.', + '.(int) $orderReturn->id.', + '.(int) $orderReturn->state.', + NOW() + ) + '); $vars = array( '{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, @@ -772,6 +782,15 @@ class AdminAntReturnprocess extends AdminTab $returnProducts = OrderReturn::getOrdersReturnProducts($orderReturn->id, $order); $orderReturnState = new OrderReturnState($orderReturn->state); + $return_history = Db::getInstance()->ExecuteS(' + SELECT rh.*, orsl.`name` as state, CONCAT(e.`firstname`,\' \',e.`lastname`) as employee + FROM '._DB_PREFIX_.'order_return_history rh + LEFT JOIN '._DB_PREFIX_.'order_return_state_lang orsl ON (orsl.`id_order_return_state` = rh.`id_order_return_state` AND orsl.`id_lang` = '.(int)($cookie->id_lang).') + LEFT JOIN '._DB_PREFIX_.'employee e ON (e.`id_employee` = rh.`id_employee`) + WHERE rh.`id_order_return` = '.(int)$orderReturn->id.' + ORDER BY rh.`date_add` DESC + '); + $other_returnProducts = Db::getInstance()->ExecuteS(' SELECT a.*, orsl.`name`, ord.`id_order_detail`, ord.`qty` FROM '._DB_PREFIX_.'order_return a @@ -862,6 +881,18 @@ class AdminAntReturnprocess extends AdminTab
+

'.$this->l('Historique statut:').'

+ '; + foreach ($return_history as $key => $history) { + $html .= ' + + + + + '; + } + $html .= ' +
'.date('d/m/Y H:i',strtotime($history['date_add'])).''.$history['state'].''.$history['employee'].'
'.$this->l('Changer le statut du retour').'