Skip to content

Commit

Permalink
Add STATUS_OPEN_INTERNAL to stock change/move pages
Browse files Browse the repository at this point in the history
  • Loading branch information
fappels committed Dec 5, 2016
1 parent c911f90 commit fbdc0c2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
11 changes: 6 additions & 5 deletions htdocs/product/class/html.formproduct.class.php
Expand Up @@ -21,6 +21,7 @@
* \brief Fichier de la classe des fonctions predefinie de composants html
*/

require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';

/**
* Class with static methods for building HTML components related to products
Expand Down Expand Up @@ -168,7 +169,7 @@ private function get_parent_path($tab, $final_label='') {
*
* @param int $selected Id of preselected warehouse ('' for no value, 'ifone'=select value if one value otherwise no value)
* @param string $htmlname Name of html select html
* @param string $filtertype For filter, additional filter on status other then 1
* @param string $filterstatus For filter, additional filter on status other then 1 (open_all). No filter when empty
* @param int $empty 1=Can be empty, 0 if not
* @param int $disabled 1=Select is disabled
* @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0.
Expand All @@ -181,15 +182,15 @@ private function get_parent_path($tab, $final_label='') {
* @param int $showfullpath 1=Show full path of name (parent ref into label), 0=Show only ref of current warehouse
* @return string HTML select
*/
function selectWarehouses($selected='',$htmlname='idwarehouse',$filtertype='',$empty=0,$disabled=0,$fk_product=0,$empty_label='', $showstock=0, $forcecombo=0, $events=array(), $morecss='minwidth200', $exclude='', $showfullpath=1)
function selectWarehouses($selected='',$htmlname='idwarehouse',$filterstatus='',$empty=0,$disabled=0,$fk_product=0,$empty_label='', $showstock=0, $forcecombo=0, $events=array(), $morecss='minwidth200', $exclude='', $showfullpath=1)
{
global $conf,$langs,$user;

dol_syslog(get_class($this)."::selectWarehouses $selected, $htmlname, $filtertype, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss",LOG_DEBUG);
dol_syslog(get_class($this)."::selectWarehouses $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss",LOG_DEBUG);

$out='';

$this->loadWarehouses($fk_product, '', + $filtertype, true, $exclude); // filter on numeric status
if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) $filterstatus = '';
$this->loadWarehouses($fk_product, '', + $filterstatus, true, $exclude); // filter on numeric status
$nbofwarehouses=count($this->cache_warehouses);

if ($conf->use_javascript_ajax && ! $forcecombo)
Expand Down
4 changes: 2 additions & 2 deletions htdocs/product/stock/massstockmove.php
Expand Up @@ -383,11 +383,11 @@
}
// In warehouse
print '<td>';
print $formproduct->selectWarehouses($id_sw, 'id_sw', '', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp');
print $formproduct->selectWarehouses($id_sw, 'id_sw', Entrepot::STATUS_OPEN_INTERNAL, 1, 0, 0, '', 0, 0, array(), 'minwidth200imp');
print '</td>';
// Out warehouse
print '<td>';
print $formproduct->selectWarehouses($id_tw, 'id_tw', '', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp');
print $formproduct->selectWarehouses($id_tw, 'id_tw', Entrepot::STATUS_OPEN_INTERNAL, 1, 0, 0, '', 0, 0, array(), 'minwidth200imp');
print '</td>';
// Qty
print '<td align="center"><input type="text" size="3" class="flat" name="qty" value="'.$qty.'"></td>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/stock/mouvement.php
Expand Up @@ -791,7 +791,7 @@
{
print '<td class="liste_titre maxwidthonsmartphone" align="left">';
//print '<input class="flat" type="text" size="8" name="search_warehouse" value="'.($search_warehouse).'">';
print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', 1, 0, 0, '', 0, 0, null, 'maxwidth200');
print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', Entrepot::STATUS_OPEN_INTERNAL, 1, 0, 0, '', 0, 0, null, 'maxwidth200');
print '</td>';
}
if (! empty($arrayfields['m.fk_user_author']['checked']))
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/stock/tpl/stockcorrection.tpl.php
Expand Up @@ -56,7 +56,7 @@ function init_price()
{
print '<td width="20%" class="fieldrequired" colspan="2">'.$langs->trans("Warehouse").'</td>';
print '<td width="20%">';
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):'ifone')), 'id_entrepot', '', 1, 0, 0, '', 0, 0, null, 'minwidth100');
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):'ifone')), 'id_entrepot', Entrepot::STATUS_OPEN_INTERNAL, 1, 0, 0, '', 0, 0, null, 'minwidth100');
print '</td>';
}
if ($object->element == 'stock')
Expand Down
4 changes: 2 additions & 2 deletions htdocs/product/stock/tpl/stocktransfer.tpl.php
Expand Up @@ -63,7 +63,7 @@
{
print '<td width="15%" class="fieldrequired">'.$langs->trans("WarehouseSource").'</td>';
print '<td width="15%">';
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):'ifone')),'id_entrepot','',1);
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):'ifone')), 'id_entrepot', Entrepot::STATUS_OPEN_INTERNAL, 1);
print '</td>';
}
if ($object->element == 'stock')
Expand All @@ -75,7 +75,7 @@
}

print '<td width="15%" class="fieldrequired">'.$langs->trans("WarehouseTarget").'</td><td width="15%">';
print $formproduct->selectWarehouses(GETPOST('id_entrepot_destination'),'id_entrepot_destination','',1);
print $formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', Entrepot::STATUS_OPEN_INTERNAL, 1);
print '</td>';
print '<td width="15%" class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td><td width="15%"><input type="text" class="flat" name="nbpiece" size="10" value="'.dol_escape_htmltag(GETPOST("nbpiece")).'"></td>';
print '</tr>';
Expand Down

0 comments on commit fbdc0c2

Please sign in to comment.