Added purchase order report
authorLinda Nichols <lynnaloo@gmail.com>
Tue, 20 May 2014 18:41:36 +0000 (18:41 +0000)
committerLinda Nichols <lynnaloo@gmail.com>
Tue, 20 May 2014 18:41:36 +0000 (18:41 +0000)
enyo-client/application/source/views/workspace.js
enyo-client/extensions/source/purchasing/client/views/list.js
enyo-client/extensions/source/purchasing/client/views/workspace.js
enyo-client/extensions/source/purchasing/database/source/manifest.js
enyo-client/extensions/source/purchasing/database/source/xt/tables/rptdef.sql [new file with mode: 0644]

index b288411..64c7a96 100644 (file)
@@ -2274,6 +2274,7 @@ strict: false*/
       onPaymentPosted: 'handlePaymentPosted',
     },
     model: "XM.SalesOrder",
+    printOnSaveSetting: "DefaultPrintPOOnSave",
     actions: [{
       name: "print",
       isViewMethod: true,
index 8b90cd5..a009283 100644 (file)
@@ -80,7 +80,6 @@ trailing:true, white:true, strict:false*/
     // ..........................................................
     // PURCHASE ORDER
     //
-
     enyo.kind({
       name: "XV.PurchaseOrderList",
       kind: "XV.List",
@@ -94,7 +93,11 @@ trailing:true, white:true, strict:false*/
           notify: false},
         {name: "unrelease", privilege: "ReleasePurchaseOrders",
           prerequisite: "canUnrelease",
-          method: "doUnrelease", notify: false}
+          method: "doUnrelease", notify: false},
+        {name: "print", privilege: "ViewPurchaseOrders",
+          method: "doPrint", isViewMethod: true},
+        {name: "email", privilege: "ViewPurchaseOrders",
+          method: "doEmail", isViewMethod: true}
       ],
       query: {orderBy: [
         {attribute: 'number'}
index da5c9db..d6c8ef1 100644 (file)
@@ -205,13 +205,25 @@ trailing:true, white:true, strict: false*/
     // ..........................................................
     // PURCHASE ORDER
     //
-
     enyo.kind({
       name: "XV.PurchaseOrderWorkspace",
       kind: "XV.Workspace",
       title: "_purchaseOrder".loc(),
       model: "XM.PurchaseOrder",
       printOnSaveSetting: "DefaultPrintPOOnSave",
+      actions: [{
+        name: "print",
+        isViewMethod: true,
+        label: "_print".loc(),
+        privilege: "ViewPurchaseOrders",
+        prerequisite: "isReadyClean"
+      },
+      {name: "email",
+        isViewMethod: true,
+        label: "_email".loc(),
+        privilege: "ViewPurchaseOrders",
+        prerequisite: "isReadyClean"
+      }],
       headerAttrs: ["number", "-", "vendor.name"],
       components: [
         {kind: "Panels", arrangerKind: "CarouselArranger",
index 3652e64..fa67c1f 100644 (file)
@@ -18,6 +18,7 @@
     "xt/tables/wftype.sql",
     "xt/tables/acttype.sql",
     "xt/tables/poheadext.sql",
+    "xt/tables/rptdef.sql",
     "xt/views/itemsrcmfg.sql",
     "xt/views/poheadinfo.sql",
     "xt/views/poiteminfo.sql",
diff --git a/enyo-client/extensions/source/purchasing/database/source/xt/tables/rptdef.sql b/enyo-client/extensions/source/purchasing/database/source/xt/tables/rptdef.sql
new file mode 100644 (file)
index 0000000..549dda1
--- /dev/null
@@ -0,0 +1,84 @@
+select xt.add_report_definition('XM.PurchaseOrder', 0, $${
+  "settings": {
+    "detailAttribute": "lineItems",
+    "defaultFontSize": 12,
+    "defaultMarginSize": 20
+  },
+  "headerElements": [
+    {
+      "definition": [
+        {"attr": "remitto.name"},
+        {"attr": "remitto.address"}
+      ],
+      "options": {"x": 0, "y": 40}
+    },
+    {
+      "element": "image",
+      "definition": "Logo",
+      "options": {"x": 200, "y": 40, "width": 150}
+    },
+    {
+      "definition": [{"text": "_purchaseOrder"}],
+      "options": {"fontBold": true, "fontSize": 18, "x": 450, "y": 40, "align": "right"}
+    },
+    {
+      "definition": [{"text": "_orderDate", "label": true}],
+      "options": {"fontBold": true, "x": 400, "y": 60}
+    },
+    {
+      "definition": [{"attr": "orderDate"}],
+      "options": {"x": 500, "y": 60, "align": "right"}
+    },
+    {
+      "definition": [{"text": "_orderNumber", "label": true}],
+      "options": {"fontBold": true, "x": 400, "y": 75}
+    },
+    {
+      "definition": [{"attr": "number"}],
+      "options": {"x": 500, "y": 75, "align": "right"}
+    },
+    {
+      "definition": [{"text": "_billto", "label": true}],
+      "options": {"x": 0, "y": 150, "fontBold": true}
+    },
+    {
+      "definition": [
+        {"attr": "billtoName"},
+        {"attr": "billtoAddress1"},
+        {"attr": "billtoAddress2"},
+        {"attr": "billtoAddress3"},
+        {"attr": "billtoCity"},
+        {"attr": "billtoState"},
+        {"attr": "billtoPostalCode"},
+        {"attr": "billtoCountry"},
+        {"attr": "billtoPhone"}
+      ],
+      "transform": "address",
+      "options": {"x": 120, "y": 150, "width": 250}
+    },
+    {"element": "fontBold"},
+    {
+      "element": "band",
+      "definition": [
+        {"text": "_quantity", "width": 100},
+        {"text": "_uom", "width": 50},
+        {"text": "_item", "width": 100},
+        {"text": "_currency", "width": 80},
+        {"text": "_unitPrice", "width": 100},
+        {"text": "_extendedPrice", "width": 100}
+      ],
+      "options": {"border": 0, "padding": 5, "x": 0, "y": 325}
+    },
+    {"element": "bandLine", "size": 2}
+  ],
+  "detailElements": [
+  ],
+  "footerElements": [
+  ],
+  "pageFooterElements": [
+    {
+      "element": "pageNumber", "definition": [],
+      "options": {"align": "center"}
+    }
+  ]
+}$$);