[Koha-bugs] [Bug 18580] New: Account-pay does not apply credits / clear old fines as did recordpayment

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu May 11 16:48:19 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18580

            Bug ID: 18580
           Summary: Account-pay does not apply credits / clear old fines
                    as did recordpayment
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Circulation
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: colin.campbell at ptfs-europe.com
        QA Contact: testopia at bugs.koha-community.org
                CC: gmcharlt at gmail.com, kyle.m.hall at gmail.com

the recordpayment routine in C4::Accounts cleared old paid fines and applied
credit amounts as part of its pay routine. The behaviour was implicit and not
signalled or commented in the code. The pay routine in Koha::Account which is
now called by paycollect.pl instead of the old routine does not leaving these
on the users fine display although they owe 0. Staff cannot manually remove
these.

For example a user has the following accountlines
+-----------+-------------+-------------------+
| amount    | accounttype | amountoutstanding |
+-----------+-------------+-------------------+
| -1.300000 | C           |         -1.300000 |
|  0.650000 | Res         |          0.650000 |
|  0.650000 | Res         |          0.650000 |
|  0.650000 | Res         |          0.650000 |
+-----------+-------------+-------------------+

after recordpayment has been called with an amount of 0.65 the lines are
+-----------+-------------+-------------------+
| amount    | accounttype | amountoutstanding |
+-----------+-------------+-------------------+
| -1.300000 | C           |          0.000000 |
|  0.650000 | Res         |          0.000000 |
|  0.650000 | Res         |          0.000000 |
|  0.650000 | Res         |          0.000000 |
| -0.650000 | Pay         |          0.000000 |
+-----------+-------------+-------------------+
However now calling Account->pay for the same amount results in 
+-----------+-------------+-------------------+
| amount    | accounttype | amountoutstanding |
+-----------+-------------+-------------------+
| -1.300000 | C           |         -1.300000 |
|  0.650000 | Res         |          0.000000 |
|  0.650000 | Res         |          0.650000 |
|  0.650000 | Res         |          0.650000 |
| -0.650000 | Pay         |          0.000000 |
+-----------+-------------+-------------------+

leaving the credit and two fines with an amountoutstanding although the user
has nothing to pay (the amountoutstanding columns sum to 0) and leading to
misleading displays.

The difference is driven by the line where @outstanding_fines is retrieved the
selection is amountoutstanding > 0. In recordpayment it was amountoutstanding
<> 0 so that negative amounts were included and processed as part of the
payment, rather than ignored. The fact that this implicit behaviour was not
commented made it easy to miss.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list