(Possibly related to #28163 at a code level) Hi, One of our customers has raised a curious bug involving the Point of Sale module within Koha. Specifically, when processing a payment in Koha, if the 'amount tendered' field is left blank, then filled in after the 'this field is mandatory' text appears, the transaction seems to be recorded twice. Please see here for a visual demo: https://i.imgur.com/upH5zlk.gifv Steps to reproduce: 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 I hope we can see this resolved quickly, as it has the potential to cause major accounting issues. Many thanks, Jake Deery
Just to update, I have applied a quick-fix to IntranetUserJS. See attached. I will look into creating a proper patch tonight -
Created attachment 130280 [details] [review] Applied a fix to stop point-of-sale items being added twice to till transaction lists
Created attachment 130423 [details] [review] Applied a fix to stop point-of-sale items being added twice to till transaction lists https://bugs.koha-community.org/show_bug.cgi?id=30003 Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Works great, thanks Jake! We have this problem with a couple of staff at one library, and we couldn't get to the bottom of it; invariably, whenever we were watching them process a transaction, they did it perfectly. Now we know the cause! :)
Jake is just fixing up the commit message to adhere to guidelines.. you guys we so quick :). I'll help him re-apply the signoff line ;)
Created attachment 130425 [details] [review] Bug 30003: Fix to stop point-of-sale items being added twice to transactions
Created attachment 130427 [details] [review] Bug 30003: Fix to stop point-of-sale items being added twice to transactions https://bugs.koha-community.org/show_bug.cgi?id=30003 Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Created attachment 130428 [details] [review] 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>
Right - apologies for the repeated attachments. Still getting the hang of git-bz ;-) Big thanks to Martin and Sally for taking a look at this, and Kyle for adding the sign-off line! Let me know how I can assist in the next steps.
*** Bug 28163 has been marked as a duplicate of this bug. ***
Hi Jake, thx for your patch and don't worry about the bugzilla noise, we all do it :)
I don't know if I am testing this correctly but with the patch I am not seeing anything on pos/register.pl
Created attachment 132249 [details] [review] 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 9. Apply patch 10. Repeat 2-6 11. Navigate to /cgi-bin/koha/pos/register.pl 12. Confirm only a single line was added Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This feels slightly hacky - it seems the "This sale" table should be part of the payment form so we don't have to copy/delete lines on every attempt This seems like a nasty bug however, passing QA
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
Pushed to 21.11.x for 21.11.05