Koha/circ
Jonathan Druart 51aa6db46c Bug 12001: Move GetMemberAccountRecords to the Koha namespace
The GetMemberAccountRecords may be a perf killer, it retrieves all the
account lines of a patron and then the related item and biblio
information.
Most of the time we only want to know how much the patron owns to the
library (sum of amountoutstanding). We already have this information in
Koha::Patron->account->balance.

This patch replaces the occurrences of this subroutine by fetching only
the information we need, either the balance, the detail, or both.
It removes the formatting done in the module, to use the TT plugin
'Price' instead.
There is a very weird and error-prone behavior/feature in
GetMemberAccountBalance (FIXME): as the accountlines.accounttype is a
varchar(5), the value of the authorised value used for the
ManInvInNoissuesCharge pref (category MANUAL_INV) is truncated to the 5
first characters. That could lead to unexpected behaviors.

On the way, this patchset also replace the GetMemberAccountBalance
subroutine, which returns the balance, the non issues charges and the
other charges. We only need to have the balance and the non issues
charges to calcul the third one.

Test plan:
Add several fees for a patron and play with HoldsInNoissuesCharge,
RentalsInNoissuesCharge and ManInvInNoissuesCharge.
The information (biblio and item info, as well as the account line) must
be correctly displayed on the different screens: 'Fines' module, fine
slips, circulation module

Note that this patchset could introduce regression on price formatting,
but will be easy to fix using the TT plugin.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-23 10:57:30 -03:00
..
add_message.pl Bug 18403: Update permissions - borrowers => 1|* becomes borrowers => 'edit_borrowers' 2018-02-12 15:41:37 -03:00
article-request-slip.pl Bug 17762: Send lang to GetPreparedLetter 2017-05-09 20:56:41 +00:00
article-requests.pl Bug 14610 - Add and update scripts 2016-10-26 12:15:14 +00:00
bookcount.pl Bug 19997: use Modern::Perl in Circulation perl scripts 2018-02-05 09:45:48 -03:00
branchoverdues.pl Bug 19997: use Modern::Perl in Circulation perl scripts 2018-02-05 09:45:48 -03:00
branchtransfers.pl Bug 18789: Send Koha::Patron object to the templates 2018-02-16 13:03:58 -03:00
circulation-home.pl Bug 16530: Add a new method to the Branches TT Plugin to avoid c/p 2017-03-03 18:34:36 +00:00
circulation.pl Bug 12001: Move GetMemberAccountRecords to the Koha namespace 2018-02-23 10:57:30 -03:00
del_message.pl Bug 18403: Update permissions - borrowers => 1|* becomes borrowers => 'edit_borrowers' 2018-02-12 15:41:37 -03:00
hold-transfer-slip.pl Bug 19997: use Modern::Perl in Circulation perl scripts 2018-02-05 09:45:48 -03:00
offline-mf.pl Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
offline.pl Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
on-site_checkouts.pl Bug 16530: Add a new method to the Branches TT Plugin to avoid c/p 2017-03-03 18:34:36 +00:00
overdue.pl Bug 18789: Send Koha::Patron object to the templates 2018-02-16 13:03:58 -03:00
pendingreserves.pl Bug 18079: Holds to pull cleanup 2017-02-14 13:48:34 +00:00
renew.pl Bug 16530: Add a new method to the Branches TT Plugin to avoid c/p 2017-03-03 18:34:36 +00:00
request-article.pl Bug 14610 - Add and update scripts 2016-10-26 12:15:14 +00:00
reserveratios.pl Bug 19997: use Modern::Perl in Circulation perl scripts 2018-02-05 09:45:48 -03:00
returns.pl Bug 18789: Pass a Koha::Patron object from returns.pl 2018-02-16 13:03:58 -03:00
selectbranchprinter.pl Bug 19997: use Modern::Perl in Circulation perl scripts 2018-02-05 09:45:48 -03:00
transfer-slip.pl Bug 19997: use Modern::Perl in Circulation perl scripts 2018-02-05 09:45:48 -03:00
transferstoreceive.pl Bug 18789: Send Koha::Patron object to the templates 2018-02-16 13:03:58 -03:00
view_holdsqueue.pl Bug 18403: Use patron-title.inc when hidepatronname is used [SPECIFIC for view_holdsqueue] 2018-02-12 15:41:39 -03:00
waitingreserves.pl Bug 18789: Send Koha::Patron object to the templates 2018-02-16 13:03:58 -03:00
ypattrodue-attr-search-authvalue.pl Bug 19997: use Modern::Perl in Circulation perl scripts 2018-02-05 09:45:48 -03:00
ysearch.pl Bug 18403: Add new methods Koha::Patrons->search_limited and use it where needed 2018-02-12 15:41:39 -03:00