Josef Moravec <> 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 <> ---
Created attachment 71979
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
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

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 <>

Signed-off-by: Josef Moravec <>

You are receiving this mail because:
You are watching all bug changes.
Koha-bugs mailing list
website :
git :
bugs :

Reply via email to