From 4b03cd4d1b66373c8ce582c2982cb1b0783d27fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Fri, 21 Apr 2017 17:50:45 +0200 Subject: [PATCH] Bug 13796: OPAC: Display rental charge for renewing This patch displays the rental fee that will be applied for renewing (near "Renew" link on patron's summary page) To test: - Apply patch - Enable system preference 'OpacRenewalAllowed' - Verify that you have item types with and without rental fee for testing - Issue items with an without rental fee to a patron - In OPAC, display patron's summary page - Verify in table 'Checked out', items with rental charge display an information as appropriate (near the link 'Renew') Patch rewritten because of merge issues with previous patches. 2017-04-21 mv Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 5 ++++- opac/opac-user.pl | 1 + 2 files changed, 5 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 074b9c576b..53021d4c6e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -281,8 +281,11 @@ Using this account is not recommended because some parts of Koha will not functi [% IF ( ISSUE.status ) %] [% IF ( canrenew ) %] Renew + ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining) + [% END %] + [% IF ISSUE.renewalfee > 0 %] + Fee for item type '[% ItemTypes.GetDescription( ISSUE.renewalitemtype) %]': [% ISSUE.renewalfee | $Price %] [% END %] - ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining) [% ELSIF ( ISSUE.on_reserve ) %] Not renewable (on hold) [% ELSIF ( ISSUE.too_many ) %] diff --git a/opac/opac-user.pl b/opac/opac-user.pl index bc39c804e5..55c04a3a78 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -209,6 +209,7 @@ if ($issues){ # check if item is renewable my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} ); ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'}); + ( $issue->{'renewalfee'}, $issue->{'renewalitemtype'} ) = GetIssuingCharges( $issue->{'itemnumber'}, $borrowernumber ); if($status && C4::Context->preference("OpacRenewalAllowed")){ $issue->{'status'} = $status; } -- 2.11.0