|
Lines 28-34
BEGIN {
Link Here
|
| 28 |
$VERSION = 3.01; |
28 |
$VERSION = 3.01; |
| 29 |
require Exporter; |
29 |
require Exporter; |
| 30 |
@ISA = qw(Exporter); |
30 |
@ISA = qw(Exporter); |
| 31 |
@EXPORT = qw(&printslip); |
31 |
@EXPORT = qw(&NetworkPrint); |
| 32 |
} |
32 |
} |
| 33 |
|
33 |
|
| 34 |
=head1 NAME |
34 |
=head1 NAME |
|
Lines 45-89
The functions in this module handle sending text to a printer.
Link Here
|
| 45 |
|
45 |
|
| 46 |
=head1 FUNCTIONS |
46 |
=head1 FUNCTIONS |
| 47 |
|
47 |
|
| 48 |
=cut |
48 |
=head2 NetworkPrint |
| 49 |
|
|
|
| 50 |
=for comment |
| 51 |
my $slip = <<"EOF"; |
| 52 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 53 |
Date: $todaysdate; |
| 54 |
|
| 55 |
ITEM RESERVED: |
| 56 |
$itemdata->{'title'} ($itemdata->{'author'}) |
| 57 |
barcode: $itemdata->{'barcode'} |
| 58 |
|
| 59 |
COLLECT AT: $branchname |
| 60 |
|
| 61 |
BORROWER: |
| 62 |
$bordata->{'surname'}, $bordata->{'firstname'} |
| 63 |
card number: $bordata->{'cardnumber'} |
| 64 |
Phone: $bordata->{'phone'} |
| 65 |
$bordata->{'streetaddress'} |
| 66 |
$bordata->{'suburb'} |
| 67 |
$bordata->{'town'} |
| 68 |
$bordata->{'emailaddress'} |
| 69 |
|
49 |
|
|
|
50 |
&NetworkPrint($text) |
| 70 |
|
51 |
|
| 71 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
52 |
Queue some text for printing on the selected branch printer |
| 72 |
EOF |
|
|
| 73 |
=cut |
| 74 |
|
| 75 |
=head2 printslip |
| 76 |
|
| 77 |
&printslip($slip) |
| 78 |
|
| 79 |
print a slip for the given $borrowernumber and $branchcode |
| 80 |
|
53 |
|
| 81 |
=cut |
54 |
=cut |
| 82 |
|
55 |
|
| 83 |
sub printslip ($) { |
56 |
sub NetworkPrint { |
| 84 |
my ($slip) = @_; |
57 |
my ($text) = @_; |
| 85 |
|
|
|
| 86 |
return unless ( C4::Context->boolean_preference('printcirculationslips') ); |
| 87 |
|
58 |
|
| 88 |
# FIXME - It'd be nifty if this could generate pretty PostScript. |
59 |
# FIXME - It'd be nifty if this could generate pretty PostScript. |
| 89 |
|
60 |
|
|
Lines 112-118
sub printslip ($) {
Link Here
|
| 112 |
|
83 |
|
| 113 |
# print $queue; |
84 |
# print $queue; |
| 114 |
#open (FILE,">/tmp/$file"); |
85 |
#open (FILE,">/tmp/$file"); |
| 115 |
print PRINTER $slip; |
86 |
print PRINTER $text; |
| 116 |
print PRINTER "\r\n" x 7 ; |
87 |
print PRINTER "\r\n" x 7 ; |
| 117 |
close PRINTER; |
88 |
close PRINTER; |
| 118 |
|
89 |
|