28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/stock.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
34$langs->loadLangs(array(
"admin",
"stocks"));
41$action =
GETPOST(
'action',
'aZ09');
42$value =
GETPOST(
'value',
'alpha');
43$modulepart =
GETPOST(
'modulepart',
'aZ09');
44$label =
GETPOST(
'label',
'alpha');
45$scandir =
GETPOST(
'scan_dir',
'alpha');
52include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
56if (preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg)) {
60 if (in_array($code, array(
'STOCK_CALCULATE_ON_BILL',
'STOCK_CALCULATE_ON_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_SHIPMENT',
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE'))) {
66 if (in_array($code, array(
'STOCK_CALCULATE_ON_SUPPLIER_BILL',
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_RECEPTION',
'STOCK_CALCULATE_ON_RECEPTION_CLOSE',
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER'))) {
75 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
82if (preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg)) {
85 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
92if ($action ==
'warehouse') {
93 $value =
GETPOST(
'default_warehouse',
'alpha');
94 $res =
dolibarr_set_const($db,
"MAIN_DEFAULT_WAREHOUSE", $value,
'chaine', 0,
'', $conf->entity);
103if ($action ==
'specimen') {
104 $modele =
GETPOST(
'module',
'alpha');
107 $object->initAsSpecimen();
113 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
114 foreach ($dirmodels as $reldir) {
115 $file =
dol_buildpath($reldir.
"core/modules/stock/doc/pdf_".$modele.
".modules.php", 0);
116 if (file_exists($file)) {
118 $classname =
"pdf_".$modele;
126 $module =
new $classname($db);
128 if ($module->write_file($object, $langs) > 0) {
129 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=stock&file=SPECIMEN.pdf");
137 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
139} elseif ($action ==
'set') {
142} elseif ($action ==
'del') {
149} elseif ($action ==
'setdoc') {
151 if (
dolibarr_set_const($db,
"STOCK_ADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
154 $conf->global->STOCK_ADDON_PDF = $value;
169$form =
new Form($db);
170$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
172llxHeader(
'', $langs->trans(
"StockSetup"));
174$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
175print
load_fiche_titre($langs->trans(
"StockSetup"), $linkback,
'title_setup');
181$form =
new Form($db);
187if (isModEnabled(
'productbatch')) {
189 $langs->load(
"productbatch");
190 $disabled =
' disabled';
193 $descmode = $langs->trans(
'DeStockOnShipmentOnClosing');
194 if (!isModEnabled(
'reception')) {
196 $incmode = $langs->trans(
'ReStockOnDispatchOrder');
199 $incmode = $langs->trans(
'StockOnReceptionOnClosing');
201 print
info_admin($langs->transnoentitiesnoconv(
"WhenProductBatchModuleOnOptionAreForced", $descmode, $incmode));
205print
info_admin($langs->trans(
"IfYouUsePointOfSaleCheckModule"));
209print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
210print
'<input type="hidden" name="token" value="'.newToken().
'">';
211print
'<input type="hidden" name="action" value="warehouse">';
214print
'<div class="div-table-responsive-no-min">';
215print
'<table class="noborder centpercent">';
216print
'<tr class="liste_titre">';
217print
"<td>".$langs->trans(
"RuleForStockManagementDecrease").
"</td>\n";
218print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
223print
'<!-- STOCK_CALCULATE_ON_BILL -->';
224print
'<tr class="oddeven">';
225print
'<td>'.$langs->trans(
"DeStockOnBill").
'</td>';
226print
'<td class="right">';
227if (isModEnabled(
'facture')) {
228 if ($conf->use_javascript_ajax) {
230 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
232 print ajax_constantonoff(
'STOCK_CALCULATE_ON_BILL', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
235 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
236 print $form->selectarray(
"STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL);
239 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module30Name")).
'</span>';
241print
"</td>\n</tr>\n";
245print
'<!-- STOCK_CALCULATE_ON_VALIDATE_ORDER -->';
246print
'<tr class="oddeven">';
247print
'<td>'.$langs->trans(
"DeStockOnValidateOrder").
'</td>';
248print
'<td class="right">';
249if (isModEnabled(
'commande')) {
250 if ($conf->use_javascript_ajax) {
252 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
254 print ajax_constantonoff(
'STOCK_CALCULATE_ON_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
257 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
258 print $form->selectarray(
"STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER);
261 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module25Name")).
'</span>';
263print
"</td>\n</tr>\n";
269print
'<!-- STOCK_CALCULATE_ON_SHIPMENT -->';
270print
'<tr class="oddeven">';
271print
'<td>'.$langs->trans(
"DeStockOnShipment").
'</td>';
272print
'<td class="right">';
273if (isModEnabled(
"expedition")) {
274 if ($conf->use_javascript_ajax) {
275 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
277 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
278 print $form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT);
281 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name")).
'</span>';
283print
"</td>\n</tr>\n";
286print
'<!-- STOCK_CALCULATE_ON_SHIPMENT_CLOSE -->';
287print
'<tr class="oddeven">';
288print
'<td>'.$langs->trans(
"DeStockOnShipmentOnClosing").
'</td>';
289print
'<td class="right">';
290if (isModEnabled(
"expedition")) {
291 if ($conf->use_javascript_ajax) {
292 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
294 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
295 print $form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE);
298 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name")).
'</span>';
300print
"</td>\n</tr>\n";
310print
'<div class="div-table-responsive-no-min">';
311print
'<table class="noborder centpercent">';
312print
'<tr class="liste_titre">';
313print
"<td>".$langs->trans(
"RuleForStockManagementIncrease").
"</td>\n";
314print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
319print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_BILL -->';
320print
'<tr class="oddeven">';
321print
'<td>'.$langs->trans(
"ReStockOnBill").
'</td>';
322print
'<td class="right">';
323if (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) {
324 if ($conf->use_javascript_ajax) {
326 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
328 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_BILL', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
331 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
332 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL);
335 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
337print
"</td>\n</tr>\n";
341print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER -->';
342print
'<tr class="oddeven">';
343print
'<td>'.$langs->trans(
"ReStockOnValidateOrder").
'</td>';
344print
'<td class="right">';
345if (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) {
346 if ($conf->use_javascript_ajax) {
348 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
350 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
353 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
354 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER);
357 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
359print
"</td>\n</tr>\n";
362if (isModEnabled(
"reception")) {
363 print
'<!-- STOCK_CALCULATE_ON_RECEPTION_CLOSE -->';
364 print
'<tr class="oddeven">';
365 print
'<td>'.$langs->trans(
"StockOnReception").
'</td>';
366 print
'<td class="right">';
368 if ($conf->use_javascript_ajax) {
369 print ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
371 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
372 print $form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION);
375 print
"</td>\n</tr>\n";
379 print
'<tr class="oddeven">';
380 print
'<td>'.$langs->trans(
"StockOnReceptionOnClosing").
'</td>';
381 print
'<td class="right">';
383 if ($conf->use_javascript_ajax) {
384 print ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION_CLOSE', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
386 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
387 print $form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE);
389 print
"</td>\n</tr>\n";
392 print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER -->';
393 print
'<tr class="oddeven">';
394 print
'<td>'.$langs->trans(
"ReStockOnDispatchOrder").
'</td>';
395 print
'<td class="right">';
396 if (isModEnabled(
"supplier_order")) {
397 if ($conf->use_javascript_ajax) {
398 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
400 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
401 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER);
404 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
406 print
"</td>\n</tr>\n";
415print
'<div class="div-table-responsive-no-min">';
416print
'<table class="noborder centpercent">';
417print
'<tr class="liste_titre">';
418print
"<td>".$langs->trans(
"RuleForStockAvailability").
"</td>\n";
419print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
423print
'<tr class="oddeven">';
424print
'<td>'.$langs->trans(
"WarehouseAllowNegativeTransfer").
'</td>';
425print
'<td class="right">';
426if ($conf->use_javascript_ajax) {
427 print ajax_constantonoff(
'STOCK_ALLOW_NEGATIVE_TRANSFER');
429 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
430 print $form->selectarray(
"STOCK_ALLOW_NEGATIVE_TRANSFER", $arrval, $conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER);
436if (isModEnabled(
'facture')) {
437 print
'<tr class="oddeven">';
438 print
'<td>'.$langs->trans(
"StockMustBeEnoughForInvoice").
'</td>';
439 print
'<td class="right">';
440 if ($conf->use_javascript_ajax) {
441 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_INVOICE');
443 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
444 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE);
450if (isModEnabled(
'commande')) {
451 print
'<tr class="oddeven">';
452 print
'<td>'.$langs->trans(
"StockMustBeEnoughForOrder").
'</td>';
453 print
'<td class="right">';
454 if ($conf->use_javascript_ajax) {
455 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_ORDER');
457 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
458 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER);
464if (isModEnabled(
"expedition")) {
465 print
'<tr class="oddeven">';
466 print
'<td>'.$langs->trans(
"StockMustBeEnoughForShipment").
'</td>';
467 print
'<td class="right">';
468 if ($conf->use_javascript_ajax) {
469 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT');
471 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
472 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT);
482$virtualdiffersfromphysical = 0;
488 || isModEnabled(
'mrp')) {
489 $virtualdiffersfromphysical = 1;
492if ($virtualdiffersfromphysical) {
493 print
'<div class="div-table-responsive-no-min">';
494 print
'<table class="noborder centpercent">';
495 print
'<tr class="liste_titre">';
496 print
"<td>".$langs->trans(
"RuleForStockReplenishment").
" ".
img_help(
'help', $langs->trans(
"VirtualDiffersFromPhysical")).
"</td>\n";
497 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
500 print
'<tr class="oddeven">';
502 print $form->textwithpicto($langs->trans(
"UseRealStockByDefault"), $langs->trans(
"ReplenishmentCalculation"));
504 print
'<td class="right">';
505 if ($conf->use_javascript_ajax) {
506 print ajax_constantonoff(
'STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT');
508 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
509 print $form->selectarray(
"STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT", $arrval, $conf->global->STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT);
522print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
523print
'<input type="hidden" name="token" value="'.newToken().
'">';
524print
'<input type="hidden" name="action" value="warehouse">';
536$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
537$sql .=
" WHERE type = '".$db->escape($type).
"'";
538$sql .=
" AND entity = ".$conf->entity;
539$resql = $db->query($sql);
542 $num_rows = $db->num_rows($resql);
543 while ($i < $num_rows) {
544 $array = $db->fetch_array($resql);
545 array_push($def, $array[0]);
553print
'<div class="div-table-responsive-no-min">';
554print
'<table class="noborder centpercent">'.
"\n";
555print
'<tr class="liste_titre">'.
"\n";
556print
'<td>'.$langs->trans(
"Name").
'</td>';
557print
'<td>'.$langs->trans(
"Description").
'</td>';
558print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
559print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
560print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
561print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
566foreach ($dirmodels as $reldir) {
567 foreach (array(
'',
'/doc') as $valdir) {
568 $realpath = $reldir.
"core/modules/stock".$valdir;
572 $handle = opendir($dir);
573 if (is_resource($handle)) {
574 while (($file = readdir($handle)) !==
false) {
580 foreach ($filelist as $file) {
581 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
582 if (file_exists($dir.
'/'.$file)) {
583 $name = substr($file, 4,
dol_strlen($file) - 16);
584 $classname = substr($file, 0,
dol_strlen($file) - 12);
586 require_once $dir.
'/'.$file;
587 $module =
new $classname($db);
589 $modulequalified = 1;
590 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
591 $modulequalified = 0;
593 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
594 $modulequalified = 0;
597 if ($modulequalified) {
598 print
'<tr class="oddeven"><td width="100">';
599 print(empty($module->name) ? $name : $module->
name);
601 if (method_exists($module,
'info')) {
602 print $module->info($langs);
604 print $module->description;
609 if (in_array($name, $def)) {
610 print
'<td class="center">'.
"\n";
611 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.newToken().
'&value='.urlencode($name).
'">';
612 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
616 print
'<td class="center">'.
"\n";
617 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.newToken().
'&value='.urlencode($name).
'&scan_dir='.urlencode($module->scandir).
'&label='.urlencode($module->name).
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
622 print
'<td class="center">';
624 print
img_picto($langs->trans(
"Default"),
'on');
626 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setdoc&token='.newToken().
'&value='.urlencode($name).
'&scan_dir='.urlencode($module->scandir).
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
631 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
632 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
633 if ($module->type ==
'pdf') {
634 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
636 $htmltooltip .=
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//',
'', $realpath).
'/'.$file;
638 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
639 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
640 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
643 print
'<td class="center">';
644 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
648 print
'<td class="center">';
649 if ($module->type ==
'pdf') {
650 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
652 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
674print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
675print
'<input type="hidden" name="token" value="'.newToken().
'">';
676print
'<input type="hidden" name="action" value="warehouse">';
680print
'<div class="div-table-responsive-no-min">';
681print
'<table class="noborder centpercent">';
683print
'<tr class="liste_titre">';
684print
"<td>".$langs->trans(
"Parameter").
"</td>\n";
685print
'<td class="right">'.$langs->trans(
"Value").
'</td>'.
"\n";
688print
'<tr class="oddeven">';
689print
'<td>'.$langs->trans(
"MainDefaultWarehouse").
'</td>';
690print
'<td class="right">';
691print $formproduct->selectWarehouses(
getDolGlobalString(
'MAIN_DEFAULT_WAREHOUSE') ? $conf->global->MAIN_DEFAULT_WAREHOUSE : -1,
'default_warehouse',
'', 1, 0, 0,
'', 0, 0, array(),
'left reposition');
692print
'<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'">';
696print
'<tr class="oddeven">';
697print
'<td>'.$langs->trans(
"UserDefaultWarehouse").
'</td>';
698print
'<td class="right">';
699if ($conf->use_javascript_ajax) {
700 print ajax_constantonoff(
'MAIN_DEFAULT_WAREHOUSE_USER', array(),
null, 0, 0, 1);
702 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
703 print $form->selectarray(
"MAIN_DEFAULT_WAREHOUSE_USER", $arrval, $conf->global->MAIN_DEFAULT_WAREHOUSE_USER);
709 print
'<tr class="oddeven">';
710 print
'<td>'.$langs->trans(
"UserWarehouseAutoCreate").
'</td>';
711 print
'<td class="right">';
712 if ($conf->use_javascript_ajax) {
713 print ajax_constantonoff(
'STOCK_USERSTOCK_AUTOCREATE');
715 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
716 print $form->selectarray(
"STOCK_USERSTOCK_AUTOCREATE", $arrval, $conf->global->STOCK_USERSTOCK_AUTOCREATE);
722print
'<tr class="oddeven">';
723print
'<td>'.$langs->trans(
"WarehouseAskWarehouseOnThirparty").
'</td>';
724print
'<td class="right">';
725if ($conf->use_javascript_ajax) {
726 print ajax_constantonoff(
'SOCIETE_ASK_FOR_WAREHOUSE');
728 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
729 print $form->selectarray(
"SOCIETE_ASK_FOR_WAREHOUSE", $arrval, $conf->global->SOCIETE_ASK_FOR_WAREHOUSE);
734print
'<tr class="oddeven">';
735print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringPropal").
'</td>';
736print
'<td class="right">';
737if ($conf->use_javascript_ajax) {
738 print ajax_constantonoff(
'WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL');
740 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
741 print $form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL);
746print
'<tr class="oddeven">';
747print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringOrder").
'</td>';
748print
'<td class="right">';
749if ($conf->use_javascript_ajax) {
750 print ajax_constantonoff(
'WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
752 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
753 print $form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER);
772print
'<tr class="oddeven">';
774print $form->textwithpicto($langs->trans(
"StockSupportServices"), $langs->trans(
"StockSupportServicesDesc"));
776print
'<td class="right">';
777if ($conf->use_javascript_ajax) {
778 print ajax_constantonoff(
'STOCK_SUPPORTS_SERVICES');
780 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
781 print $form->selectarray(
"STOCK_SUPPORTS_SERVICES", $arrval,
getDolGlobalString(
'STOCK_SUPPORTS_SERVICES'));
787print
'<tr class="oddeven">';
788print
'<td>'.$langs->trans(
"AllowAddLimitStockByWarehouse").
'</td>';
789print
'<td class="right">';
790if ($conf->use_javascript_ajax) {
791 print ajax_constantonoff(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE');
793 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
794 print $form->selectarray(
"STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE", $arrval, $conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE);
799print
'<tr class="oddeven">';
800print
'<td>'.$langs->trans(
"AlwaysShowFullArbo").
'</td>';
801print
'<td class="right">';
802if ($conf->use_javascript_ajax) {
803 print ajax_constantonoff(
'STOCK_ALWAYS_SHOW_FULL_ARBO');
805 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
806 print $form->selectarray(
"STOCK_ALWAYS_SHOW_FULL_ARBO", $arrval, $conf->global->STOCK_ALWAYS_SHOW_FULL_ARBO);
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage warehouses.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_help($usehelpcursor=1, $usealttitle=1)
Show help logo with cursor "?".
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db name
Only used if Module[ID]Name translation string is not found.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
stock_admin_prepare_head()
Return array head with list of tabs to view object informations.