From 9554373c643c91ceb95af3589ed028bd4f4ccfc1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 May 2007 14:05:36 +0000 Subject: [PATCH] N'autorise pas compte si montant 0 --- htdocs/adherents/card_subscriptions.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index b0eef2622f3..aafd77731e4 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -91,7 +91,7 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisatio $action='addsubscription'; } - if ($adht->cotisation) + if ($adht->cotisation) // Type adherent soumis a cotisation { if (! is_numeric($_POST["cotisation"])) { @@ -101,11 +101,18 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisatio } else { - if ($_POST["cotisation"] && $conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) + if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) { - if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); - if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); - if (! $_POST["accountid"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("FinancialAccount")); + if ($_POST["cotisation"]) + { + if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); + if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); + if (! $_POST["accountid"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("FinancialAccount")); + } + else + { + if ($_POST["accountid"]) $errmsg=$langs->trans("ErrorDoNotProvideAccountsIfNullAmount"); + } if ($errmsg) $action='addsubscription'; } }