Bugzilla – Attachment 141472 Details for
Bug 29987
Manual credits are not recorded for a register
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29987: Improve validation
Bug-29987-Improve-validation.patch (text/plain), 3.15 KB, created by
David Nind
on 2022-10-06 19:54:30 UTC
(
hide
)
Description:
Bug 29987: Improve validation
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-10-06 19:54:30 UTC
Size:
3.15 KB
patch
obsolete
>From 06ee87f1fa1af66702362cc83df3246161570802 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 30 Sep 2022 16:06:45 +0100 >Subject: [PATCH] Bug 29987: Improve validation > >This patch adds hinting to display the required state of the cash >register fields. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../prog/en/modules/members/mancredit.tt | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > >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 6d747d5e41..865b3d5ea1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >@@ -72,7 +72,7 @@ > <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li> > <li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li> > <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li> >- <li><label for="amount">Amount: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="amount" id="amount" required="required" min="0" value=""/> Example: 5.00</li> >+ <li><label for="amount" class="required">Amount: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="amount" id="amount" required="required" min="0" value=""/> Example: 5.00</li> > [% INCLUDE 'transaction_types.inc' type="credit" %] > [% IF Koha.Preference('UseCashRegisters') %] > <li> >@@ -85,7 +85,7 @@ > </label> > > [% IF Koha.Preference('RequireCashRegister') %] >- <select name="cash_register" id="cash_register" required> >+ <select name="cash_register" id="cash_register" required="required"> > [% ELSE %] > <select name="cash_register" id="cash_register"> > [% END %] >@@ -128,6 +128,18 @@ > $(document).ready(function(){ > $('#mancredit').preventDoubleFormSubmit(); > $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); >+ [% UNLESS Koha.Preference('RequireCashRegister') %] >+ $('#credit_type').on('change', function() { >+ let val = $(this).val(); >+ if ( val == 'CASH' ) { >+ $("label[for='cash_register']").addClass('required'); >+ $('#cash_register').attr('required','required').after( '<span class="required">Required</span>' ); >+ } else { >+ $("label[for='cash_register']").removeClass('required'); >+ $('#cash_register').removeAttr('required').next("span").remove(); >+ } >+ }); >+ [% END %] > }); > </script> > [% END %] >-- >2.30.2
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 29987
:
136743
|
136755
|
139703
|
139704
|
139705
|
141165
|
141166
|
141167
|
141171
|
141469
|
141470
|
141471
|
141472
|
142321
|
142322
|
142323
|
142324
|
142325