From 3987a6e10f586d8d85500171fce793dffd84b1ce Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 10 Mar 2008 02:06:38 +0000 Subject: [PATCH] repaired some faulty assumptions in the lineitem_detail create call. more to do. git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8946 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Acq/Financials.pm | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm index 830f3a05f1..6313a8478d 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm @@ -775,24 +775,18 @@ sub create_lineitem_detail { my $li = $e->retrieve_acq_lineitem($li_detail->lineitem) or return $e->die_event; - my $po = $e->retrieve_acq_purchase_order($li->purchase_order); - my $provider = $e->retrieve_acq_provider($po->provider); + # XXX check lineitem provider perms - my $fund = $e->retrieve_acq_fund($li_detail->fund) - or return $e->die_event; - - if($e->requestor->id != $po->owner) { + if($li_detail->fund) { + my $fund = $e->retrieve_acq_fund($li_detail->fund) or return $e->die_event; return $e->die_event unless - $e->allowed('MANAGE_PROVIDER', $provider->owner, $po); + $e->allowed('MANAGE_FUND', $fund->org, $fund); } - return $e->die_event unless - $e->allowed('MANAGE_FUND', $fund->org, $fund); - +=head XXX move to new method my $fct = $e->search_acq_currency_type({code => $fund->currency_type})->[0]; my $pct = $e->search_acq_currency_type({code => $provider->currency_type})->[0]; my $price = $$options{price}; - # create the fund_debit for this line item detail my $fdebit = Fieldmapper::acq::fund_debit->new; $fdebit->fund($$options{fund_id}); @@ -804,8 +798,9 @@ sub create_lineitem_detail { $e->create_acq_fund_debit($fdebit) or return $e->die_event; $li_detail->fund_debit($fdebit->id); - $e->create_acq_li_detail($li_detail) or return $e->die_event; +=cut + $e->create_acq_lineitem_detail($li_detail) or return $e->die_event; $e->commit; return $li_detail->id; } -- 2.11.0