Bug 8739 - Partial Fine Payments Saving Amount Paid Incorrectly
Summary: Partial Fine Payments Saving Amount Paid Incorrectly
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-07 15:43 UTC by Kyle M Hall
Modified: 2013-05-23 06:23 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 8739 - Partial Fine Payments Saving Amount Paid Incorrectly (982 bytes, patch)
2012-09-07 15:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 8739 - Partial Fine Payments Saving Amount Paid Incorrectly (1.08 KB, patch)
2012-09-14 21:05 UTC, Owen Leonard
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 2012-09-07 15:43:41 UTC
When making payments, the amount paid is meant to be stored as a negative number. C4::Accounts::makepayment does this correctly. However C4::Accounts::makepartialpayment saves the amount as a positive number. This means the payment shows up as a fine with no balance outstanding on the borrowers record.
Comment 1 Kyle M Hall 2012-09-07 15:44:46 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2012-09-14 14:04:17 UTC
Can you please add a test plan for this?
Comment 3 Kyle M Hall 2012-09-14 14:12:05 UTC
* Create two fines
* Make a partial payment one fine 1, make a full payment on the other
* Look at the fines in koha, one payment will be green, the other red. This reflects the positive or negative signed-ness of the payment.
* Apply the patch and repeat.
Comment 4 Owen Leonard 2012-09-14 21:05:58 UTC
Created attachment 12256 [details] [review]
[SIGNED-OFF] Bug 8739 - Partial Fine Payments Saving Amount Paid Incorrectly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Confirmed using test plan that the display is corrected.
Comment 5 Paul Poulain 2012-10-03 16:03:04 UTC
QA comment:
 * the makepayement sub also reverse the amount paid:
         # create new line
        my $payment = 0 - $amount;
        my $ins = 
            $dbh->prepare( 
                "INSERT 
                    INTO accountlines (borrowernumber, accountno, date, amount, itemnumber, description, accounttype, amountoutstanding, manager_id)
                    VALUES ( ?, ?, now(), ?, ?, 'Payment,thanks', 'Pay', 0, ?)"
            );
   so it's consistent
 * tiny patch (and it's a bugfix !)
 * koha-qa.pl OK (there were 2 perlcritic violations, that were not related to this patch, and that i've fixed)

passed QA
Comment 6 Chris Cormack 2012-10-03 19:34:58 UTC
Pushed to 3.8.x, will be in 3.8.6