Added check to filter out callnumbers/copies if deleted.
Signed-off-by: Mark Cooper <markchristophercooper@gmail.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
if ($holdings) {
$req->delete_field( $_ ) for ($req->field('852')); # remove any legacy 852s
- my $cn_list = $bib->call_numbers;
+
+ my $cn_list = [ grep { $_->deleted eq 'f' } @{ $bib->call_numbers } ];
if ($cn_list && @$cn_list) {
- my $cp_list = [ map { @{ $_->copies } } @$cn_list ];
+ my $cp_list = [ grep { $_->deleted eq 'f' } map { @{ $_->copies } } @$cn_list ];
if ($cp_list && @$cp_list) {
my %cn_map;
my $bib = shift;
my $r = shift;
- my $cn_list = $bib->call_numbers;
+ my $cn_list = [ grep { $_->deleted eq 'f' } @{ $bib->call_numbers } ];
if ($cn_list && @$cn_list) {
$count{cn} += @$cn_list;
-
- my $cp_list = [ map { @{ $_->copies } } @$cn_list ];
+
+ my $cp_list = [ grep { $_->deleted eq 'f' } map { @{ $_->copies } } @$cn_list ];
if ($cp_list && @$cp_list) {
my %cn_map;