Bug 2652 - This patch is an extension of the slip printing feature

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>
This commit is contained in:
Darrell Ulm 2009-08-19 12:39:32 -04:00 committed by Galen Charlton
parent 3199d032e5
commit 8a4195658d
4 changed files with 36 additions and 10 deletions

View 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 = [

View 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 = [

View File

@ -18,6 +18,19 @@ Checked out to <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=<!-- TMPL
<!-- TMPL_VAR NAME="todaysdate" --><br />
<!-- 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_ELSE -->
<h4>Checked Out</h4>
<!-- TMPL_loop name="issueloop" -->
<!-- TMPL_IF name="red" --><!-- TMPL_ELSE -->
@ -27,17 +40,20 @@ Date due: <!-- TMPL_VAR NAME="date_due" --><br /></p>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="overdues_exist" -->
<!-- TMPL_IF name="quickslip" -->
<!-- TMPL_ELSE -->
<!-- TMPL_IF name="overdues_exist" -->
<h4>Overdues</h4>
<!-- TMPL_LOOP NAME="issueloop" -->
<!-- TMPL_IF NAME="red" -->
<!-- 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" --><br /></p>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
Date due: <!-- TMPL_VAR NAME="date_due" --></p>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->

View File

@ -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;