Bugzilla – Attachment 97888 Details for
Bug 22359
Improve usability of 'change calculation' (bug 11373)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22359: Improvements to payment collection inputs
Bug-22359-Improvements-to-payment-collection-input.patch (text/plain), 4.04 KB, created by
ByWater Sandboxes
on 2020-01-24 15:36:46 UTC
(
hide
)
Description:
Bug 22359: Improvements to payment collection inputs
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2020-01-24 15:36:46 UTC
Size:
4.04 KB
patch
obsolete
>From 928bec70a3e7fcbc08a7c63910d2a1737afc89e2 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 20 Nov 2019 16:01:56 +0000 >Subject: [PATCH] Bug 22359: Improvements to payment collection inputs > >This patch attempts to clarify the uses of the various input fields on >the paycollect screens. > >It does this by adding validation to the form such that entering a >'collected' value that is lower than the 'paid' value is now forbidden. > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >--- > .../prog/en/modules/members/paycollect.tt | 29 ++++++++++++++++------ > 1 file changed, 21 insertions(+), 8 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 fa358135e6..42ba9fb5d8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >@@ -113,11 +113,11 @@ > > <li> > <label for="paid">Amount being paid: </label> >- <input name="paid" id="paid" value="[% amountoutstanding | $Price on_editing => 1 %]"/> >+ <input name="paid" id="paid" type="text" step="0.01" value="[% amountoutstanding | $Price on_editing => 1 %]"/> > </li> > <li> > <label for="collected">Collected from patron: </label> >- <input id="collected" value="[% amountoutstanding | $Price on_editing => 1 %]"/> >+ <input name="collected" id="collected" type="text" step="0.01" value="[% amountoutstanding | $Price on_editing => 1 %]"/> > </li> > <li> > <label>Change to give: </label> >@@ -237,22 +237,22 @@ > </li> > <li> > [% IF type == 'WRITEOFF' %] >- <label for="paid">Writeoff amount:</label> >+ <label for="paid">Writeoff amount: </label> > [% ELSE %] >- <label for="paid">Amount paid: </label> >+ <label for="paid">Amount being paid: </label> > [% END %] >- <input name="paid" id="paid" value="[% total | $Price on_editing => 1 %]"/> >+ <input name="paid" id="paid" type="text" step="0.01" value="[% total | $Price on_editing => 1 %]"/> > </li> >- > [% IF type != 'WRITEOFF' %] > <li> > <label for="collected">Collected from patron: </label> >- <input id="collected" value="[% total | $Price on_editing => 1 %]"/> >+ <input name="collected" id="collected" type="text" step="0.01" value="[% total | $Price on_editing => 1 %]"/> > </li> > <li> > <label>Change to give: </label> > <span id="change">0.00</span> > </li> >+ > [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] > [% IF payment_types %] > <li> >@@ -265,6 +265,7 @@ > </select> > </li> > [% END %] >+ [% END %] > > [% IF Koha.Preference('UseCashRegisters') %] > <li> >@@ -280,7 +281,6 @@ > </select> > </li> > [% END %] >- [% END %] > > <li> > <label for="selected_accts_notes">Note: </label> >@@ -366,6 +366,15 @@ > $('#modal_submit').click(function() { > forms[0].submit(); > }); >+ >+ $( "#payindivfine, #payfine" ).validate({ >+ rules: { >+ paid: { required: true }, >+ collected: { >+ required: true >+ } >+ } >+ }); > }); > > prevent_default = 1; >@@ -439,6 +448,10 @@ > var change = $('#change')[0]; > change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100; > if (change.innerHTML <= 0) { >+ var paid = $('#paid')[0]; >+ moneyFormat(paid); >+ $('#collected').rules( "add", { min: Number(paid.value) }); >+ $( "#payindivfine, #payfine" ).valid(); > change.innerHTML = "0.00"; > $('input[name="change_given"]').val('0.00'); > } else { >-- >2.11.0
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 22359
:
87591
|
95619
|
96394
|
97229
|
97840
|
97873
|
97874
|
97877
|
97878
|
97885
|
97886
|
97888
|
97889
|
98833
|
98834
|
99323
|
99324
|
99325
|
99337
|
99389
|
99390