From: ivan Date: Wed, 25 Apr 2007 00:54:55 +0000 (+0000) Subject: add lpr-postscript_prefix and lpr-postscript_suffix config options for printer comman... X-Git-Tag: TRIXBOX_2_6~534 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=7409f698686642a83b15a6f51f9034d2b8086fbc;p=freeside.git add lpr-postscript_prefix and lpr-postscript_suffix config options for printer commands to place printer in postscript mode --- diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 93ecf30c7..b54d6f54f 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -648,6 +648,20 @@ httemplate/docs/config.html 'type' => 'text', }, + { + 'key' => 'lpr-postscript_prefix', + 'section' => 'billing', + 'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)', + 'type' => 'text', + }, + + { + 'key' => 'lpr-postscript_suffix', + 'section' => 'billing', + 'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)', + 'type' => 'text', + }, + { 'key' => 'money_char', 'section' => '', diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 877d364e8..3af0c54a8 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -2105,10 +2105,21 @@ sub print_ps { unlink("$lfile"); my $ps = ''; + + if ( $conf->exists('lpr-postscript_prefix') ) { + my $prefix = $conf->config('lpr-postscript_prefix'); + $ps .= eval qq("$prefix"); + } + while () { $ps .= $_; } + if ( $conf->exists('lpr-postscript_suffix') ) { + my $suffix = $conf->config('lpr-postscript_suffix'); + $ps .= eval qq("$suffix"); + } + close POSTSCRIPT; return $ps;