When one tries to delete a patron that has a credit in his account, no warning is produced. The deletion is not performed (which is the proper behavior), however one would expect to see a warning similar to the one that is produced when the patron has an unpaid fine, a checked out item, a hold, etc. The following screencast was performed in ByWaters' sandboxes running 19.05 and shows the issue: https://screencast-o-matic.com/watch/cq6D6vu4YJ
This statement: my $charges = $patron->account->non_issues_charges; will return -15 on master and 0 on 19.05.X Tomas, Martin, what is the expected behavior?
(In reply to Jonathan Druart from comment #1) > This statement: > my $charges = $patron->account->non_issues_charges; > will return -15 on master and 0 on 19.05.X > > Tomas, Martin, what is the expected behavior? Well.. non_issuing_charges should only return debts, so I'd say master has developed a bug. (The query should include a `AND debit_type_code IS NOT NULL` I believe.)
I think this actually exposes some wider questions regarding that routine.. see bug 23293 for example.. it doesn't use the non_issuing_charges method when it probably should (again, my bad :( )
Created attachment 95254 [details] [review] Bug 23822: Fix deletion of patrons with credit There are bugs in both master and 19.05, but different. Anyway we should have this check to make sure a negative value will have the same behavior: trigger the confirmation message (instead of a blank page). If we want to reject the deletion of a patron with credit we should handle it on a separate bug report (behavior change)
I would suggest to push this patch into master even if this specific bug does not exist.
Updated the bug title to reflect the impact of the change and Jonathans bugfix.. Cloned the original bug to bug 24008 to record the enhancement request to add blocking of patron deletions if outstanding credits are found and additional warnings as this is an additional workflow that needs implementing.
Created attachment 95327 [details] [review] Bug 23822: Fix deletion of patrons with credit There are bugs in both master and 19.05, but different. Anyway we should have this check to make sure a negative value will have the same behavior: trigger the confirmation message (instead of a blank page). If we want to reject the deletion of a patron with credit we should handle it on a separate bug report (behavior change) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
A simple patch that restores the original behaviour... Signing off.
Created attachment 95388 [details] [review] Bug 23822: Fix deletion of patrons with credit There are bugs in both master and 19.05, but different. Anyway we should have this check to make sure a negative value will have the same behavior: trigger the confirmation message (instead of a blank page). If we want to reject the deletion of a patron with credit we should handle it on a separate bug report (behavior change) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Nice work! Pushed to master for 19.11.00
Shouldn't we also fix the other line : if ( $op eq 'delete_confirm' or $countissues > 0 or $charges or $is_guarantor ) {
(In reply to Fridolin SOMERS from comment #11) > Shouldn't we also fix the other line : > if ( $op eq 'delete_confirm' or $countissues > 0 or $charges or > $is_guarantor ) { Maybe, we are going to follow-up on bug 24008 anyway.
Pushed to 19.05.x for 19.05.05