From: Bill Erickson Date: Mon, 26 Mar 2012 17:00:00 +0000 (-0400) Subject: ACQ guarantee no PO re-activation X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcollab%2Fberick%2Facq-po-prevent-dbl-activation-2_1;p=working%2FEvergreen.git ACQ guarantee no PO re-activation Prevent the possibility of double PO activation by preventing it within the API. There have been reports in the wild of double-activation, even though the UI is supposed to prevent it. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm index 699a6bbb9e..085293bda5 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm @@ -2195,6 +2195,9 @@ sub activate_purchase_order_impl { 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); + return $e->die_event(OpenILS::Event->new('PO_ALREADY_ACTIVATED')) + if $po->order_date; # PO cannot be re-activated + my $provider = $e->retrieve_acq_provider($po->provider); $po->state('on-order');