From 2f1b920463f137485a6531be219aede2535abbc7 Mon Sep 17 00:00:00 2001
From: David Nind <david@davidnind.com>
Date: Sat, 20 Feb 2021 23:06:01 +0000
Subject: [PATCH] Bug 27405: (follow up) Updates to accommodate currency entry

This patch makes two modifications to allow the entry of
currency strings (for example, 1.25) so that it is consistent with other
payment entry forms.

- Inputmode changed to "decimal"
- Regex pattern changed to "^\d+(\.\d{2})?$" as found in
  admin/debit_types.tt

To test, apply the patch and test entry of various strings in the manual
invoice "amount" field. Confirm that the field only accepts digits or
digits followed by a decimal and two digits.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
---
 koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt
index 1ffdb9db77..ebee5bd376 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt
@@ -273,7 +273,7 @@
                                 </li>
                                 <li>
                                     <label class="required" for="amount">Returned to patron: </label>
-                                    <input type="text" inputmode="numeric" pattern="[0-9]*" id="returned" name="amount" required="required">
+                                    <input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" id="returned" name="amount" required="required">
                                     <span class="required">Required</span>
                                 </li>
                                 [% SET payment_types = [] %]
-- 
2.11.0