Lines 42-47
use Koha::DateUtils qw( format_sqldatetime dt_from_string );
Link Here
|
42 |
use Koha::Patrons; |
42 |
use Koha::Patrons; |
43 |
use Koha::SMTP::Servers; |
43 |
use Koha::SMTP::Servers; |
44 |
use Koha::Subscriptions; |
44 |
use Koha::Subscriptions; |
|
|
45 |
use Koha::Account::Lines; |
46 |
use Locale::Currency::Format; |
45 |
|
47 |
|
46 |
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
48 |
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
47 |
|
49 |
|
Lines 667-677
sub GetPreparedLetter {
Link Here
|
667 |
my $OPACBaseURL = C4::Context->preference('OPACBaseURL'); |
669 |
my $OPACBaseURL = C4::Context->preference('OPACBaseURL'); |
668 |
$letter->{content} =~ s/<<OPACBaseURL>>/$OPACBaseURL/go; |
670 |
$letter->{content} =~ s/<<OPACBaseURL>>/$OPACBaseURL/go; |
669 |
|
671 |
|
|
|
672 |
my $active_currency = Koha::Acquisition::Currencies->get_active; |
673 |
my $currency_format = $active_currency->currency if defined($active_currency); |
674 |
|
670 |
my $borrowernumber = $tables->{borrowers}; |
675 |
my $borrowernumber = $tables->{borrowers}; |
671 |
my $lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber }); |
676 |
my $lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber }); |
672 |
my ($totalfine) = $lines->total_outstanding; |
677 |
my ($totalfine) = $lines->total_outstanding; |
673 |
$totalfine = sprintf("%.2f", $totalfine); |
678 |
my $totalfine_formatted = currency_format($currency_format, "$totalfine", FMT_SYMBOL); |
674 |
$letter->{content} =~ s/<<borrowers.totalfine>>/$totalfine/go; |
679 |
$totalfine_formatted = sprintf("%.2f", $totalfine) unless $totalfine_formatted; |
|
|
680 |
$letter->{content} =~ s/<<borrowers.account_balance>>/$totalfine_formatted/go; |
675 |
|
681 |
|
676 |
if ($want_librarian) { |
682 |
if ($want_librarian) { |
677 |
# parsing librarian name |
683 |
# parsing librarian name |