2006-12-04 12:17:24 +01:00
|
|
|
<?php
|
2009-04-27 22:37:50 +02:00
|
|
|
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2010-05-28 22:41:41 +02:00
|
|
|
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
2018-10-27 14:43:12 +02:00
|
|
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
2013-08-20 16:50:33 +02:00
|
|
|
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
2018-05-11 22:31:17 +02:00
|
|
|
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
2013-08-20 16:50:33 +02:00
|
|
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
2025-02-08 01:49:29 +01:00
|
|
|
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
2024-04-27 22:01:34 +02:00
|
|
|
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
2006-12-04 12:17:24 +01:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2013-01-16 15:36:08 +01:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2006-12-04 12:17:24 +01:00
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2019-09-23 21:55:30 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2006-12-04 12:17:24 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2009-11-18 00:05:00 +01:00
|
|
|
* \file htdocs/admin/stock.php
|
|
|
|
|
* \ingroup stock
|
2020-09-24 17:08:31 +02:00
|
|
|
* \brief Page to setup module stock
|
2008-10-23 23:54:30 +02:00
|
|
|
*/
|
2012-08-22 23:24:21 +02:00
|
|
|
require '../main.inc.php';
|
2012-08-22 23:11:24 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
2019-06-03 15:44:17 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php';
|
2020-05-06 00:48:00 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
2020-05-06 00:57:11 +02:00
|
|
|
|
2024-11-04 23:53:20 +01:00
|
|
|
/**
|
|
|
|
|
* @var Conf $conf
|
|
|
|
|
* @var DoliDB $db
|
|
|
|
|
* @var HookManager $hookmanager
|
|
|
|
|
* @var Translate $langs
|
|
|
|
|
* @var User $user
|
|
|
|
|
*/
|
|
|
|
|
|
2018-05-26 18:52:14 +02:00
|
|
|
// Load translation files required by the page
|
2018-05-11 22:31:17 +02:00
|
|
|
$langs->loadLangs(array("admin", "stocks"));
|
2006-12-04 12:17:24 +01:00
|
|
|
|
2024-02-09 15:58:49 +01:00
|
|
|
// Security check
|
2021-02-26 22:04:03 +01:00
|
|
|
if (!$user->admin) {
|
|
|
|
|
accessforbidden();
|
|
|
|
|
}
|
2006-12-04 12:17:24 +01:00
|
|
|
|
2020-09-16 19:39:50 +02:00
|
|
|
$action = GETPOST('action', 'aZ09');
|
2020-08-18 14:02:36 +02:00
|
|
|
$value = GETPOST('value', 'alpha');
|
2024-02-07 19:36:48 +01:00
|
|
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
2020-08-18 14:02:36 +02:00
|
|
|
$label = GETPOST('label', 'alpha');
|
|
|
|
|
$scandir = GETPOST('scan_dir', 'alpha');
|
|
|
|
|
$type = 'stock';
|
2025-02-19 14:10:49 +01:00
|
|
|
$page_y = GETPOST('page_y');
|
2011-09-02 16:31:53 +02:00
|
|
|
|
2008-10-24 22:16:36 +02:00
|
|
|
|
2006-12-06 00:08:59 +01:00
|
|
|
/*
|
2018-12-30 19:07:21 +01:00
|
|
|
* Action
|
2008-10-23 23:54:30 +02:00
|
|
|
*/
|
2024-11-10 11:16:23 +01:00
|
|
|
$error = 0;
|
|
|
|
|
|
2024-02-07 19:36:48 +01:00
|
|
|
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
2020-05-28 19:10:06 +02:00
|
|
|
|
2020-08-18 15:27:17 +02:00
|
|
|
$reg = array();
|
2020-08-18 14:02:36 +02:00
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
|
2020-09-07 10:18:17 +02:00
|
|
|
$code = $reg[1];
|
|
|
|
|
|
|
|
|
|
// If constant is for a unique choice, delete other choices
|
|
|
|
|
if (in_array($code, array('STOCK_CALCULATE_ON_BILL', 'STOCK_CALCULATE_ON_VALIDATE_ORDER', 'STOCK_CALCULATE_ON_SHIPMENT', 'STOCK_CALCULATE_ON_SHIPMENT_CLOSE'))) {
|
|
|
|
|
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_BILL', $conf->entity);
|
|
|
|
|
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_VALIDATE_ORDER', $conf->entity);
|
|
|
|
|
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_SHIPMENT', $conf->entity);
|
|
|
|
|
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_SHIPMENT_CLOSE', $conf->entity);
|
|
|
|
|
}
|
|
|
|
|
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'))) {
|
|
|
|
|
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_SUPPLIER_BILL', $conf->entity);
|
|
|
|
|
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', $conf->entity);
|
|
|
|
|
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_RECEPTION', $conf->entity);
|
|
|
|
|
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_RECEPTION_CLOSE', $conf->entity);
|
|
|
|
|
dolibarr_del_const($db, 'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', $conf->entity);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) {
|
2025-02-19 14:10:49 +01:00
|
|
|
header("Location: ".$_SERVER["PHP_SELF"].($page_y ? '?page_y='.$page_y : ''));
|
2020-09-07 10:18:17 +02:00
|
|
|
exit;
|
|
|
|
|
} else {
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
2011-09-02 16:31:53 +02:00
|
|
|
}
|
2006-12-06 00:08:59 +01:00
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
|
2020-09-07 10:18:17 +02:00
|
|
|
$code = $reg[1];
|
2021-02-26 22:04:03 +01:00
|
|
|
if (dolibarr_del_const($db, $code, $conf->entity) > 0) {
|
2025-02-19 14:10:49 +01:00
|
|
|
header("Location: ".$_SERVER["PHP_SELF"].($page_y ? '?page_y='.$page_y : ''));
|
2020-09-07 10:18:17 +02:00
|
|
|
exit;
|
|
|
|
|
} else {
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
2018-12-30 19:07:21 +01:00
|
|
|
}
|
2013-06-10 15:42:58 +02:00
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
if ($action == 'warehouse') {
|
2020-05-06 00:48:00 +02:00
|
|
|
$value = GETPOST('default_warehouse', 'alpha');
|
|
|
|
|
$res = dolibarr_set_const($db, "MAIN_DEFAULT_WAREHOUSE", $value, 'chaine', 0, '', $conf->entity);
|
2023-10-24 17:00:13 +02:00
|
|
|
if ($value == -1 || empty($value) && getDolGlobalString('MAIN_DEFAULT_WAREHOUSE')) {
|
2020-05-06 00:48:00 +02:00
|
|
|
$res = dolibarr_del_const($db, "MAIN_DEFAULT_WAREHOUSE", $conf->entity);
|
|
|
|
|
}
|
2021-02-26 22:04:03 +01:00
|
|
|
if (!($res > 0)) {
|
|
|
|
|
$error++;
|
|
|
|
|
}
|
2020-05-06 00:48:00 +02:00
|
|
|
}
|
|
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
if ($action == 'specimen') {
|
2020-08-18 14:02:36 +02:00
|
|
|
$modele = GETPOST('module', 'alpha');
|
|
|
|
|
|
|
|
|
|
$object = new Entrepot($db);
|
|
|
|
|
$object->initAsSpecimen();
|
|
|
|
|
|
|
|
|
|
// Search template files
|
2023-12-04 11:41:14 +01:00
|
|
|
$file = '';
|
|
|
|
|
$classname = '';
|
2020-08-18 14:02:36 +02:00
|
|
|
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
2021-02-26 22:04:03 +01:00
|
|
|
foreach ($dirmodels as $reldir) {
|
2020-08-18 14:02:36 +02:00
|
|
|
$file = dol_buildpath($reldir."core/modules/stock/doc/pdf_".$modele.".modules.php", 0);
|
2021-02-26 22:04:03 +01:00
|
|
|
if (file_exists($file)) {
|
2020-08-18 14:02:36 +02:00
|
|
|
$classname = "pdf_".$modele;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-12 16:16:07 +01:00
|
|
|
if ($classname !== '') {
|
2020-08-18 14:02:36 +02:00
|
|
|
require_once $file;
|
|
|
|
|
|
|
|
|
|
$module = new $classname($db);
|
2024-08-19 02:05:27 +02:00
|
|
|
'@phan-var-force ModelePDFStock $module';
|
2020-08-18 14:02:36 +02:00
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
if ($module->write_file($object, $langs) > 0) {
|
2020-08-18 14:02:36 +02:00
|
|
|
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=stock&file=SPECIMEN.pdf");
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
setEventMessages($module->error, null, 'errors');
|
|
|
|
|
dol_syslog($module->error, LOG_ERR);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
|
|
|
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
|
|
|
|
}
|
2021-02-26 22:04:03 +01:00
|
|
|
} elseif ($action == 'set') {
|
|
|
|
|
// Activate a model
|
2020-08-18 14:02:36 +02:00
|
|
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
|
|
|
|
} elseif ($action == 'del') {
|
|
|
|
|
$ret = delDocumentModel($value, $type);
|
2021-02-26 22:04:03 +01:00
|
|
|
if ($ret > 0) {
|
2024-04-29 20:15:38 +02:00
|
|
|
if (getDolGlobalString('STOCK_ADDON_PDF') == "$value") {
|
2021-02-26 22:04:03 +01:00
|
|
|
dolibarr_del_const($db, 'STOCK_ADDON_PDF', $conf->entity);
|
|
|
|
|
}
|
2020-08-18 14:02:36 +02:00
|
|
|
}
|
2021-02-26 22:04:03 +01:00
|
|
|
} elseif ($action == 'setdoc') {
|
|
|
|
|
// Set default model
|
|
|
|
|
if (dolibarr_set_const($db, "STOCK_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
|
2020-08-18 14:02:36 +02:00
|
|
|
// The constant that was read before the new set
|
|
|
|
|
// We therefore requires a variable to have a coherent view
|
|
|
|
|
$conf->global->STOCK_ADDON_PDF = $value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// On active le modele
|
|
|
|
|
$ret = delDocumentModel($value, $type);
|
2021-02-26 22:04:03 +01:00
|
|
|
if ($ret > 0) {
|
2020-08-18 14:02:36 +02:00
|
|
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-28 19:10:06 +02:00
|
|
|
|
2006-12-04 12:17:24 +01:00
|
|
|
/*
|
2008-07-26 14:10:24 +02:00
|
|
|
* View
|
2006-12-04 12:17:24 +01:00
|
|
|
*/
|
2008-07-26 14:10:24 +02:00
|
|
|
|
2020-08-18 14:02:36 +02:00
|
|
|
$form = new Form($db);
|
|
|
|
|
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
|
|
|
|
|
2024-06-08 17:03:08 +02:00
|
|
|
llxHeader('', $langs->trans("StockSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-stock');
|
2006-12-04 12:17:24 +01:00
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
2019-01-27 11:55:16 +01:00
|
|
|
print load_fiche_titre($langs->trans("StockSetup"), $linkback, 'title_setup');
|
2013-03-22 17:10:17 +01:00
|
|
|
|
2019-06-03 15:44:17 +02:00
|
|
|
$head = stock_admin_prepare_head();
|
|
|
|
|
|
2020-10-22 22:50:03 +02:00
|
|
|
print dol_get_fiche_head($head, 'general', $langs->trans("StockSetup"), -1, 'stock');
|
2019-06-03 15:44:17 +02:00
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$form = new Form($db);
|
2020-05-06 00:48:00 +02:00
|
|
|
$formproduct = new FormProduct($db);
|
|
|
|
|
|
2008-07-26 14:10:24 +02:00
|
|
|
|
2006-12-04 12:17:24 +01:00
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$disabled = '';
|
2022-08-31 21:55:55 +02:00
|
|
|
if (isModEnabled('productbatch')) {
|
2023-04-10 13:03:09 +02:00
|
|
|
// If module lot/serial enabled, we force the inc/dec mode to STOCK_CALCULATE_ON_SHIPMENT_CLOSE and STOCK_CALCULATE_ON_RECEPTION_CLOSE
|
2014-12-05 16:01:01 +01:00
|
|
|
$langs->load("productbatch");
|
2020-04-10 10:59:32 +02:00
|
|
|
$disabled = ' disabled';
|
2023-04-10 13:03:09 +02:00
|
|
|
|
|
|
|
|
// STOCK_CALCULATE_ON_SHIPMENT_CLOSE
|
|
|
|
|
$descmode = $langs->trans('DeStockOnShipmentOnClosing');
|
|
|
|
|
if (!isModEnabled('reception')) {
|
|
|
|
|
// STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER
|
|
|
|
|
$incmode = $langs->trans('ReStockOnDispatchOrder');
|
|
|
|
|
} else {
|
|
|
|
|
// STOCK_CALCULATE_ON_RECEPTION_CLOSE
|
|
|
|
|
$incmode = $langs->trans('StockOnReceptionOnClosing');
|
|
|
|
|
}
|
2024-02-07 20:20:53 +01:00
|
|
|
print info_admin($langs->transnoentitiesnoconv("WhenProductBatchModuleOnOptionAreForced", $descmode, $incmode));
|
2014-12-05 16:01:01 +01:00
|
|
|
}
|
2010-07-11 21:29:18 +02:00
|
|
|
|
2023-04-10 13:03:09 +02:00
|
|
|
|
2014-12-05 16:01:01 +01:00
|
|
|
print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule"));
|
2017-05-06 17:08:38 +02:00
|
|
|
print '<br>';
|
2008-07-26 14:10:24 +02:00
|
|
|
|
2020-05-28 19:10:06 +02:00
|
|
|
|
|
|
|
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
|
|
|
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
|
|
|
|
print '<input type="hidden" name="action" value="warehouse">';
|
2025-02-19 14:10:49 +01:00
|
|
|
print '<input type="hidden" name="page_y" value="">';
|
2020-05-28 19:10:06 +02:00
|
|
|
|
2008-10-23 23:54:30 +02:00
|
|
|
// Title rule for stock decrease
|
2024-01-11 09:59:52 +01:00
|
|
|
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
2019-11-05 21:24:41 +01:00
|
|
|
print '<table class="noborder centpercent">';
|
2008-07-26 14:10:24 +02:00
|
|
|
print '<tr class="liste_titre">';
|
2018-12-30 19:07:21 +01:00
|
|
|
print "<td>".$langs->trans("RuleForStockManagementDecrease")."</td>\n";
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">'.$langs->trans("Status").'</td>'."\n";
|
2008-07-26 14:10:24 +02:00
|
|
|
print '</tr>'."\n";
|
|
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$found = 0;
|
2015-02-28 19:37:44 +01:00
|
|
|
|
2023-09-13 01:39:57 +02:00
|
|
|
print '<!-- STOCK_CALCULATE_ON_BILL -->';
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<td>'.$langs->trans("DeStockOnBill").'</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">';
|
2024-02-27 15:30:37 +01:00
|
|
|
if (isModEnabled('invoice')) {
|
2020-09-07 10:18:17 +02:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2022-11-26 12:11:31 +01:00
|
|
|
if ($disabled) {
|
|
|
|
|
print img_picto($langs->trans("Disabled"), 'off', 'class="opacitymedium"');
|
|
|
|
|
} else {
|
|
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_BILL', array(), null, 0, 0, 0, 2, 1, 0, '', '', 'reposition');
|
|
|
|
|
}
|
2020-09-07 10:18:17 +02:00
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2025-02-19 14:10:49 +01:00
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, getDolGlobalString('STOCK_CALCULATE_ON_BILL'));
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
2020-05-21 09:35:30 +02:00
|
|
|
} else {
|
2023-04-10 12:31:31 +02:00
|
|
|
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
|
2007-11-10 22:34:46 +01:00
|
|
|
}
|
2015-10-27 19:18:22 +01:00
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
2006-12-04 12:17:24 +01:00
|
|
|
|
2017-04-14 11:22:48 +02:00
|
|
|
|
2023-09-13 01:39:57 +02:00
|
|
|
print '<!-- STOCK_CALCULATE_ON_VALIDATE_ORDER -->';
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<td>'.$langs->trans("DeStockOnValidateOrder").'</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">';
|
2024-02-27 15:30:37 +01:00
|
|
|
if (isModEnabled('order')) {
|
2020-09-07 10:18:17 +02:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2022-11-26 12:11:31 +01:00
|
|
|
if ($disabled) {
|
|
|
|
|
print img_picto($langs->trans("Disabled"), 'off', 'class="opacitymedium"');
|
|
|
|
|
} else {
|
2025-02-19 14:10:49 +01:00
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1, 0, '', '', 'reposition');
|
2022-11-26 12:11:31 +01:00
|
|
|
}
|
2020-09-07 10:18:17 +02:00
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2025-02-19 14:10:49 +01:00
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER'));
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
2020-05-21 09:35:30 +02:00
|
|
|
} else {
|
2023-04-10 12:31:31 +02:00
|
|
|
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module25Name")).'</span>';
|
2015-10-27 19:18:22 +01:00
|
|
|
}
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
2007-03-22 18:27:21 +01:00
|
|
|
|
2024-05-03 19:29:54 +02:00
|
|
|
//if (isModEnabled('shipping'))
|
2015-10-27 19:18:22 +01:00
|
|
|
//{
|
2017-04-14 11:22:48 +02:00
|
|
|
|
2023-09-13 01:39:57 +02:00
|
|
|
print '<!-- STOCK_CALCULATE_ON_SHIPMENT -->';
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<td>'.$langs->trans("DeStockOnShipment").'</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">';
|
2024-03-12 11:07:18 +01:00
|
|
|
if (isModEnabled("shipping")) {
|
2020-09-07 10:18:17 +02:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2025-02-19 14:10:49 +01:00
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT', array(), null, 0, 0, 0, 2, 1, 0, '', '', 'reposition');
|
2020-09-07 10:18:17 +02:00
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2025-02-19 14:10:49 +01:00
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT'));
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
2020-05-21 09:35:30 +02:00
|
|
|
} else {
|
2023-04-10 12:31:31 +02:00
|
|
|
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name")).'</span>';
|
2015-10-27 19:18:22 +01:00
|
|
|
}
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
2015-02-28 19:37:44 +01:00
|
|
|
|
2023-09-13 01:39:57 +02:00
|
|
|
print '<!-- STOCK_CALCULATE_ON_SHIPMENT_CLOSE -->';
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<td>'.$langs->trans("DeStockOnShipmentOnClosing").'</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">';
|
2024-03-12 11:07:18 +01:00
|
|
|
if (isModEnabled("shipping")) {
|
2020-09-07 10:18:17 +02:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2025-02-19 14:10:49 +01:00
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(), null, 0, 0, 0, 2, 1, 0, '', '', 'reposition');
|
2020-09-07 10:18:17 +02:00
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2024-03-24 14:19:44 +01:00
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE'));
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
2020-05-21 09:35:30 +02:00
|
|
|
} else {
|
2023-04-10 12:31:31 +02:00
|
|
|
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name")).'</span>';
|
2016-04-25 18:33:39 +02:00
|
|
|
}
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
|
|
|
|
|
2013-03-22 17:10:17 +01:00
|
|
|
print '</table>';
|
2023-07-19 01:37:50 +02:00
|
|
|
print '</div>';
|
2020-08-18 15:27:17 +02:00
|
|
|
|
2013-03-22 17:10:17 +01:00
|
|
|
print '<br>';
|
2008-10-23 23:54:30 +02:00
|
|
|
|
2020-08-18 15:27:17 +02:00
|
|
|
|
2008-10-23 23:54:30 +02:00
|
|
|
// Title rule for stock increase
|
2024-01-11 09:59:52 +01:00
|
|
|
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
2019-11-05 21:24:41 +01:00
|
|
|
print '<table class="noborder centpercent">';
|
2008-10-23 23:54:30 +02:00
|
|
|
print '<tr class="liste_titre">';
|
2018-12-30 19:07:21 +01:00
|
|
|
print "<td>".$langs->trans("RuleForStockManagementIncrease")."</td>\n";
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">'.$langs->trans("Status").'</td>'."\n";
|
2008-10-23 23:54:30 +02:00
|
|
|
print '</tr>'."\n";
|
|
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$found = 0;
|
2015-02-28 19:37:44 +01:00
|
|
|
|
2023-09-13 01:39:57 +02:00
|
|
|
print '<!-- STOCK_CALCULATE_ON_SUPPLIER_BILL -->';
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<td>'.$langs->trans("ReStockOnBill").'</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">';
|
2023-04-18 16:15:13 +02:00
|
|
|
if (isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
|
2020-09-07 10:18:17 +02:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2022-11-26 12:11:31 +01:00
|
|
|
if ($disabled) {
|
|
|
|
|
print img_picto($langs->trans("Disabled"), 'off', 'class="opacitymedium"');
|
|
|
|
|
} else {
|
2025-02-19 14:10:49 +01:00
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL', array(), null, 0, 0, 0, 2, 1, 0, '', '', 'reposition');
|
2022-11-26 12:11:31 +01:00
|
|
|
}
|
2020-09-07 10:18:17 +02:00
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2025-02-19 14:10:49 +01:00
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_BILL'));
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
2020-05-21 09:35:30 +02:00
|
|
|
} else {
|
2023-04-10 12:31:31 +02:00
|
|
|
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")).'</span>';
|
2015-10-27 19:18:22 +01:00
|
|
|
}
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
|
|
|
|
|
2008-10-23 23:54:30 +02:00
|
|
|
|
2023-09-13 01:39:57 +02:00
|
|
|
print '<!-- STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER -->';
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<td>'.$langs->trans("ReStockOnValidateOrder").'</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">';
|
2023-04-18 16:15:13 +02:00
|
|
|
if (isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
|
2020-09-07 10:18:17 +02:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2022-11-26 12:11:31 +01:00
|
|
|
if ($disabled) {
|
|
|
|
|
print img_picto($langs->trans("Disabled"), 'off', 'class="opacitymedium"');
|
|
|
|
|
} else {
|
2025-02-19 14:10:49 +01:00
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1, 0, '', '', 'reposition');
|
2022-11-26 12:11:31 +01:00
|
|
|
}
|
2020-09-07 10:18:17 +02:00
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2025-02-19 14:10:49 +01:00
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER'));
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
2020-05-21 09:35:30 +02:00
|
|
|
} else {
|
2023-04-10 12:31:31 +02:00
|
|
|
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")).'</span>';
|
2015-10-27 19:18:22 +01:00
|
|
|
}
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
|
|
|
|
|
2022-08-23 20:01:34 +02:00
|
|
|
if (isModEnabled("reception")) {
|
2024-12-09 14:52:59 +01:00
|
|
|
print '<!-- STOCK_CALCULATE_ON_RECEPTION -->';
|
2018-10-03 18:05:22 +02:00
|
|
|
print '<tr class="oddeven">';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td>'.$langs->trans("StockOnReception").'</td>';
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<td class="right">';
|
2018-10-03 18:05:22 +02:00
|
|
|
|
2020-09-07 10:18:17 +02:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2025-02-19 14:10:49 +01:00
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION', array(), null, 0, 0, 0, 2, 1, 0, '', '', 'reposition');
|
2020-09-07 10:18:17 +02:00
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2025-02-19 14:10:49 +01:00
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION", $arrval, getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION'));
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
2018-10-03 18:05:22 +02:00
|
|
|
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
|
|
|
|
|
2024-12-09 14:52:59 +01:00
|
|
|
print '<!-- STOCK_CALCULATE_ON_RECEPTION_CLOSE -->';
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<tr class="oddeven">';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td>'.$langs->trans("StockOnReceptionOnClosing").'</td>';
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<td class="right">';
|
|
|
|
|
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
2025-02-19 14:10:49 +01:00
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION_CLOSE', array(), null, 0, 0, 0, 2, 1, 0, '', '', 'reposition');
|
2020-09-07 10:18:17 +02:00
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2025-02-19 14:10:49 +01:00
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION_CLOSE'));
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
2018-10-03 18:05:22 +02:00
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
2020-05-21 09:35:30 +02:00
|
|
|
} else {
|
2025-02-19 14:10:49 +01:00
|
|
|
// When module Reception is not enabled, option to increase real stocks on manual dispatching into warehouse, after purchase order receipt of goods
|
2023-09-13 01:39:57 +02:00
|
|
|
print '<!-- STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER -->';
|
2018-10-03 18:05:22 +02:00
|
|
|
print '<tr class="oddeven">';
|
2018-10-23 10:27:46 +02:00
|
|
|
print '<td>'.$langs->trans("ReStockOnDispatchOrder").'</td>';
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<td class="right">';
|
2023-04-18 16:15:13 +02:00
|
|
|
if (isModEnabled("supplier_order")) {
|
2020-09-07 10:18:17 +02:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2025-02-19 14:10:49 +01:00
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(), null, 0, 0, 0, 2, 1, 0, '', '', 'reposition');
|
2020-09-07 10:18:17 +02:00
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2025-02-19 14:10:49 +01:00
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER'));
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
2020-05-21 09:35:30 +02:00
|
|
|
} else {
|
2023-04-10 12:31:31 +02:00
|
|
|
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")).'</span>';
|
2018-10-03 18:05:22 +02:00
|
|
|
}
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
2008-10-24 22:16:36 +02:00
|
|
|
}
|
2008-10-23 23:54:30 +02:00
|
|
|
|
2014-03-15 12:45:56 +01:00
|
|
|
print '</table>';
|
2023-07-19 01:37:50 +02:00
|
|
|
print '</div>';
|
2014-03-15 12:45:56 +01:00
|
|
|
|
2016-07-15 19:57:35 +02:00
|
|
|
print '<br>';
|
2019-09-06 01:52:51 +02:00
|
|
|
|
2024-01-11 09:59:52 +01:00
|
|
|
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
2019-11-05 21:24:41 +01:00
|
|
|
print '<table class="noborder centpercent">';
|
2016-07-15 19:57:35 +02:00
|
|
|
print '<tr class="liste_titre">';
|
2018-12-30 19:07:21 +01:00
|
|
|
print "<td>".$langs->trans("RuleForStockAvailability")."</td>\n";
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">'.$langs->trans("Status").'</td>'."\n";
|
2016-07-15 19:57:35 +02:00
|
|
|
print '</tr>'."\n";
|
2015-02-28 19:37:44 +01:00
|
|
|
|
2017-04-14 11:22:48 +02:00
|
|
|
|
|
|
|
|
print '<tr class="oddeven">';
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<td>'.$langs->trans("WarehouseAllowNegativeTransfer").'</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">';
|
2018-12-30 19:07:21 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2020-09-07 10:18:17 +02:00
|
|
|
print ajax_constantonoff('STOCK_ALLOW_NEGATIVE_TRANSFER');
|
2018-12-30 19:07:21 +01:00
|
|
|
} else {
|
2020-09-07 10:18:17 +02:00
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2025-02-19 14:10:49 +01:00
|
|
|
print $form->selectarray("STOCK_ALLOW_NEGATIVE_TRANSFER", $arrval, getDolGlobalString('STOCK_ALLOW_NEGATIVE_TRANSFER'));
|
2018-12-30 19:07:21 +01:00
|
|
|
}
|
2016-07-15 19:57:35 +02:00
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
2015-02-28 19:37:44 +01:00
|
|
|
|
2016-07-15 19:57:35 +02:00
|
|
|
// Option to force stock to be enough before adding a line into document
|
2024-02-27 15:30:37 +01:00
|
|
|
if (isModEnabled('invoice')) {
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<td>'.$langs->trans("StockMustBeEnoughForInvoice").'</td>';
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<td class="right">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_INVOICE');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2025-02-19 14:10:49 +01:00
|
|
|
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval, getDolGlobalString('STOCK_MUST_BE_ENOUGH_FOR_INVOICE'));
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
|
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
2016-07-15 19:57:35 +02:00
|
|
|
}
|
2015-02-28 19:37:44 +01:00
|
|
|
|
2024-02-27 15:30:37 +01:00
|
|
|
if (isModEnabled('order')) {
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<td>'.$langs->trans("StockMustBeEnoughForOrder").'</td>';
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<td class="right">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_ORDER');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2025-02-19 14:10:49 +01:00
|
|
|
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval, getDolGlobalString('STOCK_MUST_BE_ENOUGH_FOR_ORDER'));
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
2016-07-15 19:57:35 +02:00
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
2015-02-28 19:37:44 +01:00
|
|
|
}
|
2014-02-15 14:14:49 +01:00
|
|
|
|
2024-03-12 11:07:18 +01:00
|
|
|
if (isModEnabled("shipping")) {
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<td>'.$langs->trans("StockMustBeEnoughForShipment").'</td>';
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<td class="right">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2025-02-19 14:10:49 +01:00
|
|
|
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval, getDolGlobalString('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT'));
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
2016-07-15 19:57:35 +02:00
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
print '</table>';
|
2023-07-19 01:37:50 +02:00
|
|
|
print '</div>';
|
2016-07-15 19:57:35 +02:00
|
|
|
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<br>';
|
|
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$virtualdiffersfromphysical = 0;
|
2023-10-24 17:00:13 +02:00
|
|
|
if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')
|
|
|
|
|
|| getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER')
|
|
|
|
|
|| getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')
|
|
|
|
|
|| getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION')
|
|
|
|
|
|| getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION_CLOSE')
|
2022-09-25 22:57:24 +02:00
|
|
|
|| isModEnabled('mrp')) {
|
2020-09-07 10:18:17 +02:00
|
|
|
$virtualdiffersfromphysical = 1; // According to increase/decrease stock options, virtual and physical stock may differs.
|
2019-10-20 01:09:11 +02:00
|
|
|
}
|
2014-02-15 14:14:49 +01:00
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
if ($virtualdiffersfromphysical) {
|
2024-01-11 09:59:52 +01:00
|
|
|
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<table class="noborder centpercent">';
|
|
|
|
|
print '<tr class="liste_titre">';
|
2024-07-06 14:30:13 +02:00
|
|
|
print "<td>".$langs->trans("RuleForStockReplenishment")." ".img_help(1, $langs->trans("VirtualDiffersFromPhysical"))."</td>\n";
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<td class="right">'.$langs->trans("Status").'</td>'."\n";
|
2014-02-15 14:14:49 +01:00
|
|
|
print '</tr>'."\n";
|
2018-05-11 22:31:17 +02:00
|
|
|
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2020-11-13 11:06:51 +01:00
|
|
|
print '<td>';
|
|
|
|
|
print $form->textwithpicto($langs->trans("UseRealStockByDefault"), $langs->trans("ReplenishmentCalculation"));
|
|
|
|
|
print '</td>';
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<td class="right">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
2020-11-13 11:06:51 +01:00
|
|
|
print ajax_constantonoff('STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT');
|
2020-09-07 10:18:17 +02:00
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2025-02-19 14:10:49 +01:00
|
|
|
print $form->selectarray("STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT", $arrval, getDolGlobalString('STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT'));
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
2014-02-15 14:14:49 +01:00
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
print '</table>';
|
2023-07-19 01:37:50 +02:00
|
|
|
print '</div>';
|
2020-05-28 19:10:06 +02:00
|
|
|
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<br>';
|
2014-02-15 14:14:49 +01:00
|
|
|
}
|
2013-06-10 17:20:49 +02:00
|
|
|
|
2020-08-27 19:52:05 +02:00
|
|
|
print '<form>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
|
|
|
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
|
|
|
|
print '<input type="hidden" name="action" value="warehouse">';
|
2020-08-18 14:02:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Document templates generators
|
|
|
|
|
*/
|
|
|
|
|
|
2020-08-18 14:13:36 +02:00
|
|
|
print load_fiche_titre($langs->trans("WarehouseModelModules"), '', '');
|
2020-08-18 14:02:36 +02:00
|
|
|
|
|
|
|
|
// Load array def with activated templates
|
|
|
|
|
$def = array();
|
|
|
|
|
$sql = "SELECT nom";
|
|
|
|
|
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
|
2020-09-19 23:11:38 +02:00
|
|
|
$sql .= " WHERE type = '".$db->escape($type)."'";
|
2020-08-18 14:02:36 +02:00
|
|
|
$sql .= " AND entity = ".$conf->entity;
|
|
|
|
|
$resql = $db->query($sql);
|
2021-02-26 22:04:03 +01:00
|
|
|
if ($resql) {
|
2020-08-18 14:02:36 +02:00
|
|
|
$i = 0;
|
|
|
|
|
$num_rows = $db->num_rows($resql);
|
2021-02-26 22:04:03 +01:00
|
|
|
while ($i < $num_rows) {
|
2020-08-18 14:02:36 +02:00
|
|
|
$array = $db->fetch_array($resql);
|
2024-04-27 22:01:34 +02:00
|
|
|
if (is_array($array)) {
|
|
|
|
|
array_push($def, $array[0]);
|
|
|
|
|
}
|
2020-08-18 14:02:36 +02:00
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-01-11 09:59:52 +01:00
|
|
|
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
2023-07-19 01:37:50 +02:00
|
|
|
print '<table class="noborder centpercent">'."\n";
|
|
|
|
|
print '<tr class="liste_titre">'."\n";
|
2020-08-18 14:02:36 +02:00
|
|
|
print '<td>'.$langs->trans("Name").'</td>';
|
|
|
|
|
print '<td>'.$langs->trans("Description").'</td>';
|
|
|
|
|
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
|
|
|
|
|
print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
|
|
|
|
|
print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
|
|
|
|
|
print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
|
|
|
|
clearstatcache();
|
|
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
foreach ($dirmodels as $reldir) {
|
|
|
|
|
foreach (array('', '/doc') as $valdir) {
|
2020-08-18 14:02:36 +02:00
|
|
|
$realpath = $reldir."core/modules/stock".$valdir;
|
|
|
|
|
$dir = dol_buildpath($realpath);
|
|
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
if (is_dir($dir)) {
|
2020-08-18 14:02:36 +02:00
|
|
|
$handle = opendir($dir);
|
2021-02-26 22:04:03 +01:00
|
|
|
if (is_resource($handle)) {
|
2024-03-09 02:43:57 +01:00
|
|
|
$filelist = array();
|
2021-02-26 22:04:03 +01:00
|
|
|
while (($file = readdir($handle)) !== false) {
|
2020-08-18 14:02:36 +02:00
|
|
|
$filelist[] = $file;
|
|
|
|
|
}
|
|
|
|
|
closedir($handle);
|
|
|
|
|
arsort($filelist);
|
|
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
foreach ($filelist as $file) {
|
|
|
|
|
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
|
|
|
|
|
if (file_exists($dir.'/'.$file)) {
|
2020-08-18 14:02:36 +02:00
|
|
|
$name = substr($file, 4, dol_strlen($file) - 16);
|
|
|
|
|
$classname = substr($file, 0, dol_strlen($file) - 12);
|
|
|
|
|
|
|
|
|
|
require_once $dir.'/'.$file;
|
|
|
|
|
$module = new $classname($db);
|
2024-03-24 21:36:33 +01:00
|
|
|
'@phan-var-force ModelePDFStock $module';
|
2020-08-18 14:02:36 +02:00
|
|
|
|
|
|
|
|
$modulequalified = 1;
|
2023-11-27 12:24:18 +01:00
|
|
|
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
2021-02-26 22:04:03 +01:00
|
|
|
$modulequalified = 0;
|
|
|
|
|
}
|
2023-11-27 12:24:18 +01:00
|
|
|
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
|
2021-02-26 22:04:03 +01:00
|
|
|
$modulequalified = 0;
|
|
|
|
|
}
|
2020-08-18 14:02:36 +02:00
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
if ($modulequalified) {
|
2020-08-18 14:02:36 +02:00
|
|
|
print '<tr class="oddeven"><td width="100">';
|
2023-12-04 11:41:14 +01:00
|
|
|
print(empty($module->name) ? $name : $module->name);
|
2020-08-18 14:02:36 +02:00
|
|
|
print "</td><td>\n";
|
2021-02-26 22:04:03 +01:00
|
|
|
if (method_exists($module, 'info')) {
|
2024-08-19 02:05:27 +02:00
|
|
|
print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
|
2021-02-26 22:04:03 +01:00
|
|
|
} else {
|
|
|
|
|
print $module->description;
|
|
|
|
|
}
|
2020-08-18 14:02:36 +02:00
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
// Active
|
2021-02-26 22:04:03 +01:00
|
|
|
if (in_array($name, $def)) {
|
2020-08-18 14:02:36 +02:00
|
|
|
print '<td class="center">'."\n";
|
2021-09-19 14:41:46 +02:00
|
|
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
|
2020-08-18 14:02:36 +02:00
|
|
|
print img_picto($langs->trans("Enabled"), 'switch_on');
|
|
|
|
|
print '</a>';
|
|
|
|
|
print '</td>';
|
|
|
|
|
} else {
|
|
|
|
|
print '<td class="center">'."\n";
|
2021-09-19 14:41:46 +02:00
|
|
|
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>';
|
2020-08-18 14:02:36 +02:00
|
|
|
print "</td>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Default
|
|
|
|
|
print '<td class="center">';
|
2024-02-09 11:27:30 +01:00
|
|
|
if (getDolGlobalString('STOCK_ADDON_PDF') == $name) {
|
2020-08-18 14:02:36 +02:00
|
|
|
print img_picto($langs->trans("Default"), 'on');
|
|
|
|
|
} else {
|
2021-09-19 18:03:38 +02:00
|
|
|
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>';
|
2020-08-18 14:02:36 +02:00
|
|
|
}
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
// Info
|
|
|
|
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
|
|
|
|
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
2021-02-26 22:04:03 +01:00
|
|
|
if ($module->type == 'pdf') {
|
2020-08-18 14:02:36 +02:00
|
|
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
|
|
|
|
}
|
|
|
|
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
|
|
|
|
|
|
|
|
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
|
|
|
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
|
|
|
|
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print '<td class="center">';
|
2025-02-08 01:49:29 +01:00
|
|
|
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
2020-08-18 14:02:36 +02:00
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
// Preview
|
|
|
|
|
print '<td class="center">';
|
2021-02-26 22:04:03 +01:00
|
|
|
if ($module->type == 'pdf') {
|
2020-12-03 13:19:35 +01:00
|
|
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
2020-08-18 14:02:36 +02:00
|
|
|
} else {
|
2025-01-08 17:45:28 +01:00
|
|
|
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
|
2020-08-18 14:02:36 +02:00
|
|
|
}
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print '</table>';
|
2023-07-19 01:37:50 +02:00
|
|
|
print '</div>';
|
2020-08-18 14:02:36 +02:00
|
|
|
|
2020-08-27 19:52:05 +02:00
|
|
|
print '</form>';
|
|
|
|
|
|
2020-08-18 14:02:36 +02:00
|
|
|
|
|
|
|
|
// Other
|
|
|
|
|
|
2020-08-27 19:52:05 +02:00
|
|
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
|
|
|
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
|
|
|
|
print '<input type="hidden" name="action" value="warehouse">';
|
|
|
|
|
|
2020-08-18 14:02:36 +02:00
|
|
|
print load_fiche_titre($langs->trans("Other"), '', '');
|
|
|
|
|
|
2024-01-11 09:59:52 +01:00
|
|
|
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
2020-05-06 00:48:00 +02:00
|
|
|
print '<table class="noborder centpercent">';
|
|
|
|
|
|
|
|
|
|
print '<tr class="liste_titre">';
|
2020-11-02 10:15:33 +01:00
|
|
|
print "<td>".$langs->trans("Parameter")."</td>\n";
|
2025-01-24 13:12:48 +01:00
|
|
|
print '<td class="right"></td>'."\n";
|
2020-05-06 00:48:00 +02:00
|
|
|
print '</tr>'."\n";
|
|
|
|
|
|
|
|
|
|
print '<tr class="oddeven">';
|
2020-05-28 19:10:06 +02:00
|
|
|
print '<td>'.$langs->trans("MainDefaultWarehouse").'</td>';
|
2020-05-06 00:48:00 +02:00
|
|
|
print '<td class="right">';
|
2023-10-24 17:00:13 +02:00
|
|
|
print $formproduct->selectWarehouses(getDolGlobalString('MAIN_DEFAULT_WAREHOUSE') ? $conf->global->MAIN_DEFAULT_WAREHOUSE : -1, 'default_warehouse', '', 1, 0, 0, '', 0, 0, array(), 'left reposition');
|
2024-04-29 20:18:03 +02:00
|
|
|
print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans("Modify").'">';
|
2020-05-28 19:10:06 +02:00
|
|
|
print "</td>";
|
2020-05-06 00:48:00 +02:00
|
|
|
print "</tr>\n";
|
|
|
|
|
|
|
|
|
|
print '<tr class="oddeven">';
|
|
|
|
|
print '<td>'.$langs->trans("UserDefaultWarehouse").'</td>';
|
|
|
|
|
print '<td class="right">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
2020-10-31 14:32:18 +01:00
|
|
|
print ajax_constantonoff('MAIN_DEFAULT_WAREHOUSE_USER', array(), null, 0, 0, 1);
|
2020-05-06 00:48:00 +02:00
|
|
|
} else {
|
2020-05-28 19:10:06 +02:00
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("MAIN_DEFAULT_WAREHOUSE_USER", $arrval, $conf->global->MAIN_DEFAULT_WAREHOUSE_USER);
|
2020-05-06 00:48:00 +02:00
|
|
|
}
|
|
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
2023-10-24 17:00:13 +02:00
|
|
|
if (getDolGlobalString('MAIN_DEFAULT_WAREHOUSE_USER')) {
|
2020-05-28 19:10:06 +02:00
|
|
|
print '<tr class="oddeven">';
|
|
|
|
|
print '<td>'.$langs->trans("UserWarehouseAutoCreate").'</td>';
|
|
|
|
|
print '<td class="right">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_USERSTOCK_AUTOCREATE');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_USERSTOCK_AUTOCREATE", $arrval, $conf->global->STOCK_USERSTOCK_AUTOCREATE);
|
|
|
|
|
}
|
|
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
2020-05-06 00:48:00 +02:00
|
|
|
}
|
2021-03-30 14:58:47 +02:00
|
|
|
|
|
|
|
|
print '<tr class="oddeven">';
|
|
|
|
|
print '<td>'.$langs->trans("WarehouseAskWarehouseOnThirparty").'</td>';
|
|
|
|
|
print '<td class="right">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('SOCIETE_ASK_FOR_WAREHOUSE');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("SOCIETE_ASK_FOR_WAREHOUSE", $arrval, $conf->global->SOCIETE_ASK_FOR_WAREHOUSE);
|
|
|
|
|
}
|
2021-10-31 15:14:15 +01:00
|
|
|
print "</td>";
|
|
|
|
|
print "</tr>\n";
|
2021-03-30 14:58:47 +02:00
|
|
|
|
2021-01-10 01:07:27 +01:00
|
|
|
print '<tr class="oddeven">';
|
|
|
|
|
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringPropal").'</td>';
|
|
|
|
|
print '<td class="right">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL);
|
|
|
|
|
}
|
2021-10-31 15:14:15 +01:00
|
|
|
print "</td>";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<tr class="oddeven">';
|
2020-05-28 19:10:06 +02:00
|
|
|
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringOrder").'</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">';
|
2018-12-30 19:07:21 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2020-05-28 19:10:06 +02:00
|
|
|
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
|
2018-12-30 19:07:21 +01:00
|
|
|
} else {
|
2020-05-28 19:10:06 +02:00
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER);
|
2018-12-30 19:07:21 +01:00
|
|
|
}
|
2020-05-28 19:10:06 +02:00
|
|
|
print '</td>';
|
2017-09-19 23:42:20 +02:00
|
|
|
print "</tr>\n";
|
|
|
|
|
|
2021-10-31 15:14:15 +01:00
|
|
|
/*
|
|
|
|
|
print '<tr class="oddeven">';
|
|
|
|
|
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringProject").'</td>';
|
|
|
|
|
print '<td class="right">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT);
|
|
|
|
|
}
|
|
|
|
|
print '</td>';
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<tr class="oddeven">';
|
|
|
|
|
print '<td>';
|
2018-08-29 21:07:00 +02:00
|
|
|
print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc"));
|
|
|
|
|
print '</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">';
|
2018-12-30 19:07:21 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2020-09-07 10:18:17 +02:00
|
|
|
print ajax_constantonoff('STOCK_SUPPORTS_SERVICES');
|
2018-12-30 19:07:21 +01:00
|
|
|
} else {
|
2020-09-07 10:18:17 +02:00
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
2023-12-10 00:10:18 +01:00
|
|
|
print $form->selectarray("STOCK_SUPPORTS_SERVICES", $arrval, getDolGlobalString('STOCK_SUPPORTS_SERVICES'));
|
2018-12-30 19:07:21 +01:00
|
|
|
}
|
2017-09-19 23:42:20 +02:00
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
2023-10-15 21:35:16 +02:00
|
|
|
// Add option to allow a "Limit for warning" and a "Desired stock" per warehouse.
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<tr class="oddeven">';
|
|
|
|
|
print '<td>'.$langs->trans("AllowAddLimitStockByWarehouse").'</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">';
|
2018-12-30 19:07:21 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2020-09-07 10:18:17 +02:00
|
|
|
print ajax_constantonoff('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE');
|
2018-12-30 19:07:21 +01:00
|
|
|
} else {
|
2020-09-07 10:18:17 +02:00
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE", $arrval, $conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE);
|
2018-12-30 19:07:21 +01:00
|
|
|
}
|
2017-09-19 23:42:20 +02:00
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
2020-05-27 14:47:20 +02:00
|
|
|
|
2020-05-19 11:05:45 +02:00
|
|
|
print '<tr class="oddeven">';
|
|
|
|
|
print '<td>'.$langs->trans("AlwaysShowFullArbo").'</td>';
|
|
|
|
|
print '<td class="right">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
2020-09-07 10:18:17 +02:00
|
|
|
print ajax_constantonoff('STOCK_ALWAYS_SHOW_FULL_ARBO');
|
2020-05-19 11:05:45 +02:00
|
|
|
} else {
|
2020-09-07 10:18:17 +02:00
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_ALWAYS_SHOW_FULL_ARBO", $arrval, $conf->global->STOCK_ALWAYS_SHOW_FULL_ARBO);
|
2020-05-19 11:05:45 +02:00
|
|
|
}
|
|
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
2021-04-19 14:34:11 +02:00
|
|
|
|
2021-05-25 23:26:03 +02:00
|
|
|
/* Disabled. Would be better to be managed with a user cookie
|
2022-08-31 21:55:55 +02:00
|
|
|
if (isModEnabled('productbatch')) {
|
2021-04-19 14:34:11 +02:00
|
|
|
print '<tr class="oddeven">';
|
|
|
|
|
print '<td>' . $langs->trans("ShowAllBatchByDefault") . '</td>';
|
|
|
|
|
print '<td class="right">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_SHOW_ALL_BATCH_BY_DEFAULT');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_SHOW_ALL_BATCH_BY_DEFAULT", $arrval, $conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT);
|
|
|
|
|
}
|
|
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
}
|
2021-05-25 23:26:03 +02:00
|
|
|
*/
|
2021-04-19 14:34:11 +02:00
|
|
|
|
2017-09-19 23:42:20 +02:00
|
|
|
print '</table>';
|
2023-07-19 01:37:50 +02:00
|
|
|
print '</div>';
|
2014-12-05 16:01:01 +01:00
|
|
|
|
2020-05-28 19:10:06 +02:00
|
|
|
print '</form>';
|
|
|
|
|
|
2018-07-28 18:03:14 +02:00
|
|
|
// End of page
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2014-07-08 01:02:30 +02:00
|
|
|
$db->close();
|