Fix for bug 1428
authorChris Cormack <crc@liblime.com>
Sun, 13 Jan 2008 23:59:41 +0000 (17:59 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Mon, 14 Jan 2008 22:48:08 +0000 (16:48 -0600)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
circ/circulation.pl

index 38c678e..124b590 100755 (executable)
@@ -260,26 +260,30 @@ if ($borrowernumber) {
 
 if ($barcode) {
    # $barcode = cuecatbarcodedecode($barcode);
+       # always check for blockers on issuing
+       my ( $error, $question ) =
+         CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
+       my $noerror    = 1;
+       foreach my $impossible ( keys %$error ) {
+            $template->param(
+                $impossible => $$error{$impossible},
+                IMPOSSIBLE  => 1
+            );
+            $noerror = 0;
+        }
     
-       if ($issueconfirmed) {
+       if ($issueconfirmed && $noerror) {
+               # we have no blockers for issuing and any issues needing confirmation have been resolved
         AddIssue( $borrower, $barcode, $datedue, $cancelreserve );
         $inprocess = 1;
     }
+       elsif ($issueconfirmed){
+       }
     else {
-        my ( $error, $question ) =
-          CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
-        my $noerror    = 1;
         my $noquestion = 1;
 #         Get the item title for more information
        my $getmessageiteminfo  = GetBiblioFromItemNumber(undef,$barcode);
     
-        foreach my $impossible ( keys %$error ) {
-            $template->param(
-                $impossible => $$error{$impossible},
-                IMPOSSIBLE  => 1
-            );
-            $noerror = 0;
-        }
         foreach my $needsconfirmation ( keys %$question ) {
             $template->param(
                 $needsconfirmation => $$question{$needsconfirmation},