Update prelevement.php

This commit is contained in:
Laurent Destailleur 2020-12-17 13:53:09 +01:00 committed by GitHub
parent 36d6b472ce
commit 27542ed8ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,34 +74,31 @@ if ($action == "set")
else $error++;
$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++;
if (! ($res > 0)) $error++;
if (GETPOST("PRELEVEMENT_USER") > 0)
{
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++;
if (! ($res > 0)) $error++;
}
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="")
{
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++;
if (! ($res > 0)) $error++;
}
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="")
{
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++;
if (! ($res > 0)) $error++;
}
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++;
if (! ($res > 0)) $error++;
if (! $error)
{
if (! $error) {
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
} else {
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
}