In Patrons > Pay Fines page, if there is a payable fine but all of them are not selected and "Pay selected" button is pressed. The next page shown is "Pay an amount toward all fines" with the "Total amount outstanding" being the total fines. The page shown should be "Pay an amount toward selected fines" like when some item is selected, with "Total amount outstanding" = 0. Step to reproduce: 1. Select a patron with some outstanding fines item. 2. Go to Pay fines page at /cgi-bin/koha/members/pay.pl?borrowernumber=xxx 3. Deselect every item. 4. Press "Pay selected" Current Result: - Next page shown is "Pay an amount toward all fines" Expected Result: - Next page shown is "Pay an amount toward selected fines"
The problem is that when nothing is selected, &selected= parameter is passed with empty string. The condition in paycollect.pl will miss it. It might be simply fixed by update that condition to use "defined" function. --- paycollect.pl 2013-03-28 14:10:16.518906138 +0700 +++ new/paycollect.pl 2013-03-28 14:11:12.994905576 +0700 @@ -86,7 +86,7 @@ notify_id => $notify_id, notify_level => $notify_level, ); -} elsif ($select_lines) { +} elsif (defined $select_lines) { $total_due = $input->param('amt'); $template->param( selected_accts => $select_lines
Maybe it's better if "Pay selected" is not clickable if nothing is selected.
Created attachment 20246 [details] [review] Bug 9943 - Pay fines page "Pay selected" button give invalid amount when nothing is selected If you select no fines but click the "pay selected" button the resulting screen offers to let you pay against all fines, which is confusing. To simplify things this patch disables the "pay selected" button if no lines are selected. To test, apply the patch and find a patron with outstanding fines. From the "pay fines" page (members/pay.pl) try selecting and deselecting checkboxes and using the "select all" and "clear all" links. When no item is selected the "Pay selected" button should become disabled. Confirm that the form submits correctly when one or more fines is selected.
Created attachment 20259 [details] [Signed off] Bug 9943 - Pay fines page "Pay selected" button give invalid amount when nothing is selected I confirmed the behavior that Pongtawat described on master. After applying this patch, I went to the pay fines page for a patron with fines. I selected and deselected each checkbox one by one, and I used the Select All and Clear All links successfully. I confirmed that the "Pay Selected" button is disabled when nothing is selected. I paid off one selected fine, and also paid off multiple fines with the pay selected button. All behaves as expected, so I am signing off!
Created attachment 20429 [details] [review] Bug 9943 - Pay fines page "Pay selected" button give invalid amount when nothing is selected If you select no fines but click the "pay selected" button the resulting screen offers to let you pay against all fines, which is confusing. To simplify things this patch disables the "pay selected" button if no lines are selected. To test, apply the patch and find a patron with outstanding fines. From the "pay fines" page (members/pay.pl) try selecting and deselecting checkboxes and using the "select all" and "clear all" links. When no item is selected the "Pay selected" button should become disabled. Confirm that the form submits correctly when one or more fines is selected. Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Created attachment 20603 [details] [review] [PASSED QA] Bug 9943 - Pay fines page "Pay selected" button give invalid amount when nothing is selected If you select no fines but click the "pay selected" button the resulting screen offers to let you pay against all fines, which is confusing. To simplify things this patch disables the "pay selected" button if no lines are selected. To test, apply the patch and find a patron with outstanding fines. From the "pay fines" page (members/pay.pl) try selecting and deselecting checkboxes and using the "select all" and "clear all" links. When no item is selected the "Pay selected" button should become disabled. Confirm that the form submits correctly when one or more fines is selected. Signed-off-by: Melia Meggs <melia@bywatersolutions.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes all tests and QA script. Works nicely in my tests.
Pushed to master. Thanks, Owen!
This patch has been pushed to 3.12.x, will be in 3.12.7. Thanks Owen!