From 07fe6601dde861e25ded9174358e6807654d1a1e Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 23 Mar 2012 15:17:50 -0400 Subject: [PATCH] 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 Signed-off-by: Michael Peters Signed-off-by: Dan Scott --- Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm | 4 ++++ 1 file changed, 4 insertions(+) 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 7272f6346c..9e256686e7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm @@ -2328,6 +2328,10 @@ 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); # find lineitems and create assets for all -- 2.43.2