[Bug 31513] New: Server error when not entering numbers in "Returned to patron"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 Bug ID: 31513 Summary: Server error when not entering numbers in "Returned to patron" Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Fines and fees Assignee: koha-bugs@lists.koha-community.org Reporter: christian.stelzenmueller@bsz-bw.de QA Contact: testopia@bugs.koha-community.org This happens with 21.11 with us. "Issue refund" on a paid transaction. In the field "Returned to patron" there is a prefilled text "NaN", i don't know why yet. "Confirming" that without correcting it to the amount in numbers that you want to refund, you get an Internal Server Error. -- 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=31513 Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26540 -- 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=31513 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- 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=31513 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Confirmed on master with CurrencyFormat FR. It works ok with US. NaN = Not a Number often a JavaScript related error -- 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=31513 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- The problem is not an easy fix on first glance. This is all done in JS, but I have a feeling it should use template variables with the unformatted data instead: var amount = button.data('amount'); var amountoutstanding = button.data('amountoutstanding') || 0; var paid = amount - amountoutstanding; $("#paid + span").replaceWith(paid); $("#returned").attr({ "value": paid, "max": paid, "min": 0 }); -- 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=31513 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- The Payout has the same issues :( We really ought to add testing with other CurrencyFormats to our normal test plans for all money related patches. Maybe also test with != EN to start with. If it works then, it is likely to always work. Tempted to mark this major actually... this breaks central money related workflows for a lot of libraries. -- 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=31513 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |katrin.fischer@bsz-bw.de |ity.org | Summary|Server error when not |NaN errors when using |entering numbers in |refund and payout with |"Returned to patron" |CurrencyFormat = FR -- 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=31513 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Medium patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 140405 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140405&action=edit Bug 31513: Remove price formatting form data- attributes We cannot use data formatted with a decimal comma for calculations. So we need to make sure that the data- attributes passed to the modals are in 'database format' with decimal . This will fix the NaN errors on the forms, but might also negatively effect formatting in some spots. Formatting should be fixed separately as this is for sure the right first step, but we need to put in more work for displays. To test: * Set CurrencyFormat system preference to FR * Go to any patron account > accounting tab * Create a credit * On Transactions tab: Payout amount at bottom = Verify NaN in input * On Transactions tab: Issue payout on the credit line = Verify NaN in input * Create a manual debit and pay it * On Transactions tab: Issue refund = Verify NaN in input * Apply patch * Repeat test plan * Now all input fields should be set with the correct amounts https://bugs.koha-community.org/show_bug.cgi?id=31486 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This fixes calculations, but we might pay with formatting... I am not sure if there is JS way to format prices yet? For example, if we stick with the JS, we'd want to format paid here for displaying it in the span: $("#paid + span").replaceWith(paid); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140405|0 |1 is obsolete| | --- Comment #6 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 140612 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140612&action=edit Bug 31513: Remove price formatting form data- attributes We cannot use data formatted with a decimal comma for calculations. So we need to make sure that the data- attributes passed to the modals are in 'database format' with decimal . This will fix the NaN errors on the forms, but might also negatively effect formatting in some spots. Formatting should be fixed separately as this is for sure the right first step, but we need to put in more work for displays. To test: * Set CurrencyFormat system preference to FR * Go to any patron account > accounting tab * Create a credit * On Transactions tab: Payout amount at bottom = Verify NaN in input * On Transactions tab: Issue payout on the credit line = Verify NaN in input * Create a manual debit and pay it * On Transactions tab: Issue refund = Verify NaN in input * Apply patch * Repeat test plan * Now all input fields should be set with the correct amounts https://bugs.koha-community.org/show_bug.cgi?id=31486 Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michaela.sieber@kit.edu Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |joonas.kylmala@iki.fi |y.org | CC| |joonas.kylmala@iki.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140612|0 |1 is obsolete| | --- Comment #7 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 140684 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140684&action=edit Bug 31513: Remove price formatting form data- attributes We cannot use data formatted with a decimal comma for calculations. So we need to make sure that the data- attributes passed to the modals are in 'database format' with decimal . This will fix the NaN errors on the forms, but might also negatively effect formatting in some spots. Formatting should be fixed separately as this is for sure the right first step, but we need to put in more work for displays. To test: * Set CurrencyFormat system preference to FR * Go to any patron account > accounting tab * Create a credit * On Transactions tab: Payout amount at bottom = Verify NaN in input * On Transactions tab: Issue payout on the credit line = Verify NaN in input * Create a manual debit and pay it * On Transactions tab: Issue refund = Verify NaN in input * Apply patch * Repeat test plan * Now all input fields should be set with the correct amounts https://bugs.koha-community.org/show_bug.cgi?id=31486 Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 --- Comment #8 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 140685 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140685&action=edit Bug 31513: (QA follow-up) Keep price formatting on non-editable text fields Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thanks for the follow-up, Joonas! I'll keep that in mind for some other places I spotted issues with the formatting! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Please backport! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thanks Tomas :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00 |22.11.00, 22.05.07 released in| | CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable --- Comment #13 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for upcoming 22.05.07 release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.suzuki@biblibre.com Status|Pushed to stable |Pushed to oldstable Version(s)|22.11.00, 22.05.07 |22.11.00, 22.05.07, released in| |21.11.14 --- Comment #14 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- applied to 21.11 for 21.11.14 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED --- Comment #15 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513 Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=41688 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org