KMAIN-1837 Add PO activation lineitem notes
authorBill Erickson <berickxx@gmail.com>
Mon, 23 Nov 2015 20:08:36 +0000 (15:08 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
When a PO is activated, add a note to each lineitem containing the
username of the staff which activated the PO.

Note format is "ORD: <username>"

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

index decc68e..a89d122 100644 (file)
@@ -2819,6 +2819,17 @@ sub activate_purchase_order_impl {
         create_lineitem_debits($mgr, $li, $options) or return $e->die_event;
         update_lineitem($mgr, $li) or return $e->die_event;
         $mgr->post_process( sub { create_lineitem_status_events($mgr, $li->id, 'aur.ordered'); });
+
+        # -----------------------------------------------
+        # KCLS create lineitem note containing PO activator
+        my $note = Fieldmapper::acq::lineitem_note->new;
+        $note->lineitem($li->id);
+        $note->creator($e->requestor->id);
+        $note->editor($e->requestor->id);
+        $note->value('ordered: ' . $e->requestor->usrname);
+        $e->create_acq_lineitem_note($note) or return $e->die_event;
+        # -----------------------------------------------
+
         $mgr->respond;
     }