LP1883171 & LP1940663: Flesh latest inventory after checkin
authorJason Stephenson <jason@sigio.com>
Sat, 13 Nov 2021 21:39:14 +0000 (16:39 -0500)
committerJason Stephenson <jason@sigio.com>
Thu, 30 Dec 2021 15:19:13 +0000 (10:19 -0500)
The checkin screen expects to get the latest inventory back, so we
flesh it.

This work was sponsored by NOBLE.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index 468c12f..46595c1 100644 (file)
@@ -4006,6 +4006,18 @@ sub checkin_flesh_events {
         );
     }
 
+    # Flesh the latest inventory.
+    # NB: This survives the unflesh_copy below. Let's keep it that way.
+    my $alci = $self->editor->search_asset_latest_inventory([
+        {copy=>$self->copy->id},
+        {flesh => 1,
+         flesh_fields => {
+             alci => ['inventory_workstation']
+         }}]);
+    if ($alci && $alci->[0]) {
+        $self->copy->latest_inventory($alci->[0]);
+    }
+
     for my $evt (@{$self->events}) {
 
         my $payload         = {};