summaryrefslogtreecommitdiff
path: root/LedgerSMB/Template.pm
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB/Template.pm')
-rwxr-xr-xLedgerSMB/Template.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/LedgerSMB/Template.pm b/LedgerSMB/Template.pm
index 0c396ac6..35602cb4 100755
--- a/LedgerSMB/Template.pm
+++ b/LedgerSMB/Template.pm
@@ -374,8 +374,16 @@ sub _email_output {
}
sub _lpr_output {
- my $self = shift;
- #TODO stub
+ my ($self) = shift;
+ my $args = $self->{output_args};
+ if ($self->{format} != /(pdf|ps)/){
+ throw Error::Simple "Invalid Format";
+ }
+ my $lpr = $LedgerSMB::Sysconfig::printer{$args->{printer}};
+
+ open(LPR, '|-', $lpr);
+ print LPR $self->{output};
+ close(LPR);
}
1;