diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index cd95fe40e5d..538bc20de20 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3055,7 +3055,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly', 'hrm'=>'umbrella-beach', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode', 'email'=>'at', - 'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'info-circle', + 'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'question-circle', 'generic'=>'file', 'holiday'=>'umbrella-beach', 'label'=>'layer-group', 'member'=>'users', 'mrp'=>'cubes', 'trip'=>'wallet', 'group'=>'users', 'sign-out'=>'sign-out-alt', @@ -3143,7 +3143,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotocolor = array( 'address'=>'#37a', 'building'=>'#37a', 'bom'=>'#a69944', 'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'dynamicprice'=>'#a69944', - 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999', + 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'help'=>'#bbb', 'listlight'=>'#999', 'dolly'=>'#a69944', 'dollyrevert'=>'#a69944', 'lot'=>'#a69944', 'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', 'other'=>'#ddd', diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index c9fd88f920d..7f4d8b0c72f 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -34,6 +34,7 @@ StockMovementForId=Movement ID %d ListMouvementStockProject=List of stock movements associated to project StocksArea=Warehouses area AllWarehouses=All warehouses +IncludeEmptyDesiredStock=Include also undefined desired stock IncludeAlsoDraftOrders=Include also draft orders Location=Location LocationSummary=Short name location diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index a4fb63ae899..d5eeac44995 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -55,7 +55,7 @@ $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', $type = GETPOST('type', 'int'); $tobuy = GETPOST('tobuy', 'int'); $salert = GETPOST('salert', 'alpha'); -$allalert = GETPOST('allalert', 'alpha'); +$includeproductswithoutdesiredqty = GETPOST('includeproductswithoutdesiredqty', 'alpha'); $mode = GETPOST('mode', 'alpha'); $draftorder = GETPOST('draftorder', 'alpha'); @@ -111,7 +111,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_label = ''; $sall = ''; $salert = ''; - $allalert = ''; + $includeproductswithoutdesiredqty = ''; $draftorder = ''; } if ($draftorder == 'on') $draftchecked = "checked"; @@ -430,7 +430,7 @@ if ($usevirtualstock) $sql .= ' ('.$sqldesiredtock.' >= 0 AND ('.$sqldesiredtock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; $sql .= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.') + ('.$sqlProductionToProduce.' - '.$sqlProductionToConsume.')))'; $sql .= ' OR '; - if ($allalert == 'on') { + if ($includeproductswithoutdesiredqty == 'on') { $sql .= ' (('.$sqlalertstock.' >= 0 OR '.$sqlalertstock.' IS NULL) AND ('.$db->ifsql("$sqlalertstock IS NULL", "0", $sqlalertstock).' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; } else { $sql .= ' ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; @@ -441,7 +441,7 @@ if ($usevirtualstock) if ($salert == 'on') // Option to see when stock is lower than alert { $sql .= ' AND (('; - if ($allalert == 'on') { + if ($includeproductswithoutdesiredqty == 'on') { $sql .= $sqlalertstock.' >= 0 OR '.$sqlalertstock.' IS NULL) AND ('.$db->ifsql("$sqlalertstock IS NULL", "0", $sqlalertstock).' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; } else { $sql .= $sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; @@ -452,7 +452,7 @@ if ($usevirtualstock) } } else { $sql .= ' HAVING (('.$sqldesiredtock.' >= 0 AND ('.$sqldesiredtock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))'; - if ($allalert == 'on') { + if ($includeproductswithoutdesiredqty == 'on') { $sql .= ' OR (('.$sqlalertstock.' >= 0 OR '.$sqlalertstock.' IS NULL) AND ('.$db->ifsql("$sqlalertstock IS NULL", "0", $sqlalertstock).' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").'))))'; } else { $sql .= ' OR ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").'))))'; @@ -460,7 +460,7 @@ if ($usevirtualstock) if ($salert == 'on') // Option to see when stock is lower than alert { - if ($allalert == 'on') { + if ($includeproductswithoutdesiredqty == 'on') { $sql .= ' AND (('.$sqlalertstock.' >= 0 OR '.$sqlalertstock.' IS NULL) AND ('.$db->ifsql("$sqlalertstock IS NULL", "0", $sqlalertstock).' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))'; } else { $sql .= ' AND ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))'; @@ -469,9 +469,9 @@ if ($usevirtualstock) } } -$allalertchecked = ''; -if ($allalert == 'on') { - $allalertchecked = 'checked'; +$includeproductswithoutdesiredqtychecked = ''; +if ($includeproductswithoutdesiredqty == 'on') { + $includeproductswithoutdesiredqtychecked = 'checked'; } // Add where from hooks @@ -547,7 +547,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; if ($limit > 0 && $limit != $conf->liste_limit) { @@ -629,7 +629,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) { } $param = (isset($type) ? '&type='.$type : ''); -$param .= '&fourn_id='.$fourn_id.'&search_label='.$search_label.'&allalert='.$allalert.'&salert='.$salert.'&draftorder='.$draftorder; +$param .= '&fourn_id='.$fourn_id.'&search_label='.$search_label.'&includeproductswithoutdesiredqty='.$includeproductswithoutdesiredqty.'&salert='.$salert.'&draftorder='.$draftorder; $param .= '&search_ref='.$search_ref; $param .= '&mode='.$mode; $param .= '&fk_supplier='.$fk_supplier; @@ -686,8 +686,8 @@ print '