Bug 14598: (QA followup) Don't die on bad barcode

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
This commit is contained in:
Kyle M Hall 2015-07-27 11:16:56 -04:00 committed by Mason James
parent f8e2e2f1e2
commit 575bbbeaba
1 changed files with 5 additions and 5 deletions

View File

@ -1813,17 +1813,17 @@ sub AddReturn {
my $stat_type = 'return';
# get information on item
my $item = GetItem( undef, $barcode )
or die "GetItem( undef, $barcode ) failed";
my $item = GetItem( undef, $barcode );
unless ($item) {
return ( 0, { BadBarcode => $barcode } ); # no barcode means no item or borrower. bail out.
}
my $itemnumber = $item->{ itemnumber };
my $biblio = GetBiblioData( $item->{ biblionumber } );
my $itemtype = ( C4::Context->preference("item-level_itypes") )
? $item->{ itype }
: $biblio->{ itemtype };
unless ($itemnumber) {
return (0, { BadBarcode => $barcode }); # no barcode means no item or borrower. bail out.
}
my $issue = GetItemIssue($itemnumber);
if ($issue and $issue->{borrowernumber}) {
$borrower = C4::Members::GetMemberDetails($issue->{borrowernumber})