Bugzilla – Attachment 130428 Details for
Bug 30003
Register entries doubled up if form fails validation on first submission
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30003: Prevent double up of point-of-sale items
Bug-30003-Prevent-double-up-of-point-of-sale-items.patch (text/plain), 1.73 KB, created by
Jake Deery
on 2022-02-10 11:01:39 UTC
(
hide
)
Description:
Bug 30003: Prevent double up of point-of-sale items
Filename:
MIME Type:
Creator:
Jake Deery
Created:
2022-02-10 11:01:39 UTC
Size:
1.73 KB
patch
obsolete
>From 354c6a20ab265ba57bf051bd64d660122ce1cbaf Mon Sep 17 00:00:00 2001 >From: Jake Deery <jake.deery@ptfs-europe.com> >Date: Tue, 8 Feb 2022 11:40:06 +0000 >Subject: [PATCH] Bug 30003: Prevent double up of point-of-sale items > >This patch prevents the double submission of point-of-sale items when form validation fails at the first submission > >Test plan >1. Navigate to /cgi-bin/koha/pos/pay.pl >2. Add an item from 'items to purchase' >3. Under 'collect payment', click submit without altering the form >4. See 'This field is required.' >5. Now, fill a value in 'Amount tendered' that satisfies or exceeds 'Amount being paid' >6. The payment should succeed >7. Navigate to /cgi-bin/koha/pos/register.pl >8. See duplicate lines in Transactions > >Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt | 8 ++++++++ > 1 file changed, 8 insertions(+) > >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 243c0baaae..007ddd1e77 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >@@ -402,6 +402,14 @@ > }); > > $('#payForm').submit(function(e){ >+ // first, clear stale sales 'rows' from the payForm >+ if($('input[name="sales"]').length > 0) { >+ $('input[name="sales"]').each(function() { >+ $(this).remove(); >+ }); >+ } >+ >+ // now, process the current & fresh contents of the sale_table > if (change != undefined && change.innerHTML > 0.00 && !checked) { > e.preventDefault(); > $("#confirm_change_form").modal("show"); >-- >2.25.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 30003
:
130280
|
130423
|
130425
|
130427
|
130428
|
132249