moved to newer fines summary method
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 20 Nov 2006 20:05:53 +0000 (20:05 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 20 Nov 2006 20:05:53 +0000 (20:05 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@6601 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm

index c3dc887..f2cf643 100644 (file)
@@ -197,13 +197,13 @@ sub fee_amount {
        my $self = shift;
        syslog('LOG_DEBUG', 'OILS: Patron->fee_amount()');
 
-       my $total = 0;
-       my $e = OpenILS::SIP->editor();
-       my $xacts = $e->search_money_open_billable_transaction_summary( 
-               { usr => $self->{user}->id, balance_owed => { '!=' => 0 } } );
+       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);
 
-       $total += $_->balance_owed for @$xacts;
-       syslog('LOG_INFO', "User ".$self->{user}->id." has a fee amount of \$$total");
+       my $total = $summary->balance_owed;
+       syslog('LOG_INFO', "User ".$self->{id} .':'.$self->{user}->id." has a fee amount of \$$total");
        return $total;
 }