From 4c1d203980af0e1d5495e68df11de9d89018c06d Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Thu, 8 Sep 2011 18:29:24 +1200 Subject: [PATCH] Bug 6857: display a charge warning alert for reserves If a user is placing a reserve on the OPAC, this'll let them know that it's going to cost them. Author: Chris Cormack Signed-off-by: Nicole C. Engard Signed-off-by: Chris Cormack --- C4/Members.pm | 6 ++++-- koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt | 5 +++++ opac/opac-reserve.pl | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index dcc168b9c4..8d4a6c5765 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -2,6 +2,7 @@ package C4::Members; # Copyright 2000-2003 Katipo Communications # Copyright 2010 BibLibre +# Parts Copyright 2010 Catalyst IT # # This file is part of Koha. # @@ -352,11 +353,11 @@ sub GetMemberDetails { my $query; my $sth; if ($borrowernumber) { - $sth = $dbh->prepare("select borrowers.*,category_type,categories.description from borrowers left join categories on borrowers.categorycode=categories.categorycode where borrowernumber=?"); + $sth = $dbh->prepare("SELECT borrowers.*,category_type,categories.description,reservefee FROM borrowers LEFT JOIN categories ON borrowers.categorycode=categories.categorycode WHERE borrowernumber=?"); $sth->execute($borrowernumber); } elsif ($cardnumber) { - $sth = $dbh->prepare("select borrowers.*,category_type,categories.description from borrowers left join categories on borrowers.categorycode=categories.categorycode where cardnumber=?"); + $sth = $dbh->prepare("SELECT borrowers.*,category_type,categories.description,reservefee FROM borrowers LEFT JOIN categories ON borrowers.categorycode=categories.categorycode WHERE cardnumber=?"); $sth->execute($cardnumber); } else { @@ -386,6 +387,7 @@ sub GetMemberDetails { $sth->execute( $borrower->{'categorycode'} ); my $enrolment = $sth->fetchrow; $borrower->{'enrolmentperiod'} = $enrolment; + return ($borrower); #, $flags, $accessflagshash); } diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt index 4d81a1751e..12c51909f4 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt @@ -220,6 +220,11 @@ [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %]) [% END %] [% END %] + [% IF (RESERVE_CHARGE) %] +
+ There is a charge of [% RESERVE_CHARGE %] for placing this reserve +
+ [% END %]
diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index a92a976003..ab02afe83d 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -54,6 +54,10 @@ sub get_out ($$$) { # get borrower information .... my ( $borr ) = GetMemberDetails( $borrowernumber ); +# Pass through any reserve charge +if ($borr->{reservefee} > 0){ + $template->param( RESERVE_CHARGE => sprintf("%.2f",$borr->{reservefee})); +} # get branches and itemtypes my $branches = GetBranches(); my $itemTypes = GetItemTypes(); -- 2.39.5