Bug 7159 - Add branchcode to circulation.pl search (take two, revising with Owen...
[koha.git] / circ / circulation.pl
index efb87da..ad6773e 100755 (executable)
@@ -30,6 +30,7 @@ use C4::Dates qw/format_date/;
 use C4::Branch; # GetBranches
 use C4::Koha;   # GetPrinter
 use C4::Circulation;
+use C4::Overdues qw/CheckBorrowerDebarred/;
 use C4::Members;
 use C4::Biblio;
 use C4::Reserves;
@@ -260,6 +261,16 @@ if ($borrowernumber) {
         issuecount   => $issue,
         finetotal    => $fines
     );
+
+    my $debar = CheckBorrowerDebarred($borrowernumber);
+    if ($debar) {
+        $template->param( 'userdebarred'    => 1 );
+        $template->param( 'debarredcomment' => $borrower->{debarredcomment} );
+        if ( $debar ne "9999-12-31" ) {
+            $template->param( 'userdebarreddate' => C4::Dates::format_date($debar) );
+        }
+    }
+
 }
 
 #
@@ -499,7 +510,7 @@ if ($borrowerslist) {
     {
         push @values, $_->{'borrowernumber'};
         $labels{ $_->{'borrowernumber'} } =
-"$_->{'surname'}, $_->{'firstname'} ... ($_->{'cardnumber'} - $_->{'categorycode'}) ...  $_->{'address'} ";
+"$_->{'surname'}, $_->{'firstname'} ... ($_->{'cardnumber'} - $_->{'categorycode'} - $_->{'branchcode'}) ...  $_->{'address'} ";
     }
     $CGIselectborrower = CGI::scrolling_list(
         -name     => 'borrowernumber',
@@ -629,9 +640,9 @@ my (undef, $roadttype_hashref) = &GetRoadTypes();
 my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'};
 
 my $fast_cataloging = 0;
-    if (defined getframeworkinfo('FA')) {
+if (defined getframeworkinfo('FA')) {
     $fast_cataloging = 1 
-    }
+}
 
 if (C4::Context->preference('ExtendedPatronAttributes')) {
     my $attributes = GetBorrowerAttributes($borrowernumber);
@@ -654,6 +665,8 @@ $template->param(
     printername       => $printer,
     firstname         => $borrower->{'firstname'},
     surname           => $borrower->{'surname'},
+    showname          => $borrower->{'showname'},
+    category_type     => $borrower->{'category_type'},
     dateexpiry        => format_date($newexpiry),
     expiry            => format_date($borrower->{'dateexpiry'}),
     categorycode      => $borrower->{'categorycode'},
@@ -669,6 +682,7 @@ $template->param(
     country           => $borrower->{'country'},
     phone             => $borrower->{'phone'} || $borrower->{'mobile'},
     cardnumber        => $borrower->{'cardnumber'},
+    othernames        => $borrower->{'othernames'},
     amountold         => $amountold,
     barcode           => $barcode,
     stickyduedate     => $stickyduedate,