http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=4078

Paul Poulain <paul.poul...@biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |paul.poul...@biblibre.com

--- Comment #3 from Paul Poulain <paul.poul...@biblibre.com> 2012-02-21 
13:31:05 UTC ---
Hi Aleksa,

The more I look at your patch, the more I think it's the *perfect* candidate
for Template::Toolkit plugins.
Something similar to what has been made for displaying dates:
see : http://wiki.koha-community.org/wiki/Coding_Guidelines#Displaying_dates

Look at Koha/Template/Plugin/KohaDates/KohaDates.pm, create a KohaCurrencies.pm
that could be (untested)

use Template::Plugin::Filter;
use base qw( Template::Plugin::Filter );

use C4::Dates;

sub filter {
    my ($self,$amount) = @_;
    my $curr_symbol = GetCurrency()->{symbol};
    if ($curr_symbol && $amount) {
        if ($amount =~ /^\-/) {
            $amount =~ s/^\-/\-$curr_symbol/;
        } else {
            $amount = $curr_symbol.$amount;
        }
    }
    return $amount;
}

and just update all template to display currencies:
[% USE KohaCurrencies %]

and
[% totspent | $KohaCurrencies %] 
...

thanks for your feedback on this
1;

-- 
Configure bugmail: 
http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to