diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 885186e83711c..21e67dde87e50 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1673,11 +1673,11 @@ if (empty($amount) && getDolGlobalString('MEMBER_NEWFORM_AMOUNT')) { $amount = getDolGlobalString('MEMBER_NEWFORM_AMOUNT'); } - // - If not set, we accept to have amount defined as parameter (for backward compatibility). - //if (empty($amount)) { - // $amount = (GETPOST('amount') ? price2num(GETPOST('amount', 'alpha'), 'MT', 2) : ''); - //} - // - If a min is set, we take it into account + // - If a new amount was posted from the form + if ($caneditamount && GETPOSTISSET('newamount') && GETPOSTFLOAT('newamount', 'MT') > 0) { + $amount = GETPOSTFLOAT('newamount', 'MT'); + } + // - If a min is set or an amount from the posted form, we take them into account $amount = max(0, (float) $amount, (float) getDolGlobalInt("MEMBER_MIN_AMOUNT")); // Amount