refining the Backorder report view
authorJulian Carlin <julianmcarlin@gmail.com>
Thu, 6 Jun 2013 21:27:54 +0000 (15:27 -0600)
committerJulian Carlin <julianmcarlin@gmail.com>
Thu, 6 Jun 2013 21:27:54 +0000 (15:27 -0600)
enyo-client/database/source/delete_system_orms.sql
enyo-client/database/source/update_version.sql
enyo-client/extensions/source/inventory/client/en/strings.js
enyo-client/extensions/source/inventory/client/views/list.js
enyo-client/extensions/source/inventory/database/orm/models/sales_order.json
lib/enyo-x/source/views/list.js

index b3816af..1891826 100644 (file)
@@ -32,8 +32,16 @@ DO $$
       plv8.execute('drop view if exists xm.' + viewname + ' cascade;');
     }
 
+    sql = "select viewname from pg_views where schemaname = 'sys';"
+    result = plv8.execute(sql);
+    for (i = 0; i < result.length; i++) {
+      viewname = result[i].viewname;
+      plv8.execute('drop view if exists sys.' + viewname + ' cascade;');
+    }
+
     plv8.execute("select xt.js_init()");
     plv8.execute("delete from xt.orm where orm_json ~ '\"isSystem\":true';");
   }
 
 $$ language plv8;
+
index 1035725..b773c9c 100644 (file)
@@ -1 +1 @@
-UPDATE pkghead SET pkghead_version = '1.3.4' WHERE pkghead_name = 'xt' ;
+UPDATE pkghead SET pkghead_version = '1.3.5' WHERE pkghead_name = 'xt' ;
index 1479386..5a84cc3 100644 (file)
@@ -12,5 +12,6 @@
 //
 
 var lang = XT.stringsFor("en_US", {
-  "_salesOrderLineListItem": "SO Line Items"
+  "_backlog": "Backlog",
+  "_inventory": "Inventory"
 });
index 6155068..8a56c92 100644 (file)
@@ -12,37 +12,39 @@ trailing:true white:true*/
   enyo.kind({
     name: "XV.SalesOrderLineListItem",
     kind: "XV.List",
-    label: "_salesOrderLineListItem".loc(),
+    label: "_backlog".loc(),
     collection: "XM.SalesOrderLineListItemCollection",
     query: {orderBy: [
-       {attribute: 'salesOrder.number'}
+       {attribute: 'salesOrder.number'},
+       {attribute: 'lineNumber', formatter: "lineNumber"}
       ]},
     components: [
       {kind: "XV.ListItem", components: [
        {kind: "FittableRows", components: [
-         {kind: "FittableColumns", name: "header", classes: "header, bold", headerAttr: "salesOrder.number", components: [
-           {kind: "XV.ListColumn", classes: "header, short", components: [               
-             {kind: "XV.ListAttr", attr: "salesOrder.number", isKey: true}
+         {kind: "FittableColumns", name: "header", classes: "header", headerAttr: "salesOrder.number", components: [
+           {kind: "XV.ListColumn", classes: "short", components: [               
+             {kind: "XV.ListAttr", attr: "salesOrder.number", isKey: true, classes: "header"}
            ]}, 
-           {kind: "XV.ListColumn", classes: "header, second, bold", components: [      
-             {kind: "XV.ListAttr", attr: "salesOrder.customer.name"}  
+           {kind: "XV.ListColumn", classes: "first", components: [     
+             {kind: "XV.ListAttr", attr: "salesOrder.customer.name", classes: "header"}  
            ]},
-           {kind: "XV.ListColumn", classes: "header, second, bold", components: [      
-             {kind: "XV.ListAttr", attr: "salesOrder.orderDate"}  
-           ]},         
-           {kind: "XV.ListColumn", classes: "header, second, bold", components: [      
-             {kind: "XV.ListAttr", attr: "salesOrder.scheduleDate"}
+           {kind: "XV.ListColumn", classes: "second", components: [    
+             {kind: "XV.ListAttr", attr: "salesOrder.shiptoName", classes: "header"}  
+           ]},
+           {kind: "XV.ListColumn", classes: "second", components: [    
+             {kind: "XV.ListAttr", attr: "salesOrder.scheduleDate", classes: "header"}
            ]},  
-           {kind: "XV.ListColumn", classes: "header, second, bold", components: [      
-             {kind: "XV.ListAttr", attr: "salesOrder.total"}
+           {kind: "XV.ListColumn", classes: "right", components: [     
+             {kind: "XV.ListAttr", attr: "salesOrder.total", formatter: "formatPrice", classes: "header"}
            ]}
          ]},
          {kind: "FittableColumns", components: [
            {kind: "XV.ListColumn", classes: "short", components: [
-             {kind: "XV.ListAttr", attr: "lineNumber"}
+             {kind: "XV.ListAttr", attr: "lineNumber",
+               formatter: "formatLineNumber"}
            ]},
            {kind: "XV.ListColumn", classes: "second", components: [
-             {kind: "XV.ListAttr", attr: "itemSite.item.number"},
+             {kind: "XV.ListAttr", attr: "itemSite.item.number", classes: "bold"},
              {kind: "XV.ListAttr", attr: "itemSite.item.description1"}
            ]},
            {kind: "XV.ListColumn", classes: "second", components: [
@@ -57,7 +59,7 @@ trailing:true white:true*/
              {kind: "XV.ListAttr", attr: "quantityShipped"}
            ]},
            {kind: "XV.ListColumn", classes: "second", components: [
-             {kind: "XV.ListAttr", attr: "shipBalance"}
+             {kind: "XV.ListAttr", attr: "shipBalance", classes: "bold"}
            ]},
            {kind: "XV.ListColumn", classes: "second", components: [
              {kind: "XV.ListAttr", attr: "price", formatter: "formatPrice"},
@@ -74,6 +76,16 @@ trailing:true white:true*/
       var currency = model ? model.getValue("salesOrder.currency") : false,
         scale = XT.session.locale.attributes.salesPriceScale;
       return currency ? currency.format(value, scale) : "";
+    },
+    formatLineNumber: function (value, view, model) {
+      var lineNumber = model.get("lineNumber"),
+        subnumber = model.get("subnumber");
+      if (subnumber == 0) {
+        value = lineNumber;
+      } else {
+        value = lineNumber + "." + subnumber;
+      }
+      return value; 
     }
   });
 
index c635284..a77f16d 100644 (file)
@@ -42,7 +42,7 @@
       {
         "name": "lineNumber",
         "attr": {
-          "type": "Number",
+          "type": "String",
           "column": "coitem_linenumber"
         }
       },
index 7c875b7..3cbf46b 100644 (file)
@@ -430,7 +430,10 @@ trailing:true white:true*/
         formatter,
         attr,
         classes;
-
+   
+     /** 
+       @todo cleanup the placement of the seperator lines of the list
+       */
       // Loop through all attribute container children and set content
       for (prop in this.$) {
         if (this.$.hasOwnProperty(prop)) {