[-] BO : Fix bug #PSCFV-9264 bad cancel qty when refund / return
This commit is contained in:
1 parent
5563c53133
commit
21d04cb423
2 files changed
+2
-2
No files matched your search
@@ -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) */
|
/* Does NOT delete a product but "cancel" it (which means return/refund/delete it depending of the case) */
|
||||||
public function deleteProduct($order, $orderDetail, $quantity)
|
public function deleteProduct($order, $orderDetail, $quantity)
|
||||||
{
|
{
|
||||||
if (!(int)($this->getCurrentState()))
|
if (!(int)($this->getCurrentState()) || !validate::isLoadedObject($orderDetail))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ($this->hasBeenDelivered())
|
if ($this->hasBeenDelivered())
|
||||||
|
|||||||
@@ -653,7 +653,7 @@ class AdminOrdersControllerCore extends AdminController
|
|||||||
|
|
||||||
// Delete product
|
// Delete product
|
||||||
$order_detail = new OrderDetail((int)$id_order_detail);
|
$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>';
|
$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));
|
Hook::exec('actionProductCancel', array('order' => $order, 'id_order_detail' => (int)$id_order_detail));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user