Bugzilla – Attachment 179620 Details for
Bug 14250
Don't allow to generate discharges for patrons with fines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14250: (follow-up) Refacto the algorithm for discharge messages
Bug-14250-follow-up-Refacto-the-algorithm-for-disc.patch (text/plain), 5.46 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-03-21 14:26:26 UTC
(
hide
)
Description:
Bug 14250: (follow-up) Refacto the algorithm for discharge messages
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-03-21 14:26:26 UTC
Size:
5.46 KB
patch
obsolete
>From aa377853b17a696341e8c95c217e4bdf41b1c900 Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Wed, 4 Sep 2024 14:45:20 +0200 >Subject: [PATCH] Bug 14250: (follow-up) Refacto the algorithm for discharge > messages > >TEST PLAN: >1 - In the intranet add fines to a client and ensure they have no checkout >2 - Set syspref useDischarge to 'Allow' >3 - On client profile click on "Discharge", see it is possible >4 - On the opac, go to the tab "Ask for discharge", see it is possible >5 - Apply patch >6 - Click on the button "Ask for discharge" -> it will not be possible > and you will be propperly messaged >7 - Return to the tab "Ask for a discharge", there will be no button > anymore >8 - On the intranet page, there will be no button anymore >9 - Check out a book >10 - Repeat 7 and 8 and see the message include issue with checkout >11 - Remove fine and repeat 7 & 8 > >Note: removing the useless has_checkout and has_debt >--- > .../bootstrap/en/modules/opac-discharge.tt | 30 +++++++------------ > opac/opac-discharge.pl | 5 ---- > 2 files changed, 11 insertions(+), 24 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt >index 6dfcbf6b..20ff8ecf 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt >@@ -42,19 +42,6 @@ > <p><a href="/cgi-bin/koha/opac-discharge.pl?op=get">Get your discharge</a></p> > [% ELSIF pending %] > <p>Your discharge will be available on this page within a few days.</p> >- [% ELSIF failure %] >- <p>You cannot be discharged because you have checked out items. Please return your checked out items before asking for a discharge.</p> >- <ul> >- [% IF has_debt %] >- <li>You have unpaid charges. Please pay your charges before reapplying.</li> >- [% END %] >- [% IF has_issues %] >- <li>You have checked out items. Please return your checked out items before reapplying.</li> >- [% END %] >- [% IF !has_issue and !has_debt %] >- <li>You cannot be discharged for an unknown reason. Please contact library staff for more information.</li> >- [% END %] >- </ul> > [% ELSIF not messages %] > <h2>What is a discharge?</h2> > <p >@@ -63,12 +50,17 @@ > > > <p><strong>Warning</strong>: This request is only valid if you are in good standing with the library. Once the application is made, you can not borrow library materials.</p> > [% UNLESS can_be_discharged %] >- <div class="alert alert-info" >- >You cannot be discharged for following reasons: >- <ul> >- [% IF discharge_problems.checkouts %] >- <li> You have [% discharge_problems.checkouts | html %] item(s) checked out. Please return your checked out items before reapplying. </li> >- [% END %] >+ [% IF failure %] >+ <p> There was an error during the discharge process </p> >+ [% END %] >+ <div class="alert alert-info">You cannot be discharged because: >+ <ul> >+ [% IF discharge_problems.checkouts %] >+ <li> >+ You have [% discharge_problems.checkouts | html %] item(s) checked out. >+ Please return your checked out items before reapplying. >+ </li> >+ [% END %] > > [% IF discharge_problems.debt %] > <li> You have unpaid charges of [% discharge_problems.debt | $Price %]. Please pay your charges before reapplying. </li> >diff --git a/opac/opac-discharge.pl b/opac/opac-discharge.pl >index 54fc526d..34fcaea4 100755 >--- a/opac/opac-discharge.pl >+++ b/opac/opac-discharge.pl >@@ -49,13 +49,10 @@ my ( $can_be_discharged, $discharge_problems ) = > Koha::Patron::Discharge::can_be_discharged( { borrowernumber => $loggedinuser } ); > my $patron = Koha::Patrons->find($loggedinuser); > my $has_pending_checkouts = $patron->checkouts->count; >-my $has_debt = ( $patron->account->outstanding_debits->total_outstanding > 0 ); > > $template->param( > can_be_discharged => $can_be_discharged, > discharge_problems => $discharge_problems, >- has_checkouts => $has_pending_checkouts, >- has_debt => $has_debt, > ); > > my $pending = Koha::Patron::Discharge::count( >@@ -82,8 +79,6 @@ if ( $op eq 'cud-request' ) { > $template->param( success => 1 ); > } else { > $template->param( failure => 1 ); >- $template->param( has_issues => $has_pending_checkouts ); >- $template->param( has_debt => $has_debt ); > } > } elsif ( $op eq 'get' ) { > unless ($available) { >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14250
:
170136
|
170228
|
170581
|
170607
|
170662
|
170663
|
170664
|
170705
|
170706
|
170707
|
170708
|
171025
|
171026
|
171271
|
171272
|
171273
|
171274
|
171275
|
171276
|
179617
|
179618
|
179619
| 179620 |
179621
|
179622