Merge remote-tracking branch 'origin/ticket/r15365-logistic-reshipping'
This commit is contained in:
commit
35e9afa6d9
@ -274,7 +274,7 @@ class AdminLogistics extends AdminTab
|
|||||||
$order = new Order((int) $id_order);
|
$order = new Order((int) $id_order);
|
||||||
if (Validate::isLoadedObject($order)) {
|
if (Validate::isLoadedObject($order)) {
|
||||||
$parcel_carrier == 'laposte' ? $weight = 0.24 : true;
|
$parcel_carrier == 'laposte' ? $weight = 0.24 : true;
|
||||||
if ($parcel_carrier == "laposte" || $parcel_carrier == "mondialrelay") {
|
if ($parcel_carrier == 'laposte' || $parcel_carrier == 'mondialrelay') {
|
||||||
$result = $logistics_carriers[$parcel_carrier]->registerParcel($order, $products, $weight);
|
$result = $logistics_carriers[$parcel_carrier]->registerParcel($order, $products, $weight);
|
||||||
if($result[0] != '') {
|
if($result[0] != '') {
|
||||||
$this->_html .= $result[0];
|
$this->_html .= $result[0];
|
||||||
|
@ -119,106 +119,9 @@ if(($id_order = (int) Tools::getValue('id_order'))
|
|||||||
|
|
||||||
$invoice_address = new Address($order->id_address_invoice);
|
$invoice_address = new Address($order->id_address_invoice);
|
||||||
$delivery_address = new Address($order->id_address_delivery);
|
$delivery_address = new Address($order->id_address_delivery);
|
||||||
|
|
||||||
/*if($delivery_address->id_country == 8) {
|
$france_address_error = FALSE;
|
||||||
$replace_tests = array(
|
$france_address_suggestions = array();
|
||||||
'-S-' => ' SUR ',
|
|
||||||
'-SS-' => ' SOUS ',
|
|
||||||
' ST-' => ' SAINT ',
|
|
||||||
'-ST ' => ' SAINT ',
|
|
||||||
'-ST-' => ' SAINT ',
|
|
||||||
' STE-' => ' SAINTE ',
|
|
||||||
'-STE ' => ' SAINTE ',
|
|
||||||
'-STE ' => ' SAINTE ',
|
|
||||||
' MT-' => ' MONT ',
|
|
||||||
'-MT ' => ' MONT ',
|
|
||||||
'-MT-' => ' MONT ',
|
|
||||||
' BG-' => ' BOURG ',
|
|
||||||
'-BG ' => ' BOURG ',
|
|
||||||
'-BG-' => ' BOURG ',
|
|
||||||
' GD-' => ' GRAND ',
|
|
||||||
'-GD ' => ' GRAND ',
|
|
||||||
'-GD-' => ' GRAND ',
|
|
||||||
' GDE-' => ' GRANDE ',
|
|
||||||
'-GDE ' => ' GRANDE ',
|
|
||||||
'-GDE-' => ' GRANDE ',
|
|
||||||
' MTS-' => ' MONTS ',
|
|
||||||
'-MTS ' => ' MONTS ',
|
|
||||||
'-MTS-' => ' MONTS ',
|
|
||||||
' VX-' => ' VIEUX ',
|
|
||||||
'-VX ' => ' VIEUX ',
|
|
||||||
'-VX-' => ' VIEUX ',
|
|
||||||
' HT-' => ' HAUT ',
|
|
||||||
'-HT ' => ' HAUT ',
|
|
||||||
'-HT-' => ' HAUT ',
|
|
||||||
' BS-' => ' BAS ',
|
|
||||||
'-BS ' => ' BAS ',
|
|
||||||
'-BS-' => ' BAS ',
|
|
||||||
' S ' => ' SUR ',
|
|
||||||
' SS ' => ' SOUS ',
|
|
||||||
' ST ' => ' SAINT ',
|
|
||||||
' STE ' => ' SAINTE ',
|
|
||||||
' MT ' => ' MONT ',
|
|
||||||
' BG ' => ' BOURG ',
|
|
||||||
' GD ' => ' GRAND ',
|
|
||||||
' GDE ' => ' GRANDE ',
|
|
||||||
' MTS ' => ' MONTS ',
|
|
||||||
' VX ' => ' VIEUX ',
|
|
||||||
' HT ' => ' HAUT ',
|
|
||||||
' BS ' => ' BAS ',
|
|
||||||
' ST. ' => ' SAINT ',
|
|
||||||
);
|
|
||||||
|
|
||||||
$cities = array();
|
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
|
||||||
SELECT `city`
|
|
||||||
FROM `'._DB_PREFIX_.'france_postcode`
|
|
||||||
WHERE `postcode` = "'.pSQL(trim($delivery_address->postcode)).'"
|
|
||||||
') as $row) {
|
|
||||||
$cities[] = $row['city'];
|
|
||||||
}
|
|
||||||
$found = FALSE;
|
|
||||||
if($cities) {
|
|
||||||
foreach($cities as $city) {
|
|
||||||
if(str_replace(array('\\', '-', '_', ' ', '/', '\'', '"', '«', '»', '’', ' ', '.', ',',), '', strtolower(trim(stripaccents($city)))) == str_replace(array('\\', '-', '_', ' ', '/', '\'', '"', '«', '»', '’', ' ', '.', ',',), '', strtolower(trim(stripaccents(preg_replace('/ C(I|E)DEX(.*)$/i', '', $delivery_address->city)))))) {
|
|
||||||
$found = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!$found) {
|
|
||||||
foreach($cities as $city) {
|
|
||||||
$clean_city = str_replace(array('\\', '-', '_', ' ', '/', '\'', '"', '«', '»', '’', ' ', '.', ',',), '', strtolower(trim(stripaccents($city))));
|
|
||||||
$clean_customer_city = str_replace(array('\\', '-', '_', ' ', '/', '\'', '"', '«', '»', '’', ' ', '.', ',',), '', strtolower(trim(str_ireplace('/', ' SUR ', str_ireplace(' S/', ' SUR ', str_ireplace(array_keys($replace_tests), array_values($replace_tests), stripaccents(' '.preg_replace('/ C(I|E)DEX(.*)$/i', '', $delivery_address->city).' ')))))));
|
|
||||||
if($clean_city === $clean_customer_city
|
|
||||||
|| $clean_city === 'le'.$clean_customer_city
|
|
||||||
|| $clean_city === 'la'.$clean_customer_city
|
|
||||||
|| $clean_city === 'les'.$clean_customer_city
|
|
||||||
|| $clean_city === 'l'.$clean_customer_city
|
|
||||||
|| 'le'.$clean_city === $clean_customer_city
|
|
||||||
|| 'la'.$clean_city === $clean_customer_city
|
|
||||||
|| 'les'.$clean_city === $clean_customer_city
|
|
||||||
|| 'l'.$clean_city === $clean_customer_city) {
|
|
||||||
$found = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$france_address_error = !$found;
|
|
||||||
$france_address_suggestions = array();
|
|
||||||
|
|
||||||
if($france_address_error) {
|
|
||||||
$france_address_suggestions = Db::getInstance()->ExecuteS('
|
|
||||||
SELECT `postcode`, `city`
|
|
||||||
FROM `'._DB_PREFIX_.'france_postcode`
|
|
||||||
WHERE `postcode` = "'.pSQL($delivery_address->postcode).'"
|
|
||||||
OR `city` = "'.pSQL($delivery_address->city).'"
|
|
||||||
GROUP BY `postcode`, `city`
|
|
||||||
');
|
|
||||||
}
|
|
||||||
} else {*/
|
|
||||||
$france_address_error = FALSE;
|
|
||||||
$france_address_suggestions = array();
|
|
||||||
/*}*/
|
|
||||||
|
|
||||||
$id_order_details = array();
|
$id_order_details = array();
|
||||||
|
|
||||||
@ -227,35 +130,32 @@ if(($id_order = (int) Tools::getValue('id_order'))
|
|||||||
$link = new Link(2);
|
$link = new Link(2);
|
||||||
$products = array();
|
$products = array();
|
||||||
foreach($order->getProductsDetail() as $p) {
|
foreach($order->getProductsDetail() as $p) {
|
||||||
$p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
|
// --- Get quantity sent
|
||||||
|
// LaPoste
|
||||||
|
$p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
|
||||||
SELECT IFNULL(SUM(`quantity`), 0)
|
SELECT IFNULL(SUM(`quantity`), 0)
|
||||||
FROM `'._DB_PREFIX_.'lapostews`
|
FROM `'._DB_PREFIX_.'lapostews`
|
||||||
WHERE `id_order_detail` = '.(int) $p['id_order_detail'].'
|
WHERE `id_order_detail` = '.(int) $p['id_order_detail'].'
|
||||||
');
|
');
|
||||||
|
// Exapaq
|
||||||
$p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
|
$p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
|
||||||
SELECT IFNULL(SUM(`quantity`), 0)
|
SELECT IFNULL(SUM(`quantity`), 0)
|
||||||
FROM `'._DB_PREFIX_.'exapaqws`
|
FROM `'._DB_PREFIX_.'exapaqws`
|
||||||
WHERE `id_order_detail` = '.(int) $p['id_order_detail'].'
|
WHERE `id_order_detail` = '.(int) $p['id_order_detail'].'
|
||||||
');
|
');
|
||||||
/**
|
// MondialRelay
|
||||||
* @Override MondialRelay
|
|
||||||
*/
|
|
||||||
$p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
|
$p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
|
||||||
SELECT IFNULL(SUM(`quantity`), 0)
|
SELECT IFNULL(SUM(`quantity`), 0)
|
||||||
FROM `'._DB_PREFIX_.'mondialrelay_parcel`
|
FROM `'._DB_PREFIX_.'mondialrelay_parcel`
|
||||||
WHERE `id_order_detail` = ' . (int) $p['id_order_detail'] . '
|
WHERE `id_order_detail` = ' . (int) $p['id_order_detail'] . '
|
||||||
');
|
');
|
||||||
/**
|
// Philea
|
||||||
* @Override Philea
|
|
||||||
*/
|
|
||||||
$p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
|
$p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
|
||||||
SELECT IFNULL(SUM(`quantity`), 0)
|
SELECT IFNULL(SUM(`quantity`), 0)
|
||||||
FROM `'._DB_PREFIX_.'philea_parcel`
|
FROM `'._DB_PREFIX_.'philea_parcel`
|
||||||
WHERE `id_order_detail` = ' . (int) $p['id_order_detail'] . '
|
WHERE `id_order_detail` = ' . (int) $p['id_order_detail'] . '
|
||||||
');
|
');
|
||||||
/**
|
// DropShipping
|
||||||
* @Override Dropshipping
|
|
||||||
*/
|
|
||||||
$p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
|
$p['product_quantity_sent'] += (int) Db::getInstance()->getValue('
|
||||||
SELECT IFNULL(SUM(`quantity`), 0)
|
SELECT IFNULL(SUM(`quantity`), 0)
|
||||||
FROM `'._DB_PREFIX_.'ant_dropshipping_parcel`
|
FROM `'._DB_PREFIX_.'ant_dropshipping_parcel`
|
||||||
@ -287,21 +187,6 @@ if(($id_order = (int) Tools::getValue('id_order'))
|
|||||||
|
|
||||||
$p['image'] = '//'.$link->getImageLink('image', $p['product_id'].'-'.$p['id_image'], 'home');
|
$p['image'] = '//'.$link->getImageLink('image', $p['product_id'].'-'.$p['id_image'], 'home');
|
||||||
|
|
||||||
/*$shipping = Db::getInstance()->getRow('
|
|
||||||
SELECT s.`id_shipping`, s.`id_sale`
|
|
||||||
FROM `'._DB_PREFIX_.'privatesale_shipping_sale` s
|
|
||||||
LEFT JOIN `'._DB_PREFIX_.'product_ps_cache` c
|
|
||||||
ON c.`id_sale` = s.`id_sale`
|
|
||||||
WHERE c.`id_product` = '.(int) $p['product_id'].'
|
|
||||||
');
|
|
||||||
|
|
||||||
if(!$shipping) {
|
|
||||||
$p['id_shipping'] = 1; // PSS
|
|
||||||
$p['id_sale'] = 999999;
|
|
||||||
} else {
|
|
||||||
$p['id_shipping'] = $shipping['id_shipping'];
|
|
||||||
$p['id_sale'] = $shipping['id_sale'];
|
|
||||||
}*/
|
|
||||||
$p['id_shipping'] = 1;
|
$p['id_shipping'] = 1;
|
||||||
$p['id_sale'] = (int) Db::getInstance()->getValue('
|
$p['id_sale'] = (int) Db::getInstance()->getValue('
|
||||||
SELECT `id_sale`
|
SELECT `id_sale`
|
||||||
@ -315,7 +200,7 @@ if(($id_order = (int) Tools::getValue('id_order'))
|
|||||||
WHERE `id_product` = '.(int) $p['product_id'].' AND id_order = '.(int)$id_order
|
WHERE `id_product` = '.(int) $p['product_id'].' AND id_order = '.(int)$id_order
|
||||||
);
|
);
|
||||||
|
|
||||||
if(!isset($sales_carriers[(int) $p['id_sale']])) {
|
if (!isset($sales_carriers[(int) $p['id_sale']])) {
|
||||||
$sales_carriers[(int) $p['id_sale']] = array();
|
$sales_carriers[(int) $p['id_sale']] = array();
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
foreach(Db::getInstance()->ExecuteS('
|
||||||
SELECT `id_carrier`
|
SELECT `id_carrier`
|
||||||
@ -327,10 +212,22 @@ if(($id_order = (int) Tools::getValue('id_order'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$p['carriers'] = $sales_carriers[(int) $p['id_sale']];
|
$p['carriers'] = $sales_carriers[(int) $p['id_sale']];
|
||||||
|
$p['location'] = isset($locations[(int) $p['product_id'].'-'.(int) $p['product_attribute_id']]) ?
|
||||||
$p['location'] = isset($locations[(int) $p['product_id'].'-'.(int) $p['product_attribute_id']])? $locations[(int) $p['product_id'].'-'.(int) $p['product_attribute_id']]: '';
|
$locations[(int) $p['product_id'].'-'.(int) $p['product_attribute_id']]: '';
|
||||||
|
|
||||||
|
// --- Get Shipping Numbers
|
||||||
$shipping_numbers = array();
|
$shipping_numbers = array();
|
||||||
|
// Philea
|
||||||
|
foreach(Db::getInstance()->ExecuteS('
|
||||||
|
SELECT l.`shipping_number`
|
||||||
|
FROM `'._DB_PREFIX_.'philea_parcel` l
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'order_detail` d ON (d.`id_order_detail` = l.`id_order_detail`)
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'order_history` h ON (h.`id_order` = d.`id_order`)
|
||||||
|
WHERE h.`id_order` = '.(int) $order->id.'
|
||||||
|
') as $row) {
|
||||||
|
$shipping_numbers[] = '"'.pSQL($row['shipping_number']).'"';
|
||||||
|
}
|
||||||
|
// LaPoste
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
foreach(Db::getInstance()->ExecuteS('
|
||||||
SELECT l.`shipping_number`
|
SELECT l.`shipping_number`
|
||||||
FROM `'._DB_PREFIX_.'lapostews` l
|
FROM `'._DB_PREFIX_.'lapostews` l
|
||||||
@ -340,6 +237,7 @@ if(($id_order = (int) Tools::getValue('id_order'))
|
|||||||
') as $row) {
|
') as $row) {
|
||||||
$shipping_numbers[] = '"'.pSQL($row['shipping_number']).'"';
|
$shipping_numbers[] = '"'.pSQL($row['shipping_number']).'"';
|
||||||
}
|
}
|
||||||
|
// Exapaq
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
foreach(Db::getInstance()->ExecuteS('
|
||||||
SELECT e.`shipping_number`
|
SELECT e.`shipping_number`
|
||||||
FROM `'._DB_PREFIX_.'exapaqws` e
|
FROM `'._DB_PREFIX_.'exapaqws` e
|
||||||
@ -349,9 +247,7 @@ if(($id_order = (int) Tools::getValue('id_order'))
|
|||||||
') as $row) {
|
') as $row) {
|
||||||
$shipping_numbers[] = '"'.pSQL($row['shipping_number']).'"';
|
$shipping_numbers[] = '"'.pSQL($row['shipping_number']).'"';
|
||||||
}
|
}
|
||||||
/*
|
// MondialRelay
|
||||||
* @Override MondialRelay
|
|
||||||
*/
|
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
foreach(Db::getInstance()->ExecuteS('
|
||||||
SELECT l.`shipping_number`
|
SELECT l.`shipping_number`
|
||||||
FROM `'._DB_PREFIX_.'mondialrelay_parcel` l
|
FROM `'._DB_PREFIX_.'mondialrelay_parcel` l
|
||||||
@ -361,24 +257,11 @@ if(($id_order = (int) Tools::getValue('id_order'))
|
|||||||
') as $row) {
|
') as $row) {
|
||||||
$shipping_numbers[] = '"'.pSQL($row['shipping_number']).'"';
|
$shipping_numbers[] = '"'.pSQL($row['shipping_number']).'"';
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* @Override Philea
|
|
||||||
*/
|
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
|
||||||
SELECT l.`shipping_number`
|
|
||||||
FROM `'._DB_PREFIX_.'philea_parcel` l
|
|
||||||
LEFT JOIN `'._DB_PREFIX_.'order_detail` d ON (d.`id_order_detail` = l.`id_order_detail`)
|
|
||||||
LEFT JOIN `'._DB_PREFIX_.'order_history` h ON (h.`id_order` = d.`id_order`)
|
|
||||||
WHERE h.`id_order` = '.(int) $order->id.'
|
|
||||||
') as $row) {
|
|
||||||
$shipping_numbers[] = '"'.pSQL($row['shipping_number']).'"';
|
|
||||||
}
|
|
||||||
|
|
||||||
if(((int) $p['product_quantity_sent'] === 0)
|
if(((int) $p['product_quantity_sent'] === 0) && Db::getInstance()->getRow('
|
||||||
&& Db::getInstance()->getRow('
|
|
||||||
SELECT h.`id_sale`
|
SELECT h.`id_sale`
|
||||||
FROM `'._DB_PREFIX_.'shipping_history` h
|
FROM `'._DB_PREFIX_.'shipping_history` h
|
||||||
WHERE h.`id_sale` = '.((int) $p['id_sale'] === 999999? 0: (int) $p['id_sale']).'
|
WHERE h.`id_sale` = '.((int) $p['id_sale'] === 999999 ? 0: (int) $p['id_sale']).'
|
||||||
AND h.`id_order` = '.(int) $order->id.'
|
AND h.`id_order` = '.(int) $order->id.'
|
||||||
'.(count($shipping_numbers) > 0? 'AND h.`shipping_number` NOT IN ('.implode(', ', $shipping_numbers).')': '').'
|
'.(count($shipping_numbers) > 0? 'AND h.`shipping_number` NOT IN ('.implode(', ', $shipping_numbers).')': '').'
|
||||||
')) {
|
')) {
|
||||||
@ -406,8 +289,24 @@ if(($id_order = (int) Tools::getValue('id_order'))
|
|||||||
if(count($id_order_details) > 0) {
|
if(count($id_order_details) > 0) {
|
||||||
$logs = array();
|
$logs = array();
|
||||||
|
|
||||||
|
// Send by PHILEA
|
||||||
|
if ($l = Db::getInstance()->ExecuteS('
|
||||||
|
SELECT l.*, d.`product_name`, d.`product_reference`, d.`product_supplier_reference`, "Philea" as firstname,
|
||||||
|
(CASE c.`external_module_name` WHEN "soflexibilite" THEN "laposte" ELSE c.`external_module_name` END) as carrier,
|
||||||
|
"1" as philea
|
||||||
|
FROM `'._DB_PREFIX_.'philea_parcel` l
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'order_detail` d ON d.`id_order_detail` = l.`id_order_detail`
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = d.`id_order`
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'carrier` c ON c.`id_carrier` = o.`id_carrier`
|
||||||
|
WHERE l.`id_order_detail` IN ('.implode(', ', $id_order_details).')
|
||||||
|
AND l.`quantity` > 0
|
||||||
|
ORDER BY l.`date_add` DESC
|
||||||
|
')) {
|
||||||
|
$logs = array_merge($logs, $l);
|
||||||
|
}
|
||||||
|
|
||||||
// Send by LAPOSTE
|
// Send by LAPOSTE
|
||||||
if($l = Db::getInstance()->ExecuteS('
|
if ($l = Db::getInstance()->ExecuteS('
|
||||||
SELECT l.*, d.`product_name`, d.`product_reference`, d.`product_supplier_reference`,
|
SELECT l.*, d.`product_name`, d.`product_reference`, d.`product_supplier_reference`,
|
||||||
e.`firstname`, e.`lastname`, "laposte" as carrier, "0" as philea
|
e.`firstname`, e.`lastname`, "laposte" as carrier, "0" as philea
|
||||||
FROM `'._DB_PREFIX_.'lapostews` l
|
FROM `'._DB_PREFIX_.'lapostews` l
|
||||||
@ -422,7 +321,7 @@ if(($id_order = (int) Tools::getValue('id_order'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send by EXAPAQ
|
// Send by EXAPAQ
|
||||||
if($l = Db::getInstance()->ExecuteS('
|
if ($l = Db::getInstance()->ExecuteS('
|
||||||
SELECT l.*, d.`product_name`, d.`product_reference`, d.`product_supplier_reference`,
|
SELECT l.*, d.`product_name`, d.`product_reference`, d.`product_supplier_reference`,
|
||||||
e.`firstname`, e.`lastname`, "exapaq" as carrier, "0" as philea
|
e.`firstname`, e.`lastname`, "exapaq" as carrier, "0" as philea
|
||||||
FROM `'._DB_PREFIX_.'exapaqws` l
|
FROM `'._DB_PREFIX_.'exapaqws` l
|
||||||
@ -437,7 +336,7 @@ if(($id_order = (int) Tools::getValue('id_order'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send by MONDIAL RELAY
|
// Send by MONDIAL RELAY
|
||||||
if($l = Db::getInstance()->ExecuteS('
|
if ($l = Db::getInstance()->ExecuteS('
|
||||||
SELECT l.*, d.`product_name`, d.`product_reference`, d.`product_supplier_reference`,
|
SELECT l.*, d.`product_name`, d.`product_reference`, d.`product_supplier_reference`,
|
||||||
e.`firstname`, e.`lastname`, "mondialrelay" as carrier, "0" as philea
|
e.`firstname`, e.`lastname`, "mondialrelay" as carrier, "0" as philea
|
||||||
FROM `'._DB_PREFIX_.'mondialrelay_parcel` l
|
FROM `'._DB_PREFIX_.'mondialrelay_parcel` l
|
||||||
@ -452,7 +351,7 @@ if(($id_order = (int) Tools::getValue('id_order'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send by DROPSHIPPING
|
// Send by DROPSHIPPING
|
||||||
if($l = Db::getInstance()->ExecuteS('
|
if ($l = Db::getInstance()->ExecuteS('
|
||||||
SELECT l.*, d.`product_name`, d.`product_reference`, d.`product_supplier_reference`,
|
SELECT l.*, d.`product_name`, d.`product_reference`, d.`product_supplier_reference`,
|
||||||
"Dropshipping" as firstname, "0" as philea
|
"Dropshipping" as firstname, "0" as philea
|
||||||
FROM `'._DB_PREFIX_.'ant_dropshipping_parcel` l
|
FROM `'._DB_PREFIX_.'ant_dropshipping_parcel` l
|
||||||
@ -464,22 +363,7 @@ if(($id_order = (int) Tools::getValue('id_order'))
|
|||||||
')) {
|
')) {
|
||||||
$logs = array_merge($logs, $l);
|
$logs = array_merge($logs, $l);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send by PHILEA
|
|
||||||
if($l = Db::getInstance()->ExecuteS('
|
|
||||||
SELECT l.*, d.`product_name`, d.`product_reference`, d.`product_supplier_reference`, "Philea" as firstname,
|
|
||||||
(CASE c.`external_module_name` WHEN "soflexibilite" THEN "laposte" ELSE c.`external_module_name` END) as carrier,
|
|
||||||
"1" as philea
|
|
||||||
FROM `'._DB_PREFIX_.'philea_parcel` l
|
|
||||||
LEFT JOIN `'._DB_PREFIX_.'order_detail` d ON d.`id_order_detail` = l.`id_order_detail`
|
|
||||||
LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = d.`id_order`
|
|
||||||
LEFT JOIN `'._DB_PREFIX_.'carrier` c ON c.`id_carrier` = o.`id_carrier`
|
|
||||||
WHERE l.`id_order_detail` IN ('.implode(', ', $id_order_details).')
|
|
||||||
AND l.`quantity` > 0
|
|
||||||
ORDER BY l.`date_add` DESC
|
|
||||||
')) {
|
|
||||||
$logs = array_merge($logs, $l);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$logs = array();
|
$logs = array();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user