Lines 40-45
use C4::Dates qw/format_date/;
Link Here
|
40 |
use C4::Debug; |
40 |
use C4::Debug; |
41 |
use C4::Letters; |
41 |
use C4::Letters; |
42 |
use C4::Overdues qw(GetFine); |
42 |
use C4::Overdues qw(GetFine); |
|
|
43 |
use C4::Budgets qw(GetCurrency); |
43 |
|
44 |
|
44 |
=head1 NAME |
45 |
=head1 NAME |
45 |
|
46 |
|
Lines 707-719
sub parse_letter {
Link Here
|
707 |
$tables{'branches'} = $p; |
708 |
$tables{'branches'} = $p; |
708 |
} |
709 |
} |
709 |
|
710 |
|
710 |
my $currency_format; |
711 |
my $currency_format = GetCurrency()->{currency}; |
711 |
if ( defined $params->{'letter'}->{'content'} |
|
|
712 |
and $params->{'letter'}->{'content'} =~ m/<fine>(.*)<\/fine>/o ) |
713 |
{ # process any fine tags... |
714 |
$currency_format = $1; |
715 |
$params->{'letter'}->{'content'} =~ s/<fine>.*<\/fine>/<<item.fine>>/o; |
716 |
} |
717 |
|
712 |
|
718 |
my @item_tables; |
713 |
my @item_tables; |
719 |
if ( my $i = $params->{'items'} ) { |
714 |
if ( my $i = $params->{'items'} ) { |
Lines 725-732
sub parse_letter {
Link Here
|
725 |
$item_format = $1; |
720 |
$item_format = $1; |
726 |
} |
721 |
} |
727 |
|
722 |
|
728 |
$item->{'fine'} = currency_format($currency_format, "$fine", FMT_SYMBOL) |
723 |
$item->{'fine'} = currency_format($currency_format, "$fine", FMT_SYMBOL); |
729 |
if $currency_format; |
724 |
# if active currency isn't correct ISO code fallback to sprintf |
|
|
725 |
$item->{'fine'} = sprintf('%.2f', $fine) unless $item->{'fine'}; |
730 |
|
726 |
|
731 |
push @item_tables, { |
727 |
push @item_tables, { |
732 |
'biblio' => $item->{'biblionumber'}, |
728 |
'biblio' => $item->{'biblionumber'}, |
733 |
- |
|
|