projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f668a91
)
better error reporting for actual errors from lpr command
author
ivan
<ivan>
Wed, 15 Jun 2005 04:46:50 +0000
(
04:46
+0000)
committer
ivan
<ivan>
Wed, 15 Jun 2005 04:46:50 +0000
(
04:46
+0000)
FS/FS/cust_bill.pm
patch
|
blob
|
history
README.1.5.7
patch
|
blob
|
history
diff --git
a/FS/FS/cust_bill.pm
b/FS/FS/cust_bill.pm
index
dfebba6
..
26c3d4b
100644
(file)
--- a/
FS/FS/cust_bill.pm
+++ b/
FS/FS/cust_bill.pm
@@
-3,6
+3,7
@@
package FS::cust_bill;
use strict;
use vars qw( @ISA $DEBUG $conf $money_char );
use vars qw( $invoice_lines @buf ); #yuck
use strict;
use vars qw( @ISA $DEBUG $conf $money_char );
use vars qw( $invoice_lines @buf ); #yuck
+use IPC::Run3;
use Date::Format;
use Text::Template 1.20;
use File::Temp 0.14;
use Date::Format;
use Text::Template 1.20;
use File::Temp 0.14;
@@
-631,7
+632,7
@@
sub email {
=item lpr_data [ TEMPLATENAME ]
=item lpr_data [ TEMPLATENAME ]
-Returns the postscript or plaintext for this invoice.
+Returns the postscript or plaintext for this invoice
as an arrayref
.
TEMPLATENAME, if specified, is the name of a suffix for alternate invoices.
TEMPLATENAME, if specified, is the name of a suffix for alternate invoices.
@@
-657,12
+658,14
@@
sub print {
my $template = scalar(@_) ? shift : '';
my $lpr = $conf->config('lpr');
my $template = scalar(@_) ? shift : '';
my $lpr = $conf->config('lpr');
- open(LPR, "|$lpr")
- or die "Can't open pipe to $lpr: $!\n";
- print LPR @{ $self->lpr_data($template) };
- close LPR
- or die $! ? "Error closing $lpr: $!\n"
- : "Exit status $? from $lpr\n";
+
+ my $outerr = '';
+ run3 $lpr, $self->lpr_data($template), \$outerr, \$outerr;
+ if ( $? ) {
+ $outerr = ": $outerr" if length($outerr);
+ die "Error from $lpr (exit status ". ($?>>8). ")$outerr\n";
+ }
+
}
=item fax [ TEMPLATENAME ]
}
=item fax [ TEMPLATENAME ]
diff --git
a/README.1.5.7
b/README.1.5.7
index
db654ca
..
b4ffff1
100644
(file)
--- a/
README.1.5.7
+++ b/
README.1.5.7
@@
-153,7
+153,7
@@
dbdef-create username
install Javascript::RPC (JavaScript::RPC::Server::CGI), Text::CSV_XS,
Spreadsheet::WriteExcel, IO-stringy (IO::Scalar), Frontier::RPC
install Javascript::RPC (JavaScript::RPC::Server::CGI), Text::CSV_XS,
Spreadsheet::WriteExcel, IO-stringy (IO::Scalar), Frontier::RPC
-(Frontier::RPC2)
and MIME::Entity (MIME-tools)
+(Frontier::RPC2)
, MIME::Entity (MIME-tools) and IPC::Run3
afterwords (for installs w/integrated RT):
install HTML::Scrubber, Text::Quoted and Tree::Simple
afterwords (for installs w/integrated RT):
install HTML::Scrubber, Text::Quoted and Tree::Simple