From 610ee61a5494ec88e9142e221cbd0a591210bde9 Mon Sep 17 00:00:00 2001 From: Victor Grousset Date: Wed, 17 Oct 2018 11:07:05 +0200 Subject: [PATCH] WIP Bug 21507 - Fix decimal separators issues in patrons payments/fines --- .../prog/en/includes/decimal-input-js.inc | 24 +++++++++++++++++++ .../prog/en/modules/members/mancredit.tt | 14 ++++++++++- .../prog/en/modules/members/maninvoice.tt | 13 +++++++++- members/maninvoice.pl | 5 ++-- 4 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/decimal-input-js.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/decimal-input-js.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/decimal-input-js.inc new file mode 100644 index 0000000000..2e3836c5af --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/decimal-input-js.inc @@ -0,0 +1,24 @@ +[% USE Koha %] + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt index c02943d96c..c5c94fe529 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt @@ -44,7 +44,8 @@
  • -
  • Example: 5.00
  • +
  • Example: 5[% IF Koha.Preference("CurrencyFormat") == 'FR' %],[% ELSE %].[% END %]12
  • +
    Cancel
    @@ -63,10 +64,21 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'str/members-menu.inc' %] [% Asset.js("js/members-menu.js") | $raw %] + [% INCLUDE 'decimal-input-js.inc' %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt index 3014227bae..c9828c04f6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt @@ -57,7 +57,7 @@
  • -
  • Example: 5.00
  • +
  • Example: 5[% IF Koha.Preference("CurrencyFormat") == 'FR' %],[% ELSE %].[% END %]12
  • Cancel
    @@ -76,6 +76,7 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'str/members-menu.inc' %] [% Asset.js("js/members-menu.js") | $raw %] + [% INCLUDE 'decimal-input-js.inc' %] [% END %] diff --git a/members/maninvoice.pl b/members/maninvoice.pl index db7a447ffa..1e411a098c 100755 --- a/members/maninvoice.pl +++ b/members/maninvoice.pl @@ -31,12 +31,12 @@ use C4::Members; use C4::Accounts; use C4::Items; use C4::Members::Attributes qw(GetBorrowerAttributes); -use Koha::Token; +use Koha::Token; use Koha::Items; use Koha::Patrons; - use Koha::Patron::Categories; +use Koha::Number::Price; my $input=new CGI; my $flagsrequired = { borrowers => 'edit_borrowers' }; @@ -67,6 +67,7 @@ if ($add){ } my $desc=$input->param('desc'); my $amount=$input->param('amount'); + $amount=Koha::Number::Price->new( $amount )->unformat(); my $type=$input->param('type'); my $note = $input->param('note'); my $error = manualinvoice( $borrowernumber, $itemnum, $desc, $type, $amount, $note ); -- 2.23.0