Browse Source

Attempting to get issues slip to print when borrower is finished with

3.0.x
rangi 21 years ago
parent
commit
cf3086c7da
  1. 4
      C4/Circulation/Circ2.pm
  2. 3
      C4/Print.pm
  3. 28
      circ/circulation.pl

4
C4/Circulation/Circ2.pm

@ -583,7 +583,9 @@ sub currentissues {
my $today = (1900+$datearr[5]).sprintf "0%02d", ($datearr[4]+1).sprintf "%02d", $datearr[3];
$crit=" and !(issues.timestamp like '$today%') ";
}
my $sth=$dbh->prepare("select * from issues,items,biblioitems,biblio where borrowernumber=$borrowernumber and issues.itemnumber=items.itemnumber and items.biblionumber=biblio.biblionumber and items.biblioitemnumber=biblioitems.biblioitemnumber and returndate is null $crit order by date_due");
my $select="select * from issues,items,biblioitems,biblio where borrowernumber=$borrowernumber and issues.itemnumber=items.itemnumber and items.biblionumber=biblio.biblionumber and items.biblioitemnumber=biblioitems.biblioitemnumber and returndate is null $crit order by date_due";
# print $select;
my $sth=$dbh->prepare($select);
$sth->execute;
while (my $data = $sth->fetchrow_hashref) {
$data->{'dewey'}=~s/0*$//;

3
C4/Print.pm

@ -1,9 +1,8 @@
package C4::Print; #asummes C4/Print.pm
use strict;
require Exporter;
use C4::InterfaceCDK;
#use C4::InterfaceCDK;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);

28
circ/circulation.pl

@ -3,6 +3,7 @@
use CGI qw/:standard/;
use C4::Circulation::Circ2;
use C4::Output;
use C4::Print;
use DBI;
@ -68,6 +69,7 @@ my $branchcookie=$query->cookie(-name=>'branch', -value=>"$branch", -expires=>'+
my $printercookie=$query->cookie(-name=>'printer', -value=>"$printer", -expires=>'+1y');
print $query->header(-type=>'text/html',-expires=>'now', -cookie=>[$branchcookie,$printercookie]);
#print $query->dump;
print startpage();
print startmenu('circulation');
@ -351,15 +353,35 @@ EOF
sub issues {
my ($noheader) = shift;
my $print=$query->param('print');
my $borrowernumber=$query->param('borrnumber');
if ($print eq 'yes'){
my ($borrower, $flags) = getpatroninformation(\%env,$borrowernumber,0);
$env{'todaysissues'}=1;
my ($borrowerissues) = currentissues(\%env, $borrower);
my $i=0;
my @issues;
foreach (sort keys %$borrowerissues) {
$issues[$i]=$borrowerissues->{$_};
#print $issues[$i]->{'date_due'};
$i++;
#print $i;
}
remoteprint(\%env,$issues,$borrower);
$query->param('borrnumber','')
}
unless ($noheader) {
print << "EOF";
<table border=0 bgcolor=$headerbackgroundcolor background=$backgroundimage cellpadding=10 cellspacing=0><tr><th><font color=black>Circulation - Issues</font></td></tr><tr><td bgcolor=$circbackgroundcolor align=center>
<table border=0 bgcolor=$headerbackgroundcolor background=$backgroundimage cellpadding=10 cellspacing=0><tr><th><font color=black>Circulation - Issues
</font></td></tr><tr><td bgcolor=$circbackgroundcolor align=center>
EOF
}
if (my $borrnumber=$query->param('borrnumber')) {
my ($borrower, $flags) = getpatroninformation(\%env,$borrnumber,0);
my ($borrower, $flags) = getpatroninformation(\%env,$borrnumber,0);
# my ($borrower, $flags) = getpatroninformation(\%env,$borrnumber,0);
my $year=$query->param('year');
my $month=$query->param('month');
my $day=$query->param('day');
@ -610,6 +632,8 @@ EOF
<td align=center valign=top>
$patrontable
<br>
<a href=/cgi-bin/koha/circ/circulation.pl?borrnumber=$borrowernumber&module=issues&branch=$branch&printer=$printer&print=yes>Next borrower</a>
<br>
$flaginfotable
</td>
</tr>

Loading…
Cancel
Save