Bug 2696 - Fine Payments Should Show What Was Paid For
Summary: Fine Payments Should Show What Was Paid For
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: PC All
: P3 major with 21 votes (vote)
Assignee: Kyle M Hall
QA Contact: Bugs List
URL:
Whiteboard:
Keywords:
: 10167 (view as bug list)
Depends on: 18790
Blocks: 18805
  Show dependency treegraph
 
Reported: 2008-10-20 05:29 UTC by Nicole C. Engard
Modified: 2017-06-15 18:40 UTC (History)
17 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
account (37.95 KB, image/png)
2008-10-20 05:29 UTC, Chris Cormack
Details
opac screenshot (33.44 KB, image/png)
2011-02-07 10:54 UTC, Katrin Fischer
Details
staff with payment description (75.96 KB, image/png)
2012-05-15 12:14 UTC, Nicole C. Engard
Details
Bug 2696 - Fine Payments Should Show What Was Paid For (15.12 KB, patch)
2017-06-14 14:50 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 2696 - Fine Payments Should Show What Was Paid For (15.11 KB, patch)
2017-06-14 17:03 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 2696 - Fine Payments Should Show What Was Paid For (16.20 KB, patch)
2017-06-15 16:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 2696 - Fine Payments Should Show What Was Paid For (16.27 KB, patch)
2017-06-15 17:42 UTC, Kyle M Hall
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 2696: Payments Shows What Paid For (16.43 KB, patch)
2017-06-15 18:06 UTC, Lee Jamison
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 2696 - Fine Payments Should Show What Was Paid For (16.44 KB, patch)
2017-06-15 18:40 UTC, Lee Jamison
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 00:54:48 UTC


---- Reported by nengard@gmail.com 2008-10-20 05:29:15 ----

The account should show which item was paid for instead of just putting the 'payment thanks' note on the account



---- Additional Comments From nengard@gmail.com 2008-10-20 05:29:31 ----

Created an attachment
account





---- Additional Comments From nengard@gmail.com 2009-04-18 14:09:31 ----

Just want to bump this up as a priority for 3.2 - and something that I think should be pretty simple to put in place.



---- Additional Comments From nengard@gmail.com 2009-04-18 15:44:22 ----

Ryan, I hear you're re-writing account management -so I wanted you to see this.



---- Additional Comments From nengard@gmail.com 2010-04-27 21:59:48 ----

This has become a bigger problem now with the ability to reverse fines - you get an account line that says 'payment thanks - reversed' -- which really makes no sense at all.

We need to see what was paid for.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 00:54 UTC  ---

This bug was previously known as _bug_ 2696 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2696
Imported an attachment (id=800)

Actual time not defined. Setting to 0.0
CC member arm@hanover.ca does not have an account here
CC member bchurch@ptfs.com does not have an account here
CC member rch@liblime.com does not have an account here
The original submitter of attachment 800 [details] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.

Comment 1 Katrin Fischer 2011-02-07 10:54:29 UTC
Created attachment 3069 [details]
opac screenshot

This problem still exists in current master and 3.2.x branches, not only in staff, but also in OPAC. The line on the 'My Fines' tab is always 'Payment,thanks. -'. Looks like something is missing.
Comment 2 Marc Véron 2012-04-15 17:50:48 UTC
At the moment the implementation is as follows (Acounts.pm line 65 ff and other places):

--Snip----
Amounts owed are paid off oldest first. That is, if the patron has a
$1 fine from Feb. 1, another $1 fine from Mar. 1, and makes a payment
of $1.50, then the oldest fine will be paid off in full, and $0.50
will be credited to the next one.

(...)

# FIXME - I'm not at all sure about the above, because I don't
# understand what the acct* tables in the Koha database are for.

--End Snip ----

I tried to understand what happens in the code, and I came to the conclusion that the most important thing is a missing primary key in the table accountlines.

This key could be transported through the chain of forms and involved code files to match payments with the fines the payments are made for.

I a primary key in the table accountlines could be the basis to solve other bugs as well:

- Bug 7531 - Reversing partial payments is buggy
- (?) Bug 6413 - Notes in Fines doing wonky things
- (?) Bug 2598 - Pay Fines allows payment against accruing fine.
- (?) Bug 7205 - can't reverse manual credits 
- (?) Bug 7565 - Fee/fines receipt for printing
- (?) Bug 6273 - SIP2 Fee Paid and Fee Paid Response support
- Bug 3498 - Allow partial fine payments
- Bug 2169 - Paying only partial fines (Duplicate of 3498)

Maybe already addressed by: Bug 6427 - Rewrite of the accounts system ?
Comment 3 Marc Véron 2012-04-15 18:31:20 UTC
Oh, I see that the primary key is already addressed in 
Bug 7671 - add a real primary key "accountlinesid" in accountlines.
Comment 4 Nicole C. Engard 2012-05-15 12:14:38 UTC
Created attachment 9583 [details]
staff with payment description

It looks like in some cases it is now showing what was paid for - when you pay for a specific line item.
Comment 5 Katrin Fischer 2013-12-05 23:11:30 UTC
Something to look out for when testing the accounts rewrite :)
Comment 6 Kyle M Hall 2013-12-11 13:18:19 UTC
(In reply to Katrin Fischer from comment #5)
> Something to look out for when testing the accounts rewrite :)

I can tell you that the new accounting system tracks and stores every fee paid for by every payment. If a payment is made that paid 3 fines, it creates three account_offset rows that link the payment to each of those fines, along with the amount paid on each!

When you look at patrons fines, you can even "drill down" to see the entire history for each fee, and for each payment.
Comment 7 Indranil Das Gupta 2015-06-15 06:56:22 UTC
(In reply to Kyle M Hall from comment #6)
> (In reply to Katrin Fischer from comment #5)
> > Something to look out for when testing the accounts rewrite :)
> 
> I can tell you that the new accounting system tracks and stores every fee
> paid for by every payment. If a payment is made that paid 3 fines, it
> creates three account_offset rows that link the payment to each of those
> fines, along with the amount paid on each!
> 
> When you look at patrons fines, you can even "drill down" to see the entire
> history for each fee, and for each payment.

So, it this still an open bug or can this be closed?
Comment 8 Katrin Fischer 2015-06-15 08:23:31 UTC
It's still an open bug.
Comment 9 Chetan Panchal 2015-11-25 12:29:35 UTC
Hi Everyone,

I am new in this. I want to solve this bug. Please suggest me what is the actual requirement. Is it that when we pay fine in admin then it shows only payment thanks but you need that it should show item details also (i.e - Item Barcode or Item Title).


Please help me.
Comment 10 Katrin Fischer 2015-11-25 13:47:05 UTC
Hi Chetan, this is not easy to solve, as one payment can be for multiple fines and can only include partial payments. This is why Kyle and others have been working on a rewrite of the accounts system.
Comment 11 Chetan Panchal 2015-11-25 18:25:17 UTC
Thanks Kartin, 

I understood the problem.
Comment 12 Katrin Fischer 2017-01-05 09:49:00 UTC
*** Bug 10167 has been marked as a duplicate of this bug. ***
Comment 13 Kyle M Hall 2017-06-14 14:50:06 UTC
Created attachment 64287 [details] [review]
Bug 2696 - Fine Payments Should Show What Was Paid For

Test Plan:
1) Apply this patch and its' dependencies
2) Create and pay some various fees and fines
3) View the payments for fees, and fees paid by payments by
   using the new 'Details' button available on boraccount.pl
Comment 14 Kyle M Hall 2017-06-14 17:03:40 UTC
Created attachment 64293 [details] [review]
Bug 2696 - Fine Payments Should Show What Was Paid For

Test Plan:
1) Apply this patch and its' dependencies
2) Create and pay some various fees and fines
3) View the payments for fees, and fees paid by payments by
   using the new 'Details' button available on boraccount.pl
Comment 15 Jonathan Druart 2017-06-14 19:02:32 UTC
Tests are missing
Comment 16 Lee Jamison 2017-06-14 19:23:26 UTC
The patch and its dependencies applied cleanly and there were no problems when running updatedatabase.pl. I added/paid fines on accounts but when I click on the "Details" button of boraccount.pl tailing plack throws the following error message:

Can't locate object method "search" via package "Koha::Account::Offsets" (perhaps you forgot to load "Koha::Account::Offsets"?) at /home/vagrant/kohaclone/members/accountline-details.pl line 52.

Line 52 of accountline-details.pl consists of the following code:

my @account_offsets = Koha::Account::Offsets->search( { $column => $accountlines_id } );

The only methods contained in Offsets.pm that are showing for me are:

sub _type {
    return 'AccountOffset';
}

sub object_class {
    return 'Koha::Account::Offset';
}

Let me know if there appears to be a problem with my test and I will try it again.
Comment 17 Jonathan Druart 2017-06-15 16:07:42 UTC
Lowering severity, it has been set as critical 7 years ago.
Comment 18 Kyle M Hall 2017-06-15 16:27:44 UTC
Created attachment 64342 [details] [review]
Bug 2696 - Fine Payments Should Show What Was Paid For

Test Plan:
1) Apply this patch and its' dependencies
2) Create and pay some various fees and fines
3) View the payments for fees, and fees paid by payments by
   using the new 'Details' button available on boraccount.pl
Comment 19 Kyle M Hall 2017-06-15 17:42:57 UTC
Created attachment 64345 [details] [review]
Bug 2696 - Fine Payments Should Show What Was Paid For

Test Plan:
1) Apply this patch and its' dependencies
2) Create and pay some various fees and fines
3) View the payments for fees, and fees paid by payments by
   using the new 'Details' button available on boraccount.pl
Comment 20 Lee Jamison 2017-06-15 18:06:46 UTC
Created attachment 64346 [details] [review]
[SIGNED-OFF]Bug 2696: Payments Shows What Paid For

Test Plan:
1) Apply this patch and its' dependencies
2) Create and pay some various fees and fines
3) View the payments for fees, and fees paid by payments by
   using the new 'Details' button available on boraccount.pl

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Running updatedatabase.pl after patch application makes dependencies
happy. Passes QA Tools and works as intended.
Comment 21 Lee Jamison 2017-06-15 18:40:44 UTC
Created attachment 64350 [details] [review]
[SIGNED-OFF] Bug 2696 - Fine Payments Should Show What Was Paid For

Test Plan:
1) Apply this patch and its' dependencies
2) Create and pay some various fees and fines
3) View the payments for fees, and fees paid by payments by
   using the new 'Details' button available on boraccount.pl

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Running updatedatabase.pl after patch application makes dependencies
happy. Passes QA Tools and works as intended.