https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43993

            Bug ID: 43993
           Summary: Refund/payout without a cash register gives an
                    uncaught 500 error
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Fines and fees
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
  Target Milestone: ---

On a patron's Accounting tab (members/boraccount.pl), 'Issue refund' and 'Issue
payout' with a cash-like transaction type (CASH, SIP00) throw
Koha::Exceptions::Account::RegisterRequired when UseCashRegisters is enabled
and no cash register is posted. The controller does not catch the exception, so
the staff user gets the generic 'An error has occurred! Error 500' page.

Bug 41585 and Bug 43910 only guard against this in the browser (JavaScript on
the modals). Anything that bypasses that JS -- site-specific JavaScript hiding
the register picker, a scripted POST, or a user whose session has no register
selected -- still gets a bare 500 and no explanation.

The controller should catch the exception, record nothing, and show a Bootstrap
alert telling the user a cash register is required. It should not silently fall
back to another register.

Test plan:
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 (or disable the form's submit handler), choose Cash as the transaction
type, and click Confirm
   => Before the patch: 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

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
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/

Reply via email to