added money.grocery retrieval method
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 1 Sep 2006 04:41:40 +0000 (04:41 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 1 Sep 2006 04:41:40 +0000 (04:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5823 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm

index eb276b8..60ed998 100644 (file)
@@ -309,6 +309,23 @@ sub create_grocery_bill {
        return $transid;
 }
 
+
+__PACKAGE__->register_method(
+       method => 'fetch_grocery',
+       api_name => 'open-ils.circ.money.grocery.retrieve'
+);
+
+sub fetch_grocery {
+       my( $self, $conn, $auth, $id ) = @_;
+       my $e = new_editor(authtoken=>$auth);
+       return $e->event unless $e->checkauth;
+       return $e->event unless $e->allowed('VIEW_TRANSACTION'); # eh.. basically the same permission
+       my $g = $e->retrieve_money_grocery($id)
+               or return $e->event;
+       return $g;
+}
+
+
 __PACKAGE__->register_method(
        method  => "billing_items",
        api_name        => "open-ils.circ.money.billing.retrieve.all",