-sub printreserve {
- my ( $branchname, $bordata, $itemdata ) = @_;
- my $printer = '';
- (return) unless ( C4::Context->boolean_preference('printreserveslips') );
- if ( $printer eq "" || $printer eq 'nulllp' ) {
- open( PRINTER, ">>/tmp/kohares" )
- or die "Could not write to /tmp/kohares";
- }
- else {
- open( PRINTER, "| lpr -P $printer >/dev/null" )
- or die "Couldn't write to queue:$!\n";
- }
- my @da = localtime();
- my $todaysdate = "$da[2]:$da[1] " . C4::Dates->today();
- my $slip = <<"EOF";
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Date: $todaysdate;
-
-ITEM RESERVED:
-$itemdata->{'title'} ($itemdata->{'author'})
-barcode: $itemdata->{'barcode'}
-
-COLLECT AT: $branchname
-
-BORROWER:
-$bordata->{'surname'}, $bordata->{'firstname'}
-card number: $bordata->{'cardnumber'}
-Phone: $bordata->{'phone'}
-$bordata->{'streetaddress'}
-$bordata->{'suburb'}
-$bordata->{'town'}
-$bordata->{'emailaddress'}
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-EOF
- print PRINTER $slip;
- close PRINTER;
- return $slip;
-}
-
-=head2 printslip
-
- &printslip($borrowernumber)
-
-print a slip for the given $borrowernumber
-
-=cut
-
-#'
-sub printslip ($) {
- my $borrowernumber = shift;
- my $borrower = GetMemberDetails($borrowernumber);
- my $issueslist = GetPendingIssues($borrowernumber);
- foreach my $it (@$issueslist){
- $it->{'date_due'}=format_date($it->{'date_due'});
- }
- my @issues = sort { $b->{'timestamp'} <=> $a->{'timestamp'} } @$issueslist;
- remoteprint(\@issues, $borrower );
-}
-
-END { } # module clean-up code here (global destructor)
-