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');
184 $langs->load(
"productbatch");
185 $disabled =
' disabled';
186 print
info_admin($langs->trans(
"WhenProductBatchModuleOnOptionAreForced"));
191 print
info_admin($langs->trans(
"IfYouUsePointOfSaleCheckModule"));
196 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
197 print
'<input type="hidden" name="token" value="'.newToken().
'">';
198 print
'<input type="hidden" name="action" value="warehouse">';
201 print
'<table class="noborder centpercent">';
202 print
'<tr class="liste_titre">';
203 print
"<td>".$langs->trans(
"RuleForStockManagementDecrease").
"</td>\n";
204 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
209 print
'<tr class="oddeven">';
210 print
'<td>'.$langs->trans(
"DeStockOnBill").
'</td>';
211 print
'<td class="right">';
213 if ($conf->use_javascript_ajax) {
215 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
217 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_BILL', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
220 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
221 print
$form->selectarray(
"STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL);
224 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module30Name"));
226 print
"</td>\n</tr>\n";
230 print
'<tr class="oddeven">';
231 print
'<td>'.$langs->trans(
"DeStockOnValidateOrder").
'</td>';
232 print
'<td class="right">';
234 if ($conf->use_javascript_ajax) {
236 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
238 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
241 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
242 print
$form->selectarray(
"STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER);
245 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module25Name"));
247 print
"</td>\n</tr>\n";
253 print
'<tr class="oddeven">';
254 print
'<td>'.$langs->trans(
"DeStockOnShipment").
'</td>';
255 print
'<td class="right">';
257 if ($conf->use_javascript_ajax) {
258 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
260 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
261 print
$form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT);
264 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name"));
266 print
"</td>\n</tr>\n";
270 print
'<tr class="oddeven">';
271 print
'<td>'.$langs->trans(
"DeStockOnShipmentOnClosing").
'</td>';
272 print
'<td class="right">';
274 if ($conf->use_javascript_ajax) {
275 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE', 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_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE);
281 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name"));
283 print
"</td>\n</tr>\n";
293 print
'<table class="noborder centpercent">';
294 print
'<tr class="liste_titre">';
295 print
"<td>".$langs->trans(
"RuleForStockManagementIncrease").
"</td>\n";
296 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
301 print
'<tr class="oddeven">';
302 print
'<td>'.$langs->trans(
"ReStockOnBill").
'</td>';
303 print
'<td class="right">';
305 if ($conf->use_javascript_ajax) {
307 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
309 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_BILL', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
312 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
313 print
$form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL);
316 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name"));
318 print
"</td>\n</tr>\n";
323 print
'<tr class="oddeven">';
324 print
'<td>'.$langs->trans(
"ReStockOnValidateOrder").
'</td>';
325 print
'<td class="right">';
327 if ($conf->use_javascript_ajax) {
329 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
331 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
334 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
335 print
$form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER);
338 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name"));
340 print
"</td>\n</tr>\n";
344 print
'<tr class="oddeven">';
345 print
'<td>'.$langs->trans(
"StockOnReception").
'</td>';
346 print
'<td class="right">';
348 if ($conf->use_javascript_ajax) {
349 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
351 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
352 print
$form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION);
355 print
"</td>\n</tr>\n";
359 print
'<tr class="oddeven">';
360 print
'<td>'.$langs->trans(
"StockOnReceptionOnClosing").
'</td>';
361 print
'<td class="right">';
363 if ($conf->use_javascript_ajax) {
364 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION_CLOSE', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
366 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
367 print
$form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE);
369 print
"</td>\n</tr>\n";
372 print
'<tr class="oddeven">';
373 print
'<td>'.$langs->trans(
"ReStockOnDispatchOrder").
'</td>';
374 print
'<td class="right">';
375 if ((
isModEnabled(
"fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) ||
isModEnabled(
"supplier_order")) {
376 if ($conf->use_javascript_ajax) {
377 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(),
null, 0, 0, 0, 2, 1,
'',
'',
'reposition');
379 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
380 print
$form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER);
383 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name"));
385 print
"</td>\n</tr>\n";
393 print
'<table class="noborder centpercent">';
394 print
'<tr class="liste_titre">';
395 print
"<td>".$langs->trans(
"RuleForStockAvailability").
"</td>\n";
396 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
400 print
'<tr class="oddeven">';
401 print
'<td>'.$langs->trans(
"WarehouseAllowNegativeTransfer").
'</td>';
402 print
'<td class="right">';
403 if ($conf->use_javascript_ajax) {
406 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
407 print
$form->selectarray(
"STOCK_ALLOW_NEGATIVE_TRANSFER", $arrval, $conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER);
414 print
'<tr class="oddeven">';
415 print
'<td>'.$langs->trans(
"StockMustBeEnoughForInvoice").
'</td>';
416 print
'<td class="right">';
417 if ($conf->use_javascript_ajax) {
420 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
421 print
$form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE);
428 print
'<tr class="oddeven">';
429 print
'<td>'.$langs->trans(
"StockMustBeEnoughForOrder").
'</td>';
430 print
'<td class="right">';
431 if ($conf->use_javascript_ajax) {
434 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
435 print
$form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER);
442 print
'<tr class="oddeven">';
443 print
'<td>'.$langs->trans(
"StockMustBeEnoughForShipment").
'</td>';
444 print
'<td class="right">';
445 if ($conf->use_javascript_ajax) {
448 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
449 print
$form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT);
458 $virtualdiffersfromphysical = 0;
459 if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
460 || !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
461 || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)
462 || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)
463 || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)
465 $virtualdiffersfromphysical = 1;
468 if ($virtualdiffersfromphysical) {
469 print
'<table class="noborder centpercent">';
470 print
'<tr class="liste_titre">';
471 print
"<td>".$langs->trans(
"RuleForStockReplenishment").
" ".
img_help(
'help', $langs->trans(
"VirtualDiffersFromPhysical")).
"</td>\n";
472 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
475 print
'<tr class="oddeven">';
477 print
$form->textwithpicto($langs->trans(
"UseRealStockByDefault"), $langs->trans(
"ReplenishmentCalculation"));
479 print
'<td class="right">';
480 if ($conf->use_javascript_ajax) {
483 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
484 print
$form->selectarray(
"STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT", $arrval, $conf->global->STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT);
496 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
497 print
'<input type="hidden" name="token" value="'.newToken().
'">';
498 print
'<input type="hidden" name="action" value="warehouse">';
510 $sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
511 $sql .=
" WHERE type = '".$db->escape($type).
"'";
512 $sql .=
" AND entity = ".$conf->entity;
513 $resql = $db->query($sql);
516 $num_rows = $db->num_rows(
$resql);
517 while ($i < $num_rows) {
518 $array = $db->fetch_array(
$resql);
519 array_push($def, $array[0]);
527 print
"<table class=\"noborder\" width=\"100%\">\n";
528 print
"<tr class=\"liste_titre\">\n";
529 print
'<td>'.$langs->trans(
"Name").
'</td>';
530 print
'<td>'.$langs->trans(
"Description").
'</td>';
531 print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
532 print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
533 print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
534 print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
539 foreach ($dirmodels as $reldir) {
540 foreach (array(
'',
'/doc') as $valdir) {
541 $realpath = $reldir.
"core/modules/stock".$valdir;
545 $handle = opendir($dir);
546 if (is_resource($handle)) {
547 while (($file = readdir($handle)) !==
false) {
553 foreach ($filelist as $file) {
554 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
555 if (file_exists($dir.
'/'.$file)) {
556 $name = substr($file, 4,
dol_strlen($file) - 16);
557 $classname = substr($file, 0,
dol_strlen($file) - 12);
559 require_once $dir.
'/'.$file;
560 $module =
new $classname($db);
562 $modulequalified = 1;
563 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
564 $modulequalified = 0;
566 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
567 $modulequalified = 0;
570 if ($modulequalified) {
571 print
'<tr class="oddeven"><td width="100">';
572 print (empty($module->name) ? $name : $module->name);
574 if (method_exists($module,
'info')) {
575 print $module->info($langs);
577 print $module->description;
582 if (in_array($name, $def)) {
583 print
'<td class="center">'.
"\n";
584 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.
newToken().
'&value='.urlencode($name).
'">';
585 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
589 print
'<td class="center">'.
"\n";
590 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>';
595 print
'<td class="center">';
596 if ($conf->global->STOCK_ADDON_PDF == $name) {
597 print
img_picto($langs->trans(
"Default"),
'on');
599 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>';
604 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
605 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
606 if ($module->type ==
'pdf') {
607 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
609 $htmltooltip .=
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//',
'', $realpath).
'/'.$file;
611 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
612 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
613 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
616 print
'<td class="center">';
617 print
$form->textwithpicto(
'', $htmltooltip, 1, 0);
621 print
'<td class="center">';
622 if ($module->type ==
'pdf') {
623 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
625 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
646 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
647 print
'<input type="hidden" name="token" value="'.newToken().
'">';
648 print
'<input type="hidden" name="action" value="warehouse">';
652 print
'<table class="noborder centpercent">';
654 print
'<tr class="liste_titre">';
655 print
"<td>".$langs->trans(
"Parameter").
"</td>\n";
656 print
'<td class="right">'.$langs->trans(
"Value").
'</td>'.
"\n";
659 print
'<tr class="oddeven">';
660 print
'<td>'.$langs->trans(
"MainDefaultWarehouse").
'</td>';
661 print
'<td class="right">';
662 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');
663 print
'<input type="submit" class="button button-edit small" value="'.$langs->trans(
"Modify").
'">';
667 print
'<tr class="oddeven">';
668 print
'<td>'.$langs->trans(
"UserDefaultWarehouse").
'</td>';
669 print
'<td class="right">';
670 if ($conf->use_javascript_ajax) {
673 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
674 print
$form->selectarray(
"MAIN_DEFAULT_WAREHOUSE_USER", $arrval, $conf->global->MAIN_DEFAULT_WAREHOUSE_USER);
679 if (!empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
680 print
'<tr class="oddeven">';
681 print
'<td>'.$langs->trans(
"UserWarehouseAutoCreate").
'</td>';
682 print
'<td class="right">';
683 if ($conf->use_javascript_ajax) {
686 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
687 print
$form->selectarray(
"STOCK_USERSTOCK_AUTOCREATE", $arrval, $conf->global->STOCK_USERSTOCK_AUTOCREATE);
693 print
'<tr class="oddeven">';
694 print
'<td>'.$langs->trans(
"WarehouseAskWarehouseOnThirparty").
'</td>';
695 print
'<td class="right">';
696 if ($conf->use_javascript_ajax) {
699 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
700 print
$form->selectarray(
"SOCIETE_ASK_FOR_WAREHOUSE", $arrval, $conf->global->SOCIETE_ASK_FOR_WAREHOUSE);
705 print
'<tr class="oddeven">';
706 print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringPropal").
'</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(
"WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL);
717 print
'<tr class="oddeven">';
718 print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringOrder").
'</td>';
719 print
'<td class="right">';
720 if ($conf->use_javascript_ajax) {
723 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
724 print
$form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER);
743 print
'<tr class="oddeven">';
745 print
$form->textwithpicto($langs->trans(
"StockSupportServices"), $langs->trans(
"StockSupportServicesDesc"));
747 print
'<td class="right">';
748 if ($conf->use_javascript_ajax) {
751 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
752 print
$form->selectarray(
"STOCK_SUPPORTS_SERVICES", $arrval, $conf->global->STOCK_SUPPORTS_SERVICES);
757 print
'<tr class="oddeven">';
758 print
'<td>'.$langs->trans(
"AllowAddLimitStockByWarehouse").
'</td>';
759 print
'<td class="right">';
760 if ($conf->use_javascript_ajax) {
763 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
764 print
$form->selectarray(
"STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE", $arrval, $conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE);
769 print
'<tr class="oddeven">';
770 print
'<td>'.$langs->trans(
"AlwaysShowFullArbo").
'</td>';
771 print
'<td class="right">';
772 if ($conf->use_javascript_ajax) {
775 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
776 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') &&!empty($user->rights->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') &&!empty($user->rights->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)) $resql
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
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_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)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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.
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.