This problem occurs if you forget to fill in the collect payment fields, then press on the “Enter” key. When a message Required field shows up, the payment will not be saved correctly in the database. Instead, Koha secretly charges the failed payment in the database before confirming the real payment on the web interface. E.g . If the item cost = $1 and you press 3 times «Enter» with missing payment fields, the web interface and receipt confirm a $1 payment, while the database register a $3 payment (3 X $1 ) for the same transaction id.
Test plan 1. Have an item for $1 in Point of Sale 2. From the point of sale, add this item (1 time) to "sale", so the total payable = $1 – (no need to modify quantity nor the item cost) 3. In the Collect payment section, click in the «Amount tendered box », leave the box empty 4. Press the Enter key --> A «Required field » message should appear <--- failed payment 1 5. Add an amount in the amount tendered box 6. Press the Enter key --> «Required field » message is still displayed <--- failed payment 2 7. Select the payment type 8. Press the Enter key --> a «Required field » message <---- failed payment 3 9. Select the cash register 10. Click on Confirm 11. Print the receipt (see the yellow box at the top) --> The receipt should confirm a $1 payment. Write down the transaction ID from the receipt. 12. In a terminal, check the transaction ID in the database; check "Accountlines" and "account_offsets" select * from accountlines where timestamp =’date of the transaction aaaa-mm-dd hh:mm:ss’ select * from account_offsets where credit_id='transaction ID from the receipt" The item cost is charged each time you miss a field (purchase = 3$ + 3 X $1 payment )
correction the payment screen shows only $1 to pay the receipt shows up $3 db tell 3 time $1 payment
Hi Marie-Luce, I'm afraid I can't replicate this with your test plan right now. Could you let me know what browser you are using and whether you have javascript disabled or any form of accessibility tool in use?
Created attachment 130091 [details] IntranetUserJS - to base patch upon
I can no longer reproduce the problem in Koha 20.05. I'm not sure what went wrong before, maybe some old sales were left in my cache. However, the point-of-sale behaviour has changed since my first test. In 21.05, you are now forced to choose a cash register before the payment confirmation. This new behaviour seems to fix the problem.