[Bug 20990] New: Add Koha::Account::outstanding_credits
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 Bug ID: 20990 Summary: Add Koha::Account::outstanding_credits Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement 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 This will be handy for the /patrons/{patron_id}/account endpoint. -- 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=20990 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=20990 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=20990 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 76380 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76380&action=edit Bug 20990: Unit tests for Koha::Account->outstanding_credits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 76381 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76381&action=edit Bug 20990: Add Koha::Account->outstanding_credits This patch adds a method that retrieves (for a patron's account) the outstanding credits (i.e. those that haven't been applied to any debit. To test: - Apply this patches - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => SUCCESS: Tests pass! - Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |20942 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20942 [Bug 20942] Add route to get patron's account balance -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20978 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20978 [Bug 20978] Add Koha::Account::add_credit -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20980 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20980 [Bug 20980] Manual credit offsets are stored as debits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=20990 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76380|0 |1 is obsolete| | Attachment #76381|0 |1 is obsolete| | --- Comment #3 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 76405 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76405&action=edit Bug 20990: Unit tests for Koha::Account->outstanding_credits Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 --- Comment #4 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 76406 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76406&action=edit Bug 20990: Add Koha::Account->outstanding_credits This patch adds a method that retrieves (for a patron's account) the outstanding credits (i.e. those that haven't been applied to any debit. To test: - Apply this patches - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 --- Comment #5 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 76407 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76407&action=edit Bug 20990: (follow-up) Fix test description Test plan: prove -v t/db_dependent/Koha/Account.t --> Test message of first test of subtest outtanding_credits correctly says "Outstanding credits total..." Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com Depends on|20978 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20978 [Bug 20978] Add Koha::Account::add_credit -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 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=20990 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76405|0 |1 is obsolete| | Attachment #76406|0 |1 is obsolete| | Attachment #76407|0 |1 is obsolete| | --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 76446 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76446&action=edit Bug 20990: Unit tests for Koha::Account->outstanding_credits Signed-off-by: Josef Moravec <josef.moravec@gmail.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=20990 --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 76447 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76447&action=edit Bug 20990: Add Koha::Account->outstanding_credits This patch adds a method that retrieves (for a patron's account) the outstanding credits (i.e. those that haven't been applied to any debit. To test: - Apply this patches - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Josef Moravec <josef.moravec@gmail.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=20990 --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 76448 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76448&action=edit Bug 20990: (follow-up) Fix test description Test plan: prove -v t/db_dependent/Koha/Account.t --> Test message of first test of subtest outtanding_credits correctly says "Outstanding credits total..." Signed-off-by: Josef Moravec <josef.moravec@gmail.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=20990 --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 76449 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76449&action=edit Bug 20990: Make same changes that were made to outstanding_debits 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=20990 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76449|0 |1 is obsolete| | --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 76525 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76525&action=edit Bug 20990: Make same changes that were made to outstanding_debits Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 76640 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76640&action=edit Bug 20990: (QA follow-up) make outstanding_credits return the account lines only This patch was discussed with Jonathan on a QA conversation. It is better to keep this simpler and more reusable. And is the right approach in this case. This patch makes Koha::Account::outstanding_credits return the account lines, code that used the $total value, will just use $lines->total_outstanding; Tests are adjusted accordingly. To test: - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => SUCCESS: Test pass. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76446|0 |1 is obsolete| | --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 76739 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76739&action=edit Bug 20990: Unit tests for Koha::Account->outstanding_credits Signed-off-by: Josef Moravec <josef.moravec@gmail.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=20990 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76447|0 |1 is obsolete| | --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 76740 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76740&action=edit Bug 20990: Add Koha::Account->outstanding_credits This patch adds a method that retrieves (for a patron's account) the outstanding credits (i.e. those that haven't been applied to any debit. To test: - Apply this patches - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Josef Moravec <josef.moravec@gmail.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=20990 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76448|0 |1 is obsolete| | --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 76741 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76741&action=edit Bug 20990: (follow-up) Fix test description Test plan: prove -v t/db_dependent/Koha/Account.t --> Test message of first test of subtest outtanding_credits correctly says "Outstanding credits total..." Signed-off-by: Josef Moravec <josef.moravec@gmail.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=20990 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76525|0 |1 is obsolete| | --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 76742 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76742&action=edit Bug 20990: Make same changes that were made to outstanding_debits Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76640|0 |1 is obsolete| | --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 76743 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76743&action=edit Bug 20990: (QA follow-up) make outstanding_credits return the account lines only This patch was discussed with Jonathan on a QA conversation. It is better to keep this simpler and more reusable. And is the right approach in this case. This patch makes Koha::Account::outstanding_credits return the account lines, code that used the $total value, will just use $lines->total_outstanding; Tests are adjusted accordingly. To test: - Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => SUCCESS: Test pass. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 Bug 20990 depends on bug 20980, which changed state. Bug 20980 Summary: Manual credit offsets are stored as debits https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20980 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |nick@bywatersolutions.com --- Comment #17 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED CC| |martin.renvoize@ptfs-europe | |.com Resolution|--- |FIXED --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Enhancement, not back porting to the 18.05.x series. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Reconsideration of that last comment, I've now Pushed to 18.05.x branch for 18.05.03. This was done to unblock the chain of dependencies for bug 20942 which is a helpful enhancement encouraging third-party API integrations. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20990 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |21909 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21909 [Bug 21909] Koha::Account::outstanding_* methods should preserve call context -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org