From a028f6a2c9e36b1d0658f61ce4f24ae62e4db17b Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 27 Jan 2006 17:39:42 +0000 Subject: [PATCH] adding untested noncat circ create code git-svn-id: svn://svn.open-ils.org/ILS/trunk@2862 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Circ/NonCat.pm | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/NonCat.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/NonCat.pm index 577ca0f019..9ddf2b6d31 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/NonCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/NonCat.pm @@ -11,6 +11,29 @@ $Data::Dumper::Indent = 0; my $U = "OpenILS::Application::AppUtils"; +# returns ( $newid, $evt ). If $evt, then there was an error +sub create_non_cat_circ { + my( $staffid, $patronid, $circ_lib, $noncat_type, $circ_time ) = @_; + + my( $id, $evt ); + $circ_time |= 'now'; + my $circ = Fieldmapper::action::non_cataloged_circulation->new; + + $circ->patron($patronid); + $circ->staff($staffid); + $circ->circ_lib($circ_lib); + $circ->item_type($noncat_type); + $circ->circ_time($circ_time); + + $id = $U->simplereq( + 'open-ils.storage', + 'open-ils.storage.direct.action.non_cataloged_circulation.create', $circ ); + $evt = $U->DB_UPDATE_FAILED($circ) unless $id; + + return( $id, $evt ); +} + + __PACKAGE__->register_method( method => "create_noncat_type", api_name => "open-ils.circ.non_cat_type.create", -- 2.43.2