fix conflicts

This commit is contained in:
Marion Muszynski 2017-04-25 15:04:54 +02:00
commit f280695772
2 changed files with 29 additions and 19 deletions

View File

@ -574,29 +574,41 @@ class AdminOrders extends AdminTab
$qtyCancelProduct = abs($qtyList[$key]);
$orderDetail = new OrderDetail((int)($id_order_detail));
// @Addition Antadis - prevent reinjection when the product is sent by Philea
$is_philea = DB::getInstance()->getValue('
SELECT p.`id_sale`
FROM `'._DB_PREFIX_.'philea_sync` p
LEFT JOIN `'._DB_PREFIX_.'product_ps_cache` ps ON (ps.`id_sale` = p.`id_sale`)
WHERE ps.`id_product`='.$orderDetail->product_id
);
// Reinject product
if (!$order->hasBeenDelivered() OR ($order->hasBeenDelivered() AND Tools::isSubmit('reinjectQuantities')))
if (!$order->hasBeenDelivered() OR ($order->hasBeenDelivered() AND Tools::isSubmit('reinjectQuantities') AND !$is_philea))
{
$reinjectableQuantity = (int)($orderDetail->product_quantity) - (int)($orderDetail->product_quantity_reinjected);
$quantityToReinject = $qtyCancelProduct > $reinjectableQuantity ? $reinjectableQuantity : $qtyCancelProduct;
if (!Product::reinjectQuantities($orderDetail, $quantityToReinject))
$this->_errors[] = Tools::displayError('Cannot re-stock product').' <span class="bold">'.$orderDetail->product_name.'</span>';
else
if(($is_philea && !$order->hasBeenShipped() && !$order->hasBeenDelivered()) || !$is_philea)
{
$updProductAttributeID = !empty($orderDetail->product_attribute_id) ? (int)($orderDetail->product_attribute_id) : NULL;
$newProductQty = Product::getQuantity((int)($orderDetail->product_id), $updProductAttributeID);
$product = get_object_vars(new Product((int)($orderDetail->product_id), false, (int)($cookie->id_lang)));
if (!empty($orderDetail->product_attribute_id))
{
$updProduct['quantity_attribute'] = (int)($newProductQty);
$product['quantity_attribute'] = $updProduct['quantity_attribute'];
}
$reinjectableQuantity = (int)($orderDetail->product_quantity) - (int)($orderDetail->product_quantity_reinjected);
$quantityToReinject = $qtyCancelProduct > $reinjectableQuantity ? $reinjectableQuantity : $qtyCancelProduct;
if (!Product::reinjectQuantities($orderDetail, $quantityToReinject))
$this->_errors[] = Tools::displayError('Cannot re-stock product').' <span class="bold">'.$orderDetail->product_name.'</span>';
else
{
$updProduct['stock_quantity'] = (int)($newProductQty);
$product['stock_quantity'] = $updProduct['stock_quantity'];
$updProductAttributeID = !empty($orderDetail->product_attribute_id) ? (int)($orderDetail->product_attribute_id) : NULL;
$newProductQty = Product::getQuantity((int)($orderDetail->product_id), $updProductAttributeID);
$product = get_object_vars(new Product((int)($orderDetail->product_id), false, (int)($cookie->id_lang)));
if (!empty($orderDetail->product_attribute_id))
{
$updProduct['quantity_attribute'] = (int)($newProductQty);
$product['quantity_attribute'] = $updProduct['quantity_attribute'];
}
else
{
$updProduct['stock_quantity'] = (int)($newProductQty);
$product['stock_quantity'] = $updProduct['stock_quantity'];
}
Hook::updateQuantity($product, $order);
}
Hook::updateQuantity($product, $order);
}
}

View File

@ -96,7 +96,6 @@ $(document).ready(function() {
}
});
if($('#privatesales_categories_block_left').length > 0){
var elem = $('#privatesales_categories_block_left');
var position_elem = $(elem).position();
@ -118,7 +117,6 @@ $(document).ready(function() {
if(parseInt(scroll) >= parseInt(initial_position) ){
var position_menu_bas = $(elem).position().top + $(elem).height() + 10;
var position_center_bas = $('.main_category_vp').position().top + $('.main_category_vp').height() - 20;
var top_max = scroll + $(elem).height();
if($('.block_filter').length > 0){