[open-ils-commits] r19145 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Jan 10 11:27:56 EST 2011


Author: erickson
Date: 2011-01-10 11:27:53 -0500 (Mon, 10 Jan 2011)
New Revision: 19145

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm
Log:
removed deprecated, unused code

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm	2011-01-10 15:27:37 UTC (rev 19144)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm	2011-01-10 16:27:53 UTC (rev 19145)
@@ -623,107 +623,7 @@
 }
 
 
-
-
-# this call duplicates a call in Order.pm and makes references to subs that don't exist.  
-# TODO: Verify then remove.
 __PACKAGE__->register_method(
-	method    => 'lineitem_detail_CUD_batch',
-	api_name  => 'open-ils.acq.lineitem_detail.cud.batch_',
-    stream    => 1,
-	signature => {
-        desc => q/Creates a new purchase order line item detail.  
-            Additionally creates the associated fund_debit/,
-        params => [
-            {desc => 'Authentication token', type => 'string'},
-            {desc => 'List of lineitem_details to create', type => 'array'},
-        ],
-        return => {desc => 'Streaming response of current position in the array'}
-    }
-);
-
-sub lineitem_detail_CUD_batch {
-    my($self, $conn, $auth, $li_details, $options) = @_;
-    my $e = new_editor(xact=>1, authtoken=>$auth);
-    return $e->die_event unless $e->checkauth;
-    my $pos = 0;
-    my $total = scalar(@$li_details);
-    for my $li_detail (@$li_details) {
-        my $res;
-
-        use Data::Dumper;
-        $logger->info(Dumper($li_detail));
-        $logger->info('lid id ' . $li_detail->id);
-        $logger->info('lineitem ' . $li_detail->lineitem);
-
-        if($li_detail->isnew) {
-            $res = create_lineitem_detail_impl($self, $conn, $e, $li_detail, $options);
-        } elsif($li_detail->ischanged) {
-            $res = update_lineitem_detail_impl($self, $conn, $e, $li_detail);
-        } elsif($li_detail->isdeleted) {
-            $res = delete_lineitem_detail_impl($self, $conn, $e, $li_detail->id);
-        }
-        return $e->event if $e->died;
-        $conn->respond({maximum => $total, progress => $pos++, li => $res});
-    }
-    $e->commit;
-    return {complete => 1};
-}
-
-
-sub create_lineitem_detail_impl {
-    my($self, $conn, $e, $li_detail, $options) = @_;
-    $options ||= {};
-
-    my $li = $e->retrieve_acq_lineitem($li_detail->lineitem)
-        or return $e->die_event;
-
-    my $evt = update_li_edit_time($e, $li);
-    return $evt if $evt;
-
-    # XXX check lineitem provider perms
-
-    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_FUND', $fund->org, $fund);
-    }
-
-    $e->create_acq_lineitem_detail($li_detail) or return $e->die_event;
-
-    unless($li_detail->barcode) {
-        my $pfx = $U->ou_ancestor_setting_value($li_detail->owning_lib, 'acq.tmp_barcode_prefix') || 'ACQ';
-        $li_detail->barcode($pfx.$li_detail->id);
-    }
-    unless($li_detail->cn_label) {
-        my $pfx = $U->ou_ancestor_setting_value($li_detail->owning_lib, 'acq.tmp_callnumber_prefix') || 'ACQ';
-        $li_detail->cn_label($pfx.$li_detail->id);
-    }
-
-    if(my $loc = $U->ou_ancestor_setting_value($li_detail->owning_lib, 'acq.default_copy_location')) {
-        $li_detail->location($loc);
-    }
-
-    $e->update_acq_lineitem_detail($li_detail) or return $e->die_event;
-
-    return $li_detail if $$options{return_obj};
-    return $li_detail->id
-}
-
-
-sub update_li_edit_time {
-    my ($e, $li) = @_;
-    # some lineitem edits are allowed after approval time...
-#    return OpenILS::Event->new('ACQ_LINEITEM_APPROVED', payload => $li->id)
-#        if $li->state eq 'approved';
-    $li->edit_time('now');
-    $li->editor($e->requestor->id);
-    $e->update_acq_lineitem($li) or return $e->die_event;
-    return undef;
-}
-
-
-__PACKAGE__->register_method(
     method    => 'retrieve_lineitem_detail',
     api_name  => 'open-ils.acq.lineitem_detail.retrieve',
     authoritative => 1,



More information about the open-ils-commits mailing list