From 21c166cd1674d0dc8d1231f078e24e916edb8c5c Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 4 Aug 2010 14:46:17 +0000 Subject: [PATCH] updated patron fee amount call to use cstore for speed git-svn-id: svn://svn.open-ils.org/ILS/trunk@17073 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm b/Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm index 63e63e562..f6acb6971 100644 --- a/Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm +++ b/Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm @@ -223,14 +223,15 @@ sub currency { sub fee_amount { my $self = shift; syslog('LOG_DEBUG', 'OILS: Patron->fee_amount()'); + my $user_id = $self->{user}->id; - my $ses = $U->start_db_session(); - my $summary = $ses->request( - 'open-ils.storage.money.open_user_summary.search', $self->{user}->id )->gather(1); - $U->rollback_db_session($ses); + my $e = $self->{editor}; + $e->xact_begin; + my $summary = $e->search_money_open_user_summary($user_id)->[0]; + $e->rollback; # xact_rollback + disconnect my $total = $summary->balance_owed; - syslog('LOG_INFO', "User ".$self->{id} .':'.$self->{user}->id." has a fee amount of \$$total"); + syslog('LOG_INFO', "User ".$self->{id} .":$user_id has a fee amount of \$$total"); return $total; } -- 2.11.0