Acq: Add a pane to show related invoices on provider interface
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 12 Apr 2010 17:26:37 +0000 (17:26 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 12 Apr 2010 17:26:37 +0000 (17:26 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16210 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/conify/global/acq/provider.js
Open-ILS/web/templates/default/conify/global/acq/provider.tt2

index 83662ab..c7ee818 100644 (file)
@@ -85,6 +85,13 @@ function drawProviderSummary(child) {
             phsListGrid.resetStore();
             phsListGrid.loadAll({order_by:{acqphsm : 'provider'}}, {provider : providerId});
             break;
+        case "tab-invoice":
+            invListGrid.resetStore();
+            invListGrid.loadAll(
+                {"order_by": {"acqinv": "provider"}},
+                {"provider": providerId}
+            );
+            break;
         default:
             paListGrid.overrideEditWidgets.provider = new
                 dijit.form.TextBox({disabled: 'true', value: providerId});
index b5892eb..176eadd 100644 (file)
@@ -29,6 +29,19 @@ function formatName(inDatum) {
     }
 }
 
+function getInvIdent(rowIndex, item) {
+    if (!item) return {};
+    return {
+        "id": this.grid.store.getValue(item, "id"),
+        "name": this.grid.store.getValue(item, "inv_ident")
+    };
+}
+
+function formatInvIdent(o) {
+    return "<a href='" + oilsBasePath + "/acq/invoice/view/" + o.id + "'>" +
+        o.name + "</a>";
+}
+
 function getProviderName(rowIndex, item) {
     if(!item) return '';
     var name = this.grid.store.getValue(item, 'name');
@@ -195,6 +208,24 @@ function formatName(value) {
             </table>
         </div>
     </div>
+
+    <div dojoType="dijit.layout.ContentPane" title="Invoices" id="tab-invoice">
+        <big class="oils-acq-basic-roomy"><strong>Invoices</strong></big>
+        <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style="height:400px">
+            <table jsId="invListGrid"
+                dojoType="openils.widget.AutoGrid"
+                fieldOrder="['inv_ident', 'receiver', 'shipper']"
+                suppressFields="['id', 'provider']"
+                query="{id: '*'}"
+                fmClass="acqinv">
+                <thead>
+                    <tr>
+                        <th field="inv_ident" get="getInvIdent" formatter="formatInvIdent" />
+                    <tr>
+                </thead>
+            </table>
+        </div>
+    </div>
 </div>
 </div>
 [% END %]