[-] BO : Fix bug #PSCFV-9264 bad cancel qty when refund / return
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user