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

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