From 3ef1669387528f35882456204d57f9e9630de906 Mon Sep 17 00:00:00 2001
From: Victor Grousset <victor.grousset@biblibre.com>
Date: Wed, 12 Dec 2018 11:11:48 +0100
Subject: [PATCH] WIP not validated at all

https://bugs.koha-community.org/show_bug.cgi?id=21507
---
 .../intranet-tmpl/prog/en/modules/members/paycollect.tt      | 5 +++--
 members/paycollect.pl                                        | 3 +++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt
index 4ffb01716f..5564f34891 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt
@@ -195,10 +195,11 @@
         [% IF type == 'writeoff' %]
             <label for="paid">Writeoff amount: </label>
         [% ELSE %]
-            <label for="paid">Collect from patron: </label>
+            <label for="paid">TESTCollect from patron: </label>
         [% END %]
         <!-- default to paying all -->
-        <input name="paid" id="paid" value="[% total | format('%.2f') %]" type="text" />
+        [% total %]
+        <input name="paid" id="paid" value="[% total %]" type="text" />
     </li>
     [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %]
     [% IF payment_types %]
diff --git a/members/paycollect.pl b/members/paycollect.pl
index a15267fa3d..9b865d0ac5 100755
--- a/members/paycollect.pl
+++ b/members/paycollect.pl
@@ -34,6 +34,7 @@ use Koha::Patron::Categories;
 use Koha::AuthorisedValues;
 use Koha::Account;
 use Koha::Token;
+use Koha::Number::Price;
 
 my $input = CGI->new();
 
@@ -188,6 +189,8 @@ if ( $input->param('error_over') ) {
     $template->param( error_over => 1, total_due => scalar $input->param('amountoutstanding') );
 }
 
+$total_due = Koha::Number::Price->new( $total_due )->format({mon_decimal_point => '-'});
+
 $template->param(
     type           => $type,
     borrowernumber => $borrowernumber,    # some templates require global
-- 
2.23.0