diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index f4208f590fd..35d4015e270 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -424,10 +424,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
@@ -516,6 +516,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 8a4c189766f..394a17433f4 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -433,7 +433,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 ' |
';
@@ -509,7 +509,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 bdeb1994ba3..2da236006c0 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -8049,6 +8049,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';
@@ -8056,7 +8060,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 3251618032f..032d4008f00 100644
--- a/htdocs/langs/en_US/members.lang
+++ b/htdocs/langs/en_US/members.lang
@@ -94,6 +94,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