From eb782000292069dbc558a7d6a728383ddc0d2cce Mon Sep 17 00:00:00 2001 From: rGaillard Date: Mon, 29 Oct 2012 14:40:13 +0000 Subject: [PATCH] [-] BO : Fix #PSCFV-5223 add product should be available when the package is not shipped --- controllers/admin/AdminOrdersController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index c97867f2b..e504e11e4 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -1474,14 +1474,14 @@ class AdminOrdersControllerCore extends AdminController public function ajaxProcessAddProductOnOrder() { // Load object - $order = new Order(Tools::getValue('id_order')); + $order = new Order((int)Tools::getValue('id_order')); if (!Validate::isLoadedObject($order)) die(Tools::jsonEncode(array( 'result' => false, 'error' => Tools::displayError('Can\'t load Order object') ))); - if ($order->hasBeenDelivered()) + if ($order->hasBeenShipped()) die(Tools::jsonEncode(array( 'result' => false, 'error' => Tools::displayError('Can\'t add a product on delivered order') @@ -1702,10 +1702,12 @@ class AdminOrdersControllerCore extends AdminController // Get the last product $product = end($products); - $resume = OrderSlip::getProductSlipResume($product['id_order_detail']); + $resume = OrderSlip::getProductSlipResume((int)$product['id_order_detail']); $product['quantity_refundable'] = $product['product_quantity'] - $resume['product_quantity']; $product['amount_refundable'] = $product['total_price_tax_incl'] - $resume['amount_tax_incl']; $product['amount_refund'] = Tools::displayPrice($resume['amount_tax_incl']); + $product['return_history'] = OrderReturn::getProductReturnDetail((int)$product['id_order_detail']); + $product['refund_history'] = OrderSlip::getProductSlipDetail((int)$product['id_order_detail']); // Get invoices collection $invoice_collection = $order->getInvoicesCollection();