[Bug 44027] New: Writing off more than a charge's outstanding amount does not show the over-writeoff warning
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44027 Bug ID: 44027 Summary: Writing off more than a charge's outstanding amount does not show the over-writeoff warning Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Fines and fees Assignee: koha-bugs@lists.koha-community.org Reporter: babarjunaid1122@gmail.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- In Patrons > Accounting > Make a payment, click "Write off" on a single charge (e.g. 6.00 outstanding) and type an amount larger than the charge (e.g. 7.00). Expected: the browser alert "You are attempting to writeoff more than the value of the fee." Actual: no alert. The form is posted and the server refuses with the payment wording "You must pay a value less than or equal to 6.00." Nothing is written off, so no data is wrong, but the message is the wrong one. Cause: the submit guard on #woindivfine in members/paycollect.tt reads the amounts with .attr("value"), which returns the input's initial value attribute, not what the librarian typed. The written-off amount therefore always equals the outstanding amount and the check never fires. Using .val() fixes it. Reproduced on Koha 26.05.02; the same code is on main. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44027 --- Comment #1 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 210872 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210872&action=edit Bug 44027: Read the typed amount in the individual write-off check Bug 44027: Read the typed amount in the individual write-off check The submit guard of the individual write-off form read both amounts with .attr("value"), which is the input's initial value, not what was typed. The write-off amount always equalled the outstanding amount, so the "You are attempting to writeoff more than the value of the fee." alert never showed and the server answered with the payment message instead. Test plan: 1. Give a patron a 6.00 manual charge. 2. Patrons > Accounting > Make a payment, click "Write off" on the line. 3. Type 7.00 and submit: no alert, the page reloads with "You must pay a value less than or equal to 6.00.". 4. Apply the patch, reload the page. 5. Repeat 2-3: the alert "You are attempting to writeoff more than the value of the fee." is shown and nothing is submitted. 6. Write off 3.00: it is recorded and 3.00 remains outstanding. Sponsored-by: Koha Solutions -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44027 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |babarjunaid1122@gmail.com |ity.org | Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org