Merge remote-tracking branch 'origin/new/bug_8585'
[koha.git] / tools / inventory.pl
index 30720e6..5e7b198 100755 (executable)
@@ -77,6 +77,8 @@ my @authorised_value_list;
 my $authorisedvalue_categories = '';
 
 my $frameworks = getframeworks();
+$frameworks->{''} = {frameworkcode => ''}; # Add the default framework
+
 for my $fwk (keys %$frameworks){
   my $fwkcode = $frameworks->{$fwk}->{'frameworkcode'};
   my $authcode = GetAuthValCode('items.location', $fwkcode);
@@ -185,7 +187,7 @@ if ( ! ($uploadbarcodes && length($uploadbarcodes)>0 ) || ( $input->param('compa
         }
     }
     if ($markseen or $op) {
-        $res = GetItemsForInventory( $minlocation, $maxlocation, $location, $ignoreissued, $itemtype, $datelastseen, $branchcode, $branch, $offset, $pagesize, $staton );
+        $res = GetItemsForInventory( $minlocation, $maxlocation, $location, $itemtype, $ignoreissued, $datelastseen, $branchcode, $branch, $offset, $pagesize, $staton );
         $template->param(loop =>$res,
                         nextoffset => ($offset+$pagesize),
                         prevoffset => ($offset?$offset-$pagesize:0),
@@ -194,7 +196,7 @@ if ( ! ($uploadbarcodes && length($uploadbarcodes)>0 ) || ( $input->param('compa
     if ( defined $input->param('compareinv2barcd') && ( ( $input->param('compareinv2barcd') eq 'on' ) && ( scalar @brcditems != scalar @$res ) ) && length($uploadbarcodes) > 0 ){
         if ( scalar @brcditems > scalar @$res ){
             for my $brcditem (@brcditems) {
-                if (! grep(/$brcditem->{barcode}/, @$res) ){
+                if (! grep( $_->{barcode} =~ /$brcditem->{barcode}/ , @$res) ){
                     $brcditem->{notfoundkoha} = 1;
                     push @$res, $brcditem;
                 }
@@ -202,7 +204,7 @@ if ( ! ($uploadbarcodes && length($uploadbarcodes)>0 ) || ( $input->param('compa
         } else {
             my @notfound;
             for my $item (@$res) {
-                if ( ! grep(/$item->{barcode}/, @brcditems) ){
+                if ( ! grep( $_->{barcode} =~ /$item->{barcode}/ , @brcditems) ){
                     $item->{notfoundbarcode} = 1;
                     push @notfound, $item;
                 }