X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FMisc.pm;h=5e89abc0c6e08dd031265a0d58c3f595f910d31d;hb=fc8d730d0a7b31b617c963c5619bd3f45c5c3eb6;hp=a1c15fdf8039d67ccf9a59badc853b3a9127d98c;hpb=963b977d201a71e85781bcbf6732795728e9fc0f;p=freeside.git diff --git a/FS/FS/Misc.pm b/FS/FS/Misc.pm index a1c15fdf8..5e89abc0c 100644 --- a/FS/FS/Misc.pm +++ b/FS/FS/Misc.pm @@ -274,6 +274,7 @@ sub send_email { }); $cust_msg->insert; # ignore errors } + $error; } @@ -799,16 +800,32 @@ sub _pslatex { } -=item do_print ARRAYREF +=item do_print ARRAYREF [, OPTION => VALUE ... ] Sends the lines in ARRAYREF to the printer. +Options available are: + +=over 4 + +=item agentnum + +Uses this agent's 'lpr' configuration setting override instead of the global +value. + +=item lpr + +Uses this command instead of the configured lpr command (overrides both the +global value and agentnum). + =cut sub do_print { - my $data = shift; + my( $data, %opt ) = @_; - my $lpr = $conf->config('lpr'); + my $lpr = ( exists($opt{'lpr'}) && $opt{'lpr'} ) + ? $opt{'lpr'} + : $conf->config('lpr', $opt{'agentnum'} ); my $outerr = ''; run3 $lpr, $data, \$outerr, \$outerr;