[Bug 21969] New: Koha::Account->outstanding_* should look for debits/cerdits by checking 'amount'
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 Bug ID: 21969 Summary: Koha::Account->outstanding_* should look for debits/cerdits by checking 'amount' Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org The current implementation checks 'amountoutstanding' matches what's expected for debits (i.e. > 0) and credits (i.e. < 0). But there are pathological use cases in Koha (that we need to deal with), specially related to accruing fines and back dated returns (and so dropbox mode) that trigger false positives (specifically debits with amountoutstanding being negative, then meaning they are actually credits). -- 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=21969 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=14591 CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com Summary|Koha::Account->outstanding_ |Koha::Account->outstanding_ |* should look for |* should look for |debits/cerdits by checking |debits/credits by checking |'amount' |'amount' Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- 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=21969 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 82939 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82939&action=edit Bug 21969: Regression tests This patch introduces regression tests for Koha::Account::outstanding_* methods so they don't pick wrong lines when amountoutstanding matches what we are looking for (i.e. negative for credits and positive for debits). To test: - Apply this patch - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: Tests fail because pathological account lines are wrongly picked. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 82940 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82940&action=edit Bug 21969: Fix Koha::Account->outstanding_* matching the opposite on pathological cases This patch makes outstanding_* methods be safe regarding pathological account lines that get converted into another type because of the value of amountoutstanding To test: - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: Tests fail because pathological account lines are wrongly picked. - Apply this patch - Run: k$ prove t/db_dependent/Koha/Account.t =>SUCCESS: All green! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |21915 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21915 [Bug 21915] Add a way to automatically reconcile balance for patrons -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82939|0 |1 is obsolete| | --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 83011 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83011&action=edit Bug 21969: Regression tests This patch introduces regression tests for Koha::Account::outstanding_* methods so they don't pick wrong lines when amountoutstanding matches what we are looking for (i.e. negative for credits and positive for debits). To test: - Apply this patch - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: Tests fail because pathological account lines are wrongly picked. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82940|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 83012 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83012&action=edit Bug 21969: Fix Koha::Account->outstanding_* matching the opposite on pathological cases This patch makes outstanding_* methods be safe regarding pathological account lines that get converted into another type because of the value of amountoutstanding To test: - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: Tests fail because pathological account lines are wrongly picked. - Apply this patch - Run: k$ prove t/db_dependent/Koha/Account.t =>SUCCESS: All green! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- A very sensible change that makes these methods considerable more robust... Signing Off. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 Kyle M Hall <kyle@bywatersolutions.com> 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=21969 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83011|0 |1 is obsolete| | Attachment #83012|0 |1 is obsolete| | --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 83047 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83047&action=edit Bug 21969: Regression tests This patch introduces regression tests for Koha::Account::outstanding_* methods so they don't pick wrong lines when amountoutstanding matches what we are looking for (i.e. negative for credits and positive for debits). To test: - Apply this patch - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: Tests fail because pathological account lines are wrongly picked. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 83048 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83048&action=edit Bug 21969: Fix Koha::Account->outstanding_* matching the opposite on pathological cases This patch makes outstanding_* methods be safe regarding pathological account lines that get converted into another type because of the value of amountoutstanding To test: - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: Tests fail because pathological account lines are wrongly picked. - Apply this patch - Run: k$ prove t/db_dependent/Koha/Account.t =>SUCCESS: All green! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 19.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pushed to 18.11.x for 18.11.01 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |19.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #10 from Lucas Gass <lucas@bywatersolutions.com> --- missing dependency for 18.05, won't backport -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Resolution|--- |FIXED Status|Pushed to Stable |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21969 Cheryl <clackman@fargolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clackman@fargolibrary.org -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org