Bugzilla – Attachment 99948 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.02 KB, created by
Martin Renvoize (ashimema)
on 2020-03-02 16:47:42 UTC
(
hide
)
Description:
Bug 24519: Match paycollect form validation for change collection
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-03-02 16:47:42 UTC
Size:
2.02 KB
patch
obsolete
>From acacd68dff76c975e935a72cd6c5559904ab050d 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. >--- > .../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 e0a68b1436..afdbb1519c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >@@ -245,14 +245,19 @@ > 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) }); >+ $("#payForm").valid() > change.innerHTML = "0.00"; >+ $(':input[name="change"]').val('0.00'); > } 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); > } > >@@ -358,6 +363,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