[Koha-bugs] [Bug 12001] GetMemberAccountRecords slows down display of patron details and checkout pages

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Feb 20 06:08:45 CET 2018


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

Josef Moravec <josef.moravec at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #71852|0                           |1
        is obsolete|                            |
  Attachment #71853|0                           |1
        is obsolete|                            |
  Attachment #71854|0                           |1
        is obsolete|                            |
  Attachment #71855|0                           |1
        is obsolete|                            |
  Attachment #71856|0                           |1
        is obsolete|                            |
  Attachment #71857|0                           |1
        is obsolete|                            |

--- Comment #18 from Josef Moravec <josef.moravec at gmail.com> ---
Created attachment 71979
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71979&action=edit
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 at theke.io>

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

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


More information about the Koha-bugs mailing list