Summary: | Partial refund triggers a 500 error | ||
---|---|---|---|
Product: | Koha | Reporter: | Esther Melander <esther.melander> |
Component: | Patrons | Assignee: | Bugs List <koha-bugs> |
Status: | NEW --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | gmcharlt, kyle.m.hall, kyle, martin.renvoize |
Version: | 23.05 | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: |
Description
Esther Melander
2023-11-29 19:10:44 UTC
If a Transaction type is chosen, the error does not occur. Partial refund appears to fail depending on Transaction type. For example, received a 500 error when selecting Cash or Check. But refund succeeded with Account Credit. Some additional insight on why this is happening. The library had a circulation rule to refund lost item charge (only if unpaid). To recreate 1. Set default refund policy to Refund lost item charge (only if unpaid) 2. Create a charge on a patron account of $150.00 3. Pay the charge as cash 4. Issue a refund, but only refund $5.00 as cash 5. See that it causes a 500 error In this case Koha is trying to refund something that has already been paid, which can't happen based on the circulation rule. Instead of a 500 error, there should be "can't refund" warning. As an extension of this bug, I can do a full refund, which also should not happen based on the circulation rule. Esther, I cannot recreate the error on master or 22.11 using your test plan and the default data in Koha Testing Docker. I was able to recreate by doing something a bit weirder through. 1. Create a charge on a patron account of $150.00 2. Pay the charge as cash 3. Issue a refund, but only refund $5.00 as cash 4. Void that refund 5. Issue refund on the "Credit has been voided" line Exception 'Koha::Exceptions::ParameterTooHigh' thrown 'Combined reduction (5 + -5) is higher than original amount (5)' at /usr/share/perl5/Exception/Class/Base.pm line 88 https://monosnap.com/file/HSdtsLVcOinrV54hX5GLr98K2akXdz We also see this in 22.11.10 There were no partial refunds, but full refunds using the button in the transactions table: Exception 'Koha::Exceptions::ParameterTooHigh' thrown 'Combined reduction (2 + -2) is higher than original amount (2)' Exception 'Koha::Exceptions::ParameterTooHigh' thrown 'Combined reduction (3 + -3) is higher than original amount (3)' Exception 'Koha::Exceptions::ParameterTooHigh' thrown 'Combined reduction (3.00 + -3) is higher than original amount (3)' Which makes no mathematical sense to me actually? (In reply to Katrin Fischer from comment #5) > We also see this in 22.11.10 > > There were no partial refunds, but full refunds using the button in the > transactions table: > > Exception 'Koha::Exceptions::ParameterTooHigh' thrown 'Combined reduction (2 > + -2) is higher than original amount (2)' > Exception 'Koha::Exceptions::ParameterTooHigh' thrown 'Combined reduction (3 > + -3) is higher than original amount (3)' > Exception 'Koha::Exceptions::ParameterTooHigh' thrown 'Combined reduction > (3.00 + -3) is higher than original amount (3)' > > Which makes no mathematical sense to me actually? The code uses absolute values which I think may be part of the issue. |