From fb61d8b1ad57aa95d9f8aaefa2f78079a7307975 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 13 Feb 2018 16:45:38 +0100 Subject: [PATCH 1/2] id_order --- modules/ant_logistic/AdminAntLogistic.php | 2 +- modules/ant_logistic/ajax.php | 1 + modules/ant_logistic/script.js | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/ant_logistic/AdminAntLogistic.php b/modules/ant_logistic/AdminAntLogistic.php index c9d43e39..121a1a67 100644 --- a/modules/ant_logistic/AdminAntLogistic.php +++ b/modules/ant_logistic/AdminAntLogistic.php @@ -346,7 +346,7 @@ class AdminAntLogistic extends AdminTab $to_ship[(int) $p['id_order_detail']] = $p['product_quantity'] - ($p['product_quantity_refunded'] > 0? $p['product_quantity_refunded']: $p['product_quantity_return']) - (int) $p['quantity_sent']; } - if(Validate::isLoadedObject($order)) { + if (Validate::isLoadedObject($order)) { $parcel_carrier = Tools::getValue('parcel_carrier', 'laposte'); if(($weight = Tools::getValue('weight')) && ($products = Tools::getValue('shipped'))) { diff --git a/modules/ant_logistic/ajax.php b/modules/ant_logistic/ajax.php index a1ca8ec1..8c837d3b 100644 --- a/modules/ant_logistic/ajax.php +++ b/modules/ant_logistic/ajax.php @@ -577,6 +577,7 @@ if(($id_order = (int) Tools::getValue('id_order'))
kg
+ '; diff --git a/modules/ant_logistic/script.js b/modules/ant_logistic/script.js index 7c003730..6ff6683a 100644 --- a/modules/ant_logistic/script.js +++ b/modules/ant_logistic/script.js @@ -47,7 +47,9 @@ function checkPrinting() { }); if(!allok) { - prompt("Les quantités scannées sont inférieures aux quantités à envoyer. Confirmer l\'envoi ?", function() { $("#button4").attr("onclick", "").trigger("click"); }); + prompt("Les quantités scannées sont inférieures aux quantités à envoyer. Confirmer l\'envoi ?", function() { + $("#button4").attr("onclick", "").trigger("click"); + }); } else { $("#button4").attr("onclick", "").trigger("click"); } From ee76fb5feba06926f2c4e357c5c0b8265f2c7227 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 13 Feb 2018 17:35:12 +0100 Subject: [PATCH 2/2] Display action --- modules/ant_logistic/AdminAntLogistic.php | 6 ++--- modules/ant_logistic/ajax.php | 28 ++++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/modules/ant_logistic/AdminAntLogistic.php b/modules/ant_logistic/AdminAntLogistic.php index 121a1a67..1963b834 100644 --- a/modules/ant_logistic/AdminAntLogistic.php +++ b/modules/ant_logistic/AdminAntLogistic.php @@ -995,10 +995,8 @@ class AdminAntLogistic extends AdminTab '.$this->l('Référence fournisseur').' '.$this->l('Numéro de suivi').' '.$this->l('Transporteur').' - '.(((int) $cookie->profile == 1 || (int) $cookie->profile == 9 || (int) $cookie->profile == 7 || (int) $cookie->profile == 14) - ?'': '').' - '.(((int) $cookie->profile == 1 || (int) $cookie->profile == 9 || (int) $cookie->profile == 7 || (int) $cookie->profile == 14) - ?'': '').' + '.(( in_array((int)$cookie->profile, array(1,9,7,13,14)) ) ?'': '' ).' + '.(( in_array((int)$cookie->profile, array(1,9,7,13,14)) ) ?'': '' ).' diff --git a/modules/ant_logistic/ajax.php b/modules/ant_logistic/ajax.php index 8c837d3b..30cb22ad 100644 --- a/modules/ant_logistic/ajax.php +++ b/modules/ant_logistic/ajax.php @@ -46,7 +46,7 @@ $ooh = array_map('intval',explode(',', Configuration::get('ANT_CARRIERS_OOH'))); if(($id_order = (int) Tools::getValue('id_order')) && (Tools::getValue('token') === Tools::getAdminToken('AdminAntLogistic'.(int) Tab::getIdFromClassName('AdminAntLogistic').(int) Tools::getValue('id_employee')))) { - $profile = Tools::getValue('id_profile'); + $profile = Tools::getValue('id_profil'); $order = new Order($id_order); if(Validate::isLoadedObject($order)) { $locked_products = array(); @@ -540,18 +540,20 @@ if(($id_order = (int) Tools::getValue('id_order')) foreach($logs as $key => $log){ $html_logs .= ' - '.str_replace(" ", "
",date('d/m/Y H:i:s',strtotime($logs[$key]['date_add']))).'\ - '.(!isset($logs[$key]['lastname'])? $logs[$key]['firstname'] : $logs[$key]['firstname'] .' '.$logs[$key]['lastname']) .' - '.$logs[$key]['quantity'].' - '.str_replace(" - ", "
",$logs[$key]['product_name']).'\ - '.$logs[$key]['product_reference'].' - '.$logs[$key]['product_supplier_reference'].' - '.$logs[$key]['shipping_number'].' - '.(($logs[$key]['carrier'] == "laposte" || $logs[$key]['carrier'] == "mondialrelay") ? $carrier_names[$logs[$key]['carrier']] : $logs[$key]['carrier']) .' - '.(( in_array((int)$profile, array(1,9,7,13,14)) ) ? - (($logs[$key]['carrier'] == "laposte" || $logs[$key]['carrier'] == "mondialrelay") ? '': ''):'').' - '.(( in_array((int)$profile, array(1,9,7,13,14)) )? - (($logs[$key]['carrier'] == "laposte" || $logs[$key]['carrier'] == "mondialrelay") ? '",$logs[$key]['product_name']).'" data-weight="'.((float)$logs[$key]['weight']>0?(float)$logs[$key]['weight']:0.24).'" data-ref="'.$logs[$key]['product_reference'] .'" data-id_order="'.$order->id.'" data-carrier="'.$logs[$key]['carrier'].'" data-id_order_detail="'.$logs[$key]['id_order_detail'].'">': ''):'').' + '.str_replace(" ", "
",date('d/m/Y H:i:s',strtotime($log['date_add']))).'\ + '.(!isset($log['lastname'])? $log['firstname'] : $log['firstname'] .' '.$log['lastname']) .' + '.$log['quantity'].' + '.str_replace(" - ", "
",$log['product_name']).'\ + '.$log['product_reference'].' + '.$log['product_supplier_reference'].' + '.$log['shipping_number'].' + '.(($log['carrier'] == "laposte" || $log['carrier'] == "mondialrelay") ? $carrier_names[$log['carrier']] : $log['carrier']) .' + '.(( in_array((int)$profile, array(1,9,7,13,14)) ) + ? '' + : '').' + '.(( in_array((int)$profile, array(1,9,7,13,14)) ) + ? '",$logs[$key]['product_name']).'" data-weight="'.((float)$log['weight']>0?(float)$log['weight']:0.24).'" data-ref="'.$log['product_reference'] .'" data-id_order="'.$order->id.'" data-carrier="'.$log['carrier'].'" data-id_order_detail="'.$log['id_order_detail'].'">' + : '').' '; }