Bugzilla – Attachment 113701 Details for
Bug 24519
Change calculation and validation in Point of Sale should match Paycollect
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24519: Match paycollect form validation for change collection
Bug-24519-Match-paycollect-form-validation-for-cha.patch (text/plain), 2.11 KB, created by
Martin Renvoize (ashimema)
on 2020-11-17 11:09:40 UTC
(
hide
)
Description:
Bug 24519: Match paycollect form validation for change collection
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-11-17 11:09:40 UTC
Size:
2.11 KB
patch
obsolete
>From 3617808a33ba7aa247848f55418a5c7084035a5a Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 2 Mar 2020 16:45:58 +0000 >Subject: [PATCH] Bug 24519: Match paycollect form validation for change > collection > >This patch adds form validation to the Point Of Sale payment page such >that one cannot submit the form with a 'collected' value that is less >than the 'owed' amount. > >Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> >--- > .../intranet-tmpl/prog/en/modules/pos/pay.tt | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > >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 d57f97637f..8d09c75df2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >@@ -253,14 +253,19 @@ > var zero_formatted = "[% 0 | $Price %]"; > 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) }); >+ $("#payForm").valid() > change.innerHTML = zero_formatted; >+ $(':input[name="change"]').val(zero_formatted); > } else { > change.value = change.innerHTML; > moneyFormat(change); > change.innerHTML = change.value; >+ $(':input[name="change"]').val(change.value); > } > >- $(':input[name="change"]').val(change.value); > $('#modal_change').html(change.innerHTML); > } > >@@ -363,6 +368,15 @@ > $('#payForm').submit(); > }); > >+ $( "#payForm" ).validate({ >+ rules: { >+ paid: { required: true }, >+ collected: { >+ required: true >+ } >+ } >+ }); >+ > $('#payForm').submit(function(e){ > if (change != undefined && change.innerHTML > 0.00 && !checked) { > e.preventDefault(); >-- >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 24519
:
99948
|
100008
|
113701
|
114453