LP#1942220: add flesh_po_items_further option to PO retrieval
authorGalen Charlton <gmc@equinoxOLI.org>
Tue, 14 Dec 2021 01:36:16 +0000 (20:36 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Tue, 14 Dec 2021 01:36:16 +0000 (20:36 -0500)
This fleshes in any fund debits and debit invoice items associated
with PO direct charges

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Financials.pm

index bc27338..f5680f2 100644 (file)
@@ -1026,6 +1026,11 @@ sub retrieve_purchase_order_impl {
     }
 
     push (@{$flesh->{flesh_fields}->{acqpo}}, 'po_items') if $options->{flesh_po_items};
+    if ($options->{flesh_po_items_further}) {
+        push (@{$flesh->{flesh_fields}->{acqpoi}}, 'fund_debit');
+        push (@{$flesh->{flesh_fields}->{acqfdeb}}, 'invoice_items');
+        $flesh->{'flesh'} = 3;
+    }
 
     my $args = (@{$flesh->{"flesh_fields"}->{"acqpo"}}) ?
         [$po_id, $flesh] : $po_id;