From e63807d02fc0446da2d9de55646744c07470bc6a Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 18 Nov 2005 18:51:49 +0000 Subject: [PATCH] fixed up some typos/bugs git-svn-id: svn://svn.open-ils.org/ILS/trunk@2075 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Circ/Money.pm | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm index 616c3f2caa..1d6d0b158f 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm @@ -137,9 +137,30 @@ sub _update_patron_credit { } +__PACKAGE__->register_method( + method => "retrieve_payments", + api_name => "open-ils.circ.money.payment.retrieve.all", + notes => "Returns a list of payments attached to a given transaction" + ); + +sub retrieve_payments { + my( $self, $client, $login, $transid ) = @_; + + my $staff = $apputils->check_user_session($login); + if($apputils->check_user_perms($staff->id, + $staff->home_ou, "VIEW_TRANSACTION")) { + return OpenILS::Perm->new("VIEW_TRANSACTION"); + } + + return $apputils->simple_scalar_request( + 'open-ils.storage', + 'open-ils.storage.direct.money.payment.search.xact.atomic', $transid ); +} + + __PACKAGE__->register_method( - method => "create_bill", + method => "create_grocery_bill", api_name => "open-ils.circ.money.grocery.create", notes => <<" NOTE"); Creates a new grocery transaction using the transaction object provided @@ -155,6 +176,10 @@ sub create_grocery_bill { return OpenILS::Perm->new("CREATE_TRANSACTION"); } + use Data::Dumper; + warn "Grocery Transaction: " . Dumper($transaction) ."\n"; + + $transaction->clear_id; my $session = $apputils->start_db_session; my $transid = $session->request( 'open-ils.storage.direct.money.grocery.create', $transaction)->gather(1); @@ -219,6 +244,8 @@ sub billing_items_create { throw OpenSRF::EX ("Error creating new bill"); } + $apputils->commit_db_session($session); + return $id; } -- 2.43.2