summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2009-01-26 02:14:04 +0000
committerivan <ivan>2009-01-26 02:14:04 +0000
commitbe48a55bb8edc45ee38e4c9098d5d1e49a9f620b (patch)
treea850f3f6a73fe24e0e471befd68e6d62722e01f6
parentc8436a358075a901c8d7b3d47919de8c4d6f6f46 (diff)
should fix: Argument "\\dollar 2.69" isn't numeric in sprintf at /usr/local/share/perl/5.8.8/FS/cust_bill.pm line 2193. Hopefully no problems with invoice with 0 tax printing :/. RT#4681
-rw-r--r--FS/FS/cust_bill.pm32
1 files changed, 22 insertions, 10 deletions
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 769839b30..34feb40f7 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -1702,6 +1702,8 @@ unsquelch_cdr - overrides any per customer cdr squelching when true
=cut
+#what's with all the sprintf('%10.2f')'s in here? will it cause any
+# (alignment?) problems to change them all to '%.2f' ?
sub print_generic {
my( $self, %params ) = @_;
@@ -2039,7 +2041,7 @@ sub print_generic {
);
my $money_char = $money_chars{$format};
- my %other_money_chars = ( 'latex' => '\dollar ',
+ my %other_money_chars = ( 'latex' => '\dollar ',#XXX should be a config too
'html' => $conf->config('money_char') || '$',
'template' => '',
);
@@ -2172,26 +2174,36 @@ sub print_generic {
}
foreach my $tax ( $self->_items_tax ) {
- my $total = {};
- $total->{'total_item'} = &$escape_function($tax->{'description'});
+
$taxtotal += $tax->{'amount'};
- $total->{'total_amount'} = $other_money_char. $tax->{'amount'};
+
+ my $description = &$escape_function( $tax->{'description'} );
+ my $amount = sprintf( '%.2f', $tax->{'amount'} );
+
if ( $multisection ) {
+
my $money = $old_latex ? '' : $money_char;
push @detail_items, {
ext_description => [],
ref => '',
quantity => '',
- description => &$escape_function($tax->{'description'}),
- amount => $money. $tax->{'amount'},
+ description => $description,
+ amount => $money. $amount,
product_code => '',
section => $tax_section,
};
- }else{
- push @total_items, $total;
+
+ } else {
+
+ push @total_items, {
+ 'total_item' => $description,
+ 'total_amount' => $other_money_char. $amount,
+ };
+
}
- push @buf,[ $total->{'total_item'},
- $money_char. sprintf("%10.2f", $total->{'total_amount'}),
+
+ push @buf,[ $description,
+ $money_char. $amount,
];
}