Bugzilla – Attachment 114453 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.17 KB, created by
Josef Moravec
on 2020-12-16 16:47:03 UTC
(
hide
)
Description:
Bug 24519: Match paycollect form validation for change collection
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2020-12-16 16:47:03 UTC
Size:
2.17 KB
patch
obsolete
>From 1ef37864fe2a9c9be1b770af7d4e4c7ce9dfe159 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> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > koha-tmpl/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.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 24519
:
99948
|
100008
|
113701
| 114453