30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/stock.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
44$langs->loadLangs(array(
"admin",
"stocks"));
51$action =
GETPOST(
'action',
'aZ09');
52$value =
GETPOST(
'value',
'alpha');
53$modulepart =
GETPOST(
'modulepart',
'aZ09');
54$label =
GETPOST(
'label',
'alpha');
55$scandir =
GETPOST(
'scan_dir',
'alpha');
64include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
68if (preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg)) {
72 if (in_array($code, array(
'STOCK_CALCULATE_ON_BILL',
'STOCK_CALCULATE_ON_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_SHIPMENT',
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE'))) {
78 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'))) {
87 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
94if (preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg)) {
97 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
104if ($action ==
'warehouse') {
105 $value =
GETPOST(
'default_warehouse',
'alpha');
115if ($action ==
'specimen') {
116 $modele =
GETPOST(
'module',
'alpha');
124 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
125 foreach ($dirmodels as $reldir) {
126 $file =
dol_buildpath($reldir.
"core/modules/stock/doc/pdf_".$modele.
".modules.php", 0);
127 if (file_exists($file)) {
128 $classname =
"pdf_".$modele;
133 if ($classname !==
'') {
136 $module =
new $classname($db);
137 '@phan-var-force ModelePDFStock $module';
139 if ($module->write_file(
$object, $langs) > 0) {
140 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=stock&file=SPECIMEN.pdf");
148 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
150} elseif ($action ==
'set') {
153} elseif ($action ==
'del') {
160} elseif ($action ==
'setdoc') {
165 $conf->global->STOCK_ADDON_PDF = $value;
180$form =
new Form($db);
181$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
183llxHeader(
'', $langs->trans(
"StockSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-stock');
185$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
186print
load_fiche_titre($langs->trans(
"StockSetup"), $linkback,
'title_setup');
192$form =
new Form($db);
198if (isModEnabled(
'productbatch')) {
200 $langs->load(
"productbatch");
201 $disabled =
' disabled';
204 $descmode = $langs->trans(
'DeStockOnShipmentOnClosing');
205 if (!isModEnabled(
'reception')) {
207 $incmode = $langs->trans(
'ReStockOnDispatchOrder');
210 $incmode = $langs->trans(
'StockOnReceptionOnClosing');
212 print
info_admin($langs->transnoentitiesnoconv(
"WhenProductBatchModuleOnOptionAreForced", $descmode, $incmode));
216print
info_admin($langs->trans(
"IfYouUsePointOfSaleCheckModule"));
220print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
221print
'<input type="hidden" name="token" value="'.newToken().
'">';
222print
'<input type="hidden" name="action" value="warehouse">';
225print
'<div class="div-table-responsive-no-min">';
226print
'<table class="noborder centpercent">';
227print
'<tr class="liste_titre">';
228print
"<td>".$langs->trans(
"RuleForStockManagementDecrease").
"</td>\n";
229print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
234print
'<!-- STOCK_CALCULATE_ON_BILL -->';
235print
'<tr class="oddeven">';
236print
'<td>'.$langs->trans(
"DeStockOnBill").
'</td>';
237print
'<td class="right">';
238if (isModEnabled(
'invoice')) {
239 if (
$conf->use_javascript_ajax) {
241 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
243 print ajax_constantonoff(
'STOCK_CALCULATE_ON_BILL', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
246 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
247 print $form->selectarray(
"STOCK_CALCULATE_ON_BILL", $arrval,
$conf->global->STOCK_CALCULATE_ON_BILL);
250 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module30Name")).
'</span>';
252print
"</td>\n</tr>\n";
256print
'<!-- STOCK_CALCULATE_ON_VALIDATE_ORDER -->';
257print
'<tr class="oddeven">';
258print
'<td>'.$langs->trans(
"DeStockOnValidateOrder").
'</td>';
259print
'<td class="right">';
260if (isModEnabled(
'order')) {
261 if (
$conf->use_javascript_ajax) {
263 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
265 print ajax_constantonoff(
'STOCK_CALCULATE_ON_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
268 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
269 print $form->selectarray(
"STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval,
$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER);
272 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module25Name")).
'</span>';
274print
"</td>\n</tr>\n";
280print
'<!-- STOCK_CALCULATE_ON_SHIPMENT -->';
281print
'<tr class="oddeven">';
282print
'<td>'.$langs->trans(
"DeStockOnShipment").
'</td>';
283print
'<td class="right">';
284if (isModEnabled(
"shipping")) {
285 if (
$conf->use_javascript_ajax) {
286 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
288 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
289 print $form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT", $arrval,
$conf->global->STOCK_CALCULATE_ON_SHIPMENT);
292 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name")).
'</span>';
294print
"</td>\n</tr>\n";
297print
'<!-- STOCK_CALCULATE_ON_SHIPMENT_CLOSE -->';
298print
'<tr class="oddeven">';
299print
'<td>'.$langs->trans(
"DeStockOnShipmentOnClosing").
'</td>';
300print
'<td class="right">';
301if (isModEnabled(
"shipping")) {
302 if (
$conf->use_javascript_ajax) {
303 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
305 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
306 print $form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE'));
309 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name")).
'</span>';
311print
"</td>\n</tr>\n";
321print
'<div class="div-table-responsive-no-min">';
322print
'<table class="noborder centpercent">';
323print
'<tr class="liste_titre">';
324print
"<td>".$langs->trans(
"RuleForStockManagementIncrease").
"</td>\n";
325print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
330print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_BILL -->';
331print
'<tr class="oddeven">';
332print
'<td>'.$langs->trans(
"ReStockOnBill").
'</td>';
333print
'<td class="right">';
334if (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) {
335 if (
$conf->use_javascript_ajax) {
337 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
339 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_BILL', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
342 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
343 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval,
$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL);
346 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
348print
"</td>\n</tr>\n";
352print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER -->';
353print
'<tr class="oddeven">';
354print
'<td>'.$langs->trans(
"ReStockOnValidateOrder").
'</td>';
355print
'<td class="right">';
356if (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) {
357 if (
$conf->use_javascript_ajax) {
359 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
361 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
364 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
365 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval,
$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER);
368 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
370print
"</td>\n</tr>\n";
373if (isModEnabled(
"reception")) {
374 print
'<!-- STOCK_CALCULATE_ON_RECEPTION_CLOSE -->';
375 print
'<tr class="oddeven">';
376 print
'<td>'.$langs->trans(
"StockOnReception").
'</td>';
377 print
'<td class="right">';
379 if (
$conf->use_javascript_ajax) {
380 print ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
382 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
383 print $form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION", $arrval,
$conf->global->STOCK_CALCULATE_ON_RECEPTION);
386 print
"</td>\n</tr>\n";
390 print
'<tr class="oddeven">';
391 print
'<td>'.$langs->trans(
"StockOnReceptionOnClosing").
'</td>';
392 print
'<td class="right">';
394 if (
$conf->use_javascript_ajax) {
395 print ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION_CLOSE', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
397 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
398 print $form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval,
$conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE);
400 print
"</td>\n</tr>\n";
403 print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER -->';
404 print
'<tr class="oddeven">';
405 print
'<td>'.$langs->trans(
"ReStockOnDispatchOrder").
'</td>';
406 print
'<td class="right">';
407 if (isModEnabled(
"supplier_order")) {
408 if (
$conf->use_javascript_ajax) {
409 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'reposition');
411 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
412 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval,
$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER);
415 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
417 print
"</td>\n</tr>\n";
426print
'<div class="div-table-responsive-no-min">';
427print
'<table class="noborder centpercent">';
428print
'<tr class="liste_titre">';
429print
"<td>".$langs->trans(
"RuleForStockAvailability").
"</td>\n";
430print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
434print
'<tr class="oddeven">';
435print
'<td>'.$langs->trans(
"WarehouseAllowNegativeTransfer").
'</td>';
436print
'<td class="right">';
437if (
$conf->use_javascript_ajax) {
438 print ajax_constantonoff(
'STOCK_ALLOW_NEGATIVE_TRANSFER');
440 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
441 print $form->selectarray(
"STOCK_ALLOW_NEGATIVE_TRANSFER", $arrval,
$conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER);
447if (isModEnabled(
'invoice')) {
448 print
'<tr class="oddeven">';
449 print
'<td>'.$langs->trans(
"StockMustBeEnoughForInvoice").
'</td>';
450 print
'<td class="right">';
451 if (
$conf->use_javascript_ajax) {
452 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_INVOICE');
454 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
455 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval,
$conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE);
461if (isModEnabled(
'order')) {
462 print
'<tr class="oddeven">';
463 print
'<td>'.$langs->trans(
"StockMustBeEnoughForOrder").
'</td>';
464 print
'<td class="right">';
465 if (
$conf->use_javascript_ajax) {
466 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_ORDER');
468 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
469 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval,
$conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER);
475if (isModEnabled(
"shipping")) {
476 print
'<tr class="oddeven">';
477 print
'<td>'.$langs->trans(
"StockMustBeEnoughForShipment").
'</td>';
478 print
'<td class="right">';
479 if (
$conf->use_javascript_ajax) {
480 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT');
482 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
483 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval,
$conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT);
493$virtualdiffersfromphysical = 0;
499 || isModEnabled(
'mrp')) {
500 $virtualdiffersfromphysical = 1;
503if ($virtualdiffersfromphysical) {
504 print
'<div class="div-table-responsive-no-min">';
505 print
'<table class="noborder centpercent">';
506 print
'<tr class="liste_titre">';
507 print
"<td>".$langs->trans(
"RuleForStockReplenishment").
" ".
img_help(1, $langs->trans(
"VirtualDiffersFromPhysical")).
"</td>\n";
508 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
511 print
'<tr class="oddeven">';
513 print $form->textwithpicto($langs->trans(
"UseRealStockByDefault"), $langs->trans(
"ReplenishmentCalculation"));
515 print
'<td class="right">';
516 if (
$conf->use_javascript_ajax) {
517 print ajax_constantonoff(
'STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT');
519 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
520 print $form->selectarray(
"STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT", $arrval,
$conf->global->STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT);
533print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
534print
'<input type="hidden" name="token" value="'.newToken().
'">';
535print
'<input type="hidden" name="action" value="warehouse">';
547$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
548$sql .=
" WHERE type = '".$db->escape($type).
"'";
549$sql .=
" AND entity = ".$conf->entity;
550$resql = $db->query($sql);
553 $num_rows = $db->num_rows($resql);
554 while ($i < $num_rows) {
555 $array = $db->fetch_array($resql);
556 if (is_array($array)) {
557 array_push($def, $array[0]);
566print
'<div class="div-table-responsive-no-min">';
567print
'<table class="noborder centpercent">'.
"\n";
568print
'<tr class="liste_titre">'.
"\n";
569print
'<td>'.$langs->trans(
"Name").
'</td>';
570print
'<td>'.$langs->trans(
"Description").
'</td>';
571print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
572print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
573print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
574print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
579foreach ($dirmodels as $reldir) {
580 foreach (array(
'',
'/doc') as $valdir) {
581 $realpath = $reldir.
"core/modules/stock".$valdir;
585 $handle = opendir($dir);
586 if (is_resource($handle)) {
588 while (($file = readdir($handle)) !==
false) {
594 foreach ($filelist as $file) {
595 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
596 if (file_exists($dir.
'/'.$file)) {
597 $name = substr($file, 4,
dol_strlen($file) - 16);
598 $classname = substr($file, 0,
dol_strlen($file) - 12);
600 require_once $dir.
'/'.$file;
601 $module =
new $classname($db);
602 '@phan-var-force ModelePDFStock $module';
604 $modulequalified = 1;
605 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
606 $modulequalified = 0;
608 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
609 $modulequalified = 0;
612 if ($modulequalified) {
613 print
'<tr class="oddeven"><td width="100">';
614 print(empty($module->name) ? $name : $module->
name);
616 if (method_exists($module,
'info')) {
617 print $module->info($langs);
619 print $module->description;
624 if (in_array($name, $def)) {
625 print
'<td class="center">'.
"\n";
626 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.
newToken().
'&value='.urlencode($name).
'">';
627 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
631 print
'<td class="center">'.
"\n";
632 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>';
637 print
'<td class="center">';
639 print
img_picto($langs->trans(
"Default"),
'on');
641 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>';
646 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
647 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
648 if ($module->type ==
'pdf') {
649 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
651 $htmltooltip .=
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//',
'', $realpath).
'/'.$file;
653 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
654 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
655 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
658 print
'<td class="center">';
659 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
663 print
'<td class="center">';
664 if ($module->type ==
'pdf') {
665 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
667 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
689print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
690print
'<input type="hidden" name="token" value="'.newToken().
'">';
691print
'<input type="hidden" name="action" value="warehouse">';
695print
'<div class="div-table-responsive-no-min">';
696print
'<table class="noborder centpercent">';
698print
'<tr class="liste_titre">';
699print
"<td>".$langs->trans(
"Parameter").
"</td>\n";
700print
'<td class="right">'.$langs->trans(
"Value").
'</td>'.
"\n";
703print
'<tr class="oddeven">';
704print
'<td>'.$langs->trans(
"MainDefaultWarehouse").
'</td>';
705print
'<td class="right">';
706print $formproduct->selectWarehouses(
getDolGlobalString(
'MAIN_DEFAULT_WAREHOUSE') ?
$conf->global->MAIN_DEFAULT_WAREHOUSE : -1,
'default_warehouse',
'', 1, 0, 0,
'', 0, 0, array(),
'left reposition');
707print
'<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'">';
711print
'<tr class="oddeven">';
712print
'<td>'.$langs->trans(
"UserDefaultWarehouse").
'</td>';
713print
'<td class="right">';
714if (
$conf->use_javascript_ajax) {
715 print ajax_constantonoff(
'MAIN_DEFAULT_WAREHOUSE_USER', array(),
null, 0, 0, 1);
717 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
718 print $form->selectarray(
"MAIN_DEFAULT_WAREHOUSE_USER", $arrval,
$conf->global->MAIN_DEFAULT_WAREHOUSE_USER);
724 print
'<tr class="oddeven">';
725 print
'<td>'.$langs->trans(
"UserWarehouseAutoCreate").
'</td>';
726 print
'<td class="right">';
727 if (
$conf->use_javascript_ajax) {
728 print ajax_constantonoff(
'STOCK_USERSTOCK_AUTOCREATE');
730 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
731 print $form->selectarray(
"STOCK_USERSTOCK_AUTOCREATE", $arrval,
$conf->global->STOCK_USERSTOCK_AUTOCREATE);
737print
'<tr class="oddeven">';
738print
'<td>'.$langs->trans(
"WarehouseAskWarehouseOnThirparty").
'</td>';
739print
'<td class="right">';
740if (
$conf->use_javascript_ajax) {
741 print ajax_constantonoff(
'SOCIETE_ASK_FOR_WAREHOUSE');
743 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
744 print $form->selectarray(
"SOCIETE_ASK_FOR_WAREHOUSE", $arrval,
$conf->global->SOCIETE_ASK_FOR_WAREHOUSE);
749print
'<tr class="oddeven">';
750print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringPropal").
'</td>';
751print
'<td class="right">';
752if (
$conf->use_javascript_ajax) {
753 print ajax_constantonoff(
'WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL');
755 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
756 print $form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval,
$conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL);
761print
'<tr class="oddeven">';
762print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringOrder").
'</td>';
763print
'<td class="right">';
764if (
$conf->use_javascript_ajax) {
765 print ajax_constantonoff(
'WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
767 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
768 print $form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval,
$conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER);
787print
'<tr class="oddeven">';
789print $form->textwithpicto($langs->trans(
"StockSupportServices"), $langs->trans(
"StockSupportServicesDesc"));
791print
'<td class="right">';
792if (
$conf->use_javascript_ajax) {
793 print ajax_constantonoff(
'STOCK_SUPPORTS_SERVICES');
795 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
796 print $form->selectarray(
"STOCK_SUPPORTS_SERVICES", $arrval,
getDolGlobalString(
'STOCK_SUPPORTS_SERVICES'));
802print
'<tr class="oddeven">';
803print
'<td>'.$langs->trans(
"AllowAddLimitStockByWarehouse").
'</td>';
804print
'<td class="right">';
805if (
$conf->use_javascript_ajax) {
806 print ajax_constantonoff(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE');
808 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
809 print $form->selectarray(
"STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE", $arrval,
$conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE);
814print
'<tr class="oddeven">';
815print
'<td>'.$langs->trans(
"AlwaysShowFullArbo").
'</td>';
816print
'<td class="right">';
817if (
$conf->use_javascript_ajax) {
818 print ajax_constantonoff(
'STOCK_ALWAYS_SHOW_FULL_ARBO');
820 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
821 print $form->selectarray(
"STOCK_ALWAYS_SHOW_FULL_ARBO", $arrval,
$conf->global->STOCK_ALWAYS_SHOW_FULL_ARBO);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage warehouses.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_help($usehelpcursor=1, $usealttitle=1)
Show help logo with cursor "?".
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
$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 information.