28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/stock.lib.php';
31 require_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 $label =
GETPOST(
'label',
'alpha');
44 $scandir =
GETPOST(
'scan_dir',
'alpha');
54 if (preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg)) {
58 if (in_array($code, array(
'STOCK_CALCULATE_ON_BILL',
'STOCK_CALCULATE_ON_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_SHIPMENT',
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE'))) {
64 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'))) {
73 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
80 if (preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg)) {
83 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
90 if ($action ==
'warehouse') {
91 $value =
GETPOST(
'default_warehouse',
'alpha');
92 $res =
dolibarr_set_const($db,
"MAIN_DEFAULT_WAREHOUSE", $value,
'chaine', 0,
'', $conf->entity);
93 if ($value == -1 || empty($value) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) {
101 if ($action ==
'specimen') {
102 $modele =
GETPOST(
'module',
'alpha');
105 $object->initAsSpecimen();
108 $file =
''; $classname =
''; $filefound = 0;
109 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
110 foreach ($dirmodels as $reldir) {
111 $file =
dol_buildpath($reldir.
"core/modules/stock/doc/pdf_".$modele.
".modules.php", 0);
112 if (file_exists($file)) {
114 $classname =
"pdf_".$modele;
122 $module =
new $classname($db);
124 if ($module->write_file($object, $langs) > 0) {
125 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=stock&file=SPECIMEN.pdf");
133 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
135 } elseif ($action ==
'set') {
138 } elseif ($action ==
'del') {
141 if ($conf->global->STOCK_ADDON_PDF ==
"$value") {
145 } elseif ($action ==
'setdoc') {
147 if (
dolibarr_set_const($db,
"STOCK_ADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
150 $conf->global->STOCK_ADDON_PDF = $value;
166 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
168 llxHeader(
'', $langs->trans(
"StockSetup"));
170 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
171 print
load_fiche_titre($langs->trans(
"StockSetup"), $linkback,
'title_setup');
185 $langs->load(
"productbatch");
186 $disabled =
' disabled';
189 $descmode = $langs->trans(
'DeStockOnShipmentOnClosing');
192 $incmode = $langs->trans(
'ReStockOnDispatchOrder');
195 $incmode = $langs->trans(
'StockOnReceptionOnClosing');
197 print
info_admin($langs->trans(
"WhenProductBatchModuleOnOptionAreForced", $descmode, $incmode));
201 print
info_admin($langs->trans(
"IfYouUsePointOfSaleCheckModule"));
205 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
206 print
'<input type="hidden" name="token" value="'.newToken().
'">';
207 print
'<input type="hidden" name="action" value="warehouse">';
210 print
'<div class="div-table-responsive-no-min">';
211 print
'<table class="noborder centpercent">';
212 print
'<tr class="liste_titre">';
213 print
"<td>".$langs->trans(
"RuleForStockManagementDecrease").
"</td>\n";
214 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
219 print
'<!-- STOCK_CALCULATE_ON_BILL -->';
220 print
'<tr class="oddeven">';
221 print
'<td>'.$langs->trans(
"DeStockOnBill").
'</td>';
222 print
'<td class="right">';
224 if ($conf->use_javascript_ajax) {
226 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
228 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_BILL', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
231 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
232 print
$form->selectarray(
"STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL);
235 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module30Name")).
'</span>';
237 print
"</td>\n</tr>\n";
241 print
'<!-- STOCK_CALCULATE_ON_VALIDATE_ORDER -->';
242 print
'<tr class="oddeven">';
243 print
'<td>'.$langs->trans(
"DeStockOnValidateOrder").
'</td>';
244 print
'<td class="right">';
246 if ($conf->use_javascript_ajax) {
248 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
250 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
253 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
254 print
$form->selectarray(
"STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER);
257 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module25Name")).
'</span>';
259 print
"</td>\n</tr>\n";
265 print
'<!-- STOCK_CALCULATE_ON_SHIPMENT -->';
266 print
'<tr class="oddeven">';
267 print
'<td>'.$langs->trans(
"DeStockOnShipment").
'</td>';
268 print
'<td class="right">';
270 if ($conf->use_javascript_ajax) {
271 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
273 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
274 print
$form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT);
277 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name")).
'</span>';
279 print
"</td>\n</tr>\n";
282 print
'<!-- STOCK_CALCULATE_ON_SHIPMENT_CLOSE -->';
283 print
'<tr class="oddeven">';
284 print
'<td>'.$langs->trans(
"DeStockOnShipmentOnClosing").
'</td>';
285 print
'<td class="right">';
287 if ($conf->use_javascript_ajax) {
288 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
290 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
291 print
$form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE);
294 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name")).
'</span>';
296 print
"</td>\n</tr>\n";
306 print
'<div class="div-table-responsive-no-min">';
307 print
'<table class="noborder centpercent">';
308 print
'<tr class="liste_titre">';
309 print
"<td>".$langs->trans(
"RuleForStockManagementIncrease").
"</td>\n";
310 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
315 print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_BILL -->';
316 print
'<tr class="oddeven">';
317 print
'<td>'.$langs->trans(
"ReStockOnBill").
'</td>';
318 print
'<td class="right">';
320 if ($conf->use_javascript_ajax) {
322 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
324 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_BILL', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
327 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
328 print
$form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL);
331 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
333 print
"</td>\n</tr>\n";
337 print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER -->';
338 print
'<tr class="oddeven">';
339 print
'<td>'.$langs->trans(
"ReStockOnValidateOrder").
'</td>';
340 print
'<td class="right">';
342 if ($conf->use_javascript_ajax) {
344 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
346 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
349 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
350 print
$form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER);
353 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
355 print
"</td>\n</tr>\n";
359 print
'<!-- STOCK_CALCULATE_ON_RECEPTION_CLOSE -->';
360 print
'<tr class="oddeven">';
361 print
'<td>'.$langs->trans(
"StockOnReception").
'</td>';
362 print
'<td class="right">';
364 if ($conf->use_javascript_ajax) {
365 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
367 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
368 print
$form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION);
371 print
"</td>\n</tr>\n";
375 print
'<tr class="oddeven">';
376 print
'<td>'.$langs->trans(
"StockOnReceptionOnClosing").
'</td>';
377 print
'<td class="right">';
379 if ($conf->use_javascript_ajax) {
380 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION_CLOSE', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
382 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
383 print
$form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE);
385 print
"</td>\n</tr>\n";
388 print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER -->';
389 print
'<tr class="oddeven">';
390 print
'<td>'.$langs->trans(
"ReStockOnDispatchOrder").
'</td>';
391 print
'<td class="right">';
393 if ($conf->use_javascript_ajax) {
394 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
396 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
397 print
$form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER);
400 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
402 print
"</td>\n</tr>\n";
411 print
'<div class="div-table-responsive-no-min">';
412 print
'<table class="noborder centpercent">';
413 print
'<tr class="liste_titre">';
414 print
"<td>".$langs->trans(
"RuleForStockAvailability").
"</td>\n";
415 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
419 print
'<tr class="oddeven">';
420 print
'<td>'.$langs->trans(
"WarehouseAllowNegativeTransfer").
'</td>';
421 print
'<td class="right">';
422 if ($conf->use_javascript_ajax) {
425 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
426 print
$form->selectarray(
"STOCK_ALLOW_NEGATIVE_TRANSFER", $arrval, $conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER);
433 print
'<tr class="oddeven">';
434 print
'<td>'.$langs->trans(
"StockMustBeEnoughForInvoice").
'</td>';
435 print
'<td class="right">';
436 if ($conf->use_javascript_ajax) {
439 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
440 print
$form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE);
447 print
'<tr class="oddeven">';
448 print
'<td>'.$langs->trans(
"StockMustBeEnoughForOrder").
'</td>';
449 print
'<td class="right">';
450 if ($conf->use_javascript_ajax) {
453 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
454 print
$form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER);
461 print
'<tr class="oddeven">';
462 print
'<td>'.$langs->trans(
"StockMustBeEnoughForShipment").
'</td>';
463 print
'<td class="right">';
464 if ($conf->use_javascript_ajax) {
467 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
468 print
$form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT);
478 $virtualdiffersfromphysical = 0;
479 if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
480 || !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
481 || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)
482 || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)
483 || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)
485 $virtualdiffersfromphysical = 1;
488 if ($virtualdiffersfromphysical) {
489 print
'<div class="div-table-responsive-no-min">';
490 print
'<table class="noborder centpercent">';
491 print
'<tr class="liste_titre">';
492 print
"<td>".$langs->trans(
"RuleForStockReplenishment").
" ".
img_help(
'help', $langs->trans(
"VirtualDiffersFromPhysical")).
"</td>\n";
493 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
496 print
'<tr class="oddeven">';
498 print
$form->textwithpicto($langs->trans(
"UseRealStockByDefault"), $langs->trans(
"ReplenishmentCalculation"));
500 print
'<td class="right">';
501 if ($conf->use_javascript_ajax) {
504 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
505 print
$form->selectarray(
"STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT", $arrval, $conf->global->STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT);
518 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
519 print
'<input type="hidden" name="token" value="'.newToken().
'">';
520 print
'<input type="hidden" name="action" value="warehouse">';
532 $sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
533 $sql .=
" WHERE type = '".$db->escape($type).
"'";
534 $sql .=
" AND entity = ".$conf->entity;
535 $resql = $db->query(
$sql);
538 $num_rows = $db->num_rows($resql);
539 while ($i < $num_rows) {
540 $array = $db->fetch_array($resql);
541 array_push($def, $array[0]);
549 print
'<div class="div-table-responsive-no-min">';
550 print
'<table class="noborder centpercent">'.
"\n";
551 print
'<tr class="liste_titre">'.
"\n";
552 print
'<td>'.$langs->trans(
"Name").
'</td>';
553 print
'<td>'.$langs->trans(
"Description").
'</td>';
554 print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
555 print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
556 print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
557 print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
562 foreach ($dirmodels as $reldir) {
563 foreach (array(
'',
'/doc') as $valdir) {
564 $realpath = $reldir.
"core/modules/stock".$valdir;
568 $handle = opendir($dir);
569 if (is_resource($handle)) {
570 while (($file = readdir($handle)) !==
false) {
576 foreach ($filelist as $file) {
577 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
578 if (file_exists($dir.
'/'.$file)) {
579 $name = substr($file, 4,
dol_strlen($file) - 16);
580 $classname = substr($file, 0,
dol_strlen($file) - 12);
582 require_once $dir.
'/'.$file;
583 $module =
new $classname($db);
585 $modulequalified = 1;
586 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
587 $modulequalified = 0;
589 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
590 $modulequalified = 0;
593 if ($modulequalified) {
594 print
'<tr class="oddeven"><td width="100">';
595 print (empty($module->name) ? $name : $module->name);
597 if (method_exists($module,
'info')) {
598 print $module->info($langs);
600 print $module->description;
605 if (in_array($name, $def)) {
606 print
'<td class="center">'.
"\n";
607 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.
newToken().
'&value='.urlencode($name).
'">';
608 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
612 print
'<td class="center">'.
"\n";
613 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>';
618 print
'<td class="center">';
619 if ($conf->global->STOCK_ADDON_PDF == $name) {
620 print
img_picto($langs->trans(
"Default"),
'on');
622 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>';
627 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
628 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
629 if ($module->type ==
'pdf') {
630 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
632 $htmltooltip .=
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//',
'', $realpath).
'/'.$file;
634 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
635 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
636 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
639 print
'<td class="center">';
640 print
$form->textwithpicto(
'', $htmltooltip, 1, 0);
644 print
'<td class="center">';
645 if ($module->type ==
'pdf') {
646 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
648 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
670 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
671 print
'<input type="hidden" name="token" value="'.newToken().
'">';
672 print
'<input type="hidden" name="action" value="warehouse">';
676 print
'<div class="div-table-responsive-no-min">';
677 print
'<table class="noborder centpercent">';
679 print
'<tr class="liste_titre">';
680 print
"<td>".$langs->trans(
"Parameter").
"</td>\n";
681 print
'<td class="right">'.$langs->trans(
"Value").
'</td>'.
"\n";
684 print
'<tr class="oddeven">';
685 print
'<td>'.$langs->trans(
"MainDefaultWarehouse").
'</td>';
686 print
'<td class="right">';
687 print $formproduct->selectWarehouses(!empty($conf->global->MAIN_DEFAULT_WAREHOUSE) ? $conf->global->MAIN_DEFAULT_WAREHOUSE : -1,
'default_warehouse',
'', 1, 0, 0,
'', 0, 0, array(),
'left reposition');
688 print
'<input type="submit" class="button button-edit small" value="'.$langs->trans(
"Modify").
'">';
692 print
'<tr class="oddeven">';
693 print
'<td>'.$langs->trans(
"UserDefaultWarehouse").
'</td>';
694 print
'<td class="right">';
695 if ($conf->use_javascript_ajax) {
698 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
699 print
$form->selectarray(
"MAIN_DEFAULT_WAREHOUSE_USER", $arrval, $conf->global->MAIN_DEFAULT_WAREHOUSE_USER);
704 if (!empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
705 print
'<tr class="oddeven">';
706 print
'<td>'.$langs->trans(
"UserWarehouseAutoCreate").
'</td>';
707 print
'<td class="right">';
708 if ($conf->use_javascript_ajax) {
711 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
712 print
$form->selectarray(
"STOCK_USERSTOCK_AUTOCREATE", $arrval, $conf->global->STOCK_USERSTOCK_AUTOCREATE);
718 print
'<tr class="oddeven">';
719 print
'<td>'.$langs->trans(
"WarehouseAskWarehouseOnThirparty").
'</td>';
720 print
'<td class="right">';
721 if ($conf->use_javascript_ajax) {
724 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
725 print
$form->selectarray(
"SOCIETE_ASK_FOR_WAREHOUSE", $arrval, $conf->global->SOCIETE_ASK_FOR_WAREHOUSE);
730 print
'<tr class="oddeven">';
731 print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringPropal").
'</td>';
732 print
'<td class="right">';
733 if ($conf->use_javascript_ajax) {
736 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
737 print
$form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL);
742 print
'<tr class="oddeven">';
743 print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringOrder").
'</td>';
744 print
'<td class="right">';
745 if ($conf->use_javascript_ajax) {
748 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
749 print
$form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER);
768 print
'<tr class="oddeven">';
770 print
$form->textwithpicto($langs->trans(
"StockSupportServices"), $langs->trans(
"StockSupportServicesDesc"));
772 print
'<td class="right">';
773 if ($conf->use_javascript_ajax) {
776 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
777 print
$form->selectarray(
"STOCK_SUPPORTS_SERVICES", $arrval, $conf->global->STOCK_SUPPORTS_SERVICES);
782 print
'<tr class="oddeven">';
783 print
'<td>'.$langs->trans(
"AllowAddLimitStockByWarehouse").
'</td>';
784 print
'<td class="right">';
785 if ($conf->use_javascript_ajax) {
788 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
789 print
$form->selectarray(
"STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE", $arrval, $conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE);
794 print
'<tr class="oddeven">';
795 print
'<td>'.$langs->trans(
"AlwaysShowFullArbo").
'</td>';
796 print
'<td class="right">';
797 if ($conf->use_javascript_ajax) {
800 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
801 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.
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='', $morecss='')
On/off button for constant.
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.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
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.