From c83d362bc17cb07468a500194cb5b774e1aa6e40 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Nov 2024 12:26:04 +0100 Subject: [PATCH] Fix edit of amount on public payment page --- htdocs/public/payment/newpayment.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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