From cf3086c7da918cf05feff48a6dbc92782cbff6cc Mon Sep 17 00:00:00 2001 From: rangi Date: Thu, 1 Feb 2001 02:08:34 +0000 Subject: [PATCH] Attempting to get issues slip to print when borrower is finished with --- C4/Circulation/Circ2.pm | 4 +++- C4/Print.pm | 3 +-- circ/circulation.pl | 28 ++++++++++++++++++++++++++-- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/C4/Circulation/Circ2.pm b/C4/Circulation/Circ2.pm index 92e08d4b45..d19efaa370 100755 --- a/C4/Circulation/Circ2.pm +++ b/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*$//; diff --git a/C4/Print.pm b/C4/Print.pm index 7520f7d0f0..40ebc6c136 100644 --- a/C4/Print.pm +++ b/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); diff --git a/circ/circulation.pl b/circ/circulation.pl index 77b201a95e..a1298c66e8 100755 --- a/circ/circulation.pl +++ b/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"; -
Circulation - Issues
+ -- 2.39.5
Circulation - Issues + +
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 $patrontable
+ Next borrower +
$flaginfotable