From 92fa2abd6ec37019b925d39ca418fc48049d1d83 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 23 Jan 2020 12:57:04 +0000 Subject: [PATCH] Bug 24489: Don't allow payment of 0 To test: 1 - Put a fine on a patron 2 - Go to Accounting->Make a payment on the patrons record 3 - Select the fine and click 'Write off selected' 4 - Enter '.0001' into Writeoff amount and hit confirm 5 - You are redirected to make a payment with no error and are no longer writing off selected 6 - Apply patch 7 - Attempt to pay less than a cent 8 - You are warned that you must pay more than 0 --- koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt index fa358135e6..6708265011 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt @@ -339,6 +339,16 @@ var forms = $('#payindivfine, #payfine'); var change = $('#change')[0]; + forms.on('submit',function(){ + if( $("#paid").val() == 0 ){ + alert(_("You must pay an amount greater than 0")); + forms.beensubmitted = false; + return false; + } else { + return true; + } + }); + $('#payindivfine, #payfine').preventDoubleFormSubmit(); $("#paid, #collected").on("change",function() { moneyFormat( this ); -- 2.11.0