From 0c3cadf74362597b005fda93c2a742227840a40b Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 29 Dec 2010 16:43:44 +0000 Subject: [PATCH] at po activation time, apply the provider's default claim policy to each lineitem when no policy is already applied git-svn-id: svn://svn.open-ils.org/ILS/trunk@19081 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm index 6fd0bf00b0..57758c6f06 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm @@ -2189,6 +2189,8 @@ 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); + my $provider = $e->retrieve_acq_provider($po->provider); + $po->state('on-order'); $po->order_date('now'); update_purchase_order($mgr, $po) or return $e->die_event; @@ -2213,6 +2215,8 @@ sub activate_purchase_order_impl { } $li->state('on-order'); + $li->claim_policy($provider->default_claim_policy) + if $provider->default_claim_policy and !$li->claim_policy; create_lineitem_debits($mgr, $li, $dry_run) or return $e->die_event; update_lineitem($mgr, $li) or return $e->die_event; $mgr->post_process( sub { create_lineitem_status_events($mgr, $li->id, 'aur.ordered'); }); -- 2.11.0