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>
|
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
|
|
|
|
|
* \brief Page d'administration/configuration du module gestion de 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';
|
2006-12-04 12:17:24 +01:00
|
|
|
|
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
|
|
|
|
2008-10-24 22:16:36 +02:00
|
|
|
// Securit check
|
2011-09-21 15:16:13 +02:00
|
|
|
if (!$user->admin) accessforbidden();
|
2006-12-04 12:17:24 +01:00
|
|
|
|
2019-01-27 11:55:16 +01:00
|
|
|
$action = GETPOST('action', 'alpha');
|
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
|
|
|
*/
|
2019-01-27 11:55:16 +01:00
|
|
|
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
|
2008-10-24 22:16:36 +02:00
|
|
|
{
|
2018-12-30 19:07:21 +01:00
|
|
|
$code=$reg[1];
|
|
|
|
|
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
2011-09-02 16:31:53 +02:00
|
|
|
{
|
2018-12-30 19:07:21 +01:00
|
|
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
|
|
|
|
exit;
|
2011-09-02 16:31:53 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-12-30 19:07:21 +01:00
|
|
|
dol_print_error($db);
|
2011-09-02 16:31:53 +02:00
|
|
|
}
|
|
|
|
|
}
|
2006-12-06 00:08:59 +01:00
|
|
|
|
2019-01-27 11:55:16 +01:00
|
|
|
if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
|
2018-12-30 19:07:21 +01:00
|
|
|
{
|
|
|
|
|
$code=$reg[1];
|
|
|
|
|
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
|
|
|
|
{
|
|
|
|
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-06-10 15:42:58 +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
|
|
|
|
2019-01-27 11:55:16 +01:00
|
|
|
llxHeader('', $langs->trans("StockSetup"));
|
2006-12-04 12:17:24 +01:00
|
|
|
|
2018-02-26 09:20:05 +01: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();
|
|
|
|
|
|
|
|
|
|
dol_fiche_head($head, 'general', $langs->trans("StockSetup"), -1, 'stock');
|
|
|
|
|
|
2011-11-08 10:18:45 +01:00
|
|
|
$form=new Form($db);
|
2008-07-26 14:10:24 +02:00
|
|
|
|
2006-12-04 12:17:24 +01:00
|
|
|
|
2014-12-05 16:01:01 +01:00
|
|
|
$disabled='';
|
|
|
|
|
if (! empty($conf->productbatch->enabled))
|
|
|
|
|
{
|
|
|
|
|
$langs->load("productbatch");
|
2015-05-07 11:57:23 +02:00
|
|
|
$disabled=' disabled';
|
2014-12-05 16:01:01 +01:00
|
|
|
print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced"));
|
|
|
|
|
}
|
2010-07-11 21:29:18 +02:00
|
|
|
|
2014-12-05 16:01:01 +01:00
|
|
|
//if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
|
|
|
|
|
//{
|
|
|
|
|
print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule"));
|
2017-05-06 17:08:38 +02:00
|
|
|
print '<br>';
|
2014-12-05 16:01:01 +01:00
|
|
|
//}
|
2008-07-26 14:10:24 +02:00
|
|
|
|
2008-10-23 23:54:30 +02:00
|
|
|
// Title rule for stock decrease
|
2013-03-22 17:10:17 +01:00
|
|
|
print '<table class="noborder" width="100%">';
|
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";
|
|
|
|
|
|
2015-02-28 19:37:44 +01:00
|
|
|
$found=0;
|
|
|
|
|
|
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">';
|
2012-09-15 10:01:35 +02:00
|
|
|
if (! empty($conf->facture->enabled))
|
2007-11-10 22:34:46 +01:00
|
|
|
{
|
2018-12-30 19:07:21 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_BILL');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL);
|
|
|
|
|
}
|
2015-10-27 19:18:22 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-08-04 11:37:32 +02:00
|
|
|
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module30Name"));
|
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
|
|
|
|
|
|
|
|
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">';
|
2012-09-15 10:01:35 +02:00
|
|
|
if (! empty($conf->commande->enabled))
|
2007-11-10 22:34:46 +01:00
|
|
|
{
|
2018-12-30 19:07:21 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER);
|
|
|
|
|
}
|
2007-11-10 22:34:46 +01:00
|
|
|
}
|
2015-10-27 19:18:22 +01:00
|
|
|
else
|
|
|
|
|
{
|
2016-08-04 11:37:32 +02:00
|
|
|
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module25Name"));
|
2015-10-27 19:18:22 +01:00
|
|
|
}
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
2007-03-22 18:27:21 +01:00
|
|
|
|
2015-10-27 19:18:22 +01:00
|
|
|
//if (! empty($conf->expedition->enabled))
|
|
|
|
|
//{
|
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">';
|
2012-09-15 10:01:35 +02:00
|
|
|
if (! empty($conf->expedition->enabled))
|
2007-11-10 22:34:46 +01:00
|
|
|
{
|
2018-12-30 19:07:21 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT);
|
|
|
|
|
}
|
2007-11-10 22:34:46 +01:00
|
|
|
}
|
2015-10-27 19:18:22 +01:00
|
|
|
else
|
|
|
|
|
{
|
2016-08-04 11:37:32 +02:00
|
|
|
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name"));
|
2015-10-27 19:18:22 +01:00
|
|
|
}
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
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("DeStockOnShipmentOnClosing").'</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">';
|
2016-04-25 18:33:39 +02:00
|
|
|
if (! empty($conf->expedition->enabled))
|
|
|
|
|
{
|
2018-12-30 19:07:21 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE);
|
|
|
|
|
}
|
2016-04-25 18:33:39 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-08-04 11:37:32 +02:00
|
|
|
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name"));
|
2016-04-25 18:33:39 +02:00
|
|
|
}
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
|
|
|
|
|
2015-10-27 19:18:22 +01:00
|
|
|
/*if (! $found)
|
2015-02-28 19:37:44 +01:00
|
|
|
{
|
2017-09-15 23:49:04 +02:00
|
|
|
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2015-10-27 19:18:22 +01:00
|
|
|
print '<td colspan="2">'.$langs->trans("NoModuleToManageStockDecrease").'</td>';
|
2015-02-28 19:37:44 +01:00
|
|
|
print "</tr>\n";
|
2015-10-27 19:18:22 +01:00
|
|
|
}*/
|
2015-02-28 19:37:44 +01:00
|
|
|
|
2013-03-22 17:10:17 +01:00
|
|
|
print '</table>';
|
2014-11-28 19:49:42 +01:00
|
|
|
|
2013-03-22 17:10:17 +01:00
|
|
|
print '<br>';
|
2008-10-23 23:54:30 +02:00
|
|
|
|
|
|
|
|
// Title rule for stock increase
|
2013-03-22 17:10:17 +01:00
|
|
|
print '<table class="noborder" width="100%">';
|
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";
|
|
|
|
|
|
2015-02-28 19:37:44 +01:00
|
|
|
$found=0;
|
|
|
|
|
|
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">';
|
2012-09-15 10:01:35 +02:00
|
|
|
if (! empty($conf->fournisseur->enabled))
|
2008-10-24 22:16:36 +02:00
|
|
|
{
|
2018-12-30 19:07:21 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL);
|
|
|
|
|
}
|
2008-10-24 22:16:36 +02:00
|
|
|
}
|
2015-10-27 19:18:22 +01:00
|
|
|
else
|
|
|
|
|
{
|
2016-08-04 11:37:32 +02:00
|
|
|
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
|
2015-10-27 19:18:22 +01:00
|
|
|
}
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
|
|
|
|
|
2008-10-23 23:54:30 +02: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("ReStockOnValidateOrder").'</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">';
|
2012-09-15 10:01:35 +02:00
|
|
|
if (! empty($conf->fournisseur->enabled))
|
2008-10-24 22:16:36 +02:00
|
|
|
{
|
2018-12-30 19:07:21 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER);
|
|
|
|
|
}
|
2010-07-11 21:29:18 +02:00
|
|
|
}
|
2015-10-27 19:18:22 +01:00
|
|
|
else
|
|
|
|
|
{
|
2016-08-04 11:37:32 +02:00
|
|
|
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
|
2015-10-27 19:18:22 +01:00
|
|
|
}
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
|
|
|
|
|
2018-10-03 18:05:22 +02:00
|
|
|
if (!empty($conf->reception->enabled))
|
2010-07-11 21:29:18 +02:00
|
|
|
{
|
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>';
|
|
|
|
|
print '<td class="right">';
|
2018-10-03 18:05:22 +02:00
|
|
|
|
2018-12-30 19:07:21 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION);
|
|
|
|
|
}
|
2018-10-03 18:05:22 +02:00
|
|
|
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
|
|
|
|
|
|
|
|
|
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td>'.$langs->trans("StockOnReceptionOnClosing").'</td>';
|
|
|
|
|
print '<td class="right">';
|
2018-10-03 18:05:22 +02:00
|
|
|
|
2018-12-30 19:07:21 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION_CLOSE');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE);
|
|
|
|
|
}
|
2018-10-03 18:05:22 +02:00
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
2015-10-27 19:18:22 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
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>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">';
|
2018-10-23 10:27:46 +02:00
|
|
|
if (! empty($conf->fournisseur->enabled))
|
2018-10-03 18:05:22 +02:00
|
|
|
{
|
2018-12-30 19:07:21 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER);
|
|
|
|
|
}
|
2018-10-03 18:05:22 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
|
|
|
|
|
}
|
|
|
|
|
print "</td>\n</tr>\n";
|
|
|
|
|
$found++;
|
2008-10-24 22:16:36 +02:00
|
|
|
}
|
2008-10-23 23:54:30 +02:00
|
|
|
|
2015-10-27 19:18:22 +01:00
|
|
|
/*if (! $found)
|
2015-02-28 19:37:44 +01:00
|
|
|
{
|
2017-09-15 23:49:04 +02:00
|
|
|
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2016-06-18 15:36:19 +02:00
|
|
|
print '<td colspan="2">'.$langs->trans("NoModuleToManageStockIncrease").'</td>';
|
2014-03-15 12:45:56 +01:00
|
|
|
print "</tr>\n";
|
2015-10-27 19:18:22 +01:00
|
|
|
}*/
|
2014-03-15 12:45:56 +01:00
|
|
|
|
|
|
|
|
print '</table>';
|
|
|
|
|
|
2016-07-15 19:57:35 +02:00
|
|
|
print '<br>';
|
2019-09-06 01:52:51 +02:00
|
|
|
|
2016-07-15 19:57:35 +02:00
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
|
|
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) {
|
|
|
|
|
print ajax_constantonoff('STOCK_ALLOW_NEGATIVE_TRANSFER');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_ALLOW_NEGATIVE_TRANSFER", $arrval, $conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER);
|
|
|
|
|
}
|
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
|
2018-05-11 22:31:17 +02:00
|
|
|
if($conf->invoice->enabled)
|
|
|
|
|
{
|
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>';
|
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) {
|
|
|
|
|
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_INVOICE');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE);
|
|
|
|
|
}
|
2016-07-15 19:57:35 +02:00
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
}
|
2015-02-28 19:37:44 +01:00
|
|
|
|
2018-07-26 18:22:16 +02:00
|
|
|
if($conf->order->enabled)
|
2018-05-11 22:31:17 +02: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("StockMustBeEnoughForOrder").'</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) {
|
|
|
|
|
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_ORDER');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER);
|
|
|
|
|
}
|
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
|
|
|
|
2018-07-26 18:22:16 +02:00
|
|
|
if($conf->expedition->enabled)
|
2018-05-11 22:31:17 +02: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("StockMustBeEnoughForShipment").'</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) {
|
|
|
|
|
print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT);
|
|
|
|
|
}
|
2016-07-15 19:57:35 +02:00
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
print '</table>';
|
|
|
|
|
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<br>';
|
|
|
|
|
|
2014-02-15 14:14:49 +01:00
|
|
|
$virtualdiffersfromphysical=0;
|
|
|
|
|
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|
|
|
|
|
|| ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
|
|
|
|
|
) $virtualdiffersfromphysical=1; // According to increase/decrease stock options, virtual and physical stock may differs.
|
|
|
|
|
|
|
|
|
|
if ($virtualdiffersfromphysical)
|
|
|
|
|
{
|
2018-12-30 19:07:21 +01:00
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
|
|
print '<tr class="liste_titre">';
|
2019-01-27 11:55:16 +01:00
|
|
|
print "<td>".$langs->trans("RuleForStockReplenishment")." ".img_help('help', $langs->trans("VirtualDiffersFromPhysical"))."</td>\n";
|
2019-09-06 01:52:51 +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">';
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<td>'.$langs->trans("UseVirtualStockByDefault").'</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) {
|
|
|
|
|
print ajax_constantonoff('STOCK_USE_VIRTUAL_STOCK');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_USE_VIRTUAL_STOCK", $arrval, $conf->global->STOCK_USE_VIRTUAL_STOCK);
|
|
|
|
|
}
|
2014-02-15 14:14:49 +01:00
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
print '</table>';
|
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
|
|
|
|
2014-12-05 16:01:01 +01:00
|
|
|
|
2017-09-19 23:42:20 +02:00
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
|
|
|
|
|
|
|
print '<tr class="liste_titre">';
|
2018-12-30 19:07:21 +01:00
|
|
|
print "<td>".$langs->trans("Other")."</td>\n";
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">'.$langs->trans("Status").'</td>'."\n";
|
2017-09-19 23:42:20 +02:00
|
|
|
print '</tr>'."\n";
|
|
|
|
|
|
|
|
|
|
print '<tr class="oddeven">';
|
|
|
|
|
print '<td>'.$langs->trans("UserWarehouseAutoCreate").'</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) {
|
|
|
|
|
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);
|
|
|
|
|
}
|
2017-09-19 23:42:20 +02:00
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
print ajax_constantonoff('STOCK_SUPPORTS_SERVICES');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("STOCK_SUPPORTS_SERVICES", $arrval, $conf->global->STOCK_SUPPORTS_SERVICES);
|
|
|
|
|
}
|
2017-09-19 23:42:20 +02:00
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
print ajax_constantonoff('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE');
|
|
|
|
|
} else {
|
|
|
|
|
$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);
|
|
|
|
|
}
|
2017-09-19 23:42:20 +02:00
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
|
|
|
|
print '</table>';
|
2014-12-05 16:01:01 +01:00
|
|
|
|
2017-09-15 23:49:04 +02:00
|
|
|
print '<br>';
|
2017-05-06 22:28:07 +02:00
|
|
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
2017-05-02 15:19:55 +02:00
|
|
|
{
|
|
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
|
|
print '<tr class="liste_titre">';
|
|
|
|
|
print '<td>'.$langs->trans("Inventory").'</td>'."\n";
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td class="right">'.$langs->trans("Status").'</td>'."\n";
|
|
|
|
|
print '</tr>'."\n";
|
2017-09-15 23:49:04 +02:00
|
|
|
|
2017-05-02 15:19:55 +02:00
|
|
|
// Example with a yes / no select
|
2019-09-06 01:52:51 +02:00
|
|
|
/*print '<tr class="oddeven">';
|
2017-05-02 15:19:55 +02:00
|
|
|
print '<td>'.$langs->trans("INVENTORY_DISABLE_VIRTUAL").'</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td align="center">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('INVENTORY_DISABLE_VIRTUAL');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("INVENTORY_DISABLE_VIRTUAL", $arrval, $conf->global->INVENTORY_DISABLE_VIRTUAL);
|
|
|
|
|
}
|
2017-05-02 15:19:55 +02:00
|
|
|
print '</td></tr>';
|
2019-09-06 01:52:51 +02:00
|
|
|
*/
|
2017-09-15 23:49:04 +02:00
|
|
|
|
2017-05-02 15:19:55 +02:00
|
|
|
// Example with a yes / no select
|
2019-09-06 01:52:51 +02:00
|
|
|
/*print '<tr class="oddeven">';
|
2017-05-02 15:19:55 +02:00
|
|
|
print '<td>'.$langs->trans("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA").'</td>';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td align="center">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('INVENTORY_USE_MIN_PA_IF_NO_LAST_PA');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA", $arrval, $conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA);
|
|
|
|
|
}
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// Example with a yes / no select
|
2017-05-06 10:54:28 +02:00
|
|
|
print '<tr class="oddeven">';
|
2019-09-06 01:52:51 +02:00
|
|
|
print '<td>'.$langs->trans("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT").'</td>';
|
|
|
|
|
print '<td class="right">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT');
|
|
|
|
|
} else {
|
|
|
|
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
|
|
|
print $form->selectarray("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT", $arrval, $conf->global->INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT);
|
|
|
|
|
}
|
2017-05-02 15:19:55 +02:00
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
print '</table>';
|
2016-11-14 15:25:45 +01:00
|
|
|
}
|
|
|
|
|
|
2015-02-24 17:23:23 +01:00
|
|
|
/* I keep the option/feature, but hidden to end users for the moment. If feature is used by module, no need to have users see it.
|
|
|
|
|
If not used by a module, I still need to understand in which case user may need this now we can set rule on product page.
|
2016-08-04 11:37:32 +02:00
|
|
|
if ($conf->global->PRODUIT_SOUSPRODUITS)
|
2015-02-24 17:23:23 +01:00
|
|
|
{
|
2016-08-04 11:37:32 +02: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("IndependantSubProductStock").'</td>';
|
2019-01-22 11:56:09 +01:00
|
|
|
print '<td class="right">';
|
2015-02-16 16:06:50 +01:00
|
|
|
print "<form method=\"post\" action=\"stock.php\">";
|
|
|
|
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
|
|
print "<input type=\"hidden\" name=\"action\" value=\"INDEPENDANT_SUBPRODUCT_STOCK\">";
|
|
|
|
|
print $form->selectyesno("INDEPENDANT_SUBPRODUCT_STOCK",$conf->global->INDEPENDANT_SUBPRODUCT_STOCK,1);
|
|
|
|
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
|
|
|
|
print '</form>';
|
|
|
|
|
print "</td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
}
|
2015-02-24 17:23:23 +01:00
|
|
|
*/
|
2015-02-16 16:06:50 +01:00
|
|
|
|
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();
|