[open-ils-commits] r17073 - trunk/Open-ILS/src/perlmods/OpenILS/SIP (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Aug 4 10:46:19 EDT 2010
Author: erickson
Date: 2010-08-04 10:46:17 -0400 (Wed, 04 Aug 2010)
New Revision: 17073
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm
Log:
updated patron fee amount call to use cstore for speed
Modified: trunk/Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm 2010-08-04 08:48:50 UTC (rev 17072)
+++ trunk/Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm 2010-08-04 14:46:17 UTC (rev 17073)
@@ -223,14 +223,15 @@
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;
}
More information about the open-ils-commits
mailing list