[Bug 43910] New: Cash payout throws a 500 error when no cash register is selected
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43910 Bug ID: 43910 Summary: Cash payout throws a 500 error when no cash register is selected Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Fines and fees Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Target Milestone: --- With UseCashRegisters enabled, choosing Cash in the "Issue payout" modal on a patron's Accounting tab and leaving the Cash register select on its placeholder submits the form with no register. The controller (members/boraccount.pl) then throws Koha::Exceptions::Account::RegisterRequired, which is not caught, and the staff member gets a 500 error page. The refund modal on the same page already blocks this client-side (Bug 41585). The payout modal has no equivalent check. This patch adds the same client-side check to the payout form: when the payout type is CASH or SIP00 and no register is selected, alert the user and keep the modal open. Test plan: 1. Enable UseCashRegisters and create at least two cash registers for your library, so that none is selected automatically. Log out and in again, and do not choose a register at login. 2. Give a patron a credit (for example a manual credit of 10.00). 3. On the patron's Accounting tab, click "Issue payout" on the credit. 4. Choose Cash as the payout type, leave Cash register unselected and click Confirm. => Without the patch: a 500 error page (Koha::Exceptions::Account::RegisterRequired). => With the patch: an alert "Cash register is required for cash payouts" and the form is not submitted. 5. Select a register and click Confirm. => The payout is recorded against that register. -- 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=43910 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208986 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208986&action=edit Bug 43910: Require a cash register when issuing a cash payout With UseCashRegisters enabled, choosing Cash in the "Issue payout" modal on a patron's Accounting tab and leaving the Cash register select on its placeholder submits the form with no registerid. The controller then throws Koha::Exceptions::Account::RegisterRequired, which is not caught, and the user gets a 500 error page. The refund modal already blocks this client-side (Bug 41585). Do the same for the payout form: when the payout type is CASH or SIP00 and no register is selected, alert the user and keep the modal open. To test: 1. Enable UseCashRegisters and create a cash register for your library 2. Give a patron a credit (e.g. a manual credit of 10.00) 3. On the patron's Accounting tab, click "Issue payout" on the credit 4. Choose Cash as the payout type, leave Cash register unselected and click Confirm => Before: a 500 error page (RegisterRequired) => After: an alert "Cash register is required for cash payouts" and the form is not submitted 5. Select a register and click Confirm => The payout is recorded against that register Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- 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=43910 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 Status|NEW |Needs Signoff -- 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=43910 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=43910 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sally.healey@cheshireshared | |services.gov.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43910 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26540 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43910 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Related: Bug 26540 (Signed Off) also touches the Issue payout modal in members/boraccount.tt. It covers a branch that has no cash register at all (the Cash option is hidden and an alert with a link to create a register is shown). This bug covers the opposite case: registers exist at the branch, but none is selected, so the form is posted with no register and the controller throws RegisterRequired. The two do not conflict in behaviour: with no register at the branch Cash is not offered, so the check added here is never reached. Both change the same modal markup and script in boraccount.tt, so whichever is pushed second will need a rebase. I have not tested them together. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43910 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=43910 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #208986|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=43910 --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 209029 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209029&action=edit Bug 43910: Require a cash register when issuing a cash payout With UseCashRegisters enabled, choosing Cash in the "Issue payout" modal on a patron's Accounting tab and leaving the Cash register select on its placeholder submits the form with no registerid. The controller then throws Koha::Exceptions::Account::RegisterRequired, which is not caught, and the user gets a 500 error page. The refund modal already blocks this client-side (Bug 41585). Do the same for the payout form: when the payout type is CASH or SIP00 and no register is selected, alert the user and keep the modal open. To test: 1. Enable UseCashRegisters and create a cash register for your library 2. Give a patron a credit (e.g. a manual credit of 10.00) 3. On the patron's Accounting tab, click "Issue payout" on the credit 4. Choose Cash as the payout type, leave Cash register unselected and click Confirm => Before: a 500 error page (RegisterRequired) => After: an alert "Cash register is required for cash payouts" and the form is not submitted 5. Select a register and click Confirm => The payout is recorded against that register 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=43910 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |blawlor@clamsnet.org |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43910 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|blawlor@clamsnet.org |nick@bywatersolutions.com Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43910 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #209029|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=43910 --- Comment #4 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 209737 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209737&action=edit Bug 43910: Require a cash register when issuing a cash payout With UseCashRegisters enabled, choosing Cash in the "Issue payout" modal on a patron's Accounting tab and leaving the Cash register select on its placeholder submits the form with no registerid. The controller then throws Koha::Exceptions::Account::RegisterRequired, which is not caught, and the user gets a 500 error page. The refund modal already blocks this client-side (Bug 41585). Do the same for the payout form: when the payout type is CASH or SIP00 and no register is selected, alert the user and keep the modal open. To test: 1. Enable UseCashRegisters and create a cash register for your library 2. Give a patron a credit (e.g. a manual credit of 10.00) 3. On the patron's Accounting tab, click "Issue payout" on the credit 4. Choose Cash as the payout type, leave Cash register unselected and click Confirm => Before: a 500 error page (RegisterRequired) => After: an alert "Cash register is required for cash payouts" and the form is not submitted 5. Select a register and click Confirm => The payout is recorded against that register Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43910 --- Comment #5 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 209738 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209738&action=edit Bug 43910: (QA follow-up) Add similar JS from the credits page to indicate register required for cash payout Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43910 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA CC| |pedro.amorim@openfifth.co.u | |k --- Comment #6 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- prove xt/tt_script_tidy.t xt/tt_script_tidy.t .. 93/3277 # Failed test 'koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt has a <script> tag with Template::Toolkit tags.' # at xt/tt_script_tidy.t line 78. # got: '1' # expected: '0 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43910 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #209737|0 |1 is obsolete| | Attachment #209738|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=43910 --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210935 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210935&action=edit Bug 43910: Require a cash register when issuing a cash payout With UseCashRegisters enabled, choosing Cash in the "Issue payout" modal on a patron's Accounting tab and leaving the Cash register select on its placeholder submits the form with no registerid. The controller then throws Koha::Exceptions::Account::RegisterRequired, which is not caught, and the user gets a 500 error page. The refund modal already blocks this client-side (Bug 41585). Do the same for the payout form: when the payout type is CASH or SIP00 and no register is selected, alert the user and keep the modal open. To test: 1. Enable UseCashRegisters and create a cash register for your library 2. Give a patron a credit (e.g. a manual credit of 10.00) 3. On the patron's Accounting tab, click "Issue payout" on the credit 4. Choose Cash as the payout type, leave Cash register unselected and click Confirm => Before: a 500 error page (RegisterRequired) => After: an alert "Cash register is required for cash payouts" and the form is not submitted 5. Select a register and click Confirm => The payout is recorded against that register Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43910 --- Comment #8 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210936 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210936&action=edit Bug 43910: (QA follow-up) Add similar JS from the credits page to indicate register required for cash payout Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43910 --- Comment #9 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 210937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210937&action=edit Bug 43910: (QA follow-up) Do not use Template Toolkit tags in the script tag The previous patch added an [% UNLESS Koha.Preference('RequireCashRegister') %] block to a <script> tag that must not contain Template::Toolkit tags, which xt/tt_script_tidy.t rejects. Template::Toolkit tags are only allowed in the single <script data-tt-allowed="true"> tag of the page. The RequireCashRegister preference is now passed to the script with the other preferences, in Koha.addPrefs, and tested in JavaScript. The behaviour does not change. To test: 1. Apply the patches 2. prove xt/tt_script_tidy.t => SUCCESS: Tests pass! (before the patch: boraccount.tt has a <script> tag with Template::Toolkit tags) 3. With UseCashRegisters enabled and RequireCashRegister disabled, choose Cash in the "Issue payout" modal: the Cash register field is marked as required 4. With RequireCashRegister enabled, it is not marked 5. Sign off :-D 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=43910 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43910 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43910 --- Comment #10 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org