diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 3733973bb2a..f7a45aff8d2 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -73,6 +73,11 @@ if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_BILL' if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", GETPOST('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER','alpha'),'chaine',0,'',$conf->entity); } +if($action == 'USE_VIRTUAL_STOCK') { + $db->begin(); + $res = dolibarr_set_const($db, "USE_VIRTUAL_STOCK", GETPOST('USE_VIRTUAL_STOCK','alpha'),'chaine',0,'',$conf->entity); +} + if($action) { if (! $res > 0) $error++; @@ -89,6 +94,7 @@ if($action) } } + /* * View */ @@ -243,6 +249,26 @@ if (! empty($conf->fournisseur->enabled)) print ''; +print '
'; +print ''; +print ''; +print " \n"; +print " \n"; +print ''."\n"; +$var = !$var; +print ""; +print ''; +print '\n"; +print "\n"; +print '
".$langs->trans("RuleForStockReplenishment")." 
'.$langs->trans("UseVirtualStock").''; +print "
"; +print ''; +print ""; +print $form->selectyesno("USE_VIRTUAL_STOCK",$conf->global->USE_VIRTUAL_STOCK,1); +print ''; +print '
'; +print "
'; + dol_htmloutput_mesg($mesg); $db->close(); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2b540f3aabd..fd58b4263b8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1400,7 +1400,7 @@ class Form $objp->remise = $objp2->remise; $objp->price_by_qty_rowid = $objp2->rowid; - $this->constructProductListOption($objp, $opt, $optJson, 0, $selected); + $this->_construct_product_list_option($objp, $opt, $optJson, 0, $selected); $j++; @@ -1414,7 +1414,7 @@ class Form } else { - $this->constructProductListOption($objp, $opt, $optJson, $price_level, $selected); + $this->_construct_product_list_option($objp, $opt, $optJson, $price_level, $selected); // Add new entry // "key" value of json key array is used by jQuery automatically as selected value // "label" value of json key array is used by jQuery automatically as text for combo box @@ -1870,6 +1870,10 @@ class Form $objp = $this->db->fetch_object($result); $opt = '