if ( $invoice_data{finance_section} &&
$section->{'description'} eq $invoice_data{finance_section} );
- $section->{'subtotal'} = $other_money_char.
- sprintf('%.2f', $section->{'subtotal'})
- if $multisection;
+ if ( $multisection ) {
+
+ if ( ref($section->{'subtotal'}) ) {
+
+ $section->{'subtotal'} =
+ sprintf("$other_money_char%.2f to $other_money_char%.2f",
+ $section->{'subtotal'}[0],
+ $section->{'subtotal'}[1]
+ );
+
+ } else {
+
+ $section->{'subtotal'} = $other_money_char.
+ sprintf('%.2f', $section->{'subtotal'})
- # continue some normalization
- $section->{'amount'} = $section->{'subtotal'}
- if $multisection;
+ }
+
+ # continue some normalization
+ $section->{'amount'} = $section->{'subtotal'}
+ }
if ( $section->{'description'} ) {
push @buf, ( [ &$escape_function($section->{'description'}), '' ],
foreach ( @new_total_items ) {
my ($item, $amount) = ($_->{'total_item'}, $_->{'total_amount'});
$_->{'total_item'} = &$embolden_function( $item );
+
+ if ( ref($amount) ) {
+ $_->{'total_amount'} = &$embolden_function(
+ $other_money_char.$amount->[0]. ' to '.
+ $other_money_char.$amount->[1]
+ );
+ } else {
$_->{'total_amount'} = &$embolden_function( $other_money_char.$amount );
+ }
+
# but if it's multisection, don't append to @total_items. the adjust
# section has all this stuff
push @total_items, $_ if !$multisection;
=cut
use MIME::Entity;
+use Encode;
sub generate_email {
if $DEBUG;
# 'print_text' argument is no longer used
- @text = $self->print_text(\%args);
+ @text = map Encode::encode_utf8($_), $self->print_text(\%args);
} else {
' </title>',
' </head>',
' <body bgcolor="#e8e8e8">',
- $html,
+ Encode::encode_utf8($html),
' </body>',
'</html>',
],