summaryrefslogtreecommitdiff
path: root/FS/FS/msg_template.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-01-30 00:13:54 -0800
committerIvan Kohler <ivan@freeside.biz>2013-01-30 00:13:54 -0800
commitc3a7e8855edbe4f836543184d5a7543e04255a43 (patch)
tree01487f202af429d4a5c61662efc653eb38eef419 /FS/FS/msg_template.pm
parentaa97e36a3bb5c92251ab14a47c710ffecb5b26c8 (diff)
per-agent lpr command, RT#18549
Diffstat (limited to 'FS/FS/msg_template.pm')
-rw-r--r--FS/FS/msg_template.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/FS/FS/msg_template.pm b/FS/FS/msg_template.pm
index e38346a..011ce24 100644
--- a/FS/FS/msg_template.pm
+++ b/FS/FS/msg_template.pm
@@ -484,13 +484,15 @@ Render a PDF and send it to the printer. OPTIONS are as for 'render'.
=cut
sub print {
- my $file = render(@_);
- my @lpr = $conf->config('lpr');
- run ([@lpr, '-r'], '<', $file)
+ my( $self, %opt ) = @_;
+ my $file = $self->render(%opt);
+
+ my $lpr = $conf->config('lpr', $opt{'cust_main'}->agentnum );
+
+ run ( $lpr, '<', $file)
or die "lpr error:\n$?\n";
}
-
# helper sub for package dates
my $ymd = sub { $_[0] ? time2str('%Y-%m-%d', $_[0]) : '' };