Summary: | Currently it is impossible to apply credits against debits in patron accounts | ||
---|---|---|---|
Product: | Koha | Reporter: | Kyle M Hall (khall) <kyle> |
Component: | Circulation | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
Severity: | critical | ||
Priority: | P5 - low | CC: | alexbuckley, barton, caroline.cyr-la-rose, catalog, cbrannon, colin.campbell, cslone, deepakkv10, fridolin.somers, gmcharlt, jesse, josef.moravec, jpalmer, kyle.m.hall, lisettepalouse+koha, lucy.vaux-harvey, marjorie.barry-vila, martin.renvoize, mfuerst, nick, sally.healey, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This patch adds an `Apply Credits` button to the accounts interface to allow a librarian to apply outstanding credits against outstanding debits.
|
Version(s) released in: | |
Circulation function: | |||
Bug Depends on: | 2696, 21896 | ||
Bug Blocks: | 14825, 21916 | ||
Attachments: |
Bug 18805 - Add ability to use up account credits
Bug 18805 - Add ability to use up account credits Bug 18805 - Add ability to use up account credits Bug 18805: Add ability to use up account credits Bug 18805: Add ability to use up account credits Bug 18805: Add ability to use up account credits Bug 18805: Add ability to use up account credits Bug 18805: Add ability to use up account credits [18.05.x] Bug 18805: Add ability to use up account credits |
Description
Kyle M Hall (khall)
2017-06-14 18:08:40 UTC
Created attachment 64297 [details] [review] Bug 18805 - Add ability to use up account credits Right now, in Koha, credits always have a static amount outstanding. So if a patron owes $10 in fines, and has a $10 credit, they technically owe nothing, but yet they still owe $10. This seems rather confusing. Instead, we should add the ability for credits to be used to pay down closed out fines and other fees. Test Plan: 1) Apply this patch and dependencies 2) Create a manual credit of some amount 3) Create a manual invoice 4) Note the manual invoice was automatically paid down using the balance from the manual credit! After applying the patch when we applied a manual credit we got the following error: SOFTWARE ERROR DBIx::Class:Storage::DBI::_dbh_execute():table 'koha_sandbox1.accountoffsets' doesn't exist doesn't exist at /var/lib/koha/sandbox/1.kohaclone/koha/object.pm line 121. The credit did apply. Same error when applying the manual credit. Behavior appears to be the same both before and after patch. Error message when trying to apply patch. fatal: sha1 information is lacking or useless (C4/Accounts.pm) I think this is a change in behaviour that was inadvertantly added into - see bug 18580 for one case of it This is at the bottom of a rather long dependency tree where most of the items are not yet pushed to master: 18805: Add ability to use up account credits depends on: 2696: Fine Payments Should Show What Was Paid For 18790: Add ability to void payments 18786: Add ability to create custom payment types 14826: Resurrect account offsets table When trying to suspend a hold from the holds list in staff, there is an internal server error that translates to: Can't call method "ymd" on an undefined value at /home/vagrant/kohaclone/Koha/Hold.pm line 65. Created attachment 72025 [details] [review] Bug 18805 - Add ability to use up account credits Right now, in Koha, credits always have a static amount outstanding. So if a patron owes $10 in fines, and has a $10 credit, they technically owe nothing, but yet they still owe $10. This seems rather confusing. Instead, we should add the ability for credits to be used to pay down closed out fines and other fees. Test Plan: 1) Apply this patch and dependencies 2) Create a manual credit of some amount 3) Create a manual invoice 4) Note the manual invoice was automatically paid down using the balance from the manual credit! (In reply to Katrin Fischer from comment #6) > When trying to suspend a hold from the holds list in staff, there is an > internal server error that translates to: > > Can't call method "ymd" on an undefined value at > /home/vagrant/kohaclone/Koha/Hold.pm line 65. Can you test again? I can't recreate your error. My guess is it was an unrelated bug. (In reply to Kyle M Hall from comment #8) > (In reply to Katrin Fischer from comment #6) > > When trying to suspend a hold from the holds list in staff, there is an > > internal server error that translates to: > > > > Can't call method "ymd" on an undefined value at > > /home/vagrant/kohaclone/Koha/Hold.pm line 65. > > Can you test again? I can't recreate your error. My guess is it was an > unrelated bug. I wonder if this comment ended up on the wrong bug report? It appears really unrelated to the bug topic now and I don't remember. Please discount it. Right now, we are able to create credits (mancredit.pl) but there's no way to 'use' the existing credit against existing outstanding (debit) lines. This is odd in the interface and worth working on. I don't think this should be implemented as an automatic feature in the first place. I would rather implement a way to assign remaining credits to specific lines, and THEN add the option to do it automatically, maybe syspref-controlled (better by payment type ;-)) Applying: Bug 18805 - Add ability to use up account credits fatal: sha1 information is lacking or useless (Koha/Account.pm). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 18805 - Add ability to use up account credits The copy of the patch that failed is found in: /home/vagrant/kohaclone/.git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-18805---Add-ability-to-use-up-account-credits-P_PACB.patch Lisette Created attachment 80415 [details] [review] Bug 18805 - Add ability to use up account credits Right now, in Koha, credits always have a static amount outstanding. So if a patron owes $10 in fines, and has a $10 credit, they technically owe nothing, but yet they still owe $10. This seems rather confusing. Instead, we should add the ability for credits to be used to pay down closed out fines and other fees. Test Plan: 1) Apply this patch and dependencies 2) Create a manual credit of some amount 3) Create a manual invoice 4) Note the manual invoice was automatically paid down using the balance from the manual credit! Created attachment 81609 [details] [review] Bug 18805: Add ability to use up account credits Right now, in Koha, credits always have a static amount outstanding. So if a patron owes $10 in fines, and has a $10 credit, they technically owe nothing, but yet they still owe $10. This seems rather confusing. Instead, we should add the ability for credits to be used to pay down closed out fines and other fees. Test Plan: 1) Apply this patch and dependencies 2) Create a manual credit of some amount 3) Create a manual invoice 4) Note the manual invoice was automatically paid down using the balance from the manual credit! Followed test plan, patch worked as described. I also ran t/db_dependent/Accounts.t test which passed Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> Patch works as described and I also ran t/db_dependent/Accounts.t unit test which also passes. I have corrected the commit message to be in the format 'Bug: <bugnumber>' so it matches commit message guidelines. I'm marking this as critical -- this is causing old credits (which existed before the account offsets table) not to apply, which means that the debits show as unpaid on the pay fines tab. I'm taking this one with Kyle's permission. I rewrite and moved the Koha::Account::normalize_balance method to bug 21896. It is fully covered by tests there. Created attachment 82686 [details] [review] Bug 18805: Add ability to use up account credits This patch introduces a new button in the 'Pay fines' tab on the patron's account page. This button, labeled 'Normalize account' is only displayed when outstanding credits are available, that could be used to pay up existing debts. When clicking the button, the Koha::Account::normalize_balance method (bug 21896) is used for the purpose. To test: - Apply this patch (on top of 21896) - On a patron's 'Fines' tab, create a 'manual invoice' (maybe more than one) - Go to the 'Pay fines' tab => SUCCESS: No 'Normalize account' button is displayed. - On the 'create manual credit' tab, create a couple credits. - Go to the 'Pay fines' => SUCCESS: 'Normalize account' button is displayed - Click on 'Normalize account' => SUCCESS: Outstanding credits have been used to pay up debts. - Play with different options (credit excedes debts and vice-versa, they match, etc) => SUCCESS: They all work as expected - Sign off :-D (In reply to Tomás Cohen Arazi from comment #10) > Right now, we are able to create credits (mancredit.pl) but there's no way > to 'use' the existing credit against existing outstanding (debit) lines. > This is odd in the interface and worth working on. > > I don't think this should be implemented as an automatic feature in the > first place. I would rather implement a way to assign remaining credits to > specific lines, and THEN add the option to do it automatically, maybe > syspref-controlled (better by payment type ;-)) I do hope an automatic setting is in the near future. One would assume credit would be used automatically. I don't know of many places that don't automatically use your credit. Can't locate object method "normalize_balance" via package "Koha::Account" at /home/vagrant/kohaclone/members/pay.pl line 290 Sorry, needed a restart. Passes. I just can't figure out how to get the sign off to work! (In reply to Christopher Brannon from comment #21) > Passes. I just can't figure out how to get the sign off to work! I can add your signoff to this patch. Created attachment 82711 [details] [review] Bug 18805: Add ability to use up account credits This patch introduces a new button in the 'Pay fines' tab on the patron's account page. This button, labeled 'Normalize account' is only displayed when outstanding credits are available, that could be used to pay up existing debts. When clicking the button, the Koha::Account::normalize_balance method (bug 21896) is used for the purpose. To test: - Apply this patch (on top of 21896) - On a patron's 'Fines' tab, create a 'manual invoice' (maybe more than one) - Go to the 'Pay fines' tab => SUCCESS: No 'Apply credits' button is displayed. - On the 'create manual credit' tab, create a couple credits. - Go to the 'Pay fines' => SUCCESS: 'Apply credits' button is displayed - Click on 'Apply credits' => SUCCESS: Outstanding credits have been used to pay up debts. - Play with different options (credit excedes debts and vice-versa, they match, etc) => SUCCESS: They all work as expected - Sign off :-D Created attachment 82712 [details] [review] Bug 18805: Add ability to use up account credits This patch introduces a new button in the 'Pay fines' tab on the patron's account page. This button, labeled 'Normalize account' is only displayed when outstanding credits are available, that could be used to pay up existing debts. When clicking the button, the Koha::Account::normalize_balance method (bug 21896) is used for the purpose. To test: - Apply this patch (on top of 21896) - On a patron's 'Fines' tab, create a 'manual invoice' (maybe more than one) - Go to the 'Pay fines' tab => SUCCESS: No 'Apply credits' button is displayed. - On the 'create manual credit' tab, create a couple credits. - Go to the 'Pay fines' => SUCCESS: 'Apply credits' button is displayed - Click on 'Apply credits' => SUCCESS: Outstanding credits have been used to pay up debts. - Play with different options (credit excedes debts and vice-versa, they match, etc) => SUCCESS: They all work as expected - Sign off :-D Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Created attachment 82758 [details] [review] Bug 18805: Add ability to use up account credits This patch introduces a new button in the 'Pay fines' tab on the patron's account page. This button, labeled 'Normalize account' is only displayed when outstanding credits are available, that could be used to pay up existing debts. When clicking the button, the Koha::Account::normalize_balance method (bug 21896) is used for the purpose. To test: - Apply this patch (on top of 21896) - On a patron's 'Fines' tab, create a 'manual invoice' (maybe more than one) - Go to the 'Pay fines' tab => SUCCESS: No 'Apply credits' button is displayed. - On the 'create manual credit' tab, create a couple credits. - Go to the 'Pay fines' => SUCCESS: 'Apply credits' button is displayed - Click on 'Apply credits' => SUCCESS: Outstanding credits have been used to pay up debts. - Play with different options (credit excedes debts and vice-versa, they match, etc) => SUCCESS: They all work as expected - Sign off :-D Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> The qa script throws an error: 'Argument "" isn't numeric in numeric gt (>) at /home/martin/kohaclone/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc line 84.' But, I think it's a false catch as .count numifies. Passing QA. Awesome work everyone! Pushed to master for 19.05 Created attachment 82816 [details] [review] [18.05.x] Bug 18805: Add ability to use up account credits This patch introduces a new button in the 'Pay fines' tab on the patron's account page. This button, labeled 'Normalize account' is only displayed when outstanding credits are available, that could be used to pay up existing debts. When clicking the button, the Koha::Account::normalize_balance method (bug 21896) is used for the purpose. To test: - Apply this patch (on top of 21896) - On a patron's 'Fines' tab, create a 'manual invoice' (maybe more than one) - Go to the 'Pay fines' tab => SUCCESS: No 'Apply credits' button is displayed. - On the 'create manual credit' tab, create a couple credits. - Go to the 'Pay fines' => SUCCESS: 'Apply credits' button is displayed - Click on 'Apply credits' => SUCCESS: Outstanding credits have been used to pay up debts. - Play with different options (credit excedes debts and vice-versa, they match, etc) => SUCCESS: They all work as expected - Sign off :-D Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Pushed to 18.11.x for 18.11.01 Will not be backported to 18.05 *** Bug 14672 has been marked as a duplicate of this bug. *** |