View | Details | Raw Unified | Return to bug 13961
Collapse All | Expand All

(-)a/C4/Letters.pm (-2 / +8 lines)
Lines 40-45 use Koha::Notice::Templates; Link Here
40
use Koha::DateUtils qw( format_sqldatetime dt_from_string );
40
use Koha::DateUtils qw( format_sqldatetime dt_from_string );
41
use Koha::Patrons;
41
use Koha::Patrons;
42
use Koha::Subscriptions;
42
use Koha::Subscriptions;
43
use Koha::Account::Lines;
44
use Locale::Currency::Format;
43
45
44
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
46
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
45
47
Lines 632-642 sub GetPreparedLetter { Link Here
632
    my $OPACBaseURL = C4::Context->preference('OPACBaseURL');
634
    my $OPACBaseURL = C4::Context->preference('OPACBaseURL');
633
    $letter->{content} =~ s/<<OPACBaseURL>>/$OPACBaseURL/go;
635
    $letter->{content} =~ s/<<OPACBaseURL>>/$OPACBaseURL/go;
634
636
637
    my $active_currency = Koha::Acquisition::Currencies->get_active;
638
    my $currency_format = $active_currency->currency if defined($active_currency);
639
635
    my $borrowernumber = $tables->{borrowers};
640
    my $borrowernumber = $tables->{borrowers};
636
    my $lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber  });
641
    my $lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber  });
637
    my ($totalfine) = $lines->total_outstanding;
642
    my ($totalfine) = $lines->total_outstanding;
638
    $totalfine = sprintf("%.2f", $totalfine);
643
    my $totalfine_formatted = currency_format($currency_format, "$totalfine", FMT_SYMBOL);
639
    $letter->{content} =~ s/<<borrowers.totalfine>>/$totalfine/go;
644
    $totalfine_formatted = sprintf("%.2f", $totalfine) unless $totalfine_formatted;
645
    $letter->{content} =~ s/<<borrowers.account_balance>>/$totalfine_formatted/go;
640
646
641
    if ($want_librarian) {
647
    if ($want_librarian) {
642
        # parsing librarian name
648
        # parsing librarian name
(-)a/tools/letter.pl (-2 / +1 lines)
Lines 247-253 sub add_form { Link Here
247
            {value => 'items.content', text => 'items.content'},
247
            {value => 'items.content', text => 'items.content'},
248
            {value => 'items.fine',    text => 'items.fine'},
248
            {value => 'items.fine',    text => 'items.fine'},
249
            add_fields('borrowers'),
249
            add_fields('borrowers'),
250
            {value => 'borrowers.totalfine', text => 'borrowers.totalfine' };
250
            {value => 'borrowers.account_balance', text => 'borrowers.account_balance' };
251
        if ($module eq 'circulation') {
251
        if ($module eq 'circulation') {
252
            push @{$field_selection}, add_fields('opac_news');
252
            push @{$field_selection}, add_fields('opac_news');
253
253
254
- 

Return to bug 13961