JBAS-1295 EDI invoice LI note requestor repair
authorBill Erickson <berickxx@gmail.com>
Tue, 26 Apr 2016 15:06:14 +0000 (11:06 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Create LI notes using 'admin' as the creator for EDI invoices, since
there is no 'requestor' value in this context, but one is required.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Invoice.pm

index 7fae388..cf62a74 100644 (file)
@@ -431,6 +431,9 @@ sub create_li_invoice_note {
     my ($e, $entry) = @_;
     my $note = Fieldmapper::acq::lineitem_note->new;
     $note->lineitem($entry->lineitem);
+    # $e->requestor is unset when using EDI
+    $e->requestor($e->search_actor_user({usrname => 'admin'})->[0])
+        unless $e->requestor;
     $note->creator($e->requestor->id);
     $note->editor($e->requestor->id);
     $note->value('invoiced: ' . $e->requestor->usrname);