add lpr-postscript_prefix and lpr-postscript_suffix config options for printer comman...
authorivan <ivan>
Wed, 25 Apr 2007 00:54:55 +0000 (00:54 +0000)
committerivan <ivan>
Wed, 25 Apr 2007 00:54:55 +0000 (00:54 +0000)
FS/FS/Conf.pm
FS/FS/cust_bill.pm

index 93ecf30..b54d6f5 100644 (file)
@@ -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 `$\'',
index 877d364..3af0c54 100644 (file)
@@ -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;