bugfixes
authortipaul <tipaul>
Mon, 3 May 2004 16:36:53 +0000 (16:36 +0000)
committertipaul <tipaul>
Mon, 3 May 2004 16:36:53 +0000 (16:36 +0000)
circ/circulation.pl

index 1b7fe28..30af110 100755 (executable)
@@ -126,26 +126,29 @@ if ($findborrower) {
 if ($barcode) {
        $barcode = cuecatbarcodedecode($barcode);
        my ($datedue, $invalidduedate) = fixdate($year, $month, $day);
-#      unless ($invalidduedate) {
+       if ($issueconfirmed) {
+                       warn "CONFIRMED";
+                       issuebook(\%env, $borrower, $barcode, $datedue);
+       } else {
+       #       unless ($invalidduedate) {
                my ($error, $question) = canbookbeissued(\%env, $borrower, $barcode, $year, $month, $day);
                my $noerror=1;
                my $noquestion = 1;
                foreach my $impossible (keys %$error) {
-                       warn "Impossible : $impossible : ";#.%$error->{$impossible};
-                       $template->param($impossible => 1,
+                       $template->param($impossible => $$error{$impossible},
                                                        IMPOSSIBLE => 1);
                        $noerror = 0;
                }
                foreach my $needsconfirmation (keys %$question) {
-                       warn "needsconfirmation : $needsconfirmation : "; #.%$error->{$needsconfirmation};
-                       $template->param($needsconfirmation => 1,
+                       $template->param($needsconfirmation => $$question{$needsconfirmation},
                                                        NEEDSCONFIRMATION => 1);
                        $noquestion = 0;
                }
                if ($noerror && ($noquestion || $issueconfirmed)) {
                        warn "NO ERROR";
-#                      issuebook(\%env, $borrower, $barcode, $datedue);
+                       issuebook(\%env, $borrower, $barcode, $datedue);
                }
+       }
 
 #      }
 }