2 #===============================================================================
11 # AUTHOR: Chris Cormack (rangi), chrisc@catalyst.net.nz
12 # ORGANIZATION: Koha Development Team
14 # CREATED: 05/11/13 11:14:09
16 #===============================================================================
17 package NCIP::ILS::Koha;
20 use Object::Tiny qw{ name };
22 use C4::Members qw{ GetMemberDetails };
23 use C4::Circulation qw { AddReturn CanBookBeIssued AddIssue };
28 return ( { barcode => '123', title => 'fish' }, undef );
34 my $userdata = GetMemberDetails( undef, $userid );
42 my $exemptfine = undef;
44 my ( $success, $messages, $issue, $borrower ) =
45 AddReturn( $barcode, $branch, $exemptfine, $dropbox );
48 messages => $messages,
49 iteminformation => $issue,
59 my $borrower = GetMemberDetails( undef, $userid );
63 $usernum, $userid, $usercnum, $userfirstname,
64 $usersurname, $userbranch, $branchname, $userflags,
65 $emailaddress, $branchprinter, $persona
73 'AS', #branchcode need to set this properly
78 C4::Context->_new_userenv('DUMMY_SESSION_ID');
79 C4::Context->set_userenv(@USERENV);
83 ( $error, $confirm ) = CanBookBeIssued( $borrower, $barcode );
85 #( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $borrower,
86 # $barcode, $duedatespec, $inprocess, $ignore_reserves );
89 # Can't issue item, return error hash
93 return ( 1, $confirm );
96 my $datedue = AddIssue( $borrower, $barcode );
97 return ( 0, undef, $datedue ); #successfully issued
101 $error->{'badborrower'} = 1;
102 return ( 1, $error );
110 my $borrower = GetMemberDetails( undef, $userid );
112 my $datedue = AddRenewal( $barcode, $borrower->{'borrowernumber'} );