tweak invoice grid and middle layer retriever
authorJason Etheridge <jason@EquinoxInitiative.org>
Wed, 20 Nov 2019 12:49:50 +0000 (07:49 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 16 Jan 2020 21:38:28 +0000 (16:38 -0500)
Flesh provider and shipper, and provide links to the legacy dojo for those and inv_ident

Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts
Open-ILS/src/eg2/src/app/staff/acq/search/invoice-results.component.html
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Invoice.pm

index 38040a2..45ea4e3 100644 (file)
@@ -56,7 +56,8 @@ const searchOptions = {
         flesh_editor: false
     },
     invoice: {
-        no_flesh_misc: true
+        no_flesh_misc: true,
+        flesh_provider: true // and shipper, which is also a provider
     }
 };
 
index fbccacb..2f85b98 100644 (file)
@@ -1,5 +1,32 @@
+<ng-template #inv_identTmpl let-invoice="row">
+  <a href="/eg/staff/acq/legacy/invoice/view/{{invoice.id()}}"
+     target="_blank">
+    {{invoice.inv_ident()}}
+  </a>
+</ng-template>
+<ng-template #providerTmpl let-invoice="row">
+  <a href="/eg/staff/admin/acq/conify/provider/{{invoice.provider().id()}}"
+     target="_blank">
+    {{invoice.provider().code()}}
+  </a>
+</ng-template>
+<ng-template #shipperTmpl let-invoice="row">
+  <a href="/eg/staff/admin/acq/conify/provider/{{invoice.shipper().id()}}"
+     target="_blank">
+    {{invoice.shipper().code()}}
+  </a>
+</ng-template>
+
 <eg-grid #acqSearchInvoicesGrid
   persistKey="acq.search.invoices"
   [stickyHeader]="true"
   idlClass="acqinv" [dataSource]="gridSource">
+
+  <eg-grid-column path="inv_ident" [cellTemplate]="inv_identTmpl"></eg-grid-column>
+  <eg-grid-column path="provider" [cellTemplate]="providerTmpl"></eg-grid-column>
+  <eg-grid-column path="shipper" [cellTemplate]="shipperTmpl"></eg-grid-column>
+
+  <eg-grid-column path="id" [hidden]="true"></eg-grid-column>
+  <eg-grid-column path="recv_date" [hidden]="true"></eg-grid-column>
+
 </eg-grid>
index 78765c6..653a664 100644 (file)
@@ -717,6 +717,13 @@ sub fetch_invoice_impl {
             }
         }
     ];
+    if ($options->{"flesh_provider"}) {
+        if ($options->{"no_flesh_misc"}) {
+            $args = [ $invoice_id, { "flesh" => 1, "flesh_fields" => { "acqinv" => [] } } ];
+        }
+        push @{ $args->[1]->{flesh_fields}->{acqinv} }, "provider";
+        push @{ $args->[1]->{flesh_fields}->{acqinv} }, "shipper";
+    }
 
     return $e->retrieve_acq_invoice($args);
 }