[Bug 43912] New: Complete cashup requires an amount for payment types with nothing expected
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 Bug ID: 43912 Summary: Complete cashup requires an amount for payment types with nothing expected Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Point of Sale Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: martin.renvoize@openfifth.co.uk Target Milestone: --- With Bug 33501 the Complete cashup modal lists every payment type in CashupPaymentTypes and requires an actual amount for each one. If a register only took cash, staff still have to type 0.00 for cheque, card and every other configured type before the cashup can be completed, and every extra row adds noise to the screen. Suggestion: for a payment type with nothing expected, pre-fill the amount with the expected value (0.00) and keep the row out of the way (collapsed, or behind a "Show all payment types" toggle), still submitting 0.00 so the cashup stays balanced. Typing a non-zero amount in such a row is a discrepancy, exactly as today. Test plan: 1. Set UseCashRegisters and set CashupPaymentTypes to CASH,CHEQUE,CARD. 2. Take a cash payment on a register. 3. Click Record cashup, Start cashup, then Complete cashup. => Before: the CHEQUE and CARD rows are empty required inputs, and the form cannot be submitted until 0.00 is typed in each. => After: they are pre-filled with 0.00 and out of the way, and entering the cash amount is enough to complete. 4. Type a non-zero amount in a zero-expected row. => It is shown as a discrepancy, and needs a note where notes are required. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk Depends on| |33501 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33501 [Bug 33501] Add optional support for different payment types during cashup reconciliation -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13985 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13985 [Bug 13985] [Omnibus] Cash Management - Koha as 'Point of Sale' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208992 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208992&action=edit Bug 43912: Collapse payment types with nothing expected in the Complete cashup modal The Complete cashup modal lists every payment type in CashupPaymentTypes and requires an actual amount for each one. When a register only took cash, staff still had to type 0.00 for cheque, card and every other configured type before the cashup could be completed. When at least one payment type has an amount expected, pre-fill each type with nothing expected with 0.00 and collapse them behind a "Show payment types with nothing expected (N)" link. They are still submitted, so the cashup stays balanced, and a non-zero amount entered in one is a discrepancy exactly as before. When nothing at all is expected every row is shown. To test: 1. Set UseCashRegisters and set CashupPaymentTypes to CASH,CHEQUE,CARD 2. Take a cash payment on a register 3. Click Record cashup, Start cashup, then Complete cashup => Before: the CHEQUE and CARD rows are empty required inputs and the form cannot be submitted until 0.00 is typed in each => After: only the Cash row is shown, with a link "Show payment types with nothing expected (2)" 4. Enter the cash amount that was taken => The totals show Balanced and the cashup can be completed 5. Click the link => The CHEQUE and CARD rows appear, pre-filled with 0.00, and the link now reads "Hide payment types with nothing expected" 6. Type 2.00 in the CHEQUE row => It shows a +2.00 discrepancy and its note field is enabled Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #208992|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 209044 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209044&action=edit Bug 43912: Collapse payment types with nothing expected in the Complete cashup modal The Complete cashup modal lists every payment type in CashupPaymentTypes and requires an actual amount for each one. When a register only took cash, staff still had to type 0.00 for cheque, card and every other configured type before the cashup could be completed. When at least one payment type has an amount expected, pre-fill each type with nothing expected with 0.00 and collapse them behind a "Show payment types with nothing expected (N)" link. They are still submitted, so the cashup stays balanced, and a non-zero amount entered in one is a discrepancy exactly as before. When nothing at all is expected every row is shown. To test: 1. Set UseCashRegisters and set CashupPaymentTypes to CASH,CHEQUE,CARD 2. Take a cash payment on a register 3. Click Record cashup, Start cashup, then Complete cashup => Before: the CHEQUE and CARD rows are empty required inputs and the form cannot be submitted until 0.00 is typed in each => After: only the Cash row is shown, with a link "Show payment types with nothing expected (2)" 4. Enter the cash amount that was taken => The totals show Balanced and the cashup can be completed 5. Click the link => The CHEQUE and CARD rows appear, pre-filled with 0.00, and the link now reads "Hide payment types with nothing expected" 6. Type 2.00 in the CHEQUE row => It shows a +2.00 discrepancy and its note field is enabled Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. Apply the patches in bug 33501, databaseupdate, yarn build (just in case) and restart_all 2. Add CHEQUE and CARD authorized values to the PAYMENT_TYPE authorized values category (Administration > Basic parameters > Authorized values). 3. Set the UseCashRegisters system preference to "Use". 4. For the new CashupPaymentTypes system preference select the "Card" and "Cheque" payment types. 5. Add a cash register for Centerville (Administration > Accounting > Cash registers). 6. Add a transaction and payment for a patron: - Create a manual invoice for a patron ([selected patron] > Accounting > Create manual invoice), for Example Mary Burton for $10.00 - Make a payment for $10.00 7. Go to More > Tools > Cash management > Cash summary for Centerville. 8. For the register, click Record cashup, then Start cashup and then Complete cashup. 9. Put $10.00 in the actual counted column for the Cash row. 10. If you click "Confirm cashup" you can't go any further as you need to put 0 in each of the other rows (the fields now show as required with a tooltip message" Please fill in this field"). 11. Click "Cancel". 12. Apply the patches for this bug (don't apply the patches for bug 33501, as these are already applied) and restart everything (restart_all). 13. Refresh the "Cash summary for Centerville" page. 14. Click "Complete cashup": Note: Now only the Cash row is shown, with a link under it with "Show payment types with nothing expected (3)" 15. Enter the cash amount that was received in the actual counted column ($10.00) => Reconciliation shows as: "Balanced - no surplus or deficit" The discrepancy column for cash row shows as "Balanced" The cashup can be completed (don't click "Confirm cashup" yet!) 16. Click the "Show payment types with nothing expected (3)" link. ==> Result: The Cash via SIP2, Card and Cheque rows appear, pre-filled with 0.00, and the link now reads "Hide payment types with nothing expected". 17. Type 2.00 in the Cheque row: ==> Result: It shows +2.00 in the discrepancy column and the note field is enabled -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|martin.renvoize@openfifth.c |andrew@bywatersolutions.com |o.uk | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #4 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Claude points out two issues here that I was able to confirm: Cashups cannot be completed if CurrencyFormat is set to FR: - When CurrencyFormat is FR, the pre-filled value is "0,00". - That value fails the input’s pattern ^-?\d+(\.\d{1,2})?$ and the server-side check in pos/register.pl:175. If CashupReconciliationNoteRequired is disabled but CashupReconciliationNoteAuthorisedValue is enabled, Koha does not confirm that the submitted value on a note is actually an authorized value (though I'll grant it's a bit complicated and unlikely to circumvent the dropdown in the modal in order to insert an unauthorized note). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211468 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211468&action=edit Bug 43912: (QA follow-up) Pre-fill zero-expected rows with a plain 0.00 The rows collapsed behind "Show payment types with nothing expected" were pre-filled with format_price(), which follows CurrencyFormat. With CurrencyFormat set to FR that gives "0,00", which fails the amount input's pattern (^-?\d+(\.\d{1,2})?$) and the server-side amount check, so the Complete cashup form could not be submitted even with every amount entered correctly. These rows are zero by definition, so pre-fill them with a plain "0.00", the dot-decimal form the input and the server expect whatever CurrencyFormat is. To test: 1. Set UseCashRegisters, set CashupPaymentTypes to CASH,CHEQUE,CARD and set CurrencyFormat to FR 2. Take a cash payment of 10.00 on a register 3. Click Record cashup, Start cashup, then Complete cashup 4. Enter 10.00 in the Cash row and click the "Show payment types with nothing expected" link => The Cheque and Card rows are pre-filled with 0.00, show no validation error, and the cashup can be completed (before: they held "0,00" and the form could not be submitted) 5. Type 2.00 in the Cheque row => The discrepancy column shows +2,00 (formatted for FR) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Thanks Andrew, the CurrencyFormat catch was a good one. 1. CurrencyFormat FR: confirmed. The rows collapsed behind "Show payment types with nothing expected" were pre-filled with format_price(), which follows CurrencyFormat. With FR that gives "0,00", which fails the amount input's pattern (^-?\d+(\.\d{1,2})?$) and the server-side check in pos/register.pl, so Complete cashup could not be submitted even with every amount entered correctly. I've attached a follow-up that pre-fills a plain "0.00" instead. These rows are zero by definition, and a dot-decimal value is what Koha uses for any editable amount whatever CurrencyFormat is (see Koha::Number::Price->format_for_editing). I tested it with CurrencyFormat set to FR: the form validates, a 2.00 cheque shows as "+2,00" in the discrepancy column (display stays locale-formatted), and the cashup completes. Note that this does not change what a user can type: the amount inputs accept a dot decimal only, so "10,00" is still rejected by the pattern. That comes from the Complete cashup modal in Bug 33501, matches the existing POS "amount returned" input, and is part of the wider decimal-separator problem already tracked in Bugs 18186, 12310, 21507 and 17098, so I have left it out of scope here. 2. Note validation against the authorised value category: confirmed. The check in Koha::Cash::Register::add_cashup only runs when CashupReconciliationNoteRequired is enabled. That code comes from Bug 33501, and this patch only touches cashup_modals.js, so I'd rather handle it separately than widen this bug. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #209044|0 |1 is obsolete| | Attachment #211468|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 --- Comment #7 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211475 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211475&action=edit Bug 43912: Collapse payment types with nothing expected in the Complete cashup modal The Complete cashup modal lists every payment type in CashupPaymentTypes and requires an actual amount for each one. When a register only took cash, staff still had to type 0.00 for cheque, card and every other configured type before the cashup could be completed. When at least one payment type has an amount expected, pre-fill each type with nothing expected with 0.00 and collapse them behind a "Show payment types with nothing expected (N)" link. They are still submitted, so the cashup stays balanced, and a non-zero amount entered in one is a discrepancy exactly as before. When nothing at all is expected every row is shown. To test: 1. Set UseCashRegisters and set CashupPaymentTypes to CASH,CHEQUE,CARD 2. Take a cash payment on a register 3. Click Record cashup, Start cashup, then Complete cashup => Before: the CHEQUE and CARD rows are empty required inputs and the form cannot be submitted until 0.00 is typed in each => After: only the Cash row is shown, with a link "Show payment types with nothing expected (2)" 4. Enter the cash amount that was taken => The totals show Balanced and the cashup can be completed 5. Click the link => The CHEQUE and CARD rows appear, pre-filled with 0.00, and the link now reads "Hide payment types with nothing expected" 6. Type 2.00 in the CHEQUE row => It shows a +2.00 discrepancy and its note field is enabled Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 --- Comment #8 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211476 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211476&action=edit Bug 43912: (QA follow-up) Pre-fill zero-expected rows with a plain 0.00 The rows collapsed behind "Show payment types with nothing expected" were pre-filled with format_price(), which follows CurrencyFormat. With CurrencyFormat set to FR that gives "0,00", which fails the amount input's pattern (^-?\d+(\.\d{1,2})?$) and the server-side amount check, so the Complete cashup form could not be submitted even with every amount entered correctly. These rows are zero by definition, so pre-fill them with a plain "0.00", the dot-decimal form the input and the server expect whatever CurrencyFormat is. To test: 1. Set UseCashRegisters, set CashupPaymentTypes to CASH,CHEQUE,CARD and set CurrencyFormat to FR 2. Take a cash payment of 10.00 on a register 3. Click Record cashup, Start cashup, then Complete cashup 4. Enter 10.00 in the Cash row and click the "Show payment types with nothing expected" link => The Cheque and Card rows are pre-filled with 0.00, show no validation error, and the cashup can be completed (before: they held "0,00" and the form could not be submitted) 5. Type 2.00 in the Cheque row => The discrepancy column shows +2,00 (formatted for FR) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43912 --- Comment #9 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Martin Renvoize (ashimema) from comment #6)
2. Note validation against the authorised value category: confirmed. The check in Koha::Cash::Register::add_cashup only runs when CashupReconciliationNoteRequired is enabled. That code comes from Bug 33501, and this patch only touches cashup_modals.js, so I'd rather handle it separately than widen this bug.
Fair enough! It doesn't seem like huge concern anyway -- a lot of effort for a user to be mildly disruptive -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org