31require
'../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/stock.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
44$langs->loadLangs(array(
"admin",
"stocks"));
51$action =
GETPOST(
'action',
'aZ09');
52$value =
GETPOST(
'value',
'alpha');
53$modulepart =
GETPOST(
'modulepart',
'aZ09');
54$label =
GETPOST(
'label',
'alpha');
55$scandir =
GETPOST(
'scan_dir',
'alpha');
66include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
70if ($action ==
'update' || preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg)) {
71 if ($action ==
'update') {
73 'STOCK_CALCULATE_ON_BILL',
'STOCK_CALCULATE_ON_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_SHIPMENT',
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE',
74 '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 'STOCK_DISALLOW_NEGATIVE_TRANSFER',
'STOCK_MUST_BE_ENOUGH_FOR_INVOICE',
'STOCK_MUST_BE_ENOUGH_FOR_ORDER',
'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT',
76 'STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT'
79 $arrayofcode = array($reg[1]);
83 foreach ($arrayofcode as $code) {
90 if (in_array($code, array(
'STOCK_CALCULATE_ON_BILL',
'STOCK_CALCULATE_ON_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_SHIPMENT',
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE'))) {
96 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'))) {
110 header(
"Location: ".$_SERVER[
"PHP_SELF"].($page_y ?
'?page_y='.$page_y :
''));
113 dol_print_error($db);
117if ($action ==
'update' || preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg)) {
118 if ($action ==
'update') {
119 $arrayofcode = array(
120 'STOCK_CALCULATE_ON_BILL',
'STOCK_CALCULATE_ON_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_SHIPMENT',
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE',
121 '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',
124 $arrayofcode = array($reg[1]);
128 foreach ($arrayofcode as $code) {
132 header(
"Location: ".$_SERVER[
"PHP_SELF"].($page_y ?
'?page_y='.$page_y :
''));
135 dol_print_error($db);
139if ($action ==
'warehouse') {
140 $value =
GETPOST(
'default_warehouse',
'alpha');
150 $value =
GETPOST(
'STOCK_VIRTUAL_HORIZON_IN_DAYS',
'alphanohtml');
154 $res =
dolibarr_set_const($db,
"STOCK_VIRTUAL_HORIZON_IN_DAYS", max(0, (
int) $value),
'chaine', 0,
'',
$conf->entity);
162if ($action ==
'specimen') {
163 $modele =
GETPOST(
'module',
'alpha');
171 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
172 foreach ($dirmodels as $reldir) {
173 $file =
dol_buildpath($reldir.
"core/modules/stock/doc/pdf_".$modele.
".modules.php", 0);
174 if (file_exists($file)) {
175 $classname =
"pdf_".$modele;
180 if ($classname !==
'') {
184 '@phan-var-force ModelePDFStock $module';
187 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=stock&file=SPECIMEN.pdf");
190 setEventMessages(
$module->error,
null,
'errors');
194 setEventMessages($langs->trans(
"ErrorModuleNotFound"),
null,
'errors');
195 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
197} elseif ($action ==
'set') {
200} elseif ($action ==
'del') {
207} elseif ($action ==
'setdoc') {
212 $conf->global->STOCK_ADDON_PDF = $value;
227$form =
new Form($db);
228$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
230llxHeader(
'', $langs->trans(
"StockSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-stock');
232$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
234print
load_fiche_titre($langs->trans(
"StockSetup"), $linkback,
'title_setup');
240$form =
new Form($db);
244$disableStockCalculateOn = array();
249 $disableStockCalculateOn[] =
'BILL';
250 $disableStockCalculateOn[] =
'VALIDATE_ORDER';
254 $disableStockCalculateOn[] =
'SUPPLIER_BILL';
255 $disableStockCalculateOn[] =
'SUPPLIER_VALIDATE_ORDER';
257 print
info_admin($langs->trans(
'WhenProductVirtualOnOptionAreForced'));
262 $langs->load(
"productbatch");
263 $disableStockCalculateOn[] =
'BILL';
264 $disableStockCalculateOn[] =
'VALIDATE_ORDER';
268 $disableStockCalculateOn[] =
'SUPPLIER_BILL';
269 $disableStockCalculateOn[] =
'SUPPLIER_VALIDATE_ORDER';
271 $descmode =
""; $incmode =
"";
280 print
info_admin($langs->transnoentitiesnoconv(
"WhenProductBatchModuleOnOptionAreForced", $descmode, $incmode));
284print
info_admin($langs->trans(
"IfYouUsePointOfSaleCheckModule"));
288print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" spellcheck="false">';
289print
'<input type="hidden" name="token" value="'.newToken().
'">';
290print
'<input type="hidden" name="action" value="update">';
291print
'<input type="hidden" name="page_y" value="">';
294print
'<div class="div-table-responsive-no-min">';
295print
'<table class="noborder centpercent">';
296print
'<tr class="liste_titre">';
297print
"<td>".$langs->trans(
"RuleForStockManagementDecrease").
"</td>\n";
298print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
303print
'<!-- STOCK_CALCULATE_ON_BILL -->';
304print
'<tr class="oddeven">';
305print
'<td>'.$langs->trans(
"DeStockOnBill").
'</td>';
306print
'<td class="right">';
308 if (
$conf->use_javascript_ajax) {
309 if (in_array(
'BILL', $disableStockCalculateOn)) {
310 print img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
312 print ajax_constantonoff(
'STOCK_CALCULATE_ON_BILL', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
315 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
316 print $form->selectarray(
"STOCK_CALCULATE_ON_BILL", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_BILL'));
319 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module30Name")).
'</span>';
321print
"</td>\n</tr>\n";
325print
'<!-- STOCK_CALCULATE_ON_VALIDATE_ORDER -->';
326print
'<tr class="oddeven">';
327print
'<td>'.$langs->trans(
"DeStockOnValidateOrder").
'</td>';
328print
'<td class="right">';
330 if (
$conf->use_javascript_ajax) {
331 if (in_array(
'VALIDATE_ORDER', $disableStockCalculateOn)) {
332 print img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
334 print ajax_constantonoff(
'STOCK_CALCULATE_ON_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
337 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
338 print $form->selectarray(
"STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_VALIDATE_ORDER'));
341 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module25Name")).
'</span>';
343print
"</td>\n</tr>\n";
349print
'<!-- STOCK_CALCULATE_ON_SHIPMENT -->';
350print
'<tr class="oddeven">';
351print
'<td>'.$langs->trans(
"DeStockOnShipment").
'</td>';
352print
'<td class="right">';
354 if (
$conf->use_javascript_ajax) {
355 if (in_array(
'SHIPMENT', $disableStockCalculateOn)) {
356 print img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
358 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
361 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
362 print $form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_SHIPMENT'));
365 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name")).
'</span>';
367print
"</td>\n</tr>\n";
370print
'<!-- STOCK_CALCULATE_ON_SHIPMENT_CLOSE -->';
371print
'<tr class="oddeven">';
372print
'<td>'.$langs->trans(
"DeStockOnShipmentOnClosing").
'</td>';
373print
'<td class="right">';
375 if (
$conf->use_javascript_ajax) {
376 if (in_array(
'SHIPMENT_CLOSE', $disableStockCalculateOn)) {
377 print img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
379 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
382 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
383 print $form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE'));
386 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name")).
'</span>';
388print
"</td>\n</tr>\n";
399print
'<div class="div-table-responsive-no-min">';
400print
'<table class="noborder centpercent">';
401print
'<tr class="liste_titre">';
402print
"<td>".$langs->trans(
"RuleForStockManagementIncrease").
"</td>\n";
403print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
408print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_BILL -->';
409print
'<tr class="oddeven">';
410print
'<td>'.$langs->trans(
"ReStockOnBill").
'</td>';
411print
'<td class="right">';
413 if (
$conf->use_javascript_ajax) {
414 if (in_array(
'SUPPLIER_BILL', $disableStockCalculateOn)) {
415 print img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
417 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_BILL', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
420 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
421 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_BILL'));
424 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
426print
"</td>\n</tr>\n";
430print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER -->';
431print
'<tr class="oddeven">';
432print
'<td>'.$langs->trans(
"ReStockOnValidateOrder").
'</td>';
433print
'<td class="right">';
435 if (
$conf->use_javascript_ajax) {
436 if (in_array(
'SUPPLIER_VALIDATE_ORDER', $disableStockCalculateOn)) {
437 print img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
439 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
442 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
443 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER'));
446 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
448print
"</td>\n</tr>\n";
452 print
'<!-- STOCK_CALCULATE_ON_RECEPTION -->';
453 print
'<tr class="oddeven">';
454 print
'<td>'.$langs->trans(
"StockOnReception").
'</td>';
455 print
'<td class="right">';
457 if (
$conf->use_javascript_ajax) {
458 if (in_array(
'RECEPTION', $disableStockCalculateOn)) {
459 print img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
461 print ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
464 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
465 print $form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_RECEPTION'));
468 print
"</td>\n</tr>\n";
471 print
'<!-- STOCK_CALCULATE_ON_RECEPTION_CLOSE -->';
472 print
'<tr class="oddeven">';
473 print
'<td>'.$langs->trans(
"StockOnReceptionOnClosing").
'</td>';
474 print
'<td class="right">';
476 if (
$conf->use_javascript_ajax) {
477 if (in_array(
'RECEPTION_CLOSE', $disableStockCalculateOn)) {
478 print img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
480 print ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION_CLOSE', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
483 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
484 print $form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_RECEPTION_CLOSE'));
486 print
"</td>\n</tr>\n";
490 print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER -->';
491 print
'<tr class="oddeven">';
492 print
'<td>'.$langs->trans(
"ReStockOnDispatchOrder").
'</td>';
493 print
'<td class="right">';
495 if (
$conf->use_javascript_ajax) {
496 if (in_array(
'SUPPLIER_DISPATCH_ORDER', $disableStockCalculateOn)) {
497 print img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
499 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
502 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
503 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER'));
506 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
508 print
"</td>\n</tr>\n";
517print
'<div class="div-table-responsive-no-min">';
518print
'<table class="noborder centpercent">';
519print
'<tr class="liste_titre">';
520print
"<td>".$langs->trans(
"RuleForStockAvailability").
"</td>\n";
521print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
525print
'<tr class="oddeven">';
526print
'<td>'.$langs->trans(
"WarehouseAllowNegativeTransfer").
'</td>';
527print
'<td class="right">';
528if (
$conf->use_javascript_ajax) {
529 print ajax_constantonoff(
'STOCK_DISALLOW_NEGATIVE_TRANSFER', array(),
null, 1);
531 $arrval = array(
'1' => $langs->trans(
"No"),
'0' => $langs->trans(
"Yes"));
532 print $form->selectarray(
"STOCK_DISALLOW_NEGATIVE_TRANSFER", $arrval,
getDolGlobalInt(
'STOCK_DISALLOW_NEGATIVE_TRANSFER'));
539 print
'<tr class="oddeven">';
540 print
'<td>'.$langs->trans(
"StockMustBeEnoughForInvoice").
'</td>';
541 print
'<td class="right">';
542 if (
$conf->use_javascript_ajax) {
543 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_INVOICE');
545 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
546 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval,
getDolGlobalString(
'STOCK_MUST_BE_ENOUGH_FOR_INVOICE'));
553 print
'<tr class="oddeven">';
554 print
'<td>'.$langs->trans(
"StockMustBeEnoughForOrder").
'</td>';
555 print
'<td class="right">';
556 if (
$conf->use_javascript_ajax) {
557 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_ORDER');
559 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
560 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval,
getDolGlobalString(
'STOCK_MUST_BE_ENOUGH_FOR_ORDER'));
567 print
'<tr class="oddeven">';
568 print
'<td>'.$langs->trans(
"StockMustBeEnoughForShipment").
'</td>';
569 print
'<td class="right">';
570 if (
$conf->use_javascript_ajax) {
571 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT');
573 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
574 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval,
getDolGlobalString(
'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT'));
584$virtualdiffersfromphysical = 0;
591 $virtualdiffersfromphysical = 1;
594if ($virtualdiffersfromphysical) {
595 print
'<div class="div-table-responsive-no-min">';
596 print
'<table class="noborder centpercent">';
597 print
'<tr class="liste_titre">';
598 print
"<td>".$langs->trans(
"RuleForStockReplenishment").
" ".img_help(1, $langs->trans(
"VirtualDiffersFromPhysical")).
"</td>\n";
599 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
602 print
'<tr class="oddeven">';
604 print $form->textwithpicto($langs->trans(
"UseRealStockByDefault"), $langs->trans(
"ReplenishmentCalculation"));
606 print
'<td class="right">';
607 if (
$conf->use_javascript_ajax) {
608 print ajax_constantonoff(
'STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT');
610 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
611 print $form->selectarray(
"STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT", $arrval,
getDolGlobalString(
'STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT'));
621if (empty(
$conf->use_javascript_ajax)) {
623 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
"Save").
'">';
635printDocumentModelList($type,
'stock',
'STOCK_ADDON_PDF', $langs->trans(
"WarehouseModelModules"), array(
636 'Logo' =>
'option_logo',
637 'MultiLanguage' =>
'option_multilang',
643print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" spellcheck="false">';
644print
'<input type="hidden" name="token" value="'.newToken().
'">';
645print
'<input type="hidden" name="action" value="warehouse">';
646print
'<input type="hidden" name="page_y" value="">';
650print
'<div class="div-table-responsive-no-min">';
651print
'<table class="noborder centpercent">';
653print
'<tr class="liste_titre">';
654print
"<td>".$langs->trans(
"Parameter").
"</td>\n";
655print
'<td class="right"></td>'.
"\n";
658print
'<tr class="oddeven">';
659print
'<td>'.$langs->trans(
"MainDefaultWarehouse").
'</td>';
660print
'<td class="right">';
661print $formproduct->selectWarehouses(
getDolGlobalInt(
'MAIN_DEFAULT_WAREHOUSE', -1),
'default_warehouse',
'', 1, 0, 0,
'', 0, 0, array(),
'left reposition');
662print
'<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'">';
671 print
'<tr class="oddeven">';
672 print
'<td>'.$form->textwithpicto($langs->trans(
"VirtualStockHorizon"), $langs->trans(
"VirtualStockHorizonHelp")).
'</td>';
673 print
'<td class="right">';
674 print
'<input type="number" min="0" step="1" class="width50 right" name="STOCK_VIRTUAL_HORIZON_IN_DAYS" value="'.dol_escape_htmltag(
getDolGlobalString(
'STOCK_VIRTUAL_HORIZON_IN_DAYS')).
'"> '.$langs->trans(
"days").
' ';
675 print
'<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'">';
680 print
'<tr class="oddeven">';
681 print
'<td>'.$form->textwithpicto($langs->trans(
"VirtualStockHorizonKeepUndatedOrders"), $langs->trans(
"VirtualStockHorizonKeepUndatedOrdersHelp")).
'</td>';
682 print
'<td class="right">';
683 if (
$conf->use_javascript_ajax) {
684 print ajax_constantonoff(
'STOCK_VIRTUAL_HORIZON_INCLUDE_UNDATED_ORDERS');
686 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
687 print $form->selectarray(
"STOCK_VIRTUAL_HORIZON_INCLUDE_UNDATED_ORDERS", $arrval,
getDolGlobalString(
'STOCK_VIRTUAL_HORIZON_INCLUDE_UNDATED_ORDERS'));
694print
'<tr class="oddeven">';
695print
'<td>'.$langs->trans(
"UserDefaultWarehouse").
'</td>';
696print
'<td class="right">';
697if (
$conf->use_javascript_ajax) {
698 print ajax_constantonoff(
'MAIN_DEFAULT_WAREHOUSE_USER', array(),
null, 0, 0, 1);
700 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
701 print $form->selectarray(
"MAIN_DEFAULT_WAREHOUSE_USER", $arrval,
getDolGlobalString(
'MAIN_DEFAULT_WAREHOUSE_USER'));
707 print
'<tr class="oddeven">';
708 print
'<td>'.$langs->trans(
"UserWarehouseAutoCreate").
'</td>';
709 print
'<td class="right">';
710 if (
$conf->use_javascript_ajax) {
711 print ajax_constantonoff(
'STOCK_USERSTOCK_AUTOCREATE');
713 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
714 print $form->selectarray(
"STOCK_USERSTOCK_AUTOCREATE", $arrval,
getDolGlobalString(
'STOCK_USERSTOCK_AUTOCREATE'));
720print
'<tr class="oddeven">';
721print
'<td>'.$langs->trans(
"WarehouseAskWarehouseOnThirparty").
'</td>';
722print
'<td class="right">';
723if (
$conf->use_javascript_ajax) {
724 print ajax_constantonoff(
'SOCIETE_ASK_FOR_WAREHOUSE');
726 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
727 print $form->selectarray(
"SOCIETE_ASK_FOR_WAREHOUSE", $arrval,
getDolGlobalString(
'SOCIETE_ASK_FOR_WAREHOUSE'));
732print
'<tr class="oddeven">';
733print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringPropal").
'</td>';
734print
'<td class="right">';
735if (
$conf->use_javascript_ajax) {
736 print ajax_constantonoff(
'WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL');
738 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
739 print $form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval,
getDolGlobalString(
'WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL'));
744print
'<tr class="oddeven">';
745print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringOrder").
'</td>';
746print
'<td class="right">';
747if (
$conf->use_javascript_ajax) {
748 print ajax_constantonoff(
'WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
750 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
751 print $form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval,
getDolGlobalString(
'WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'));
770print
'<tr class="oddeven">';
772print $form->textwithpicto($langs->trans(
"StockSupportServices"), $langs->trans(
"StockSupportServicesDesc"));
774print
'<td class="right">';
775if (
$conf->use_javascript_ajax) {
776 print ajax_constantonoff(
'STOCK_SUPPORTS_SERVICES');
778 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
779 print $form->selectarray(
"STOCK_SUPPORTS_SERVICES", $arrval,
getDolGlobalString(
'STOCK_SUPPORTS_SERVICES'));
785print
'<tr class="oddeven">';
786print
'<td>'.$langs->trans(
"AllowAddLimitStockByWarehouse").
'</td>';
787print
'<td class="right">';
788if (
$conf->use_javascript_ajax) {
789 print ajax_constantonoff(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE');
791 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
792 print $form->selectarray(
"STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE", $arrval,
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE'));
797print
'<tr class="oddeven">';
798print
'<td>'.$langs->trans(
"AlwaysShowFullArbo").
'</td>';
799print
'<td class="right">';
800if (
$conf->use_javascript_ajax) {
801 print ajax_constantonoff(
'STOCK_ALWAYS_SHOW_FULL_ARBO');
803 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
804 print $form->selectarray(
"STOCK_ALWAYS_SHOW_FULL_ARBO", $arrval,
getDolGlobalString(
'STOCK_ALWAYS_SHOW_FULL_ARBO'));
if(! $sortfield) if(! $sortorder) $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.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
if(! $sortfield) if(! $sortorder) $module
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
Show information in HTML for admin users or standard users.
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.