fixed typo that caused MARC21 leader form to emit 25 characters instead of 24
[koha_fer] / circ / transferstoreceive.pl
old mode 100644 (file)
new mode 100755 (executable)
index 9289eb0..697a41a
@@ -1,6 +1,5 @@
 #!/usr/bin/perl
 
-# $Id$
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -29,7 +28,6 @@ use C4::Date;
 use C4::Biblio;
 use C4::Circulation;
 use C4::Members;
-#use C4::Interface::CGI::Output;
 use Date::Calc qw(
   Today
   Add_Delta_Days
@@ -70,12 +68,12 @@ my @branchesloop;
 foreach my $br ( keys %$branches ) {
     my @transferloop;
     my %branchloop;
-    $branchloop{'branchname'} = $branches->{$br}->{'branchname'};
-    $branchloop{'branchcode'} = $branches->{$br}->{'branchcode'};
     my @gettransfers =
       GetTransfersFromTo( $branches->{$br}->{'branchcode'}, $default );
 
     if (@gettransfers) {
+        $branchloop{'branchname'} = $branches->{$br}->{'branchname'};
+        $branchloop{'branchcode'} = $branches->{$br}->{'branchcode'};
         foreach my $num (@gettransfers) {
             my %getransf;
 
@@ -125,13 +123,7 @@ foreach my $br ( keys %$branches ) {
       #                If we have a return of reservloop we put it in the branchloop sequence
         $branchloop{'reserv'} = \@transferloop;
     }
-    else {
-
-#      if we don't have a retrun from reservestobranch we unset branchname and branchcode
-        $branchloop{'branchname'} = 0;
-        $branchloop{'branchcode'} = 0;
-    }
-    push( @branchesloop, \%branchloop );
+    push( @branchesloop, \%branchloop ) if %branchloop;
 }
 
 $template->param(