create standalone PO activation routine so PO's can be activated during create time
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 11 Mar 2010 16:33:18 +0000 (16:33 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 11 Mar 2010 16:33:18 +0000 (16:33 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15796 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm

index b5f1d39..25a2a88 100644 (file)
@@ -2000,6 +2000,17 @@ sub activate_purchase_order {
     my $e = new_editor(xact=>1, authtoken=>$auth);
     return $e->die_event unless $e->checkauth;
     my $mgr = OpenILS::Application::Acq::BatchManager->new(editor => $e, conn => $conn);
+    my $die_event = activate_purchase_order_impl($mgr, $po_id);
+    return $die_event if $die_event;
+    $e->commit;
+    $conn->respond_complete(1);
+    $mgr->run_post_response_hooks;
+    return undef;
+}
+
+sub activate_purchase_order_impl {
+    my($mgr, $po_id) = @_;
+    my $e = $mgr->editor;
 
     my $po = $e->retrieve_acq_purchase_order($po_id) or return $e->die_event;
     return $e->die_event unless $e->allowed('CREATE_PURCHASE_ORDER', $po->ordering_agency);
@@ -2020,9 +2031,6 @@ sub activate_purchase_order {
         $mgr->respond;
     }
 
-    $e->commit;
-    $conn->respond_complete(1);
-    $mgr->run_post_response_hooks;
     return undef;
 }