28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/stock.lib.php';
31require_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');
54if (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"]);
80if (preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg)) {
83 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
90if ($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)) {
101if ($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;
165$form =
new Form($db);
166$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
168llxHeader(
'', $langs->trans(
"StockSetup"));
170$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
171print
load_fiche_titre($langs->trans(
"StockSetup"), $linkback,
'title_setup');
177$form =
new Form($db);
183if (isModEnabled(
'productbatch')) {
185 $langs->load(
"productbatch");
186 $disabled =
' disabled';
189 $descmode = $langs->trans(
'DeStockOnShipmentOnClosing');
190 if (!isModEnabled(
'reception')) {
192 $incmode = $langs->trans(
'ReStockOnDispatchOrder');
195 $incmode = $langs->trans(
'StockOnReceptionOnClosing');
197 print
info_admin($langs->trans(
"WhenProductBatchModuleOnOptionAreForced", $descmode, $incmode));
201print
info_admin($langs->trans(
"IfYouUsePointOfSaleCheckModule"));
205print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
206print
'<input type="hidden" name="token" value="'.newToken().
'">';
207print
'<input type="hidden" name="action" value="warehouse">';
210print
'<div class="div-table-responsive-no-min">';
211print
'<table class="noborder centpercent">';
212print
'<tr class="liste_titre">';
213print
"<td>".$langs->trans(
"RuleForStockManagementDecrease").
"</td>\n";
214print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
219print
'<!-- STOCK_CALCULATE_ON_BILL -->';
220print
'<tr class="oddeven">';
221print
'<td>'.$langs->trans(
"DeStockOnBill").
'</td>';
222print
'<td class="right">';
223if (isModEnabled(
'facture')) {
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>';
237print
"</td>\n</tr>\n";
241print
'<!-- STOCK_CALCULATE_ON_VALIDATE_ORDER -->';
242print
'<tr class="oddeven">';
243print
'<td>'.$langs->trans(
"DeStockOnValidateOrder").
'</td>';
244print
'<td class="right">';
245if (isModEnabled(
'commande')) {
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>';
259print
"</td>\n</tr>\n";
265print
'<!-- STOCK_CALCULATE_ON_SHIPMENT -->';
266print
'<tr class="oddeven">';
267print
'<td>'.$langs->trans(
"DeStockOnShipment").
'</td>';
268print
'<td class="right">';
269if (isModEnabled(
"expedition")) {
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>';
279print
"</td>\n</tr>\n";
282print
'<!-- STOCK_CALCULATE_ON_SHIPMENT_CLOSE -->';
283print
'<tr class="oddeven">';
284print
'<td>'.$langs->trans(
"DeStockOnShipmentOnClosing").
'</td>';
285print
'<td class="right">';
286if (isModEnabled(
"expedition")) {
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>';
296print
"</td>\n</tr>\n";
306print
'<div class="div-table-responsive-no-min">';
307print
'<table class="noborder centpercent">';
308print
'<tr class="liste_titre">';
309print
"<td>".$langs->trans(
"RuleForStockManagementIncrease").
"</td>\n";
310print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
315print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_BILL -->';
316print
'<tr class="oddeven">';
317print
'<td>'.$langs->trans(
"ReStockOnBill").
'</td>';
318print
'<td class="right">';
319if (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) {
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>';
333print
"</td>\n</tr>\n";
337print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER -->';
338print
'<tr class="oddeven">';
339print
'<td>'.$langs->trans(
"ReStockOnValidateOrder").
'</td>';
340print
'<td class="right">';
341if (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) {
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>';
355print
"</td>\n</tr>\n";
358if (isModEnabled(
"reception")) {
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">';
392 if (isModEnabled(
"supplier_order")) {
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";
411print
'<div class="div-table-responsive-no-min">';
412print
'<table class="noborder centpercent">';
413print
'<tr class="liste_titre">';
414print
"<td>".$langs->trans(
"RuleForStockAvailability").
"</td>\n";
415print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
419print
'<tr class="oddeven">';
420print
'<td>'.$langs->trans(
"WarehouseAllowNegativeTransfer").
'</td>';
421print
'<td class="right">';
422if ($conf->use_javascript_ajax) {
423 print ajax_constantonoff(
'STOCK_ALLOW_NEGATIVE_TRANSFER');
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);
432if (isModEnabled(
'facture')) {
433 print
'<tr class="oddeven">';
434 print
'<td>'.$langs->trans(
"StockMustBeEnoughForInvoice").
'</td>';
435 print
'<td class="right">';
436 if ($conf->use_javascript_ajax) {
437 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_INVOICE');
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);
446if (isModEnabled(
'commande')) {
447 print
'<tr class="oddeven">';
448 print
'<td>'.$langs->trans(
"StockMustBeEnoughForOrder").
'</td>';
449 print
'<td class="right">';
450 if ($conf->use_javascript_ajax) {
451 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_ORDER');
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);
460if (isModEnabled(
"expedition")) {
461 print
'<tr class="oddeven">';
462 print
'<td>'.$langs->trans(
"StockMustBeEnoughForShipment").
'</td>';
463 print
'<td class="right">';
464 if ($conf->use_javascript_ajax) {
465 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT');
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;
479if (!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)
484 || isModEnabled(
'mrp')) {
485 $virtualdiffersfromphysical = 1;
488if ($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) {
502 print ajax_constantonoff(
'STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT');
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);
518print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
519print
'<input type="hidden" name="token" value="'.newToken().
'">';
520print
'<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]);
549print
'<div class="div-table-responsive-no-min">';
550print
'<table class="noborder centpercent">'.
"\n";
551print
'<tr class="liste_titre">'.
"\n";
552print
'<td>'.$langs->trans(
"Name").
'</td>';
553print
'<td>'.$langs->trans(
"Description").
'</td>';
554print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
555print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
556print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
557print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
562foreach ($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');
670print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
671print
'<input type="hidden" name="token" value="'.newToken().
'">';
672print
'<input type="hidden" name="action" value="warehouse">';
676print
'<div class="div-table-responsive-no-min">';
677print
'<table class="noborder centpercent">';
679print
'<tr class="liste_titre">';
680print
"<td>".$langs->trans(
"Parameter").
"</td>\n";
681print
'<td class="right">'.$langs->trans(
"Value").
'</td>'.
"\n";
684print
'<tr class="oddeven">';
685print
'<td>'.$langs->trans(
"MainDefaultWarehouse").
'</td>';
686print
'<td class="right">';
687print $formproduct->selectWarehouses(!empty($conf->global->MAIN_DEFAULT_WAREHOUSE) ? $conf->global->MAIN_DEFAULT_WAREHOUSE : -1,
'default_warehouse',
'', 1, 0, 0,
'', 0, 0, array(),
'left reposition');
688print
'<input type="submit" class="button button-edit small" value="'.$langs->trans(
"Modify").
'">';
692print
'<tr class="oddeven">';
693print
'<td>'.$langs->trans(
"UserDefaultWarehouse").
'</td>';
694print
'<td class="right">';
695if ($conf->use_javascript_ajax) {
696 print ajax_constantonoff(
'MAIN_DEFAULT_WAREHOUSE_USER', array(),
null, 0, 0, 1);
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);
704if (!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) {
709 print ajax_constantonoff(
'STOCK_USERSTOCK_AUTOCREATE');
711 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
712 print $form->selectarray(
"STOCK_USERSTOCK_AUTOCREATE", $arrval, $conf->global->STOCK_USERSTOCK_AUTOCREATE);
718print
'<tr class="oddeven">';
719print
'<td>'.$langs->trans(
"WarehouseAskWarehouseOnThirparty").
'</td>';
720print
'<td class="right">';
721if ($conf->use_javascript_ajax) {
722 print ajax_constantonoff(
'SOCIETE_ASK_FOR_WAREHOUSE');
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);
730print
'<tr class="oddeven">';
731print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringPropal").
'</td>';
732print
'<td class="right">';
733if ($conf->use_javascript_ajax) {
734 print ajax_constantonoff(
'WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL');
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);
742print
'<tr class="oddeven">';
743print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringOrder").
'</td>';
744print
'<td class="right">';
745if ($conf->use_javascript_ajax) {
746 print ajax_constantonoff(
'WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
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);
768print
'<tr class="oddeven">';
770print $form->textwithpicto($langs->trans(
"StockSupportServices"), $langs->trans(
"StockSupportServicesDesc"));
772print
'<td class="right">';
773if ($conf->use_javascript_ajax) {
774 print ajax_constantonoff(
'STOCK_SUPPORTS_SERVICES');
776 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
777 print $form->selectarray(
"STOCK_SUPPORTS_SERVICES", $arrval, $conf->global->STOCK_SUPPORTS_SERVICES);
782print
'<tr class="oddeven">';
783print
'<td>'.$langs->trans(
"AllowAddLimitStockByWarehouse").
'</td>';
784print
'<td class="right">';
785if ($conf->use_javascript_ajax) {
786 print ajax_constantonoff(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE');
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);
794print
'<tr class="oddeven">';
795print
'<td>'.$langs->trans(
"AlwaysShowFullArbo").
'</td>';
796print
'<td class="right">';
797if ($conf->use_javascript_ajax) {
798 print ajax_constantonoff(
'STOCK_ALWAYS_SHOW_FULL_ARBO');
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.
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.
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)
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.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db name
Only used if Module[ID]Name translation string is not found.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
stock_admin_prepare_head()
Return array head with list of tabs to view object informations.