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

(-)a/C4/Letters.pm (-2 / +8 lines)
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
(-)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