30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/stock.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
36$langs->loadLangs(array(
"admin",
"stocks"));
43$action =
GETPOST(
'action',
'aZ09');
44$value =
GETPOST(
'value',
'alpha');
45$modulepart =
GETPOST(
'modulepart',
'aZ09');
46$label =
GETPOST(
'label',
'alpha');
47$scandir =
GETPOST(
'scan_dir',
'alpha');
54include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
58if (preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg)) {
62 if (in_array($code, array(
'STOCK_CALCULATE_ON_BILL',
'STOCK_CALCULATE_ON_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_SHIPMENT',
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE'))) {
68 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'))) {
77 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
84if (preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg)) {
87 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
94if ($action ==
'warehouse') {
95 $value =
GETPOST(
'default_warehouse',
'alpha');
96 $res =
dolibarr_set_const($db,
"MAIN_DEFAULT_WAREHOUSE", $value,
'chaine', 0,
'', $conf->entity);
105if ($action ==
'specimen') {
106 $modele =
GETPOST(
'module',
'alpha');
114 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
115 foreach ($dirmodels as $reldir) {
116 $file =
dol_buildpath($reldir.
"core/modules/stock/doc/pdf_".$modele.
".modules.php", 0);
117 if (file_exists($file)) {
118 $classname =
"pdf_".$modele;
123 if ($classname !==
'') {
126 $module =
new $classname($db);
127 '@phan-var-force ModelePDFStock $module';
129 if ($module->write_file(
$object, $langs) > 0) {
130 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=stock&file=SPECIMEN.pdf");
138 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
140} elseif ($action ==
'set') {
143} elseif ($action ==
'del') {
150} elseif ($action ==
'setdoc') {
152 if (
dolibarr_set_const($db,
"STOCK_ADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
155 $conf->global->STOCK_ADDON_PDF = $value;
170$form =
new Form($db);
171$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
173llxHeader(
'', $langs->trans(
"StockSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-stock');
175$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
176print
load_fiche_titre($langs->trans(
"StockSetup"), $linkback,
'title_setup');
182$form =
new Form($db);
188if (isModEnabled(
'productbatch')) {
190 $langs->load(
"productbatch");
191 $disabled =
' disabled';
194 $descmode = $langs->trans(
'DeStockOnShipmentOnClosing');
195 if (!isModEnabled(
'reception')) {
197 $incmode = $langs->trans(
'ReStockOnDispatchOrder');
200 $incmode = $langs->trans(
'StockOnReceptionOnClosing');
202 print
info_admin($langs->transnoentitiesnoconv(
"WhenProductBatchModuleOnOptionAreForced", $descmode, $incmode));
206print
info_admin($langs->trans(
"IfYouUsePointOfSaleCheckModule"));
210print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
211print
'<input type="hidden" name="token" value="'.newToken().
'">';
212print
'<input type="hidden" name="action" value="warehouse">';
215print
'<div class="div-table-responsive-no-min">';
216print
'<table class="noborder centpercent">';
217print
'<tr class="liste_titre">';
218print
"<td>".$langs->trans(
"RuleForStockManagementDecrease").
"</td>\n";
219print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
224print
'<!-- STOCK_CALCULATE_ON_BILL -->';
225print
'<tr class="oddeven">';
226print
'<td>'.$langs->trans(
"DeStockOnBill").
'</td>';
227print
'<td class="right">';
228if (isModEnabled(
'invoice')) {
229 if ($conf->use_javascript_ajax) {
231 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
233 print ajax_constantonoff(
'STOCK_CALCULATE_ON_BILL', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
236 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
237 print $form->selectarray(
"STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL);
240 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module30Name")).
'</span>';
242print
"</td>\n</tr>\n";
246print
'<!-- STOCK_CALCULATE_ON_VALIDATE_ORDER -->';
247print
'<tr class="oddeven">';
248print
'<td>'.$langs->trans(
"DeStockOnValidateOrder").
'</td>';
249print
'<td class="right">';
250if (isModEnabled(
'order')) {
251 if ($conf->use_javascript_ajax) {
253 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
255 print ajax_constantonoff(
'STOCK_CALCULATE_ON_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
258 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
259 print $form->selectarray(
"STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER);
262 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module25Name")).
'</span>';
264print
"</td>\n</tr>\n";
270print
'<!-- STOCK_CALCULATE_ON_SHIPMENT -->';
271print
'<tr class="oddeven">';
272print
'<td>'.$langs->trans(
"DeStockOnShipment").
'</td>';
273print
'<td class="right">';
274if (isModEnabled(
"shipping")) {
275 if ($conf->use_javascript_ajax) {
276 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
278 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
279 print $form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT);
282 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name")).
'</span>';
284print
"</td>\n</tr>\n";
287print
'<!-- STOCK_CALCULATE_ON_SHIPMENT_CLOSE -->';
288print
'<tr class="oddeven">';
289print
'<td>'.$langs->trans(
"DeStockOnShipmentOnClosing").
'</td>';
290print
'<td class="right">';
291if (isModEnabled(
"shipping")) {
292 if ($conf->use_javascript_ajax) {
293 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
295 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
296 print $form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE'));
299 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name")).
'</span>';
301print
"</td>\n</tr>\n";
311print
'<div class="div-table-responsive-no-min">';
312print
'<table class="noborder centpercent">';
313print
'<tr class="liste_titre">';
314print
"<td>".$langs->trans(
"RuleForStockManagementIncrease").
"</td>\n";
315print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
320print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_BILL -->';
321print
'<tr class="oddeven">';
322print
'<td>'.$langs->trans(
"ReStockOnBill").
'</td>';
323print
'<td class="right">';
324if (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) {
325 if ($conf->use_javascript_ajax) {
327 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
329 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_BILL', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
332 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
333 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL);
336 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
338print
"</td>\n</tr>\n";
342print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER -->';
343print
'<tr class="oddeven">';
344print
'<td>'.$langs->trans(
"ReStockOnValidateOrder").
'</td>';
345print
'<td class="right">';
346if (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) {
347 if ($conf->use_javascript_ajax) {
349 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
351 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
354 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
355 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER);
358 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
360print
"</td>\n</tr>\n";
363if (isModEnabled(
"reception")) {
364 print
'<!-- STOCK_CALCULATE_ON_RECEPTION_CLOSE -->';
365 print
'<tr class="oddeven">';
366 print
'<td>'.$langs->trans(
"StockOnReception").
'</td>';
367 print
'<td class="right">';
369 if ($conf->use_javascript_ajax) {
370 print ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
372 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
373 print $form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION);
376 print
"</td>\n</tr>\n";
380 print
'<tr class="oddeven">';
381 print
'<td>'.$langs->trans(
"StockOnReceptionOnClosing").
'</td>';
382 print
'<td class="right">';
384 if ($conf->use_javascript_ajax) {
385 print ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION_CLOSE', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
387 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
388 print $form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE);
390 print
"</td>\n</tr>\n";
393 print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER -->';
394 print
'<tr class="oddeven">';
395 print
'<td>'.$langs->trans(
"ReStockOnDispatchOrder").
'</td>';
396 print
'<td class="right">';
397 if (isModEnabled(
"supplier_order")) {
398 if ($conf->use_javascript_ajax) {
399 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
401 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
402 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER);
405 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
407 print
"</td>\n</tr>\n";
416print
'<div class="div-table-responsive-no-min">';
417print
'<table class="noborder centpercent">';
418print
'<tr class="liste_titre">';
419print
"<td>".$langs->trans(
"RuleForStockAvailability").
"</td>\n";
420print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
424print
'<tr class="oddeven">';
425print
'<td>'.$langs->trans(
"WarehouseAllowNegativeTransfer").
'</td>';
426print
'<td class="right">';
427if ($conf->use_javascript_ajax) {
428 print ajax_constantonoff(
'STOCK_ALLOW_NEGATIVE_TRANSFER');
430 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
431 print $form->selectarray(
"STOCK_ALLOW_NEGATIVE_TRANSFER", $arrval, $conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER);
437if (isModEnabled(
'invoice')) {
438 print
'<tr class="oddeven">';
439 print
'<td>'.$langs->trans(
"StockMustBeEnoughForInvoice").
'</td>';
440 print
'<td class="right">';
441 if ($conf->use_javascript_ajax) {
442 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_INVOICE');
444 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
445 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE);
451if (isModEnabled(
'order')) {
452 print
'<tr class="oddeven">';
453 print
'<td>'.$langs->trans(
"StockMustBeEnoughForOrder").
'</td>';
454 print
'<td class="right">';
455 if ($conf->use_javascript_ajax) {
456 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_ORDER');
458 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
459 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER);
465if (isModEnabled(
"shipping")) {
466 print
'<tr class="oddeven">';
467 print
'<td>'.$langs->trans(
"StockMustBeEnoughForShipment").
'</td>';
468 print
'<td class="right">';
469 if ($conf->use_javascript_ajax) {
470 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT');
472 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
473 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT);
483$virtualdiffersfromphysical = 0;
489 || isModEnabled(
'mrp')) {
490 $virtualdiffersfromphysical = 1;
493if ($virtualdiffersfromphysical) {
494 print
'<div class="div-table-responsive-no-min">';
495 print
'<table class="noborder centpercent">';
496 print
'<tr class="liste_titre">';
497 print
"<td>".$langs->trans(
"RuleForStockReplenishment").
" ".
img_help(1, $langs->trans(
"VirtualDiffersFromPhysical")).
"</td>\n";
498 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
501 print
'<tr class="oddeven">';
503 print $form->textwithpicto($langs->trans(
"UseRealStockByDefault"), $langs->trans(
"ReplenishmentCalculation"));
505 print
'<td class="right">';
506 if ($conf->use_javascript_ajax) {
507 print ajax_constantonoff(
'STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT');
509 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
510 print $form->selectarray(
"STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT", $arrval, $conf->global->STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT);
523print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
524print
'<input type="hidden" name="token" value="'.newToken().
'">';
525print
'<input type="hidden" name="action" value="warehouse">';
537$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
538$sql .=
" WHERE type = '".$db->escape($type).
"'";
539$sql .=
" AND entity = ".$conf->entity;
540$resql = $db->query($sql);
543 $num_rows = $db->num_rows($resql);
544 while ($i < $num_rows) {
545 $array = $db->fetch_array($resql);
546 if (is_array($array)) {
547 array_push($def, $array[0]);
556print
'<div class="div-table-responsive-no-min">';
557print
'<table class="noborder centpercent">'.
"\n";
558print
'<tr class="liste_titre">'.
"\n";
559print
'<td>'.$langs->trans(
"Name").
'</td>';
560print
'<td>'.$langs->trans(
"Description").
'</td>';
561print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
562print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
563print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
564print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
569foreach ($dirmodels as $reldir) {
570 foreach (array(
'',
'/doc') as $valdir) {
571 $realpath = $reldir.
"core/modules/stock".$valdir;
575 $handle = opendir($dir);
576 if (is_resource($handle)) {
578 while (($file = readdir($handle)) !==
false) {
584 foreach ($filelist as $file) {
585 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
586 if (file_exists($dir.
'/'.$file)) {
587 $name = substr($file, 4,
dol_strlen($file) - 16);
588 $classname = substr($file, 0,
dol_strlen($file) - 12);
590 require_once $dir.
'/'.$file;
591 $module =
new $classname($db);
592 '@phan-var-force ModelePDFStock $module';
594 $modulequalified = 1;
595 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
596 $modulequalified = 0;
598 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
599 $modulequalified = 0;
602 if ($modulequalified) {
603 print
'<tr class="oddeven"><td width="100">';
604 print(empty($module->name) ? $name : $module->
name);
606 if (method_exists($module,
'info')) {
607 print $module->info($langs);
609 print $module->description;
614 if (in_array($name, $def)) {
615 print
'<td class="center">'.
"\n";
616 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.
newToken().
'&value='.urlencode($name).
'">';
617 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
621 print
'<td class="center">'.
"\n";
622 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>';
627 print
'<td class="center">';
629 print
img_picto($langs->trans(
"Default"),
'on');
631 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>';
636 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
637 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
638 if ($module->type ==
'pdf') {
639 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
641 $htmltooltip .=
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//',
'', $realpath).
'/'.$file;
643 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
644 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
645 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
648 print
'<td class="center">';
649 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
653 print
'<td class="center">';
654 if ($module->type ==
'pdf') {
655 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
657 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
679print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
680print
'<input type="hidden" name="token" value="'.newToken().
'">';
681print
'<input type="hidden" name="action" value="warehouse">';
685print
'<div class="div-table-responsive-no-min">';
686print
'<table class="noborder centpercent">';
688print
'<tr class="liste_titre">';
689print
"<td>".$langs->trans(
"Parameter").
"</td>\n";
690print
'<td class="right">'.$langs->trans(
"Value").
'</td>'.
"\n";
693print
'<tr class="oddeven">';
694print
'<td>'.$langs->trans(
"MainDefaultWarehouse").
'</td>';
695print
'<td class="right">';
696print $formproduct->selectWarehouses(
getDolGlobalString(
'MAIN_DEFAULT_WAREHOUSE') ? $conf->global->MAIN_DEFAULT_WAREHOUSE : -1,
'default_warehouse',
'', 1, 0, 0,
'', 0, 0, array(),
'left reposition');
697print
'<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'">';
701print
'<tr class="oddeven">';
702print
'<td>'.$langs->trans(
"UserDefaultWarehouse").
'</td>';
703print
'<td class="right">';
704if ($conf->use_javascript_ajax) {
705 print ajax_constantonoff(
'MAIN_DEFAULT_WAREHOUSE_USER', array(),
null, 0, 0, 1);
707 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
708 print $form->selectarray(
"MAIN_DEFAULT_WAREHOUSE_USER", $arrval, $conf->global->MAIN_DEFAULT_WAREHOUSE_USER);
714 print
'<tr class="oddeven">';
715 print
'<td>'.$langs->trans(
"UserWarehouseAutoCreate").
'</td>';
716 print
'<td class="right">';
717 if ($conf->use_javascript_ajax) {
718 print ajax_constantonoff(
'STOCK_USERSTOCK_AUTOCREATE');
720 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
721 print $form->selectarray(
"STOCK_USERSTOCK_AUTOCREATE", $arrval, $conf->global->STOCK_USERSTOCK_AUTOCREATE);
727print
'<tr class="oddeven">';
728print
'<td>'.$langs->trans(
"WarehouseAskWarehouseOnThirparty").
'</td>';
729print
'<td class="right">';
730if ($conf->use_javascript_ajax) {
731 print ajax_constantonoff(
'SOCIETE_ASK_FOR_WAREHOUSE');
733 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
734 print $form->selectarray(
"SOCIETE_ASK_FOR_WAREHOUSE", $arrval, $conf->global->SOCIETE_ASK_FOR_WAREHOUSE);
739print
'<tr class="oddeven">';
740print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringPropal").
'</td>';
741print
'<td class="right">';
742if ($conf->use_javascript_ajax) {
743 print ajax_constantonoff(
'WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL');
745 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
746 print $form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL);
751print
'<tr class="oddeven">';
752print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringOrder").
'</td>';
753print
'<td class="right">';
754if ($conf->use_javascript_ajax) {
755 print ajax_constantonoff(
'WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
757 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
758 print $form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER);
777print
'<tr class="oddeven">';
779print $form->textwithpicto($langs->trans(
"StockSupportServices"), $langs->trans(
"StockSupportServicesDesc"));
781print
'<td class="right">';
782if ($conf->use_javascript_ajax) {
783 print ajax_constantonoff(
'STOCK_SUPPORTS_SERVICES');
785 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
786 print $form->selectarray(
"STOCK_SUPPORTS_SERVICES", $arrval,
getDolGlobalString(
'STOCK_SUPPORTS_SERVICES'));
792print
'<tr class="oddeven">';
793print
'<td>'.$langs->trans(
"AllowAddLimitStockByWarehouse").
'</td>';
794print
'<td class="right">';
795if ($conf->use_javascript_ajax) {
796 print ajax_constantonoff(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE');
798 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
799 print $form->selectarray(
"STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE", $arrval, $conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE);
804print
'<tr class="oddeven">';
805print
'<td>'.$langs->trans(
"AlwaysShowFullArbo").
'</td>';
806print
'<td class="right">';
807if ($conf->use_javascript_ajax) {
808 print ajax_constantonoff(
'STOCK_ALWAYS_SHOW_FULL_ARBO');
810 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
811 print $form->selectarray(
"STOCK_ALWAYS_SHOW_FULL_ARBO", $arrval, $conf->global->STOCK_ALWAYS_SHOW_FULL_ARBO);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage warehouses.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_help($usehelpcursor=1, $usealttitle=1)
Show help logo with cursor "?".
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
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 information.