Koha/members
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
..
boraccount.pl Bug 12001: Move GetMemberAccountRecords to the Koha namespace 2018-02-23 10:57:30 -03:00
default_messageprefs.pl Bug 18403: Update permissions - borrowers => 1|* becomes borrowers => 'edit_borrowers' 2018-02-12 15:41:37 -03:00
deletemem.pl Bug 18789: Use Koha::Patron->is_adult where needed 2018-02-16 13:03:58 -03:00
discharge.pl Bug 18789: Use Koha::Patron->image from the templates 2018-02-16 13:03:58 -03:00
discharges.pl Bug 18403: Patron discharges 2018-02-12 15:41:41 -03:00
files.pl Bug 18789: Use Koha::Patron->is_adult where needed 2018-02-16 13:03:58 -03:00
guarantor_search.pl Bug 18403: Update permissions - borrowers => 1|* becomes borrowers => 'edit_borrowers' 2018-02-12 15:41:37 -03:00
holdshistory.pl Bug 18789: (QA follow-up) Update holdshistory.pl, fix is_child, is_adult, patron->image, clear template params 2018-02-16 13:03:58 -03:00
housebound.pl Bug 18789: (follow-up) Fix perlcritic issue - housebound.pl 2018-02-16 15:05:34 -03:00
mancredit.pl Bug 18789: Update other occurences where is_child should be used 2018-02-16 13:03:58 -03:00
maninvoice.pl Bug 18789: Update other occurences where is_child should be used 2018-02-16 13:03:58 -03:00
member-flags.pl Bug 18789: Update other occurences where is_child should be used 2018-02-16 13:03:58 -03:00
member-password.pl Bug 18789: Update other occurences where is_child should be used 2018-02-16 13:03:58 -03:00
member.pl Bug 18403: Update permissions - borrowers => 1|* becomes borrowers => 'edit_borrowers' 2018-02-12 15:41:37 -03:00
memberentry.pl Bug 18789: (QA follow-up) Fix loading saved address data to edit patron form 2018-02-16 13:03:58 -03:00
members-home.pl Bug 18403: Update permissions - borrowers => 1|* becomes borrowers => 'edit_borrowers' 2018-02-12 15:41:37 -03:00
members-update-do.pl Bug 18403: Add sub output_and_exit_if_error - unknown_patron & cannot_see_patron_infos 2018-02-12 15:41:38 -03:00
members-update.pl Bug 18403: Update permissions - borrowers => 1|* becomes borrowers => 'edit_borrowers' 2018-02-12 15:41:37 -03:00
mod_debarment.pl Bug 18403: Fix few errors found with hit_pages.t 2018-02-12 15:41:43 -03:00
moremember.pl Bug 12001: Move GetMemberAccountRecords to the Koha namespace 2018-02-23 10:57:30 -03:00
nl-search.pl Bug 18403: Update permissions - borrowers => 1|* becomes borrowers => 'edit_borrowers' 2018-02-12 15:41:37 -03:00
notices.pl Bug 18789: Use Koha::Patron->is_adult where needed 2018-02-16 13:03:58 -03:00
patronimage.pl Bug 17423 - patronimage.pl permission is too restrictive 2016-10-17 23:44:25 +00:00
pay.pl Bug 12001: Move GetMemberAccountRecords to the Koha namespace 2018-02-23 10:57:30 -03:00
paycollect.pl Bug 12001: Move GetMemberAccountRecords to the Koha namespace 2018-02-23 10:57:30 -03:00
print_overdues.pl Bug 18403: Add sub output_and_exit_if_error - unknown_patron & cannot_see_patron_infos 2018-02-12 15:41:38 -03:00
printfeercpt.pl Bug 12001: Move GetMemberAccountRecords to the Koha namespace 2018-02-23 10:57:30 -03:00
printinvoice.pl Bug 12001: Move GetMemberAccountRecords to the Koha namespace 2018-02-23 10:57:30 -03:00
printslip.pl Bug 18403: Add sub output_and_exit_if_error - unknown_patron & cannot_see_patron_infos 2018-02-12 15:41:38 -03:00
purchase-suggestions.pl Bug 18789: Use Koha::Patron->image from the templates 2018-02-16 13:03:58 -03:00
readingrec.pl Bug 18789: Update other occurences where is_child should be used 2018-02-16 13:03:58 -03:00
routing-lists.pl Bug 18789: Update other occurences where is_child should be used 2018-02-16 13:03:58 -03:00
setstatus.pl Bug 18403: Fix few errors found with hit_pages.t 2018-02-12 15:41:43 -03:00
statistics.pl Bug 18789: Use Koha::Patron->is_adult where needed 2018-02-16 13:03:58 -03:00
summary-print.pl Bug 12001: Move GetMemberAccountRecords to the Koha namespace 2018-02-23 10:57:30 -03:00
update-child.pl Bug 18403: Add sub output_and_exit_if_error - unknown_patron & cannot_see_patron_infos 2018-02-12 15:41:38 -03:00