diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 64cc4fa8dc4..bcbbbd5f701 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -408,10 +408,10 @@ if ($search_filter == 'waitingsubscription') {
$sql .= " AND (datefin IS NULL AND t.subscription = '1')";
}
if ($search_filter == 'uptodate') {
- $sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = '0')";
+ $sql .= " AND (datefin >= '".$db->idate($now)."' OR (datefin IS NULL AND t.subscription = '0'))";
}
if ($search_filter == 'outofdate') {
- $sql .= " AND (datefin < '".$db->idate($now)."' AND t.subscription = '1')";
+ $sql .= " AND (datefin < '".$db->idate($now)."')";
}
if ($search_status != '') {
// Peut valoir un nombre ou liste de nombre separes par virgules
@@ -500,6 +500,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
}
$db->free($resql);
}
+//print $sql;
// Complete request and execute it with limit
$sql .= $db->order($sortfield, $sortorder);
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index 7361ba8fa7f..2f10848a827 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -383,7 +383,7 @@ if ($action == 'create') {
print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy", 'aZ09') : 'morphy');
print "";
- print '
| '.$langs->trans("SubscriptionRequired").' | ';
+ print ' |
| '.$form->textwithpicto($langs->trans("SubscriptionRequired"), $langs->trans("SubscriptionRequiredDesc")).' | ';
print $form->selectyesno("subscription", 1, 1);
print ' |
';
@@ -459,7 +459,7 @@ if ($rowid > 0) {
print '| '.$langs->trans("MembersNature").' | '.$object->getmorphylib($object->morphy).' | ';
print '
';
- print '| '.$langs->trans("SubscriptionRequired").' | ';
+ print ' |
| '.$form->textwithpicto($langs->trans("SubscriptionRequired"), $langs->trans("SubscriptionRequiredDesc")).' | ';
print yn($object->subscription);
print ' |
';
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index a5303555f71..942473a362b 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -7953,6 +7953,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
}
if (is_object($object) && $object->element == 'member') {
$typeforonlinepayment = 'member';
+ $amounttouse = 0;
+ if (!empty($object->last_subscription_amount)) {
+ $amounttouse = $object->last_subscription_amount;
+ }
}
if (is_object($object) && $object->element == 'contrat') {
$typeforonlinepayment = 'contract';
@@ -7960,7 +7964,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
if (is_object($object) && $object->element == 'fichinter') {
$typeforonlinepayment = 'ficheinter';
}
- $url = getOnlinePaymentUrl(0, $typeforonlinepayment, $substitutionarray['__REF__']);
+
+ $url = getOnlinePaymentUrl(0, $typeforonlinepayment, $substitutionarray['__REF__'], $amounttouse);
$paymenturl = $url;
}
diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang
index b35b704b87f..4da2b7af21b 100644
--- a/htdocs/langs/en_US/members.lang
+++ b/htdocs/langs/en_US/members.lang
@@ -92,6 +92,7 @@ NoTypeDefinedGoToSetup=No member types defined. Go to menu "Members types"
NewMemberType=New member type
WelcomeEMail=Welcome email
SubscriptionRequired=Contribution required
+SubscriptionRequiredDesc=If subscription is required, a subscription with a start or end date must be recorded to have the member up to date (whatever is subscription amount, even if subscription is free).
DeleteType=Delete
VoteAllowed=Vote allowed
Physical=Individual