[open-ils-commits] SPAM: r8946 -
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Mar 9 22:39:38 EDT 2008
Author: erickson
Date: 2008-03-09 22:06:38 -0400 (Sun, 09 Mar 2008)
New Revision: 8946
Modified:
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm
Log:
repaired some faulty assumptions in the lineitem_detail create call. more to do.
Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm 2008-03-10 01:21:14 UTC (rev 8945)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm 2008-03-10 02:06:38 UTC (rev 8946)
@@ -775,24 +775,18 @@
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 @@
$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;
}
More information about the open-ils-commits
mailing list