[Koha-patches] [PATCH] Display amount of credit patron has, not just that they have credit.

Chris Cormack chrisc at catalyst.net.nz
Wed Feb 17 02:34:07 CET 2010


From: Will Stokes <will at catalyst.net.nz>

Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz>
---
 circ/circulation.pl                                |    6 ++++--
 .../prog/en/modules/circ/circulation.tmpl          |    4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/circ/circulation.pl b/circ/circulation.pl
index 4cd0ff7..96601ec 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -561,7 +561,8 @@ foreach my $flag ( sort keys %$flags ) {
         elsif ( $flag eq 'CREDITS' ) {
             $template->param(
                 credits    => 'true',
-                creditsmsg => $flags->{'CREDITS'}->{'message'}
+                creditsmsg => $flags->{'CREDITS'}->{'message'},
+                creditsamount => sprintf("%.02f", -($flags->{'CREDITS'}->{'amount'})), # from patron's pov
             );
         }
     }
@@ -577,7 +578,8 @@ foreach my $flag ( sort keys %$flags ) {
         elsif ( $flag eq 'CREDITS' ) {
             $template->param(
                 credits    => 'true',
-                creditsmsg => $flags->{'CREDITS'}->{'message'}
+                creditsmsg => $flags->{'CREDITS'}->{'message'},
+                creditsamount => sprintf("%.02f", -($flags->{'CREDITS'}->{'amount'})), # from patron's pov
             );
         }
         elsif ( $flag eq 'ODUES' ) {
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
index 7bbdffa..466b35a 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
@@ -514,7 +514,9 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
 			<!-- /TMPL_IF -->
 
         	<!-- TMPL_IF NAME="credits" -->
-			<li><span class="circ-hlt">Credits:</span> Patron has a credit</li>
+			<li>
+                <span class="circ-hlt">Credits:</span> Patron has a credit<!-- TMPL_IF NAME="creditsamount" --> of <!-- TMPL_VAR name="creditsamount" --><!-- /TMPL_IF -->
+            </li>
 			<!-- /TMPL_IF -->
 
 
-- 
1.6.3.3




More information about the Koha-patches mailing list