From aa2f9b98cf05640506b7d5876eb8145609f390fb Mon Sep 17 00:00:00 2001 From: root Date: Thu, 7 Dec 2017 10:37:27 +0100 Subject: [PATCH] fix from prod adminOrders --- adm/tabs/AdminOrders.php | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/adm/tabs/AdminOrders.php b/adm/tabs/AdminOrders.php index 721a0137..2db37453 100755 --- a/adm/tabs/AdminOrders.php +++ b/adm/tabs/AdminOrders.php @@ -1298,10 +1298,10 @@ class AdminOrders extends AdminTab
- '.($order->appli?'

'.$this->l('Commande faite via l\'appli').'

':'').' + '.($order->appli?'

'.$this->l('Commande faite via l\'appli').'

':'

'.$this->l('Commande faite via le site').'

').'

'.Tools::substr($order->payment, 0, 32).' '.($order->module ? '('.$order->module.')' : '').'

'.$this->l('Cart #').sprintf('%06d', $cart->id).'

-

'.$this->l('Recycled package').'

+

'.$this->l('Recycled package').'

'.(!empty($order->gift_message) ? ' '.$this->l('Gift wrapping').'':$this->l('Gift wrapping')).'

@@ -1509,9 +1509,9 @@ class AdminOrders extends AdminTab '.($order->hasBeenPaid() ? ''.(int)($product['product_quantity_refunded']).' | '.(int)($product['product_quantity_return']).'' : '').' '.(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_return'] + $product['product_quantity_refunded']) >= (int)($product['product_quantity'])) ? '' : '').' + + = (int)($product['product_quantity'])) ? 'disabled="disabled" ' : '').'/> + ('.((int)($product['product_quantity_return'] + $product['product_quantity_refunded'])).'/'.$quantity.') '; } @@ -1615,19 +1615,19 @@ class AdminOrders extends AdminTab $html .= '

Pas de remboursement

'; } } elseif($order->module && $order->module=="paypal") { - $messages = Db::getInstance()->ExecuteS(' + $paypal_messages = Db::getInstance()->ExecuteS(' SELECT `message`, `date_add` FROM `ps_message` WHERE `id_order` = '.$order->id.' AND (`message` LIKE "%Refund operation%" || `message` LIKE "%Cancel products%") ORDER BY `date_add` DESC '); - if($messages && !empty($messages)) { - foreach ($messages as $message) { + if($paypal_messages && !empty($paypal_message)) { + foreach ($paypal_message as $message) { $html .= '

('.date('d/m/Y',strtotime($message['message'])).'):
'.$message['message'].'

'; } } - if(empty($messages)){ + if(empty($paypal_messages)){ $html .= '

Pas de remboursement

'; } @@ -1653,7 +1653,7 @@ class AdminOrders extends AdminTab
-
+ @@ -1953,6 +1953,21 @@ class AdminOrders extends AdminTab $helper->_js .= '