@@ -, +, @@ format syspref --- Koha/Number/Price.pm | 18 ++++++++++ .../prog/en/includes/decimal-input-js.inc | 24 +++++++++++++ .../prog/en/modules/members/mancredit.tt | 13 ++++++- .../prog/en/modules/members/maninvoice.tt | 14 ++++++-- .../prog/en/modules/members/paycollect.tt | 8 ++--- members/mancredit.pl | 12 +++++++ members/maninvoice.pl | 36 +++++++++++++------ members/pay.pl | 3 ++ members/paycollect.pl | 7 +++- 9 files changed, 116 insertions(+), 19 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/decimal-input-js.inc --- a/Koha/Number/Price.pm +++ a/Koha/Number/Price.pm @@ -53,6 +53,8 @@ sub format_for_editing { return unless defined $self->value; my $format_params = $self->_format_params( $params ); + my $currency_format = C4::Context->preference("CurrencyFormat"); + $format_params = { %$format_params, int_curr_symbol => '', @@ -60,6 +62,22 @@ sub format_for_editing { mon_decimal_point => '.', }; + if ( $currency_format eq 'FR' ) { + %$format_params = ( + int_curr_symbol => '', + mon_thousands_sep => ' ', + mon_decimal_point => ',' + ); + } + + if ( $currency_format eq 'CH' ) { + %$format_params = ( + int_curr_symbol => '', + mon_thousands_sep => '\'', + mon_decimal_point => '.' + ); + } + # To avoid the system to crash, we will not format big number # We divide per 100 because we want to keep the default DECIMAL_DIGITS (2) # error - round() overflow. Try smaller precision or use Math::BigFloat --- a/koha-tmpl/intranet-tmpl/prog/en/includes/decimal-input-js.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/decimal-input-js.inc @@ -0,0 +1,24 @@ +[% USE Koha %] + + --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt @@ -83,7 +83,7 @@
  • -
  • Example: 5.00
  • +
  • Example: 5[% decimal_delimiter | html %]12
  • [% INCLUDE 'transaction_types.inc' type="credit" %] [% IF Koha.Preference('UseCashRegisters') %]
  • @@ -135,10 +135,21 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'str/members-menu.inc' %] [% Asset.js("js/members-menu.js") | $raw %] + [% INCLUDE 'decimal-input-js.inc' %] +