From 1bf22dc11619d30992c657c60332b92c275e8fb5 Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 6 Sep 2006 05:55:57 +0000 Subject: [PATCH] convert opac fleshing method git-svn-id: svn://svn.open-ils.org/ILS/trunk@5980 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/perlmods/OpenILS/Application/Actor.pm | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index bee5d2fa8f..7a002ed8ef 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -1343,25 +1343,26 @@ sub user_transactions { if($api =~ /have_charge/o) { - $trans = $apputils->simple_scalar_request( - "open-ils.cstore", - "open-ils.cstore.direct.money.open_billable_transaction_summary.search.atomic", - { usr => $user_id, total_owed => { ">" => 0 }, @xact }); + ($trans) = $self + ->method_lookup('open-ils.actor.user.transactions.history.have_bill') + ->run($login_session => $user_id => $type); + $trans = [ grep { int($_->total_owed * 100) > 0 } @$trans ]; } elsif($api =~ /have_balance/o) { - $trans = $apputils->simple_scalar_request( - "open-ils.cstore", - "open-ils.cstore.direct.money.open_billable_transaction_summary.search.atomic", - { usr => $user_id, balance_owed => { "<>" => 0 }, @xact }); + ($trans) = $self + ->method_lookup('open-ils.actor.user.transactions.history.have_balance') + ->run($login_session => $user_id => $type); } else { - $trans = $apputils->simple_scalar_request( - "open-ils.cstore", - "open-ils.cstore.direct.money.open_billable_transaction_summary.search.atomic", - { usr => $user_id, @xact }); + ($trans) = $self + ->method_lookup('open-ils.actor.user.transactions.history') + ->run($login_session => $user_id => $type); + } + + $trans = [ grep { !$_->xact_finish } @$trans; if($api =~ /total/o) { my $total = 0.0; @@ -1827,7 +1828,7 @@ sub user_transaction_history { for my $x (@xacts) { my $s = new Fieldmapper::money::billable_transaction_summary; $s->id( $x->id ); - $s->id( $userid ); + $s->usr( $userid ); $s->xact_start( $x->xact_start ); $s->xact_finish( $x->xact_finish ); @@ -1877,14 +1878,14 @@ sub user_transaction_history { } if($api =~ /have_balance/o) { - @mbts = grep { int($_->balance_owed * 100) > 0 } @mbts; + @mbts = grep { int($_->balance_owed * 100) != 0 } @mbts; } - if($api =~ /have_charge/o) { + if($api =~ /have_charge)/o) { @mbts = grep { defined($_->last_billing_ts) } @mbts; } - if($api =~ /total_owed/o) { + if($api =~ /have_bill/o) { @mbts = grep { int($_->total_owed * 100) != 0 } @mbts; } -- 2.43.2