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

--- Comment #7 from Martin Renvoize (ashimema) 
<[email protected]> ---
We hit another way to get this 500 error on the refund modal while
investigating a customer report, in case it helps whoever picks this up.

Steps (UseCashRegisters on or off, it does not matter):
1. Add a charge of 5.00 to a patron
2. Apply a 1.00 discount to it (status becomes DISCOUNTED, 4.00 outstanding)
3. Pay the remaining 4.00
4. Click 'Issue refund' on the charge. The modal pre-fills 'Amount paid' and
'Returned to patron' with 5.00
5. Choose Account credit and Confirm
   => Error 500: Koha::Exceptions::ParameterTooHigh 'Combined reduction (5.00 +
-1) is higher than original amount (5)'

The modal works out 'Amount paid' as amount - amountoutstanding, which counts
the 1.00 discount as if it had been paid. Koha::Account::Line->reduce then
(correctly) refuses to reduce the charge by more than 4.00 in total, because
the discount is also a reduction.

So at least part of the error reported here is the modal offering a refund
amount that reduce() cannot accept. The controller also does not catch the
exception, so the user sees a bare 500 instead of an explanation.

Reproduced on 25.11 (o5th build); the reduce() check and the modal calculation
are the same in current main by code reading, but I have not run it there.

-- 
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/

Reply via email to