Don't save shipping number in dropshipping

This commit is contained in:
Michael RICOIS 2018-01-31 12:05:57 +01:00
parent 70afb97e26
commit 9cadd3e8af
2 changed files with 18 additions and 17 deletions

View File

@ -293,18 +293,19 @@ class AdminAntDropshippingtracking extends AdminTab
$history->id_employee = 0; $history->id_employee = 0;
$history->add(); $history->add();
Db::getInstance()->ExecuteS(' if ($infosTrackingEnable == 1) {
INSERT INTO `'._DB_PREFIX_.'shipping_history`
VALUES ( Db::getInstance()->ExecuteS('
'.(int) $order->id.', INSERT INTO `'._DB_PREFIX_.'shipping_history`
"'.pSQL($o['tracking_number']).'", VALUES (
NOW(), '.(int) $order->id.',
0, "'.pSQL($o['tracking_number']).'",
'.(int)$id_sale.' NOW(),
) 0,
'); '.(int)$id_sale.'
)
if ($infosTrackingEnable) { ');
global $_LANGMAIL; global $_LANGMAIL;
$subject = 'Package in transit'; $subject = 'Package in transit';
$customer = new Customer((int) $order->id_customer); $customer = new Customer((int) $order->id_customer);

View File

@ -165,7 +165,7 @@ if(($id_order = (int) Tools::getValue('id_order'))
// Image // Image
$p['id_image'] = 0; $p['id_image'] = 0;
if((int) $p['product_attribute_id'] != 0) { if ((int) $p['product_attribute_id'] != 0) {
$img = Db::getInstance()->getRow(' $img = Db::getInstance()->getRow('
SELECT `id_image` SELECT `id_image`
FROM `'._DB_PREFIX_.'product_attribute_image` FROM `'._DB_PREFIX_.'product_attribute_image`
@ -175,7 +175,7 @@ if(($id_order = (int) Tools::getValue('id_order'))
$p['id_image'] = $img['id_image']; $p['id_image'] = $img['id_image'];
} }
if($p['id_image'] == 0) { if ($p['id_image'] == 0) {
$img = Db::getInstance()->getRow(' $img = Db::getInstance()->getRow('
SELECT `id_image` SELECT `id_image`
FROM `'._DB_PREFIX_.'image` FROM `'._DB_PREFIX_.'image`
@ -259,12 +259,12 @@ if(($id_order = (int) Tools::getValue('id_order'))
$shipping_numbers[] = '"'.pSQL($row['shipping_number']).'"'; $shipping_numbers[] = '"'.pSQL($row['shipping_number']).'"';
} }
if(((int) $p['product_quantity_sent'] === 0) && Db::getInstance()->getRow(' if (((int) $p['product_quantity_sent'] === 0) && 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).')': '').'
')) { ')) {
$p['product_quantity_sent'] = $p['product_quantity'] - ( $p['product_quantity_return'] > 0 ? $p['product_quantity_sent'] = $p['product_quantity'] - ( $p['product_quantity_return'] > 0 ?
$p['product_quantity_return']: $p['product_quantity_refunded'] ); $p['product_quantity_return']: $p['product_quantity_refunded'] );