[Koha-bugs] [Bug 20946] Cannot pay fines for patrons with credits

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jun 29 21:52:58 CEST 2018


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

--- Comment #18 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
(In reply to Jonathan Druart from comment #17)
> Quick code review:
> 
> 1. I do not like "return ( $total, $lines );"
> We are simplifying the call here, but maybe next ones will not need the
> total, or the line. It seems that we are recreating wrong patterns from C4.

Do you prefer a Koha::Account::OutstandingCredits objecT?
or
Koha::Account->oustanding_debits_total + outstanding_debit_lines ?

> 2.
>   Koha::Account->new( { patron_id => $borrowernumber } )->outstanding_debits;
> should be
>   $patron->account->outstanding_debits

I agree. This is an easy fix, though.

> 3. ->balance is used from several other places, do we need to update them as
> well?

Balance is another thing. Balance is a global value representing if the patron
owes or has credit. The point of having debits and credits separate is
replicating what other tools do (see any bank account balance, for example). So
in many places where ->balance is used, it is done in a correct way!

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


More information about the Koha-bugs mailing list