diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index ef5fccea80b503f9060f7b22ae83abf036c0eb2f..f0ab4fd5e78a92b4b4d2bde99243df56a34ddd1c 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -545,7 +545,7 @@ if ($ok && GETPOST('clean_product_stock_batch')) while ($i < $num) { $obj=$db->fetch_object($resql); - print '<tr><td>Product '.$obj->rowid.'-'.$obj->ref.' in warehose '.$obj->fk_entrepot.' -> '.$obj->psrowid.': '.$obj->reel.' (product_stock.reel) != '.$obj->reelbatch.' (sum product_batch)'; + print '<tr><td>Product '.$obj->rowid.'-'.$obj->ref.' in warehose '.$obj->fk_entrepot.' -> '.$obj->psrowid.': '.$obj->reel.' (product_stock.reel) != '.($obj->reelbatch?$obj->reelbatch:'0').' (sum product_batch)'; // Fix if ($obj->reel != $obj->reelbatch) @@ -571,7 +571,7 @@ if ($ok && GETPOST('clean_product_stock_batch')) if ($methodtofix == 'updatestock') { // Method 2 - print ' -> Update qty of product_stock with qty = '.$obj->reelbatch.' for ps.rowid = '.$obj->psrowid; + print ' -> Update qty of product_stock with qty = '.($obj->reelbatch?$obj->reelbatch:'0').' for ps.rowid = '.$obj->psrowid; if (GETPOST('clean_product_stock_batch') == 'confirmed') { $error=0; @@ -579,7 +579,7 @@ if ($ok && GETPOST('clean_product_stock_batch')) $db->begin(); $sql2 ="UPDATE ".MAIN_DB_PREFIX."product_stock"; - $sql2.=" SET reel = ".$obj->reelbatch." WHERE rowid = ".$obj->psrowid; + $sql2.=" SET reel = ".($obj->reelbatch?$obj->reelbatch:'0')." WHERE rowid = ".$obj->psrowid; $resql2=$db->query($sql2); if ($resql2) {