Bugzilla – Attachment 172266 Details for
Bug 37511
Add option to place the currency symbol before or after the amount
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37511: Location of the currency symbol (before or *after*) the amount
Bug-37511-Location-of-the-currency-symbol-before-o.patch (text/plain), 4.71 KB, created by
Janusz Kaczmarek
on 2024-10-01 13:35:34 UTC
(
hide
)
Description:
Bug 37511: Location of the currency symbol (before or *after*) the amount
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2024-10-01 13:35:34 UTC
Size:
4.71 KB
patch
obsolete
>From de286b18733e1fc2da3a2ab9e84cb340115abc5f Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Tue, 1 Oct 2024 08:30:33 +0000 >Subject: [PATCH] Bug 37511: Location of the currency symbol (before or > *after*) the amount >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >It is customary in non-English-speaking European countries to write the >currency symbol after the amount and separated from it by a space (e.g. >123 â¬, 54 zÅ, 38 KÄ). This custom should be taken into account >in Koha::Number::Price::_format_params (by proper use the p_cs_precedes >parameter). > >The correct display of the currency is particularly important when using >OPACShowSavings system preference. > >Test plan: >========== >1. Enable OPACShowSavings, have some items with defined 'v - Cost, > replacement price'. Check out the items to a patron. >2. Log in to OPAC as the patron. See the amount of 'total savings' on > the main page. Note that the currency symbol precedes the amount. > There is no way to configure the position of the currency symbol. >3. Apply the patch ; updatedatabase.pl ; restart_all. >4. Go to Administration > Currencies and exchange rates. Modify the > active currency unchecking the 'Currency symbol precedes value' > checkbox. >5. Refresh the OPAC page. See that the position of the currency symbol > has been changed. > >Sponsored-by: Ignatianum University in Cracow >--- > Koha/Number/Price.pm | 3 ++- > admin/currency.pl | 14 +++++++++----- > .../prog/en/modules/admin/currency.tt | 8 ++++++++ > 3 files changed, 19 insertions(+), 6 deletions(-) > >diff --git a/Koha/Number/Price.pm b/Koha/Number/Price.pm >index a0f847d495..4518e97457 100644 >--- a/Koha/Number/Price.pm >+++ b/Koha/Number/Price.pm >@@ -127,7 +127,8 @@ sub _format_params { > } > > >- $format_params{p_cs_precedes} = $p_cs_precedes if defined $p_cs_precedes; >+ $format_params{p_cs_precedes} = >+ defined $p_cs_precedes ? $p_cs_precedes : ( $currency and $currency->p_cs_precedes ) ? 1 : 0; > $format_params{p_sep_by_space} = ( $currency and $currency->p_sep_by_space ) ? 1 : 0; > > return \%format_params; >diff --git a/admin/currency.pl b/admin/currency.pl >index 6220bbd081..2ca7d620e4 100755 >--- a/admin/currency.pl >+++ b/admin/currency.pl >@@ -57,6 +57,7 @@ if ( $op eq 'add_form' ) { > my $rate = $input->param('rate'); > my $active = $input->param('active'); > my $p_sep_by_space = $input->param('p_sep_by_space'); >+ my $p_cs_precedes = $input->param('p_cs_precedes') // 0; > my $is_a_modif = $input->param('is_a_modif'); > > if ($is_a_modif) { >@@ -66,6 +67,7 @@ if ( $op eq 'add_form' ) { > $currency->rate($rate); > $currency->active($active); > $currency->p_sep_by_space($p_sep_by_space); >+ $currency->p_cs_precedes($p_cs_precedes); > eval { $currency->store; }; > if ($@) { > push @messages, { type => 'error', code => 'error_on_update' }; >@@ -74,12 +76,14 @@ if ( $op eq 'add_form' ) { > } > } else { > my $currency = Koha::Acquisition::Currency->new( >- { currency => $currency_code, >- symbol => $symbol, >- isocode => $isocode, >- rate => $rate, >- active => $active, >+ { >+ currency => $currency_code, >+ symbol => $symbol, >+ isocode => $isocode, >+ rate => $rate, >+ active => $active, > p_sep_by_space => $p_sep_by_space, >+ p_cs_precedes => $p_cs_precedes, > } > ); > eval { $currency->store; }; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt >index 0cf35c914d..a3ef292b31 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt >@@ -148,6 +148,14 @@ > <input type="checkbox" id="p_sep_by_space" name="p_sep_by_space" value="1" /> > [% END %] > </li> >+ <li> >+ <label for="p_cs_precedes">Currency symbol precedes value: </label> >+ [% IF currency.p_cs_precedes %] >+ <input type="checkbox" id="p_cs_precedes" name="p_cs_precedes" value="1" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" id="p_cs_precedes" name="p_cs_precedes" value="1" /> >+ [% END %] >+ </li> > <li> > <label for="active">Active: </label> > [% IF currency.active %] >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37511
:
172264
|
172265
|
172266
|
172267
|
172286
|
172287
|
172288
|
172289
|
173551
|
173552
|
173553
|
173554
|
173555