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: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected], [email protected]

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.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to