Bug 15738: Show rental fees on OPAC summary page
authorAleisha Amohia <aleishaamohia@hotmail.com>
Thu, 5 Jan 2017 02:01:57 +0000 (02:01 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 28 Apr 2017 10:53:59 +0000 (06:53 -0400)
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 <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
opac/opac-user.pl

index e724b18..e8b6d96 100644 (file)
@@ -281,7 +281,9 @@ Using this account is not recommended because some parts of Koha will not functi
                                                     <td class="fines">
                                                         <span class="tdlabel">Fines:</span>
                                                         [% IF ( ISSUE.charges ) %]
-                                                            Yes
+                                                            Yes (Item overdue or lost)
+                                                        [% ELSIF ( ISSUE.rentalfines ) %]
+                                                            Yes (Rental fees)
                                                         [% ELSE %]
                                                             No
                                                         [% END %]
index adba791..346aae4 100755 (executable)
@@ -188,6 +188,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'}
@@ -196,9 +197,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