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"));
39 $action =
GETPOST(
'action',
'aZ09');
40 $value =
GETPOST(
'value',
'alpha');
41 $label =
GETPOST(
'label',
'alpha');
42 $scandir =
GETPOST(
'scan_dir',
'alpha');
52 if (preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg))
57 if (in_array($code, array(
'STOCK_CALCULATE_ON_BILL',
'STOCK_CALCULATE_ON_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_SHIPMENT',
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE'))) {
63 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))
85 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
92 if ($action ==
'warehouse')
94 $value =
GETPOST(
'default_warehouse',
'alpha');
95 $res =
dolibarr_set_const($db,
"MAIN_DEFAULT_WAREHOUSE", $value,
'chaine', 0,
'', $conf->entity);
96 if ($value == -1 || empty($value) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) {
99 if (!($res > 0)) $error++;
102 if ($action ==
'specimen')
104 $modele =
GETPOST(
'module',
'alpha');
107 $object->initAsSpecimen();
110 $file =
''; $classname =
''; $filefound = 0;
111 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
112 foreach ($dirmodels as $reldir)
114 $file =
dol_buildpath($reldir.
"core/modules/stock/doc/pdf_".$modele.
".modules.php", 0);
115 if (file_exists($file))
118 $classname =
"pdf_".$modele;
127 $module =
new $classname($db);
129 if ($module->write_file($object, $langs) > 0)
131 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=stock&file=SPECIMEN.pdf");
139 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
144 elseif ($action ==
'set') {
146 } elseif ($action ==
'del') {
150 if ($conf->global->STOCK_ADDON_PDF ==
"$value")
dolibarr_del_const($db,
'STOCK_ADDON_PDF', $conf->entity);
155 elseif ($action ==
'setdoc')
157 if (
dolibarr_set_const($db,
"STOCK_ADDON_PDF", $value,
'chaine', 0,
'', $conf->entity))
161 $conf->global->STOCK_ADDON_PDF = $value;
177 $form =
new Form($db);
178 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
180 llxHeader(
'', $langs->trans(
"StockSetup"));
182 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
189 $form =
new Form($db);
195 if (!empty($conf->productbatch->enabled))
197 $langs->load(
"productbatch");
198 $disabled =
' disabled';
199 print info_admin($langs->trans(
"WhenProductBatchModuleOnOptionAreForced"));
209 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
210 print
'<input type="hidden" name="token" value="'.newToken().
'">';
211 print
'<input type="hidden" name="action" value="warehouse">';
214 print
'<table class="noborder centpercent">';
215 print
'<tr class="liste_titre">';
216 print
"<td>".$langs->trans(
"RuleForStockManagementDecrease").
"</td>\n";
217 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
222 print
'<tr class="oddeven">';
223 print
'<td>'.$langs->trans(
"DeStockOnBill").
'</td>';
224 print
'<td class="right">';
225 if (!empty($conf->facture->enabled))
227 if ($conf->use_javascript_ajax) {
230 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
231 print $form->selectarray(
"STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL);
234 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module30Name"));
236 print
"</td>\n</tr>\n";
240 print
'<tr class="oddeven">';
241 print
'<td>'.$langs->trans(
"DeStockOnValidateOrder").
'</td>';
242 print
'<td class="right">';
243 if (!empty($conf->commande->enabled))
245 if ($conf->use_javascript_ajax) {
246 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1);
248 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
249 print $form->selectarray(
"STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER);
252 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module25Name"));
254 print
"</td>\n</tr>\n";
260 print
'<tr class="oddeven">';
261 print
'<td>'.$langs->trans(
"DeStockOnShipment").
'</td>';
262 print
'<td class="right">';
263 if (!empty($conf->expedition->enabled))
265 if ($conf->use_javascript_ajax) {
266 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT', array(), null, 0, 0, 0, 2, 1);
268 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
269 print $form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT);
272 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name"));
274 print
"</td>\n</tr>\n";
278 print
'<tr class="oddeven">';
279 print
'<td>'.$langs->trans(
"DeStockOnShipmentOnClosing").
'</td>';
280 print
'<td class="right">';
281 if (!empty($conf->expedition->enabled))
283 if ($conf->use_javascript_ajax) {
284 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(), null, 0, 0, 0, 2, 1);
286 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
287 print $form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE);
290 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name"));
292 print
"</td>\n</tr>\n";
302 print
'<table class="noborder centpercent">';
303 print
'<tr class="liste_titre">';
304 print
"<td>".$langs->trans(
"RuleForStockManagementIncrease").
"</td>\n";
305 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
310 print
'<tr class="oddeven">';
311 print
'<td>'.$langs->trans(
"ReStockOnBill").
'</td>';
312 print
'<td class="right">';
313 if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
315 if ($conf->use_javascript_ajax) {
316 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_BILL', array(), null, 0, 0, 0, 2, 1);
318 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
319 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL);
322 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name"));
324 print
"</td>\n</tr>\n";
329 print
'<tr class="oddeven">';
330 print
'<td>'.$langs->trans(
"ReStockOnValidateOrder").
'</td>';
331 print
'<td class="right">';
332 if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
334 if ($conf->use_javascript_ajax) {
335 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1);
337 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
338 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER);
341 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name"));
343 print
"</td>\n</tr>\n";
346 if (!empty($conf->reception->enabled))
348 print
'<tr class="oddeven">';
349 print
'<td>'.$langs->trans(
"StockOnReception").
'</td>';
350 print
'<td class="right">';
352 if ($conf->use_javascript_ajax) {
353 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION', array(), null, 0, 0, 0, 2, 1);
355 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
356 print $form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION);
359 print
"</td>\n</tr>\n";
363 print
'<tr class="oddeven">';
364 print
'<td>'.$langs->trans(
"StockOnReceptionOnClosing").
'</td>';
365 print
'<td class="right">';
367 if ($conf->use_javascript_ajax) {
368 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION_CLOSE', array(), null, 0, 0, 0, 2, 1);
370 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
371 print $form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE);
373 print
"</td>\n</tr>\n";
376 print
'<tr class="oddeven">';
377 print
'<td>'.$langs->trans(
"ReStockOnDispatchOrder").
'</td>';
378 print
'<td class="right">';
379 if (!empty($conf->fournisseur->enabled))
381 if ($conf->use_javascript_ajax) {
382 print
ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(), null, 0, 0, 0, 2, 1);
384 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
385 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER);
388 print $langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name"));
390 print
"</td>\n</tr>\n";
398 print
'<table class="noborder centpercent">';
399 print
'<tr class="liste_titre">';
400 print
"<td>".$langs->trans(
"RuleForStockAvailability").
"</td>\n";
401 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
405 print
'<tr class="oddeven">';
406 print
'<td>'.$langs->trans(
"WarehouseAllowNegativeTransfer").
'</td>';
407 print
'<td class="right">';
408 if ($conf->use_javascript_ajax) {
411 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
412 print $form->selectarray(
"STOCK_ALLOW_NEGATIVE_TRANSFER", $arrval, $conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER);
418 if ($conf->invoice->enabled)
420 print
'<tr class="oddeven">';
421 print
'<td>'.$langs->trans(
"StockMustBeEnoughForInvoice").
'</td>';
422 print
'<td class="right">';
423 if ($conf->use_javascript_ajax) {
426 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
427 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE);
433 if ($conf->order->enabled)
435 print
'<tr class="oddeven">';
436 print
'<td>'.$langs->trans(
"StockMustBeEnoughForOrder").
'</td>';
437 print
'<td class="right">';
438 if ($conf->use_javascript_ajax) {
441 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
442 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER);
448 if ($conf->expedition->enabled)
450 print
'<tr class="oddeven">';
451 print
'<td>'.$langs->trans(
"StockMustBeEnoughForShipment").
'</td>';
452 print
'<td class="right">';
453 if ($conf->use_javascript_ajax) {
456 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
457 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT);
466 $virtualdiffersfromphysical = 0;
467 if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
468 || !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
469 || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)
470 || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)
471 || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)
472 || !empty($conf->mrp->enabled))
474 $virtualdiffersfromphysical = 1;
477 if ($virtualdiffersfromphysical)
479 print
'<table class="noborder centpercent">';
480 print
'<tr class="liste_titre">';
481 print
"<td>".$langs->trans(
"RuleForStockReplenishment").
" ".
img_help(
'help', $langs->trans(
"VirtualDiffersFromPhysical")).
"</td>\n";
482 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
485 print
'<tr class="oddeven">';
487 print $form->textwithpicto($langs->trans(
"UseRealStockByDefault"), $langs->trans(
"ReplenishmentCalculation"));
489 print
'<td class="right">';
490 if ($conf->use_javascript_ajax) {
493 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
494 print $form->selectarray(
"STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT", $arrval, $conf->global->STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT);
506 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
507 print
'<input type="hidden" name="token" value="'.newToken().
'">';
508 print
'<input type="hidden" name="action" value="warehouse">';
520 $sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
521 $sql .=
" WHERE type = '".$db->escape($type).
"'";
522 $sql .=
" AND entity = ".$conf->entity;
523 $resql = $db->query($sql);
527 $num_rows = $db->num_rows(
$resql);
528 while ($i < $num_rows)
530 $array = $db->fetch_array(
$resql);
531 array_push($def, $array[0]);
539 print
"<table class=\"noborder\" width=\"100%\">\n";
540 print
"<tr class=\"liste_titre\">\n";
541 print
'<td>'.$langs->trans(
"Name").
'</td>';
542 print
'<td>'.$langs->trans(
"Description").
'</td>';
543 print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
544 print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
545 print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
546 print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
551 foreach ($dirmodels as $reldir)
553 foreach (array(
'',
'/doc') as $valdir)
555 $realpath = $reldir.
"core/modules/stock".$valdir;
560 $handle = opendir($dir);
561 if (is_resource($handle))
563 while (($file = readdir($handle)) !==
false)
570 foreach ($filelist as $file)
572 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file))
574 if (file_exists($dir.
'/'.$file))
576 $name = substr($file, 4,
dol_strlen($file) - 16);
577 $classname = substr($file, 0,
dol_strlen($file) - 12);
579 require_once $dir.
'/'.$file;
580 $module =
new $classname($db);
582 $modulequalified = 1;
583 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
584 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
586 if ($modulequalified)
588 print
'<tr class="oddeven"><td width="100">';
589 print (empty($module->name) ? $name : $module->name);
591 if (method_exists($module,
'info')) print $module->info($langs);
592 else print $module->description;
596 if (in_array($name, $def))
598 print
'<td class="center">'.
"\n";
599 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.
newToken().
'&value='.$name.
'">';
600 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
604 print
'<td class="center">'.
"\n";
605 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.
newToken().
'&value='.$name.
'&scan_dir='.$module->scandir.
'&label='.urlencode($module->name).
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
610 print
'<td class="center">';
611 if ($conf->global->STOCK_ADDON_PDF == $name)
613 print
img_picto($langs->trans(
"Default"),
'on');
615 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setdoc&token='.
newToken().
'&value='.$name.
'&scan_dir='.$module->scandir.
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
620 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
621 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
622 if ($module->type ==
'pdf')
624 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
626 $htmltooltip .=
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//',
'', $realpath).
'/'.$file;
628 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
629 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
630 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
633 print
'<td class="center">';
634 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
638 print
'<td class="center">';
639 if ($module->type ==
'pdf')
641 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
643 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
664 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
665 print
'<input type="hidden" name="token" value="'.newToken().
'">';
666 print
'<input type="hidden" name="action" value="warehouse">';
670 print
'<table class="noborder centpercent">';
672 print
'<tr class="liste_titre">';
673 print
"<td>".$langs->trans(
"Parameter").
"</td>\n";
674 print
'<td class="right">'.$langs->trans(
"Value").
'</td>'.
"\n";
677 print
'<tr class="oddeven">';
678 print
'<td>'.$langs->trans(
"MainDefaultWarehouse").
'</td>';
679 print
'<td class="right">';
680 print $formproduct->selectWarehouses($conf->global->MAIN_DEFAULT_WAREHOUSE,
'default_warehouse',
'', 1, 0, 0,
'', 0, 0, array(),
'left reposition');
681 print
'<input type="submit" class="button" value="'.$langs->trans(
"Modify").
'">';
685 print
'<tr class="oddeven">';
686 print
'<td>'.$langs->trans(
"UserDefaultWarehouse").
'</td>';
687 print
'<td class="right">';
688 if ($conf->use_javascript_ajax) {
691 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
692 print $form->selectarray(
"MAIN_DEFAULT_WAREHOUSE_USER", $arrval, $conf->global->MAIN_DEFAULT_WAREHOUSE_USER);
697 if (!empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
698 print
'<tr class="oddeven">';
699 print
'<td>'.$langs->trans(
"UserWarehouseAutoCreate").
'</td>';
700 print
'<td class="right">';
701 if ($conf->use_javascript_ajax) {
704 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
705 print $form->selectarray(
"STOCK_USERSTOCK_AUTOCREATE", $arrval, $conf->global->STOCK_USERSTOCK_AUTOCREATE);
711 print
'<tr class="oddeven">';
712 print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringOrder").
'</td>';
713 print
'<td class="right">';
714 if ($conf->use_javascript_ajax) {
717 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
718 print $form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER);
724 print
'<tr class="oddeven">';
726 print $form->textwithpicto($langs->trans(
"StockSupportServices"), $langs->trans(
"StockSupportServicesDesc"));
728 print
'<td class="right">';
729 if ($conf->use_javascript_ajax) {
732 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
733 print $form->selectarray(
"STOCK_SUPPORTS_SERVICES", $arrval, $conf->global->STOCK_SUPPORTS_SERVICES);
738 print
'<tr class="oddeven">';
739 print
'<td>'.$langs->trans(
"AllowAddLimitStockByWarehouse").
'</td>';
740 print
'<td class="right">';
741 if ($conf->use_javascript_ajax) {
744 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
745 print $form->selectarray(
"STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE", $arrval, $conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE);
750 print
'<tr class="oddeven">';
751 print
'<td>'.$langs->trans(
"AlwaysShowFullArbo").
'</td>';
752 print
'<td class="right">';
753 if ($conf->use_javascript_ajax) {
756 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
757 print $form->selectarray(
"STOCK_ALWAYS_SHOW_FULL_ARBO", $arrval, $conf->global->STOCK_ALWAYS_SHOW_FULL_ARBO);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
delDocumentModel($name, $type)
Delete document model used by doc generator.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
stock_admin_prepare_head()
Return array head with list of tabs to view object informations.
img_help($usehelpcursor=1, $usealttitle=1)
Show help logo with cursor "?".
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).
addDocumentModel($name, $type, $label= '', $description= '')
Add document model used by doc generator.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
dolibarr_del_const($db, $name, $entity=1)
Effacement d'une constante dans la base de donnees.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0)
On/off button for constant.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin= '1', $morecss= '', $textfordropdown= '')
Show information for admin users or standard users.
Class to manage warehouses.