From 3a9f7ef77cf8944149f3670582fce3b586bac60a Mon Sep 17 00:00:00 2001 From: Marion Muszynski Date: Mon, 13 Nov 2017 17:13:07 +0100 Subject: [PATCH] part 2 of inte --- adm/tabs/AdminOrders.php | 164 ++++++++++-------- .../AdminAntConfigurations.php | 11 ++ modules/refundreason/refundreason.php | 26 +++ 3 files changed, 130 insertions(+), 71 deletions(-) diff --git a/adm/tabs/AdminOrders.php b/adm/tabs/AdminOrders.php index 4ea18354..c8922813 100755 --- a/adm/tabs/AdminOrders.php +++ b/adm/tabs/AdminOrders.php @@ -1066,7 +1066,8 @@ class AdminOrders extends AdminTab SELECT DISTINCT lpws.`shipping_number`, lpws.`date_add` FROM `'._DB_PREFIX_.'lapostews` lpws LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = lpws.`id_order_detail`) - WHERE `id_order` ='. (int)$order->id + WHERE `id_order` ='. (int)$order->id.' + GROUP BY lpws.`shipping_number`' ) as $row){ $shipping_numbers[$row['shipping_number']] = $row; } @@ -1074,7 +1075,8 @@ class AdminOrders extends AdminTab SELECT DISTINCT ppp.`shipping_number`, ppp.`date_add` FROM `'._DB_PREFIX_.'philea_parcel` ppp LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = ppp.`id_order_detail`) - WHERE od.`id_order` ='. (int)$order->id + WHERE od.`id_order` ='. (int)$order->id.' + GROUP BY ppp.`shipping_number`' ) as $row){ $shipping_numbers[$row['shipping_number']] = $row; } @@ -1082,7 +1084,8 @@ class AdminOrders extends AdminTab SELECT DISTINCT mrp.`shipping_number`, mrp.`date_add` FROM `'._DB_PREFIX_.'mondialrelay_parcel` mrp LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = mrp.`id_order_detail`) - WHERE od.`id_order` ='. (int)$order->id + WHERE od.`id_order` ='. (int)$order->id.' + GROUP BY mrp.`shipping_number`' ) as $row){ $shipping_numbers[$row['shipping_number']] = $row; } @@ -1345,8 +1348,9 @@ class AdminOrders extends AdminTab // shipping numbers $html.=' -
- +
'; + if(!empty($shipping_numbers)){ + $html .= '
@@ -1365,8 +1369,10 @@ class AdminOrders extends AdminTab '; } - $html .= ' + $html .= ' +
'.$this->l('Date').''.$number['shipping_number'].'
'; + } /* Display shipping number field */ if ($carrier->url && $order->hasBeenShipped()){ @@ -1410,7 +1416,7 @@ class AdminOrders extends AdminTab
'.$order->printCarrier($order->id_carrier,array()).' Adresse Livraison '.($cart->id_carrier!=(int)Configuration::get('ANT_CARRIER_DOM') && in_array($cart->id_carrier,$carriers_socol)?'':'').' - '.(in_array($cart->id_carrier,$carriers_mr)?'':'').' + '.(in_array($cart->id_carrier,$carriers_mr)?'':'').'

'.$data['order_address'].'

@@ -1496,7 +1502,8 @@ class AdminOrders extends AdminTab '.(int)$stock['quantity'].' '.Tools::displayPrice(Tools::ps_round($product_price, 2) * ((int)($product['product_quantity']) - $product['customizationQuantityTotal']), $currency, false).' - = (int)($product['product_quantity'])) ? 'disabled="disabled" ' : '').'/> + = (int)($product['product_quantity'])) ? 'disabled="disabled" ' : '').'/> + '.(((int)($product['product_quantity_return'] + $product['product_quantity_refunded']) >= (int)($product['product_quantity'])) ? '' : '').' '; } @@ -1532,7 +1539,7 @@ class AdminOrders extends AdminTab $html .= '
'; } - $html .= ' + $html .= ' '; $html .= ' @@ -1555,12 +1562,31 @@ class AdminOrders extends AdminTab
'.($order->module ? ($order->module=="paybox"?' ':' ') : '').' Info Remboursement
'; $slips = OrderSlip::getOrdersSlip($order->id_customer, $order->id); if (sizeof($slips)){ - $html .= '
'; - foreach ($slips as $slip){ - $html .= ''.Tools::displayDate($slip['date_upd'], $cookie->id_lang).' : '.$this->l('#').sprintf('%06d', $slip['id_order_slip']).'
'; - $html .= ''; - } - $html .= '
'; + $html .= '
+ + + + + + + '; + foreach ($slips as $slip){ + $reason = Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'order_slip` s + LEFT JOIN `'._DB_PREFIX_.'refundreason` r ON s.`id_order_slip` = r.`id_order_slip` + WHERE s.`id_order_slip` ='.(int)$slip['id_order_slip'] + ); + $html .= ' + + + + + '; + } + $html .= ' +
DateIDRaison
'.Tools::displayDate($slip['date_upd'], $cookie->id_lang).''.$this->l('#').sprintf('%06d', $slip['id_order_slip']).''.($reason?$this->l('#'.$reason['id_reason']):'').'
+
'; } $html .= '
'; if($order->module && $order->module=="paybox"){ @@ -1613,7 +1639,7 @@ class AdminOrders extends AdminTab $html.= '
-
+

Nouveau Message

@@ -1646,47 +1672,38 @@ class AdminOrders extends AdminTab
-
-
'; - /* Display list of messages */ - - $html.=' -
-
-
-

'.$this->l('Messages').'

-
-
'; - if (sizeof($messages)) { - foreach ($messages as $message) - { - $html.= ''; +
+
+

'.$this->l('Messages').'

+
+
+
'; + if (sizeof($messages)) { + foreach ($messages as $message) + { + $html.= ''; + } + $html.= '

'.$this->l('When you read a message, please click on the green check.').'

'; + } else { + $html.= '
'.$this->l('No Message for this order.').'
'; } - $html.= '

'.$this->l('When you read a message, please click on the green check.').'

'; - } else { - $html.= '
'.$this->l('No Message for this order.').'
'; - } - $html.= '
+ $html.= '
+
-
'; - $html.= ' -
'; // - $html.= ' -
@@ -1696,8 +1713,8 @@ class AdminOrders extends AdminTab
'; if (!sizeof($returns)){ $html.= ' -
'.$this->l('Create a product return').'
-
'.$this->l('No merchandise return for this order.').'
'; +
'.$this->l('Create a product return').'
+
'.$this->l('No merchandise return for this order.').'
'; } else { $html.=' @@ -1725,8 +1742,8 @@ class AdminOrders extends AdminTab - - + + '; } $html.=' @@ -1788,8 +1805,8 @@ class AdminOrders extends AdminTab $html.= '
-
'.$this->l('Create a product return').'
-
+
'.$this->l('Create a product return').'
+
    '; foreach($returnable as $id_order_detail => $product) { $html.= ' @@ -1836,14 +1853,14 @@ class AdminOrders extends AdminTab
'; } else { $html.= ' -
'.$this->l('Create a product return').'
-
'.$this->l('No product can currently be returned on this order').'
'; +
'.$this->l('Create a product return').'
+
'.$this->l('No product can currently be returned on this order').'
'; } } } $html.= ' - '; + '; if(!class_exists('SupplierDemand')){ require_once(_PS_MODULE_DIR_.'ant_supplierdemand/models/SupplierDemand.php'); @@ -1851,17 +1868,14 @@ class AdminOrders extends AdminTab $supplierDemands = SupplierDemand::getDemands(array(),'sd.id_order='.$order->id); $alreadyDemand = array(); $html .= ' -
-

'.$this->l('Supplier demands').'

+

'.$this->l('Supplier demands').'

'; $demand_product = 0; - if (!sizeof($supplierDemands)) { - $html .= '
'.$this->l('No Supplier demands for this order.').'
'; - } else { + if(sizeof($supplierDemands)) { $html .= '
'.Tools::displayDate($return['date_upd'], $cookie->id_lang).' '.$this->l('#').sprintf('%06d', $return['id_order_return']).' '.$state->name[$cookie->id_lang].''.($return_link?''.$return_link['return_number'].'': '').''.($return_link?'': '').''.($return_link?''.$return_link['return_number'].'': '/').''.($return_link?'': '/').'
@@ -1878,7 +1892,7 @@ class AdminOrders extends AdminTab $html .= ' - + '; @@ -1888,8 +1902,8 @@ class AdminOrders extends AdminTab } $html .= '
-
'.$this->l('Make a supplier demand').'
- +
'.$this->l('Make a supplier demand').'
+

'.Tools::displayDate($demand['date_upd'], $cookie->id_lang).''.$this->l('#').sprintf('%06d', $demand['id_supplier_demand']).''.$this->l('#').sprintf('%06d', $demand['id_supplier_demand']).' '.$demandStates[$demand['id_state']]['name'].' '.$demandProduct['product_name'].'