Bugzilla – Attachment 144110 Details for
Bug 26598
Display guarantee's fines on guarantor's details page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26598: Display guarantee's fines on guarantor's details page
Bug-26598-Display-guarantees-fines-on-guarantors-d.patch (text/plain), 7.08 KB, created by
Hammat wele
on 2022-11-21 12:46:53 UTC
(
hide
)
Description:
Bug 26598: Display guarantee's fines on guarantor's details page
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2022-11-21 12:46:53 UTC
Size:
7.08 KB
patch
obsolete
>From 9ee6d6bc18ba9f8810e33e3d9507a547994e3829 Mon Sep 17 00:00:00 2001 >From: Maryse Simard <maryse.simard@inlibro.com> >Date: Thu, 1 Oct 2020 23:53:17 -0400 >Subject: [PATCH] Bug 26598: Display guarantee's fines on guarantor's details > page > >A new tab is added to the details page of a patron to show, in a table, the fines of the patron's guarantees. A warning appears in the "Guarantees" section of the patron to make it obvious that fines exists. > >+ resolve a git merge conflict > >To test: >1) Apply patch >2) Choose a patron that has guarantees and navigate to the patron's details page >3) If the guarantees don't have any fines, the display should be unchanged >4) Add fines to the guarantee >5) Go back to the guarantor's details page > => A warning should appear in the "Guarantees" section with the total due >6) Clicking on the link accompanying the warning focuses on the new >"Guarantees' fines" tab containing a table of all guarantee's and their >fines. > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Hammat Wele <hammat.wele@inlibro.com> >--- > .../prog/en/modules/members/moremember.tt | 54 +++++++++++++++++-- > members/moremember.pl | 5 ++ > 2 files changed, 54 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index ef0a906c90..2352920ffa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -212,6 +212,13 @@ > <li> > <span class="label">Guarantees:</span> > <ul> >+ [% IF guarantees_fines and guarantees_fines > 0 %] >+ <li class="guarantees-fines"> >+ <span class="circ-hlt">Charges:</span> >+ Patron's guarantees collectively owe [% guarantees_fines | $Price %]. >+ <a id="view-guarantees-finesandcharges" href="#guarantees-finesandcharges" >See all charges.</a> >+ </li> >+ [% END %] > [% FOREACH guarantee IN guarantees %] > [% IF logged_in_user.can_see_patron_infos( guarantee ) %] > <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber | uri %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></li> >@@ -667,6 +674,11 @@ > <a href="#finesandcharges" aria-controls="finesandcharges" role="tab" data-toggle="tab">Charges ([% fines | $Price %])</a> > </li> > [% END %] >+ [% IF ( guarantees_fines ) %] >+ <li id="guarantees-finestab"> >+ <a href="#guarantees-finesandcharges">Guarantees' charges ([% guarantees_fines | $Price %])</a> >+ </li> >+ [% END %] > [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %] > <li role="presentation"> > <a href="#reserves" id="holds-tab" aria-controls="reserves" role="tab" data-toggle="tab">Holds ([% holds_count || 0 | html %])</a> >@@ -742,11 +754,38 @@ > </div> > [% END %] > >- [% IF CAN_user_clubs && ( enrollments.count || enrollable.count ) %] >- <div id="clubs-tab" role="tabpanel" class="tab-pane"> >- Loading... >- </div> >- [% END %] >+ [% IF ( guarantees_fines ) %] >+ <div id="guarantees-finesandcharges"> >+ <table id="tguaranteesfines"> >+ <thead> >+ <tr> >+ <th>Guarantee</th> >+ <th>Amount outstanding</th> >+ </tr> >+ </thead> >+ [% FOREACH guarantee IN guarantees %] >+ <tr> >+ <td>[% INCLUDE 'patron-title.inc' patron=guarantee hide_patron_infos_if_needed=1 %]</td> >+ [% IF logged_in_user.can_see_patron_infos( guarantee ) %] >+ <td>[% guarantee.account.balance | $Price %]</td> >+ [% ELSE %] >+ <td>-</td> >+ [% END %] >+ </tr> >+ [% END %] >+ <tfoot> >+ <td>Total due</td> >+ <td>[% guarantees_fines | $Price %]</td> >+ </tfoot> >+ </table> >+ </div> >+ [% END %] >+ >+ [% IF CAN_user_clubs && ( enrollments.count || enrollable.count ) %] >+ <div id="clubs-tab"> >+ Loading... >+ </div> >+ [% END %] > > [% INCLUDE borrower_debarments.inc %] > >@@ -912,6 +951,11 @@ > $("#view_restrictions").on("click",function(){ > $('#debarments-tab-link').click(); > }); >+ >+ $("#view-guarantees-finesandcharges").on("click",function(){ >+ $('#guarantees-finestab a').click(); >+ }); >+ > }); > function uncheck_sibling(me){ > nodename=me.getAttribute("name"); >diff --git a/members/moremember.pl b/members/moremember.pl >index 0523d02831..ebfad3df82 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -117,6 +117,11 @@ $template->param( > my $relatives_issues_count = > Koha::Checkouts->count({ borrowernumber => \@relatives }); > >+if ( @guarantees ) { >+ my $total_amount = $patron->relationships_debt({ include_guarantors => 0, only_this_guarantor => 1, include_this_patron => 1 }); >+ $template->param( guarantees_fines => $total_amount ); >+} >+ > # Calculate and display patron's age > if ( !$patron->is_valid_age ) { > $template->param( age_limitations => 1 ); >-- >2.34.1
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 26598
:
111055
|
111320
|
112110
|
139712
|
140376
|
142655
|
144110
|
144696
|
144697
|
151499