summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-07-16 20:44:44 -0700
committerMark Wells <mark@freeside.biz>2012-07-16 20:44:44 -0700
commit55393622d8e4b87dca04e037d591074bbfabb2f6 (patch)
treea6c80ab0f9b2c18f32c8b03febe34a78a1a36385 /FS/FS
parenta6aa4c2a3f8128c26a63314a5ec58c71c494e88e (diff)
fix barcodes, from #16996
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/Template_Mixin.pm13
1 files changed, 10 insertions, 3 deletions
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index d1bcec5..c42e239 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -12,6 +12,7 @@ use Text::Template 1.20;
use File::Temp 0.14;
use HTML::Entities;
use Locale::Country;
+use Cwd;
use FS::UID;
use FS::Record qw( qsearch qsearchs );
use FS::Misc qw( generate_ps generate_pdf );
@@ -133,7 +134,9 @@ sub print_latex {
close $lh;
$params{'logo_file'} = $lh->filename;
- if( $conf->exists('invoice-barcode') && $self->can('invoice_barcode') ) {
+ if( $conf->exists('invoice-barcode')
+ && $self->can('invoice_barcode')
+ && $self->invnum ) { # don't try to barcode statements
my $png_file = $self->invoice_barcode($dir);
my $eps_file = $png_file;
$eps_file =~ s/\.png$/.eps/g;
@@ -699,6 +702,8 @@ sub print_generic {
warn "$me generating sections\n"
if $DEBUG > 1;
+ # Previous Charges section
+ # subtotal is the first return value from $self->previous
my $previous_section = { 'description' => $self->mt('Previous Charges'),
'subtotal' => $other_money_char.
sprintf('%.2f', $pr_total),
@@ -923,8 +928,10 @@ sub print_generic {
}
$detail->{'amount'} = ( $old_latex ? '' : $money_char ).
$line_item->{'amount'};
- $detail->{'unit_amount'} = ( $old_latex ? '' : $money_char ).
- $line_item->{'unit_amount'};
+ if ( exists $line_item->{'unit_amount'} ) {
+ $detail->{'unit_amount'} = ( $old_latex ? '' : $money_char ).
+ $line_item->{'unit_amount'};
+ }
$detail->{'product_code'} = $line_item->{'pkgpart'} || 'N/A';
$detail->{'sdate'} = $line_item->{'sdate'};