Bug 18805 - Add ability to use up account credits
Summary: Add ability to use up account credits
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 2696
Blocks: 14825
  Show dependency treegraph
 
Reported: 2017-06-14 18:08 UTC by Kyle M Hall
Modified: 2018-06-14 16:32 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 18805 - Add ability to use up account credits (8.80 KB, patch)
2017-06-14 18:17 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 18805 - Add ability to use up account credits (8.66 KB, patch)
2018-02-21 15:12 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2017-06-14 18:08:40 UTC
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.
Comment 1 Kyle M Hall 2017-06-14 18:17:05 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!
Comment 2 Lisette Scheer 2017-08-11 21:12:58 UTC
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.
Comment 3 Caroline Cyr La Rose 2017-09-08 20:51:33 UTC
Error message when trying to apply patch.

fatal: sha1 information is lacking or useless (C4/Accounts.pm)
Comment 4 Colin Campbell 2017-10-10 10:08:15 UTC
I think this is a change in behaviour that was inadvertantly added into - see bug 18580 for one case of it
Comment 5 Katrin Fischer 2017-10-14 20:54:10 UTC
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
Comment 6 Katrin Fischer 2017-10-14 22:49:47 UTC
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.
Comment 7 Kyle M Hall 2018-02-21 15:12:40 UTC
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!
Comment 8 Kyle M Hall 2018-02-21 15:15:44 UTC
(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.
Comment 9 Katrin Fischer 2018-02-22 22:18:02 UTC
(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.
Comment 10 Tomás Cohen Arazi 2018-06-14 16:32:09 UTC
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 ;-))