When a hold has gone around the org-unit loop (if configured) X number of times witho...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 22 Sep 2009 21:09:46 +0000 (21:09 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 22 Sep 2009 21:09:46 +0000 (21:09 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14104 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 3d84401..747e282 100644 (file)
@@ -1121,9 +1121,17 @@ sub new_hold_copy_targeter {
                                                # We have, and should remove potentials and cancel the hold
                                                my @oldmaps = action::hold_copy_map->search( hold => $hold->id );
                                                $_->delete for (@oldmaps);
-       
-                                               $hold->update( { cancel_time => 'now' } );
+
+                                               # cancel cause = un-targeted expiration
+                                               $hold->update( { cancel_time => 'now', cancel_cause => 1 } ); 
                                                $self->method_lookup('open-ils.storage.transaction.commit')->run;
+
+                                               # tell A/T the hold was cancelled
+                                               my $fm_hold = $hold->to_fieldmapper;
+                                               my $ses = OpenSRF::AppSession->create('open-ils.trigger');
+                                               $ses->request('open-ils.trigger.event.autocreate', 
+                                                       'hold_request.cancel.expire_no_target', $fm_hold, $fm_hold->pickup_lib);
+
                                                die "OK\n";
                                        }
                                }