[Koha-bugs] [Bug 27995] Koha::Account::Line->apply should return the update Koha::Account::Line object

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Mar 19 12:28:45 CET 2021


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

--- Comment #2 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 118512
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118512&action=edit
Bug 27995: Update return for Koha::Account::Line->apply

This patch updates the return value of Koha::Account::Line->apply to return the
updated Koha::Account::Line object with Koha::Object::Messages embedded
for the results of any triggered renewals.

Available credit, the former return value, is still availabe via the
object directly as `amountoutstanding`.

Koha::REST::V1::Patrons::Account->add_credit has been updated to reflect
the change. No other area's of Koha relied upon the return value.

This patch also fixes a bug whereby if you passed a list of debits with
an outstanding debit larger than the outstanding credit then you could
end up with superflous offest lines with zero amounts that was
highlighted by the improved unit tests in
t/db_dependent/Koha/Account/Line.t

Test plan
1/ Run t/db_dependent/Koha/Account/Line.t
2/ Run t/db_dependent/api/v1/patrons_accounts.t
3/ If both tests pass then signoff

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


More information about the Koha-bugs mailing list