$circ->{ 'barcode' } = barcodedecode($circ->{'barcode'}) if( $circ->{'barcode'} && C4::Context->preference('itemBarcodeInputFilter'));
my $branchcode = C4::Context->userenv->{branch};
- my $borrower = GetMember( 'cardnumber'=>$circ->{ 'cardnumber' } );
+ my $patron = Koha::Patrons->find( { cardnumber => $circ->{cardnumber} } );
+ my $borrower = $patron->unblessed;
my $item = Koha::Items->find({ barcode => $circ->{barcode} });
my $issue = Koha::Checkouts->find( { itemnumber => $item->itemnumber } );
my $biblio = $item->biblio;
my $biblio = $item->biblio;
my $borrowernumber = _get_borrowernumber_from_barcode( $circ->{'barcode'} );
if ( $borrowernumber ) {
- my $borrower = GetMember( 'borrowernumber' => $borrowernumber );
+ my $patron = Koha::Patrons->find( $borrowernumber );
C4::Circulation::MarkIssueReturned(
$borrowernumber,
$item->itemnumber,
undef,
$circ->{'date'},
- $borrower->{'privacy'}
+ $patron->privacy
);
ModItem({ onloan => undef }, $biblio->biblionumber, $item->itemnumber);
ModDateLastSeen( $item->itemnumber );
- push @output, {
- return => 1,
- title => $biblio->title,
- biblionumber => $biblio->biblionumber,
- barcode => $item->barcode,
- borrowernumber => $borrower->{'borrowernumber'},
- firstname => $borrower->{'firstname'},
- surname => $borrower->{'surname'},
- cardnumber => $borrower->{'cardnumber'},
- datetime => $circ->{ 'datetime' }
- };
+ push @output,
+ {
+ return => 1,
+ title => $biblio->title,
+ biblionumber => $biblio->biblionumber,
+ barcode => $item->barcode,
+ borrowernumber => $patron->borrowernumber,
+ firstname => $patron->firstname,
+ surname => $patron->surname,
+ cardnumber => $patron->cardnumber,
+ datetime => $circ->{'datetime'}
+ };
} else {
push @output, {
ERROR_no_borrower_from_item => 1,