summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2007-04-25 00:54:55 +0000
committerivan <ivan>2007-04-25 00:54:55 +0000
commit7409f698686642a83b15a6f51f9034d2b8086fbc (patch)
treee1b8771b2d6bdf9d268b402c0c0d2944f7f79f04
parentcc6de013fc36e40950f35a6f6e6b30f0b8f1e46a (diff)
add lpr-postscript_prefix and lpr-postscript_suffix config options for printer commands to place printer in postscript mode
-rw-r--r--FS/FS/Conf.pm14
-rw-r--r--FS/FS/cust_bill.pm11
2 files changed, 25 insertions, 0 deletions
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
@@ -649,6 +649,20 @@ httemplate/docs/config.html
},
{
+ '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' => '',
'description' => 'Currency symbol - defaults to `$\'',
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 (<POSTSCRIPT>) {
$ps .= $_;
}
+ if ( $conf->exists('lpr-postscript_suffix') ) {
+ my $suffix = $conf->config('lpr-postscript_suffix');
+ $ps .= eval qq("$suffix");
+ }
+
close POSTSCRIPT;
return $ps;