diff --git a/adm/mraddressedit.php b/adm/mraddressedit.php index 221d6324..760b3ab4 100644 --- a/adm/mraddressedit.php +++ b/adm/mraddressedit.php @@ -103,12 +103,13 @@ if($cookie->isLoggedBack() && $cart = Tools::getValue('id_cart')) { var isocode = "'.$address['MR_Selected_Pays'].'"; var postcode = "'.$address['MR_Selected_CP'].'"; var mode = "24R"; - var weight = '.(int)$weight.'; + var weight = '.(int)($weight * 1000).'; if( weight == 0 ) weight = 100; var t; $(document).ready(function () { $("#Zone_Widget").MR_ParcelShopPicker({ UseSSL : true, + Weight: weight, Target: "#Target_Widget", TargetDisplay: "#TargetDisplay_Widget", TargetDisplayInfoPR: "#TargetDisplayInfoPR_Widget", diff --git a/modules/logistics/AdminLogisticsPending.php b/modules/logistics/AdminLogisticsPending.php index 901986ec..61aebd0e 100644 --- a/modules/logistics/AdminLogisticsPending.php +++ b/modules/logistics/AdminLogisticsPending.php @@ -2,7 +2,7 @@ if(!defined('_PS_VERSION_')) { exit; } - +require_once(PS_ADMIN_DIR . '/helpers/HelperFormBootstrap.php'); include _PS_ROOT_DIR_.'/modules/privatesales/Sale.php'; @@ -24,7 +24,7 @@ class AdminLogisticsPending extends AdminTab { '); foreach(Db::getInstance()->ExecuteS(' SELECT lp.*, oh.`id_order_state` - FROM `'._DB_PREFIX_.'logistics_pending` lp + FROM `'._DB_PREFIX_.'logistics_pending` lp LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON (oh.`id_order` = lp.`id_order`) WHERE oh.`id_order_history` = (SELECT MAX(`id_order_history`) FROM `'._DB_PREFIX_.'order_history` moh WHERE moh.`id_order` = lp.`id_order` GROUP BY moh.`id_order`) ORDER BY lp.`id_sale` @@ -100,105 +100,155 @@ class AdminLogisticsPending extends AdminTab { $sales_info[(int)$row['id_sale']]['orders'][(int)$row['id_order']]['products'][] = $p; } - echo ''; - echo ''; - echo '
'.$this->l('Aucune Commandes en attente').'
'; - } + $html .= ' + + + + '; + + $html .= $helper->renderScript(); + + echo $html; } public function postProcess() @@ -207,8 +257,25 @@ class AdminLogisticsPending extends AdminTab { if(Tools::isSubmit('submitPrint')) { $orders = Tools::getValue('orders'); if (!empty($orders)) { - $orders = array_unique($orders); - Tools::redirectAdmin('pdf.php?pendingorders&orders='.implode(',', $orders) .'&token='.$this->token); + $_orders = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT d.`id_order`, p.`id_product`, c.`id_sale`, GREATEST(d.`product_quantity` - d.`product_quantity_return`, 0) AS `product_quantity`, + d.`product_reference`, COUNT(d.id_order_detail) as `nb_p` + FROM `'._DB_PREFIX_.'privatesale_category` c + LEFT JOIN `'._DB_PREFIX_.'product` p + ON c.`id_category` = p.`id_category_default` + LEFT JOIN `'._DB_PREFIX_.'order_detail` d + ON d.`product_id` = p.`id_product` + WHERE d.`id_order` IN ('.implode(', ', $orders).') + GROUP BY d.`id_order` + ORDER BY `nb_p` ASC, d.`product_reference` + ') as $row) { + if(!isset($_orders[(int)$row['id_order']])) { + $_orders[(int)$row['id_order']] = (int)$row['id_order']; + } + } + $_orders = array_unique($_orders); + Tools::redirectAdmin('pdf.php?pendingorders&orders='.implode(',', $_orders) .'&token='.$this->token); } else { $this->_errors[] = $this->l('No selected orders for these sales'); } diff --git a/modules/privatesales/AdminPrivateSalesSales.php b/modules/privatesales/AdminPrivateSalesSales.php index 334dcc13..bcbd83ae 100755 --- a/modules/privatesales/AdminPrivateSalesSales.php +++ b/modules/privatesales/AdminPrivateSalesSales.php @@ -820,6 +820,7 @@ class AdminPrivateSalesSales extends AdminTab { $.ajax({ url: "ajax_vp.php", type: 'GET', + async: false, data: 'position=' + position + '&way='+ way +'&updatePosition', success: function() { var type = $('.tri.active').attr('name'); @@ -932,6 +933,7 @@ class AdminPrivateSalesSales extends AdminTab { $.ajax({ url: "ajax_vp.php", type: "GET", + async: false, data: "id_sale=" + id_sale + "&position=" + diff +"&updatePositionDrag", success: function(html) { var loader = "";