FIX Removed error when no error on accounting setup page
This commit is contained in:
parent
304adff973
commit
aad99bdcc0
@ -27,9 +27,8 @@
|
|||||||
* \ingroup Advanced accountancy
|
* \ingroup Advanced accountancy
|
||||||
* \brief Setup page to configure accounting expert module
|
* \brief Setup page to configure accounting expert module
|
||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
|
||||||
|
|
||||||
// Class
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
|
||||||
@ -65,26 +64,8 @@ $accounting_mode = empty($conf->global->ACCOUNTING_MODE) ? 'RECETTES-DEPENSES' :
|
|||||||
if ($action == 'update') {
|
if ($action == 'update') {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$accounting_modes = array (
|
if (! $error)
|
||||||
'RECETTES-DEPENSES',
|
{
|
||||||
'CREANCES-DETTES'
|
|
||||||
);
|
|
||||||
|
|
||||||
$accounting_mode = GETPOST('accounting_mode', 'alpha');
|
|
||||||
|
|
||||||
if (in_array($accounting_mode, $accounting_modes)) {
|
|
||||||
|
|
||||||
if (! dolibarr_set_const($db, 'ACCOUNTING_MODE', $accounting_mode, 'chaine', 0, '', $conf->entity)) {
|
|
||||||
$error ++;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$error ++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($error) {
|
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($list as $constname)
|
foreach ($list as $constname)
|
||||||
{
|
{
|
||||||
$constvalue = GETPOST($constname, 'alpha');
|
$constvalue = GETPOST($constname, 'alpha');
|
||||||
@ -93,11 +74,13 @@ if ($action == 'update') {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($error) {
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
} else {
|
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user