From: Chris Cormack Date: Wed, 16 Jul 2014 23:49:51 +0000 (+1200) Subject: Setting the correct branch on CheckOut X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1a89b94ba0a8ce10d084ec0c19bbe259beecddb8;p=NCIPServer.git Setting the correct branch on CheckOut --- diff --git a/lib/NCIP/ILS/Koha.pm b/lib/NCIP/ILS/Koha.pm index a5f5590..24b708b 100644 --- a/lib/NCIP/ILS/Koha.pm +++ b/lib/NCIP/ILS/Koha.pm @@ -53,13 +53,14 @@ sub userdata { sub userenv { my $self = shift; + my $branch = shift || 'AS'; my @USERENV = ( 1, 'test', 'MASTERTEST', 'Test', 'Test', - 'AS', #branchcode need to set this properly + $branch, #branchcode need to set this properly 'Auckland', 0, ); @@ -93,15 +94,14 @@ sub checkout { my $userid = shift; my $barcode = shift; my $borrower = GetMemberDetails( undef, $userid ); + my $item = GetItem( undef, $barcode); my $error; my $confirm; - $self->userenv(); + $self->userenv($item->{holdingbranch}); if ($borrower) { ( $error, $confirm ) = CanBookBeIssued( $borrower, $barcode ); - #( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $borrower, - # $barcode, $duedatespec, $inprocess, $ignore_reserves ); if (%$error) { # Can't issue item, return error hash