diff --git a/modules/ant_returnprocess/AdminAntReturnprocess.php b/modules/ant_returnprocess/AdminAntReturnprocess.php index f564cdcb..f0e3d37a 100644 --- a/modules/ant_returnprocess/AdminAntReturnprocess.php +++ b/modules/ant_returnprocess/AdminAntReturnprocess.php @@ -396,7 +396,12 @@ class AdminAntReturnprocess extends AdminTab HelperFormBootstrap::displayErrors('Le remboursement n\'a pu avoir lieu'); return; } - } elseif(Tools::isSubmit('submitCancelProduct') && Tools::getValue('id_order_return') && ($id_order = (int)(Tools::getValue('id_order'))) AND Validate::isLoadedObject($order = new Order($id_order))) { + } + elseif (Tools::isSubmit('submitCancelProduct') + && Tools::getValue('id_order_return') + && ($id_order = (int)(Tools::getValue('id_order'))) + && Validate::isLoadedObject($order = new Order($id_order))) { + $_POST['generateCreditSlip'] = 1; $customer = new Customer($order->id_customer); @@ -688,7 +693,8 @@ class AdminAntReturnprocess extends AdminTab } HelperFormBootstrap::displaySuccess('Remboursement Effectué'); } - } elseif(Tools::isSubmit('submitResendParcel') && Tools::getValue('id_order_return') && ($id_order = (int)(Tools::getValue('id_order'))) AND Validate::isLoadedObject($order = new Order($id_order))) { + } + elseif(Tools::isSubmit('submitResendParcel') && Tools::getValue('id_order_return') && ($id_order = (int)(Tools::getValue('id_order'))) AND Validate::isLoadedObject($order = new Order($id_order))) { $products = Tools::getValue('resendQuantity'); $parcel_carrier = Tools::getValue('parcel_carrier'); diff --git a/modules/labelgenerate/AdminLabelGenerate.php b/modules/labelgenerate/AdminLabelGenerate.php index c6193dd7..58ce187d 100644 --- a/modules/labelgenerate/AdminLabelGenerate.php +++ b/modules/labelgenerate/AdminLabelGenerate.php @@ -420,10 +420,12 @@ class AdminLabelGenerate extends AdminTab LEFT JOIN '._DB_PREFIX_.'orders o ON (o.`id_order` = od.`id_order`) WHERE od.`product_id` = ' . (int)$product->id . ' AND `product_attribute_id` = 0 AND o.`valid` != 0' ); + $quantity = 0; foreach ($result_quantities as $od) { $quantity += ($od['product_quantity'] - $od['product_quantity_reinjected']); } + if ($quantity > 0) { $ean_generate = $barcode->generateBarcode($product->id, NULL, $product->reference); $barcode->assocProduct($product->id, NULL, $quantity, $product->reference); @@ -439,7 +441,6 @@ class AdminLabelGenerate extends AdminTab AND `product_attribute_id` = 0 '); } - } }