[open-ils-commits] r17677 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq (atz)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Sep 15 01:24:59 EDT 2010
Author: atz
Date: 2010-09-15 01:24:55 -0400 (Wed, 15 Sep 2010)
New Revision: 17677
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm
Log:
perltidy and cleanup
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm 2010-09-15 05:24:54 UTC (rev 17676)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm 2010-09-15 05:24:55 UTC (rev 17677)
@@ -1160,9 +1160,9 @@
# ----------------------------------------------------------------------------
__PACKAGE__->register_method(
- method => 'upload_records',
+ method => 'upload_records',
api_name => 'open-ils.acq.process_upload_records',
- stream => 1,
+ stream => 1,
);
sub upload_records {
@@ -1175,14 +1175,14 @@
my $cache = OpenSRF::Utils::Cache->new;
my $data = $cache->get_cache("vandelay_import_spool_$key");
- my $purpose = $data->{purpose};
- my $filename = $data->{path};
- my $provider = $data->{provider};
- my $picklist = $data->{picklist};
- my $create_po = $data->{create_po};
- my $activate_po = $data->{activate_po};
+ my $purpose = $data->{purpose};
+ my $filename = $data->{path};
+ my $provider = $data->{provider};
+ my $picklist = $data->{picklist};
+ my $create_po = $data->{create_po};
+ my $activate_po = $data->{activate_po};
my $ordering_agency = $data->{ordering_agency};
- my $create_assets = $data->{create_assets};
+ my $create_assets = $data->{create_assets};
my $po;
my $evt;
@@ -1214,8 +1214,7 @@
$logger->info("acq processing MARC file=$filename");
- my $marctype = 'USMARC'; # ?
- my $batch = new MARC::Batch ($marctype, $filename);
+ my $batch = new MARC::Batch ('USMARC', $filename);
$batch->strict_off;
my $count = 0;
@@ -1223,10 +1222,8 @@
while(1) {
- my $err;
- my $xml;
+ my ($err, $xml, $r);
$count++;
- my $r;
try {
$r = $batch->next;
@@ -1283,7 +1280,7 @@
unlink($filename);
$cache->delete_cache('vandelay_import_spool_' . $key);
- if($create_assets) {
+ if ($create_assets) {
create_lineitem_list_assets($mgr, \@li_list) or return $e->die_event;
}
@@ -1315,14 +1312,15 @@
last unless $$compiled{quantity};
for(1..$$compiled{quantity}) {
- my $lid = create_lineitem_detail($mgr,
- lineitem => $li->id,
- owning_lib => $$compiled{owning_lib},
- cn_label => $$compiled{call_number},
- fund => $$compiled{fund},
- circ_modifier => $$compiled{circ_modifier},
- note => $$compiled{note},
- location => $$compiled{copy_location},
+ my $lid = create_lineitem_detail(
+ $mgr,
+ lineitem => $li->id,
+ owning_lib => $$compiled{owning_lib},
+ cn_label => $$compiled{call_number},
+ fund => $$compiled{fund},
+ circ_modifier => $$compiled{circ_modifier},
+ note => $$compiled{note},
+ location => $$compiled{copy_location},
collection_code => $$compiled{collection_code}
) or return 0;
}
@@ -1483,10 +1481,10 @@
__PACKAGE__->register_method(
- method => 'create_purchase_order_api',
- api_name => 'open-ils.acq.purchase_order.create',
- signature => {
- desc => 'Creates a new purchase order',
+ method => 'create_purchase_order_api',
+ api_name => 'open-ils.acq.purchase_order.create',
+ signature => {
+ desc => 'Creates a new purchase order',
params => [
{desc => 'Authentication token', type => 'string'},
{desc => 'purchase_order to create', type => 'object'}
@@ -1506,10 +1504,10 @@
# create the PO
my %pargs = (ordering_agency => $e->requestor->ws_ou); # default
- $pargs{provider} = $po->provider if $po->provider;
- $pargs{ordering_agency} = $po->ordering_agency if $po->ordering_agency;
- $pargs{prepayment_required} = $po->prepayment_required
- if $po->prepayment_required;
+ $pargs{provider} = $po->provider if $po->provider;
+ $pargs{ordering_agency} = $po->ordering_agency if $po->ordering_agency;
+ $pargs{prepayment_required} = $po->prepayment_required if $po->prepayment_required;
+
$po = create_purchase_order($mgr, %pargs) or return $e->die_event;
my $li_ids = $$args{lineitems};
@@ -1544,14 +1542,11 @@
__PACKAGE__->register_method(
- method => 'update_lineitem_fund_batch',
- api_name => 'open-ils.acq.lineitem.fund.update.batch',
- stream => 1,
+ method => 'update_lineitem_fund_batch',
+ api_name => 'open-ils.acq.lineitem.fund.update.batch',
+ stream => 1,
signature => {
- desc => q/
- Given a set of lineitem IDS, updates the fund for all attached
- lineitem details
- /
+ desc => q/Given a set of lineitem IDS, updates the fund for all attached lineitem details/
}
);
@@ -1834,8 +1829,8 @@
__PACKAGE__->register_method(
- method => 'rollback_receive_po_api',
- api_name => 'open-ils.acq.purchase_order.receive.rollback'
+ method => 'rollback_receive_po_api',
+ api_name => 'open-ils.acq.purchase_order.receive.rollback'
);
sub rollback_receive_po_api {
@@ -1863,10 +1858,10 @@
__PACKAGE__->register_method(
- method => 'rollback_receive_lineitem_detail_api',
- api_name => 'open-ils.acq.lineitem_detail.receive.rollback',
- signature => {
- desc => 'Mark a lineitem_detail as Un-received',
+ method => 'rollback_receive_lineitem_detail_api',
+ api_name => 'open-ils.acq.lineitem_detail.receive.rollback',
+ signature => {
+ desc => 'Mark a lineitem_detail as Un-received',
params => [
{desc => 'Authentication token', type => 'string'},
{desc => 'lineitem detail ID', type => 'number'}
More information about the open-ils-commits
mailing list