From 10ac74162e71e9463883feb46293e74c18ad4e17 Mon Sep 17 00:00:00 2001 From: Haldarys <49756127+Haldarys@users.noreply.github.com> Date: Thu, 17 Dec 2020 10:19:21 +0100 Subject: [PATCH] Fix PRELEVEMENT_ADDDAYS check If we used a positive value in PRELEVEMENT_ADDDAYS it couldn't submit the changes to database --- htdocs/admin/prelevement.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 144ec744d41..2f942410787 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -92,11 +92,10 @@ if ($action == "set") 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++; - } elseif (! $error) + $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + + if (! $error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');