From a051f2174b1fbc4f84dd6861c48839e2cfb9f37a Mon Sep 17 00:00:00 2001 From: Hystepik Date: Wed, 31 Jan 2024 11:25:42 +0100 Subject: [PATCH] fix amount --- htdocs/adherents/list.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 93e8a0dfc9520..f5e133dd011ae 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -349,6 +349,10 @@ $res = $adht->fetch($tmpmember->typeid); if ($res > 0) { $amount = $adht->amount; + if (!empty($tmpmember->last_subscription_amount) && !GETPOSTISSET('newamount') && is_numeric($amount)) { + $amount = max($tmpmember->last_subscription_amount, $amount); + } + $amount = max(0, getDolGlobalString('MEMBER_MIN_AMOUNT'), $amount); $result = $tmpmember->subscription($now, $amount); if ($result < 0) { $error++; @@ -778,7 +782,7 @@ $objecttmp = new Adherent($db); $trackid = 'mem'.$object->id; if ($massaction == 'createsubscription') { - print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassSubsriptionCreation"), $langs->trans("ConfirmMassSubsriptionCreationQuestion", count($toselect)), "createsubscription", $formquestion, '', 0, 200, 500, 1); + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassSubsriptionCreation"), $langs->trans("ConfirmMassSubsriptionCreationQuestion", count($toselect)), "createsubscription", '', '', 0, 200, 500, 1); } include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';