Bug 37507 - Koha explodes when trying to apply discount higher than amount of manual invoice
Summary: Koha explodes when trying to apply discount higher than amount of manual invoice
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-26 21:33 UTC by Roman Dolny
Modified: 2024-08-04 20:56 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Dolny 2024-07-26 21:33:10 UTC
When applying discount higher than amount of manual invoice Koha explodes with a message: "Exception 'Koha::Exceptions::ParameterTooHigh' thrown 'Amount to reduce (100) is higher than original amount (10.000000)' at /usr/share/perl5/Exception/Class/Base.pm line 88".

To reproduce:
1. Go to the patron -> accounting
2. Create manual invoice with positive amount (e.g. 10). Click Save.
3. In Transactions tab click 'Apply discount' button and enter discount to apply higher than amount entered in p. 2 (e.g. 100).
4. Koha explodes.
Comment 1 CJ Lynce 2024-08-04 20:56:42 UTC
I believe this has something to do with the 'Amount charged' price not populating when a price is divisible by .10 (a.k.a. ends in a 0 in the 2nd decimal place).

The check built into the 'Discount to apply' field is not working, because the amount is not being populated. Allowing you to enter an amount larger than the account line amount.

This is fixed with the patch I submitted on Bug 37563 which fixes the amount issuing not be populated, along with a number of other issues in the Accounting and POS modals.