Fix PRELEVEMENT_ADDDAYS check

If we used a positive value in PRELEVEMENT_ADDDAYS it couldn't submit the changes to database
This commit is contained in:
Haldarys 2020-12-17 10:19:21 +01:00
parent 04c233c229
commit 10ac74162e

View File

@ -92,11 +92,10 @@ if ($action == "set")
if (! $res > 0) $error++; if (! $res > 0) $error++;
} }
if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS")=="") $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
{ if (! $res > 0) $error++;
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++; if (! $error)
} elseif (! $error)
{ {
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');