Code comment

This commit is contained in:
Laurent Destailleur 2021-08-23 15:08:29 +02:00
parent a25346e302
commit 5f16de8150

View File

@ -268,6 +268,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$error++; $error++;
$action = 'addsubscription'; $action = 'addsubscription';
} else { } else {
// If an amount has been provided, we check also fields that becomes mandatory when amount is not null.
if (!empty($conf->banque->enabled) && GETPOST("paymentsave") != 'none') { if (!empty($conf->banque->enabled) && GETPOST("paymentsave") != 'none') {
if (GETPOST("subscription")) { if (GETPOST("subscription")) {
if (!GETPOST("label")) { if (!GETPOST("label")) {
@ -280,7 +281,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount")); $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount"));
} }
} else { } else {
if (GETPOST("accountid")) { if (GETPOST("accountid", 'int')) {
$errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount"); $errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
} }
} }