Bugzilla – Attachment 116389 Details for
Bug 27290
Cash register allows for 'amount tendered' less than amount being paid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27290: Clean up validation
Bug-27290-Clean-up-validation.patch (text/plain), 3.44 KB, created by
Martin Renvoize (ashimema)
on 2021-02-05 11:14:27 UTC
(
hide
)
Description:
Bug 27290: Clean up validation
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-02-05 11:14:27 UTC
Size:
3.44 KB
patch
obsolete
>From 2a396458ee3be57343b50c1d366fa8419746fe02 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 21 Dec 2020 16:25:47 +0000 >Subject: [PATCH] Bug 27290: Clean up validation > >It seems we had the validator instantiated twice and we used a mix of >validation of required at form element level and in JS instantiator. > >This patch moves the rules to consistently apply at the instantiation >and removes the duplicate lines. > >To test: >1 - Enable 'useCashRegisters' and 'EnablePointofSale' >2 - Add a cash register >3 - Add a debit type that can be sold >4 - Go to point of sale and sell the item multiple times >5 - Enter 'Amount tendered' less than amount being paid >6 - Click confirm >7 - Transaction is processed as if full funds received >8 - Try with a negative number - goes through again > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../intranet-tmpl/prog/en/modules/pos/pay.tt | 26 ++++++++----------- > 1 file changed, 11 insertions(+), 15 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >index efdea82446..4d35b60ff7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >@@ -112,7 +112,7 @@ > <ol> > <li> > <label for="paid">Amount being paid: </label> >- <input type="text" inputmode="numeric" pattern="[0-9]*" name="paid" id="paid" value="[% amountoutstanding | $Price on_editing => 1 %]" readonly/> >+ <input type="text" inputmode="none" pattern="[0-9]*" name="paid" id="paid" value="" readonly/> > </li> > <li> > <label for="collected" class="required">Amount tendered: </label> >@@ -258,7 +258,6 @@ > var paid = $('#paid')[0]; > moneyFormat(paid); > $('#collected').rules( "add", { min: Number(paid.value) }); >- $("#payForm").valid() > change.innerHTML = zero_formatted; > $(':input[name="change"]').val(zero_formatted); > } else { >@@ -372,11 +371,19 @@ > $('#payForm').submit(); > }); > >- $( "#payForm" ).validate({ >+ $('#payForm').validate({ > rules: { >- paid: { required: true }, >+ paid: { >+ required: true >+ }, > collected: { > required: true >+ }, >+ payment_type: { >+ required: true >+ }, >+ registerid: { >+ required: true > } > } > }); >@@ -403,17 +410,6 @@ > } > }); > >- $('#payForm').validate({ >- rules: { >- collected: { >- required: true >- }, >- registerid: { >- required: true >- } >- } >- }); >- > [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %] > $("#printReceipt").click(function() { > var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=[% payment_id | uri %]&collected=[% collected | uri %]&change=[% change | uri %]', '_blank'); >-- >2.20.1
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 27290
:
114568
|
114670
|
114671
|
114747
|
114748
|
114749
|
114757
|
116389
|
116472