Bug 2652 - This patch is an extension of the slip printing feature
authorDarrell Ulm <darrellulm@smfpl.org>
Wed, 19 Aug 2009 16:39:32 +0000 (12:39 -0400)
committerGalen Charlton <gmcharlt@gmail.com>
Fri, 21 Aug 2009 01:08:05 +0000 (21:08 -0400)
and will print a SHORT SLIP of today's checkouts only.
 I also enhanced the normal slip to print the overdues separately as well as today's
 checkouts. There is another button on the print CIRC menu. Easily another quick key
 can be added, one for the regular slip and one for the short slip, i.e. today's
 only.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tmpl
members/moremember.pl

index 359e697..4306fce 100644 (file)
@@ -53,7 +53,8 @@ function update_child() {
        function yuiToolbar() {
            var printmenu = [
                { text: _("Print Page"), onclick: {fn: function(){printx_window("page")}} },
-               { text: _("Print Slip"), onclick: {fn: function(){printx_window("slip")}} }
+               { text: _("Print Slip"), onclick: {fn: function(){printx_window("slip")}} },
+               { text: _("Quick Slip"), onclick: {fn: function(){printx_window("qslip")}} }
            ];
        
                var moremenu = [
index 8da6db2..dcd55a4 100644 (file)
@@ -51,7 +51,8 @@ function update_child() {
        function yuiToolbar() {
            var printmenu = [
                { text: _("Print Page"), onclick: {fn: function(){printx_window("page")}} },
-               { text: _("Print Slip"), onclick: {fn: function(){printx_window("slip")}} }
+               { text: _("Print Slip"), onclick: {fn: function(){printx_window("slip")}} },
+               { text: _("Quick Slip"), onclick: {fn: function(){printx_window("qslip")}} }
            ];
        
                var moremenu = [
index f04e6ab..a63e15d 100644 (file)
@@ -18,20 +18,22 @@ Checked out to <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=<!-- TMPL
 
 <!-- TMPL_VAR NAME="todaysdate" --><br />
 
-<h4>Checked Out</h4>
+<!-- TMPL_IF name="quickslip" -->
+<h4>Checked Out Today</h4>
 <!-- TMPL_loop name="issueloop" -->
 <!-- TMPL_IF name="red" --><!-- TMPL_ELSE -->
+<!-- TMPL_IF name="today" -->
 <p><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" escape="html" --></a><br />
 Barcode: <!-- TMPL_VAR NAME="barcode" --><br />
 Date due: <!-- TMPL_VAR NAME="date_due" --><br /></p>
+    <!-- /TMPL_IF -->
     <!-- /TMPL_IF -->
     <!-- /TMPL_LOOP -->
 
-
-<!-- TMPL_IF NAME="overdues_exist" -->
-<h4>Overdues</h4>
-    <!-- TMPL_LOOP NAME="issueloop" -->
-    <!-- TMPL_IF NAME="red" -->
+<!-- TMPL_ELSE -->
+<h4>Checked Out</h4>
+<!-- TMPL_loop name="issueloop" -->
+<!-- TMPL_IF name="red" --><!-- TMPL_ELSE -->
 <p><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" escape="html" --></a><br />
 Barcode: <!-- TMPL_VAR NAME="barcode" --><br />
 Date due: <!-- TMPL_VAR NAME="date_due" --><br /></p>
@@ -40,4 +42,18 @@ Date due: <!-- TMPL_VAR NAME="date_due" --><br /></p>
 
 <!-- /TMPL_IF -->
 
+<!-- TMPL_IF name="quickslip" -->
+<!-- TMPL_ELSE -->
+<!-- TMPL_IF name="overdues_exist" -->
+<h4>Overdues</h4>
+    <!-- TMPL_LOOP name="issueloop" -->
+    <!-- TMPL_IF name="red" -->
+<p><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" escape="html" --></a><br />
+Barcode: <!-- TMPL_VAR NAME="barcode" --><br />
+Date due: <!-- TMPL_VAR NAME="date_due" --></p>
+<!-- /TMPL_IF -->
+<!-- /TMPL_LOOP -->
+<!-- /TMPL_IF -->
+<!-- /TMPL_IF -->
+
 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
index b0cab92..d5040b6 100755 (executable)
@@ -73,9 +73,11 @@ my %return_failed;
 for my $failedret (@failedreturns) { $return_failed{$failedret} = 1; }
 
 my $template_name;
+my $quickslip = 0;
 
 if    ($print eq "page") { $template_name = "members/moremember-print.tmpl";   }
 elsif ($print eq "slip") { $template_name = "members/moremember-receipt.tmpl"; }
+elsif ($print eq "qslip") { $template_name = "members/moremember-receipt.tmpl"; $quickslip = 1; }
 else {                     $template_name = "members/moremember.tmpl";         }
 
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
@@ -222,6 +224,7 @@ my $overdues_exist = 0;
 my $totalprice = 0;
 for ( my $i = 0 ; $i < $count ; $i++ ) {
     my $datedue = $issue->[$i]{'date_due'};
+    my $issuedate = $issue->[$i]{'issuedate'};
     $issue->[$i]{'date_due'}  = C4::Dates->new($issue->[$i]{'date_due'}, 'iso')->output('syspref');
     $issue->[$i]{'issuedate'} = C4::Dates->new($issue->[$i]{'issuedate'},'iso')->output('syspref');
     my $biblionumber = $issue->[$i]{'biblionumber'};
@@ -255,7 +258,11 @@ for ( my $i = 0 ; $i < $count ; $i++ ) {
     if ( $datedue lt $today ) {
         $overdues_exist = 1;
         $row{'red'} = 1;
-        }
+       }
+        if ( $issuedate eq $today ) {
+        $row{'today'} = 1; 
+        }
+
     #find the charge for an item
     my ( $charge, $itemtype ) =
       GetIssuingCharges( $issue->[$i]{'itemnumber'}, $borrowernumber );
@@ -398,6 +405,7 @@ $template->param(
     dateformat      => C4::Context->preference("dateformat"),
     "dateformat_" . (C4::Context->preference("dateformat") || '') => 1,
     samebranch     => $samebranch,
+    quickslip            => $quickslip,
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;