Also skip deleted bibs and deleted call numbers.
authorRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Wed, 29 Feb 2012 22:37:21 +0000 (14:37 -0800)
committerRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Wed, 29 Feb 2012 22:37:21 +0000 (14:37 -0800)
marc_export_custom/marc_export_custom

index 8a544a0..b74a2cb 100755 (executable)
@@ -239,6 +239,8 @@ sub export_record {
 
     $count{bib}++;
     return unless $bib;
+    # Return if the bib is deleted
+    return if $bib->deleted;
 
     if ($format eq 'ARE' or $format eq 'BRE') {
         print $outfh OpenSRF::Utils::JSON->perl2JSON($bib);
@@ -442,8 +444,11 @@ sub add_bib_holdings {
             my %cn_map;
             push @{$cn_map{$_->call_number}}, $_ for (@$cp_list);
                             
-            for my $cn ( @$cn_list ) {
+            CALLNUMMAP: for my $cn ( @$cn_list ) {
                 my $cn_map_list = $cn_map{$cn->id};
+                   
+               # Ignore deleted copies
+               next CALLNUMMAP if $cn->deleted;
 
                 COPYMAP: for my $cp ( @$cn_map_list ) {
                     $count{cp}++;