From 895767c146e463d231f4cc95a8e45149b5a51359 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Thu, 5 Jan 2017 02:01:57 +0000 Subject: [PATCH] Bug 15738: Show rental fees on OPAC summary page This patch adds a few lines that check for a rental fee on an item. If yes, it will show in brackets as a rental fee on the OPAC summary page. To test: 1) Have a borrower with an overdue item accruing fines, a lost item and an item with a rental fee. Confirm the Fines column on the OPAC summary page now shows you what you may expect to see for each item. Sponsored-by: Catalyst IT Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart Signed-off-by: Mason James --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 4 +++- opac/opac-user.pl | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 9aa4cc3c77..a29cd2df4c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -283,7 +283,9 @@ Using this account is not recommended because some parts of Koha will not functi Fines: [% IF ( ISSUE.charges ) %] - Yes + Yes (Item overdue or lost) + [% ELSIF ( ISSUE.rentalfines ) %] + Yes (Rental fees) [% ELSE %] No [% END %] diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 14f548ac1f..06d410f0bb 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -185,6 +185,7 @@ if ($issues){ my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); my $charges = 0; + my $rentalfines = 0; foreach my $ac (@$accts) { if ( $ac->{'itemnumber'} == $issue->{'itemnumber'} ) { $charges += $ac->{'amountoutstanding'} @@ -193,9 +194,12 @@ if ($issues){ if $ac->{'accounttype'} eq 'FU'; $charges += $ac->{'amountoutstanding'} if $ac->{'accounttype'} eq 'L'; + $rentalfines += $ac->{'amountoutstanding'} + if $ac->{'accounttype'} eq 'Rent'; } } $issue->{'charges'} = $charges; + $issue->{'rentalfines'} = $rentalfines; my $marcrecord = GetMarcBiblio( $issue->{'biblionumber'} ); $issue->{'subtitle'} = GetRecordValue('subtitle', $marcrecord, GetFrameworkCode($issue->{'biblionumber'})); # check if item is renewable -- 2.39.5