Lines 41-46
use Koha::Notice::Templates;
Link Here
|
41 |
use Koha::DateUtils qw( format_sqldatetime dt_from_string ); |
41 |
use Koha::DateUtils qw( format_sqldatetime dt_from_string ); |
42 |
use Koha::Patrons; |
42 |
use Koha::Patrons; |
43 |
use Koha::Subscriptions; |
43 |
use Koha::Subscriptions; |
|
|
44 |
use Koha::Account::Lines; |
45 |
use Locale::Currency::Format; |
44 |
|
46 |
|
45 |
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
47 |
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
46 |
|
48 |
|
Lines 634-644
sub GetPreparedLetter {
Link Here
|
634 |
my $OPACBaseURL = C4::Context->preference('OPACBaseURL'); |
636 |
my $OPACBaseURL = C4::Context->preference('OPACBaseURL'); |
635 |
$letter->{content} =~ s/<<OPACBaseURL>>/$OPACBaseURL/go; |
637 |
$letter->{content} =~ s/<<OPACBaseURL>>/$OPACBaseURL/go; |
636 |
|
638 |
|
|
|
639 |
my $active_currency = Koha::Acquisition::Currencies->get_active; |
640 |
my $currency_format = $active_currency->currency if defined($active_currency); |
641 |
|
637 |
my $borrowernumber = $tables->{borrowers}; |
642 |
my $borrowernumber = $tables->{borrowers}; |
638 |
my $lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber }); |
643 |
my $lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber }); |
639 |
my ($totalfine) = $lines->total_outstanding; |
644 |
my ($totalfine) = $lines->total_outstanding; |
640 |
$totalfine = sprintf("%.2f", $totalfine); |
645 |
my $totalfine_formatted = currency_format($currency_format, "$totalfine", FMT_SYMBOL); |
641 |
$letter->{content} =~ s/<<borrowers.totalfine>>/$totalfine/go; |
646 |
$totalfine_formatted = sprintf("%.2f", $totalfine) unless $totalfine_formatted; |
|
|
647 |
$letter->{content} =~ s/<<borrowers.account_balance>>/$totalfine_formatted/go; |
642 |
|
648 |
|
643 |
if ($want_librarian) { |
649 |
if ($want_librarian) { |
644 |
# parsing librarian name |
650 |
# parsing librarian name |