https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43993
--- Comment #1 from Martin Renvoize (ashimema) <[email protected]> --- Created attachment 210425 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210425&action=edit Bug 43993: Catch RegisterRequired on refund and payout and show an alert With UseCashRegisters enabled, issuing a refund or payout of a cash-like type (CASH, SIP00) without a cash register throws Koha::Exceptions::Account::RegisterRequired. members/boraccount.pl did not catch it, so staff got the generic Error 500 page. Bug 41585 and Bug 43910 only guard against this in the browser. Anything that bypasses that JavaScript (site-specific JS hiding the register picker, a scripted POST, a session with no register selected) still got a bare 500. Run both operations through a helper that rolls the transaction back, catches RegisterRequired and returns a code for the template, which shows a Bootstrap warning alert. No fallback register is chosen. To test: 1. Enable UseCashRegisters and create a cash register for your library 2. Pay a charge on a patron's account (e.g. 5.00 as cash), then use 'Issue refund' on it 3. In the browser dev tools, remove the 'Cash register' select from the refund form, choose Cash as the transaction type and click Confirm => Before: Error 500 page => After: the Accounting page reloads with a warning alert that a cash register is required, and no refund was recorded 4. Repeat for 'Issue payout' on a credit 5. Choose Account credit as the refund type with no register => The refund still works 6. Select a register and choose Cash => The refund is recorded against that register 7. prove t/db_dependent/Koha/Account/Line.t Co-Authored-By: Claude Sonnet 5.5 <[email protected]> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. _______________________________________________ Koha-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected] website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
