From 143409e4c44d8f49570e17c5fb6aeca3a505cd6e Mon Sep 17 00:00:00 2001 From: Jon Knight Date: Wed, 7 Feb 2018 19:12:43 +0000 Subject: [PATCH] Attempt to display price formatted according to CurrencyFormat syspref using templates, with the English template as an example. https://bugs.koha-community.org/show_bug.cgi?id=19479 --- acqui/basketgroup.pl | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index 8c0e4c4..6f6d113 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -97,6 +97,8 @@ sub displaybasketgroups { my $basketsqty = 0; while($i < scalar(@$baskets)){ my $basket = @$baskets[$i]; + my $active_currency = Koha::Acquisition::Currencies->get_active; + $basket->{currency} = $active_currency->currency; if($basket->{'basketgroupid'} && $basket->{'basketgroupid'} == $basketgroup->{'id'}){ $basket->{total} = BasketTotal($basket->{basketno}, $bookseller); push(@{$basketgroup->{'baskets'}}, $basket); @@ -254,6 +256,8 @@ if ( $op eq "add" ) { my $selecteds = GetBasketsByBasketgroup($basketgroupid); foreach my $basket(@{$selecteds}){ $basket->{total} = BasketTotal($basket->{basketno}, $bookseller); + my $active_currency = Koha::Acquisition::Currencies->get_active; + $basket->{currency} = $active_currency->currency; } $template->param(basketgroupid => $basketgroupid, selectedbaskets => $selecteds); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt index 1ee7083..4b3e126 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt @@ -1,4 +1,5 @@ [% USE Branches %] +[% USE Price %] [% INCLUDE 'doc-head-open.inc' %] Koha › Basket grouping for [% booksellername |html %] @@ -173,7 +174,7 @@ function submitForm(form) { No name, basketnumber: [% basket.basketno %] [% END %] ,
- Total: [% basket.total %] + Total: [% basket.total | $Price %] ([% basket.currency %]) [% END %] @@ -259,7 +260,7 @@ function submitForm(form) { No name, basketnumber: [% selectedbasket.basketno %] [% END %] ,
- Total: [% selectedbasket.total %] + Total: [% selectedbasket.total | $Price %] ([% selectedbasket.currency %]) [% END %] -- 2.1.4