X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FTemplate_Mixin.pm;h=c97e84e8392027d2142f33492765f9bfdd97186b;hb=57d4a5ffe7b86d032339d6eefe1a22277f3ca113;hp=c8b419d1c5222e8e731e283bfc2bb92e43f12266;hpb=861c90163e1b7c564ef7905d657b3cf16e7a328d;p=freeside.git diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm index c8b419d1c..c97e84e83 100644 --- a/FS/FS/Template_Mixin.pm +++ b/FS/FS/Template_Mixin.pm @@ -1156,14 +1156,27 @@ sub print_generic { 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'}), '' ], @@ -1362,7 +1375,16 @@ sub print_generic { 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; @@ -2085,6 +2107,7 @@ Returns an argument list to be passed to L. =cut use MIME::Entity; +use Encode; sub generate_email { @@ -2152,7 +2175,7 @@ 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 { @@ -2247,7 +2270,7 @@ sub generate_email { ' ', ' ', ' ', - $html, + Encode::encode_utf8($html), ' ', '', ],