fix to CanBookBeIssued()
authorGalen Charlton <galen.charlton@liblime.com>
Mon, 11 May 2009 21:10:37 +0000 (16:10 -0500)
committerGalen Charlton <galen.charlton@liblime.com>
Mon, 11 May 2009 21:11:36 +0000 (16:11 -0500)
Bail out if item does not exist - otherwise
subsequent checks can fail for lack of an
item branchcode.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Circulation.pm

index 1c8052b..e6389ee 100644 (file)
@@ -669,6 +669,12 @@ sub CanBookBeIssued {
        $item->{'itemtype'}=$item->{'itype'}; 
     my $dbh             = C4::Context->dbh;
 
+    # MANDATORY CHECKS - unless item exists, nothing else matters
+    unless ( $item->{barcode} ) {
+        $issuingimpossible{UNKNOWN_BARCODE} = 1;
+    }
+       return ( \%issuingimpossible, \%needsconfirmation ) if %issuingimpossible;
+
     #
     # DUE DATE is OK ? -- should already have checked.
     #
@@ -748,10 +754,6 @@ sub CanBookBeIssued {
     #
     # ITEM CHECKING
     #
-    unless ( $item->{barcode} ) {
-        $issuingimpossible{UNKNOWN_BARCODE} = 1;
-    }
-
     if (   $item->{'notforloan'}
         && $item->{'notforloan'} > 0 )
     {