Summary: | Can generate discharge for patrons with fines | ||
---|---|---|---|
Product: | Koha | Reporter: | Nicole C. Engard <nengard> |
Component: | Patrons | Assignee: | nikkom |
Status: | NEW --- | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | gmcharlt, jamsheer.np, jonathan.druart, kohadevinim, kyle.m.hall, nikkom, veron |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Bug Depends on: | 8007 | ||
Bug Blocks: |
Description
Nicole C. Engard
2015-05-21 16:47:46 UTC
Generating discharge to a patron having unpaid fine is a serious problem. Generating discharge to a patron having unpaid fine is a serious problem. *** Bug 25986 has been marked as a duplicate of this bug. *** I have not tested but this fix should be as simple as: diff --git a/Koha/Patron/Discharge.pm b/Koha/Patron/Discharge.pm index 76e04e8533a..b9ebc7653af 100644 --- a/Koha/Patron/Discharge.pm +++ b/Koha/Patron/Discharge.pm @@ -39,7 +39,12 @@ sub can_be_discharged { return unless $patron; my $has_pending_checkouts = $patron->checkouts->count; - return $has_pending_checkouts ? 0 : 1; + return 0 if $has_pending_checkouts; + + my $has_debt = $patron->account->outstanding_debits->total_outstanding + return 0 if $has_debt; + + return 1; } sub is_discharged { Still valid in master (22.12.00.048) |