diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php
index 3a35960dd86..0051b2d1cc9 100644
--- a/htdocs/adherents/card_subscriptions.php
+++ b/htdocs/adherents/card_subscriptions.php
@@ -93,18 +93,18 @@ if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"])
if ($adht->cotisation)
{
+ if ($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 ($errmsg) $action='addsubscription';
+ }
if (! $_POST["cotisation"] > 0)
{
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
$action='addsubscription';
}
- if ($conf->global->ADHERENT_BANK_USE)
- {
- if (! $_POST["accountid"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("FinancialAccount"));
- if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode"));
- if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label"));
- if ($errmsg) $action='addsubscription';
- }
}
if ($action=='cotisation')
diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php
index 7e855650360..1a6d2698cef 100644
--- a/htdocs/adherents/fiche.php
+++ b/htdocs/adherents/fiche.php
@@ -69,77 +69,6 @@ if ($_POST["action"] == 'confirm_sendinfo' && $_POST["confirm"] == 'yes')
}
}
-/*
-if ($_POST["action"] == 'cotisation')
-{
- $adh->id = $rowid;
- $adh->fetch($rowid);
-
- $reday=$_POST["reday"];
- $remonth=$_POST["remonth"];
- $reyear=$_POST["reyear"];
- if ($_POST["reyear"] && $_POST["remonth"] && $_POST["reday"])
- {
- $datecotisation=dolibarr_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
- }
- $cotisation=$_POST["cotisation"];
-
- $accountid=$_POST["accountid"];
- $operation=$_POST["operation"];
- $label=$_POST["label"];
- $num_chq=$_POST["num_chq"];
-
-
- if (! $datecotisation)
- {
- $errmsg=$langs->trans("BadDateFormat");
- $action='';
- }
-
- if (! $_POST["cotisation"] > 0)
- {
- $errmsg=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
- $action='';
- }
- if ($conf->global->ADHERENT_BANK_USE)
- {
- if (! $_POST["accountid"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->trans("FinancialAccount"));
- if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->trans("PaymentMode"));
- if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->trans("Label"));
- if ($errmsg) $action='';
- }
-
- if ($action)
- {
- $db->begin();
-
- $crowid=$adh->cotisation($datecotisation, $cotisation, $accountid, $operation, $label, $num_chq);
-
- if ($crowid > 0)
- {
- $db->commit();
-
- // Envoi mail
- if ($adh->email && $conf->global->ADHERENT_MAIL_COTIS)
- {
- $adh->send_an_email($adh->email,$conf->global->ADHERENT_MAIL_COTIS,$conf->global->ADHERENT_MAIL_COTIS_SUBJECT);
- }
-
- $_POST["cotisation"]='';
- $_POST["accountid"]='';
- $_POST["operation"]='';
- $_POST["label"]='';
- $_POST["num_chq"]='';
- }
- else
- {
- $db->rollback();
- dolibarr_print_error($db,$adh->error);
- }
- }
-}
-*/
-
if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"])
{
$datenaiss='';
@@ -789,35 +718,6 @@ if ($action == 'create')
print "\n";
print '
';
-/*
- // Boite cotisations
- print '
| ".$langs->trans("DateSubscription")." | \n"; - $htmls->select_date('','','','','','add'); - print " |
| '.$langs->trans("PaymentMode").' | '; - $htmls->select_types_paiements('','operation'); - print " |
| '.$langs->trans("FinancialAccount").' | '; - $htmls->select_comptes('','accountid'); - print " |
| '.$langs->trans("Numero").' | '; - print ''; - print " |
| '.$langs->trans("Label").' | |
| '.$langs->trans("Subscription").' | '.$langs->trans("Currency".$conf->monnaie).' |