[open-ils-commits] r12660 - in trunk/Open-ILS: src/perlmods/OpenILS/Application/Acq web/js/ui/default/acq/picklist (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Mar 24 17:11:22 EDT 2009
Author: erickson
Date: 2009-03-24 17:11:18 -0400 (Tue, 24 Mar 2009)
New Revision: 12660
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
trunk/Open-ILS/web/js/ui/default/acq/picklist/upload.js
Log:
plugged in PO creation to marc upload process. small bug fixes to upload UI
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm 2009-03-24 21:10:10 UTC (rev 12659)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm 2009-03-24 21:11:18 UTC (rev 12660)
@@ -546,12 +546,22 @@
my($self, $conn, $auth, $p_order) = @_;
my $e = new_editor(xact=>1, authtoken=>$auth);
return $e->die_event unless $e->checkauth;
+ $p_order->ordering_agency($e->requestor->ws_ou);
+ my $evt = create_purchase_order_impl($e, $p_order);
+ return $evt if $evt;
+ $e->commit;
+ return $p_order->id;
+}
+
+sub create_purchase_order_impl {
+ my($e, $p_order) = @_;
+
$p_order->creator($e->requestor->id);
$p_order->editor($e->requestor->id);
$p_order->owner($e->requestor->id);
$p_order->edit_time('now');
- $p_order->ordering_agency($e->requestor->ws_ou);
+
return $e->die_event unless
$e->allowed('CREATE_PURCHASE_ORDER', $p_order->ordering_agency);
@@ -561,9 +571,7 @@
$e->allowed('MANAGE_PROVIDER', $provider->owner, $provider);
$e->create_acq_purchase_order($p_order) or return $e->die_event;
-
- $e->commit;
- return $p_order->id;
+ return undef;
}
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm 2009-03-24 21:10:10 UTC (rev 12659)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm 2009-03-24 21:11:18 UTC (rev 12660)
@@ -16,6 +16,7 @@
use MARC::File::XML;
use MIME::Base64;
use Digest::MD5 qw/md5_hex/;
+use OpenILS::Application::Acq::Financials;
my $U = 'OpenILS::Application::AppUtils';
@@ -577,9 +578,11 @@
}
if($create_po) {
- return $e->die_event unless
- $e->allowed('CREATE_PURCHASE_ORDER', $ordering_agency);
- # $purchase_order =
+ $purchase_order = Fieldmapper::acq::purchase_order->new;
+ $purchase_order->provider($provider);
+ $purchase_order->ordering_agency($ordering_agency);
+ my $evt = OpenILS::Application::Acq::Financials::create_purchase_order_impl($e, $purchase_order);
+ return $evt if $evt;
}
$logger->info("acq processing MARC file=$filename");
Modified: trunk/Open-ILS/web/js/ui/default/acq/picklist/upload.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/picklist/upload.js 2009-03-24 21:10:10 UTC (rev 12659)
+++ trunk/Open-ILS/web/js/ui/default/acq/picklist/upload.js 2009-03-24 21:11:18 UTC (rev 12660)
@@ -69,7 +69,7 @@
}
});
} else {
- acqSendUploadForm({});
+ acqSendUploadForm({picklist:null});
}
}
@@ -92,7 +92,6 @@
function acqHandlePostUpload(key) {
- openils.Util.hide('acq-pl-upload-progress');
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.process_upload_records'],
{ async: true,
@@ -103,7 +102,7 @@
if(resp.picklist) {
location.href = location.href + '/../view/' + resp.picklist.id();
} else {
- location.href = location.href + '/../../po/view/' + resp.purchase_order.id;
+ location.href = location.href + '/../../po/view/' + resp.purchase_order.id();
}
} else {
dojo.byId('acq-pl-upload-count').innerHTML = resp.count;
More information about the open-ils-commits
mailing list