[-] BO : Fix bug #PSCFV-9264 bad cancel qty when refund / return

This commit is contained in:
gRoussac
2013-06-20 18:21:55 +02:00
parent 5563c53133
commit 21d04cb423
2 changed files with 2 additions and 2 deletions

View File

@@ -290,7 +290,7 @@ class OrderCore extends ObjectModel
/* Does NOT delete a product but "cancel" it (which means return/refund/delete it depending of the case) */
public function deleteProduct($order, $orderDetail, $quantity)
{
if (!(int)($this->getCurrentState()))
if (!(int)($this->getCurrentState()) || !validate::isLoadedObject($orderDetail))
return false;
if ($this->hasBeenDelivered())

View File

@@ -653,7 +653,7 @@ class AdminOrdersControllerCore extends AdminController
// Delete product
$order_detail = new OrderDetail((int)$id_order_detail);
if (!$order->deleteProduct($order, $order_detail, $qtyCancelProduct))
if (!$order->deleteProduct($order, $order_detail, $qty_cancel_product))
$this->errors[] = Tools::displayError('An error occurred while attempting to delete the product.').' <span class="bold">'.$order_detail->product_name.'</span>';
Hook::exec('actionProductCancel', array('order' => $order, 'id_order_detail' => (int)$id_order_detail));
}