fix for 2177: Barcode on checkout slip
authorJesse Weaver <jesse.weaver@liblime.com>
Mon, 14 Jul 2008 17:15:15 +0000 (12:15 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 15 Jul 2008 01:10:03 +0000 (20:10 -0500)
This patch adds barcodes to the Checkouts and Overdues section of the receipt. It also removes the Overdues section if it is empty.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tmpl
members/moremember.pl

index 6c97137..786f442 100644 (file)
@@ -15,35 +15,42 @@ Issued To <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=<!-- TMPL_VAR
 <!-- TMPL_VAR NAME="todaysdate" --><br />
 
 <table>
-       <caption>Issues</caption>
-       <tr>
-               <th>Date Due</th>
-               <th>Title</th>
-       </tr>
+    <caption>Issues</caption>
+    <tr>
+        <th>Date Due</th>
+        <th>Title</th>
+        <th>Barcode</th>
+    </tr>
 
-       <!-- TMPL_loop name="issueloop" -->
-       <!-- TMPL_IF name="red" --><!-- TMPL_ELSE -->
-               <tr>
-               <td><!-- TMPL_VAR NAME="date_due" --></td>
-               <td><a href="/cgi-bin/koha/catalogue/detail.pl?item=<!-- TMPL_VAR NAME="itemnumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->"><!-- TMPL_VAR NAME="title" --></a></td>
-               </tr>
-       <!-- /TMPL_IF -->
-       <!-- /TMPL_LOOP -->
+    <!-- TMPL_loop name="issueloop" -->
+    <!-- TMPL_IF name="red" --><!-- TMPL_ELSE -->
+    <tr>
+        <td><!-- TMPL_VAR NAME="date_due" --></td>
+        <td><a href="/cgi-bin/koha/catalogue/detail.pl?item=<!-- TMPL_VAR NAME="itemnumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->"><!-- TMPL_VAR NAME="title" --></a></td>
+        <td><!-- TMPL_VAR NAME="barcode" --></td>
+    </tr>
+    <!-- /TMPL_IF -->
+    <!-- /TMPL_LOOP -->
 </table>
-       
-       <table>
-       <caption>Overdues</caption>
-       <tr>
-       <th>Date Due</th>
-       <th>Title</th>
-       </tr>
-       <!-- TMPL_LOOP NAME="issueloop" -->
-       <!-- TMPL_IF NAME="red" --><tr>
-       <td><!-- TMPL_VAR NAME="date_due" --></td>
-       <td><a href="/cgi-bin/koha/catalogue/detail.pl?item=<!-- TMPL_VAR NAME="itemnumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->"><!-- TMPL_VAR NAME="title" --></a></td>
-       </tr>
-       <!-- /TMPL_IF -->
-       <!-- /TMPL_LOOP -->
-       </table>
+
+<!-- TMPL_IF NAME="overdues_exist" -->
+<table>
+    <caption>Overdues</caption>
+    <tr>
+        <th>Date Due</th>
+        <th>Title</th>
+        <th>Barcode</th>
+    </tr>
+    <!-- TMPL_LOOP NAME="issueloop" -->
+    <!-- TMPL_IF NAME="red" -->
+    <tr>
+        <td><!-- TMPL_VAR NAME="date_due" --></td>
+        <td><a href="/cgi-bin/koha/catalogue/detail.pl?item=<!-- TMPL_VAR NAME="itemnumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->"><!-- TMPL_VAR NAME="title" --></a></td>
+    <td><!-- TMPL_VAR NAME="barcode" --></td>
+    </tr>
+    <!-- /TMPL_IF -->
+    <!-- /TMPL_LOOP -->
+</table>
+<!-- /TMPL_IF -->
 
 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
index 5989627..3919eb1 100755 (executable)
@@ -218,6 +218,7 @@ my ( $count, $issue ) = GetPendingIssues($borrowernumber);
 my $roaddetails = &GetRoadTypeDetails( $data->{'streettype'} );
 my $today       = POSIX::strftime("%Y-%m-%d", localtime);      # iso format
 my @issuedata;
+my $overdues_exist = 0;
 my $totalprice = 0;
 my $toggle     = 0;
 for ( my $i = 0 ; $i < $count ; $i++ ) {
@@ -228,6 +229,7 @@ for ( my $i = 0 ; $i < $count ; $i++ ) {
     $totalprice += $issue->[$i]{'replacementprice'};
     $row{'replacementprice'} = $issue->[$i]{'replacementprice'};
     if ( $datedue lt $today ) {
+        $overdues_exist = 1;
         $row{'red'} = 1;    #print "<font color=red>";
        }
     $row{toggle} = $toggle++ % 2;
@@ -350,6 +352,7 @@ $template->param(
     totalprice       => sprintf( "%.2f", $totalprice ),
     totaldue         => sprintf( "%.2f", $total ),
     issueloop        => \@issuedata,
+    overdues_exist   => $overdues_exist,
     unvalidlibrarian => $unvalidlibrarian,
        error            => $error,
        $error                  => 1,