excluding deleted CNs and copies from hold targeting
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 8 Dec 2006 13:44:38 +0000 (13:44 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 8 Dec 2006 13:44:38 +0000 (13:44 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@6660 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/asset.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm

index a6f615e..7944f7f 100644 (file)
@@ -817,7 +817,8 @@ sub new_hold_copy_targeter {
                        # trim unholdables
                        @$all_copies = grep {   isTrue($_->status->holdable) && 
                                                isTrue($_->location->holdable) && 
-                                               isTrue($_->holdable)
+                                               isTrue($_->holdable) &&
+                                               !isTrue($_->deleted)
                                        } @$all_copies;
 
                        # let 'em know we're still working
index 839ca8f..80576d7 100644 (file)
@@ -766,6 +766,7 @@ sub cn_ranged_tree {
 
        $cn = asset::call_number->retrieve( $cn );
        return undef unless ($cn);
+       return undef if ($cn->deleted);
 
        my $call_number = $cn->to_fieldmapper;
        $call_number->copies([]);
@@ -774,6 +775,7 @@ sub cn_ranged_tree {
        $call_number->record->fixed_fields( $cn->record->record_descriptor->next->to_fieldmapper );
 
        for my $cp ( $cn->copies(circ_lib => $ou_list) ) {
+               next if ($cp->deleted);
                my $copy = $cp->to_fieldmapper;
                $copy->status( $cp->status->to_fieldmapper );
                $copy->location( $cp->status->to_fieldmapper );
index 2f7b5ca..6408d75 100644 (file)
@@ -142,11 +142,13 @@ sub record_ranged_tree {
        my $offset_count = 0;
        my $limit_count = 0;
        for my $cn ( $r->call_numbers  ) {
+               next if ($cn->deleted);
                my $call_number = $cn->to_fieldmapper;
                $call_number->copies([]);
 
 
                for my $cp ( $cn->copies(circ_lib => $ou_list) ) {
+                       next if ($cp->deleted);
                        if ($offset > 0 && $offset_count < $offset) {
                                $offset_count++;
                                next;