adding initial closed date support to the targeter
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 21 Aug 2006 20:48:32 +0000 (20:48 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 21 Aug 2006 20:48:32 +0000 (20:48 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5630 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index c399c67..4e9e89e 100644 (file)
@@ -718,9 +718,20 @@ sub new_hold_copy_targeter {
 
                        $client->status( new OpenSRF::DomainObject::oilsContinueStatus );
 
+                       my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
+                       $year += 1900;
+                       $mon += 1;
+                       my $today= sprintf( '%s-%0.2d-%0.2d', $year, $mon, $mday );
+
+                       my @closed = actor::org_unit::closed_date->search(
+                               { close_start => { '<=', $today },
+                                 close_end => { '>=', $today } }
+                       );
+
                        my @good_copies;
                        for my $c (@$all_copies) {
                                next if ($c->id == $hold->current_copy);
+                               next if ( grep { ''.$_->org_unit == ''.$c->circ_lib } @closed );
                                next if (action::hold_request
                                                ->search_where(
                                                        { current_copy => $c->id,