';
diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php
index 2911564adef..c006c4b9c9f 100644
--- a/htdocs/core/lib/payments.lib.php
+++ b/htdocs/core/lib/payments.lib.php
@@ -318,7 +318,9 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
}
} elseif ($type == 'member' || $type == 'membersubscription') {
$newtype = 'member';
- $out = $urltouse.'/public/payment/newpayment.php?source=member&ref='.($mode ? '' : '');
+ $out = $urltouse.'/public/payment/newpayment.php?source=member';
+ $out .= '&amount='.$amount;
+ $out .= '&ref='.($mode ? '' : '');
if ($mode == 1) {
$out .= 'member_ref';
}
diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
index b57cab5b4eb..c465151f9c2 100644
--- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
+++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
@@ -648,4 +648,5 @@ ALTER TABLE llx_paiement MODIFY COLUMN ext_payment_id varchar(255);
ALTER TABLE llx_payment_donation MODIFY COLUMN ext_payment_id varchar(255);
ALTER TABLE llx_prelevement_facture_demande MODIFY COLUMN ext_payment_id varchar(255);
-
+-- Allow users to make subscriptions of any amount during membership subscription
+ALTER TABLE llx_adherent_type ADD COLUMN caneditamount varchar(3) DEFAULT 0 AFTER amount;
diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang
index fafa1a60400..e552755f705 100644
--- a/htdocs/langs/en_US/members.lang
+++ b/htdocs/langs/en_US/members.lang
@@ -71,6 +71,9 @@ MemberTypeCanNotBeDeleted=Member type can not be deleted
NewSubscription=New contribution
NewSubscriptionDesc=This form allows you to record your subscription as a new member of the foundation. If you want to renew your subscription (if already a member), please contact foundation board instead by email %s.
Subscription=Contribution
+AnyAmountWithAdvisedAmount=Any amount with a recommended amount of %s %s
+AnyAmountWithoutAdvisedAmount=Any amount
+CanEditAmountShort=Any amount
Subscriptions=Contributions
SubscriptionLate=Late
SubscriptionNotReceived=Contribution never received
diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang
index a6f805daca6..5f67cc681ab 100644
--- a/htdocs/langs/fr_FR/members.lang
+++ b/htdocs/langs/fr_FR/members.lang
@@ -199,6 +199,9 @@ AmountOfSubscriptions=Montant des cotisations
TurnoverOrBudget=Chiffre affaire (pour société) ou Budget (asso ou collectivité)
DefaultAmount=Montant par défaut de la cotisation
CanEditAmount=Le visiteur peut modifier / choisir le montant de sa cotisation
+AnyAmountWithAdvisedAmount=Montant libre avec un montant recommandé de %s %s
+AnyAmountWithoutAdvisedAmount=Montant libre
+CanEditAmountShort=Montant libre
MEMBER_NEWFORM_PAYONLINE=Rediriger sur la page intégrée de paiement en ligne
ByProperties=Par nature
MembersStatisticsByProperties=Statistiques des adhérents par nature
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 654fce78ccc..f6957502284 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -692,16 +692,31 @@ if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) {
// Clean the amount
$amount = price2num($amount);
-
+ $adht = new AdherentType($db);
+ $adht->fetch($typeid);
+ $caneditamount = $adht->caneditamount;
+ $showedamount = $amount>0? $amount: 0;
// $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe'
- print '