Merge pull request #1513 from shackbarth/readme
authorTravis Webb <travis@traviswebb.com>
Thu, 22 May 2014 08:12:24 +0000 (04:12 -0400)
committerTravis Webb <travis@traviswebb.com>
Thu, 22 May 2014 08:12:24 +0000 (04:12 -0400)
Dev-friendly readme

60 files changed:
enyo-client/application/source/views/workspace.js
enyo-client/database/orm/models/contact.json
enyo-client/database/orm/models/invoice.json
enyo-client/database/orm/models/sales_order.json
enyo-client/database/source/manifest.js
enyo-client/database/source/public/tables/invchead.sql [new file with mode: 0644]
enyo-client/database/source/public/tables/shiphead.sql [new file with mode: 0644]
enyo-client/database/source/xt/views/invcheadinfo.sql
enyo-client/extensions/source/billing/database/source/manifest.js
enyo-client/extensions/source/billing/database/source/xt/tables/sharetype.sql [new file with mode: 0644]
enyo-client/extensions/source/billing/database/source/xt/views/share_users_invchead.sql [new file with mode: 0644]
enyo-client/extensions/source/purchasing/client/models/purchase_order.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/orm/models/purchase_order.json
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]
enyo-client/extensions/source/sales/database/source/xt/tables/rptdef.sql
foundation-database/manifest.js
foundation-database/public/functions/calcinvoiceamt.sql
foundation-database/public/functions/calcquoteamt.sql
foundation-database/public/functions/calcsalesorderamt.sql
foundation-database/public/functions/postbankreconciliation.sql
foundation-database/public/functions/postcreditmemo.sql
foundation-database/public/functions/reopenbankreconciliation.sql
foundation-database/public/functions/togglebankreccleared.sql
foundation-database/public/indexes/apopentax.sql [new file with mode: 0644]
foundation-database/public/indexes/aropentax.sql [new file with mode: 0644]
foundation-database/public/indexes/asohisttax.sql [new file with mode: 0644]
foundation-database/public/indexes/cmheadtax.sql [new file with mode: 0644]
foundation-database/public/indexes/cmitemtax.sql [new file with mode: 0644]
foundation-database/public/indexes/cobilltax.sql [new file with mode: 0644]
foundation-database/public/indexes/cobmisctax.sql [new file with mode: 0644]
foundation-database/public/indexes/cohisttax.sql [new file with mode: 0644]
foundation-database/public/indexes/invchead.sql [new file with mode: 0644]
foundation-database/public/indexes/invcheadtax.sql [new file with mode: 0644]
foundation-database/public/indexes/invcitemtax.sql
foundation-database/public/indexes/taxhist.sql [new file with mode: 0644]
foundation-database/public/indexes/voheadtax.sql [new file with mode: 0644]
foundation-database/public/indexes/voitemtax.sql [new file with mode: 0644]
foundation-database/public/tables/bankrecitem.sql [new file with mode: 0644]
foundation-database/public/tables/cashrcpt.sql [new file with mode: 0644]
foundation-database/public/tables/metasql/bankrec-checks.mql
foundation-database/public/tables/metasql/bankrec-receipts.mql
foundation-database/public/tables/metasql/taxHistory-detail.mql
foundation-database/public/tables/metasql/voucherItem-receipts.mql
foundation-database/public/tables/metric.sql
foundation-database/public/tables/priv.sql [new file with mode: 0644]
foundation-database/public/tables/tax.sql [new file with mode: 0644]
foundation-database/public/tables/taxpay.sql [new file with mode: 0644]
foundation-database/public/trigger_functions/accnt.sql
lib/enyo-x/source/less/dashboard.less
lib/enyo-x/source/stylesheets/screen.css
node-datasource/routes/generate_report.js
scripts/xml/distribution_install.xml
scripts/xml/distribution_package.xml
scripts/xml/postbooks_package.xml
scripts/xml/xtmfg_install.xml
scripts/xml/xtmfg_package.xml
test/specs/invoice.js

index b288411..64c7a96 100644 (file)
@@ -2274,6 +2274,7 @@ strict: false*/
       onPaymentPosted: 'handlePaymentPosted',
     },
     model: "XM.SalesOrder",
+    printOnSaveSetting: "DefaultPrintPOOnSave",
     actions: [{
       name: "print",
       isViewMethod: true,
index f21aefd..af0ad54 100644 (file)
           "column": "cntct_name"
         }
       },
+      {
+        "name": "honorific",
+        "attr": {
+          "type": "String",
+          "column": "cntct_honorific"
+        }
+      },
       {
         "name": "firstName",
         "attr": {
           "column": "cntct_first_name"
         }
       },
+      {
+        "name": "middleName",
+        "attr": {
+          "type": "String",
+          "column": "cntct_middle"
+        }
+      },
       {
         "name": "lastName",
         "attr": {
           "column": "cntct_last_name"
         }
       },
+      {
+        "name": "suffix",
+        "attr": {
+          "type": "String",
+          "column": "cntct_suffix"
+        }
+      },
       {
         "name": "jobTitle",
         "attr": {
index 4c7d750..f228263 100644 (file)
         "isVoid": {
           "update": false
         }
+      },
+      "personal": {
+        "create": false,
+        "read": "ViewPersonalCRMAccounts",
+        "update": false,
+        "delete": false,
+        "properties": [
+          "crmaccountUsers"
+        ]
       }
     },
     "properties": [
           "column": "invchead_id",
           "inverse": "source"
         }
+      },
+      {
+        "name": "crmaccountUsers",
+        "toMany": {
+          "type": "ShareUsers",
+          "column": "obj_uuid",
+          "inverse": "uuid"
+        }
       }
     ],
     "isSystem": true
         "read": "MaintainMiscInvoices ViewMiscInvoices",
         "update": false,
         "delete": false
+      },
+      "personal": {
+        "create": false,
+        "read": "ViewPersonalCRMAccounts",
+        "update": false,
+        "delete": false,
+        "properties": [
+          "crmaccountUsers"
+        ]
       }
     },
     "properties": [
           "isNested": true,
           "required": true
         }
+      },
+      {
+        "name": "crmaccountUsers",
+        "toMany": {
+          "type": "ShareUsers",
+          "column": "obj_uuid",
+          "inverse": "uuid"
+        }
       }
     ],
     "isSystem": true
index 466223c..76ddd4e 100644 (file)
         "total": {
           "view": "MaintainSalesOrders ViewSalesOrders"
         }
+      },
+      "personal": {
+        "create": false,
+        "read": "ViewPersonalCRMAccounts",
+        "update": false,
+        "delete": false,
+        "properties": [
+          "crmaccountUsers"
+        ]
       }
     },
     "properties": [
           "type": "String",
           "column": "cohead_shiptocountry"
         }
+      },
+      {
+        "name": "crmaccountUsers",
+        "toMany": {
+          "type": "ShareUsers",
+          "column": "obj_uuid",
+          "inverse": "uuid"
+        }
       }
     ],
     "isSystem": true
index 7c4f568..67e8c94 100644 (file)
@@ -34,6 +34,7 @@
     "public/tables/docass.sql",
     "public/tables/grppriv.sql",
     "public/tables/incdt.sql",
+    "public/tables/invchead.sql",
     "public/tables/invcitem.sql",
     "public/tables/invcitemtax.sql",
     "public/tables/itemsite.sql",
@@ -45,6 +46,7 @@
     "public/tables/prj.sql",
     "public/tables/prjtask.sql",
     "public/tables/quitem.sql",
+    "public/tables/shiphead.sql",
     "public/tables/shiptoinfo.sql",
     "public/tables/todoitem.sql",
     "public/tables/usrpref.sql",
diff --git a/enyo-client/database/source/public/tables/invchead.sql b/enyo-client/database/source/public/tables/invchead.sql
new file mode 100644 (file)
index 0000000..749bb47
--- /dev/null
@@ -0,0 +1,4 @@
+-- add uuid column here because there are views that need this
+select xt.add_column('invchead','obj_uuid', 'uuid', 'default xt.uuid_generate_v4()', 'public');
+select xt.add_inheritance('invchead', 'xt.obj');
+select xt.add_constraint('invchead', 'invchead_obj_uuid','unique(obj_uuid)', 'public');
diff --git a/enyo-client/database/source/public/tables/shiphead.sql b/enyo-client/database/source/public/tables/shiphead.sql
new file mode 100644 (file)
index 0000000..4cd93c6
--- /dev/null
@@ -0,0 +1,4 @@
+-- add uuid column here because there are views that need this
+select xt.add_column('shiphead','obj_uuid', 'uuid', 'default xt.uuid_generate_v4()', 'public');
+select xt.add_inheritance('shiphead', 'xt.obj');
+select xt.add_constraint('shiphead', 'shiphead_obj_uuid','unique(obj_uuid)', 'public');
index 07efb4e..d762d6c 100644 (file)
@@ -131,7 +131,18 @@ insert into invchead (
   new.invchead_void,
   new.invchead_saletype_id,
   new.invchead_shipzone_id
-);
+)
+
+returning invchead.*,
+  null::numeric,
+  null::numeric,
+  null::numeric,
+  null::numeric,
+  null::numeric,
+  null::numeric,
+  null::numeric,
+  null::date,
+  null::date;
 
 create or replace rule "_UPDATE" as on update to xt.invcheadinfo do instead
 
index fce729d..7fea1c8 100644 (file)
@@ -16,6 +16,8 @@
     "xt/views/receivable_invoice_return.sql",
     "xt/views/aropeninfo.sql",
     "xt/views/receivable_applications.sql",
-    "xt/views/cashrcpt.sql"
+    "xt/views/share_users_invchead.sql",
+    "xt/views/cashrcpt.sql",
+    "xt/tables/sharetype.sql"
   ]
 }
diff --git a/enyo-client/extensions/source/billing/database/source/xt/tables/sharetype.sql b/enyo-client/extensions/source/billing/database/source/xt/tables/sharetype.sql
new file mode 100644 (file)
index 0000000..fc4059b
--- /dev/null
@@ -0,0 +1,13 @@
+-- Invoice CRM Account's users.
+delete from xt.sharetype where sharetype_tblname = 'share_users_invchead';
+insert into xt.sharetype (
+  sharetype_nsname,
+  sharetype_tblname,
+  sharetype_col_obj_uuid,
+  sharetype_col_username
+) values (
+  'xt',
+  'share_users_invchead',
+  'obj_uuid',
+  'username'
+);
diff --git a/enyo-client/extensions/source/billing/database/source/xt/views/share_users_invchead.sql b/enyo-client/extensions/source/billing/database/source/xt/views/share_users_invchead.sql
new file mode 100644 (file)
index 0000000..f21c0de
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * This view lists all postgres usernames that are associated with a CRM
+ * Account that owns a resource. That associaiton is either the main user
+ * account, owner's user account, customer's sale rep's user account or
+ * a shared access that has been specifically granted.
+ *
+ * This view can be used to determine which users have personal privilege
+ * access to an Invoice based on what CRM Account it belongs to.
+ */
+
+select xt.create_view('xt.share_users_invchead', $$
+
+  -- Invoice CRM Account's users.
+  SELECT
+    invchead_cust_crmacct_ids.obj_uuid::uuid AS obj_uuid,
+    username::text AS username
+  FROM (
+    SELECT
+      invchead.obj_uuid,
+      crmacct_id
+    FROM invchead
+    LEFT JOIN custinfo ON invchead_cust_id = cust_id
+    LEFT JOIN crmacct ON cust_id = crmacct_cust_id
+  ) invchead_cust_crmacct_ids
+  LEFT JOIN xt.crmacct_users USING (crmacct_id)
+  WHERE 1=1
+    AND username IS NOT NULL;
+
+$$, false);
index f75edb3..2817536 100644 (file)
@@ -321,7 +321,7 @@ white:true*/
             shiptoContactHonorific: "",
             shiptoContactFirstName: "",
             shiptoContactLastName: "",
-            shiptoContactMiddle: "",
+            shiptoContactMiddleName: "",
             shiptoContactSuffix: "",
             shiptoContactTitle: "",
             shiptoContactPhone: "",
@@ -345,7 +345,7 @@ white:true*/
           attrs.shiptoContactHonorific = contact.get("honorific");
           attrs.shiptoContactFirstName = contact.get("firstName");
           attrs.shiptoContactLastName = contact.get("lastName");
-          attrs.shiptoContactMiddle = contact.get("middle");
+          attrs.shiptoContactMiddleName = contact.get("middleName");
           attrs.shiptoContactSuffix = contact.get("suffix");
           attrs.shiptoContactTitle = contact.get("title");
           attrs.shiptoContactPhone = contact.get("phone");
@@ -446,7 +446,7 @@ white:true*/
             vendorContactHonorific: "",
             vendorContactFirstName: "",
             vendorContactLastName: "",
-            vendorContactMiddle: "",
+            vendorContactMiddleName: "",
             vendorContactSuffix: "",
             vendorContactTitle: "",
             vendorContactPhone: "",
@@ -469,7 +469,7 @@ white:true*/
           attrs.vendorContactHonorific = contact.get("honorific");
           attrs.vendorContactFirstName = contact.get("firstName");
           attrs.vendorContactLastName = contact.get("lastName");
-          attrs.vendorContactMiddle = contact.get("middle");
+          attrs.vendorContactMiddleName = contact.get("middleName");
           attrs.vendorContactSuffix = contact.get("suffix");
           attrs.vendorContactTitle = contact.get("title");
           attrs.vendorContactPhone = contact.get("phone");
@@ -1293,4 +1293,3 @@ white: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 ee437f5..5efa964 100644 (file)
         }
       },
       {
-        "name": "vendorContactSuffic",
+        "name": "vendorContactSuffix",
         "attr": {
           "type": "String",
           "column": "pohead_vend_cntct_suffix"
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..428a244
--- /dev/null
@@ -0,0 +1,170 @@
+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": "_orderDate", "label": true}],
+      "options": {"fontBold": true, "x": 400, "y": 60}
+    },
+    {
+      "definition": [{"text": "_purchaseOrder"}],
+      "options": {"fontBold": true, "fontSize": 18, "x": 450, "y": 40, "align": "right"}
+    },
+    {
+      "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": "_to", "label": true}],
+      "options": {"x": 50, "y": 140, "fontBold": true}
+    },
+    {
+      "definition": [
+        {"attr": "vendorContactFirstName"},
+        {"attr": "vendorContactLastName"},
+        {"attr": "vendorContactHonorific"}
+      ],
+      "transform": "fullname",
+      "options": {"x": 50, "y": 160, "width": 250}
+    },
+    {
+      "definition": [
+        {"attr": "vendorContact"},
+        {"attr": "vendorAddress1"},
+        {"attr": "vendorAddress2"},
+        {"attr": "vendorAddress3"},
+        {"attr": "vendorCity"},
+        {"attr": "vendorState"},
+        {"attr": "vendorPostalCode"},
+        {"attr": "vendorCountry"},
+        {"attr": "vendorPhone"}
+      ],
+      "transform": "address",
+      "options": {"x": 50, "y": 170, "width": 250}
+    },
+    {
+      "definition": [{"text": "_shipTo", "label": true}],
+      "options": {"x": 350, "y": 140, "fontBold": true}
+    },
+    {
+      "definition": [
+        {"attr": "shiptoContactFirstName"},
+        {"attr": "shiptoContactLastName"},
+        {"attr": "shiptoContactHonorific"}
+      ],
+      "transform": "fullname",
+      "options": {"x": 350, "y": 160, "width": 250}
+    },
+    {
+      "definition": [
+        {"attr": "shiptoName"},
+        {"attr": "shiptoAddress1"},
+        {"attr": "shiptoAddress2"},
+        {"attr": "shiptoAddress3"},
+        {"attr": "shiptoCity"},
+        {"attr": "shiptoState"},
+        {"attr": "shiptoPostalCode"},
+        {"attr": "shiptoCountry"},
+        {"attr": "shiptoPhone"}
+      ],
+      "transform": "address",
+      "options": {"x": 350, "y": 170, "width": 250}
+    },
+    {
+      "definition": [{"text": "_fob", "label": true}],
+      "options": {"fontBold": true, "x": 50, "y": 230}
+    },
+    {
+      "definition": [{"attr": "fob"}],
+      "options": {"x": 50, "y": 245}
+    },
+    {
+      "definition": [{"text": "_shipVia", "label": true}],
+      "options": {"fontBold": true, "x": 175, "y": 230}
+    },
+    {
+      "definition": [{"attr": "shipVia"}],
+      "options": {"x": 175, "y": 245}
+    },
+    {
+      "definition": [{"text": "_terms", "label": true}],
+      "options": {"fontBold": true, "x": 300, "y": 230}
+    },
+    {
+      "definition": [{"attr": "terms.description"}],
+      "options": {"x": 300, "y": 245}
+    },
+    {"element": "fontBold"},
+    {
+      "element": "band",
+      "definition": [
+        {"text": "_item", "width": 90},
+        {"text": "_vendorItem", "width": 100},
+        {"text": "_description", "width": 100},
+        {"text": "_ordered", "width": 60},
+        {"text": "_uom", "width": 45},
+        {"text": "_unitPrice", "width": 90},
+        {"text": "_extendedPrice", "width": 100}
+      ],
+      "options": {"border": 0, "padding": 5, "x": 0, "y": 300}
+    },
+    {"element": "bandLine", "size": 2}
+  ],
+  "detailElements": [
+    {"element": "fontNormal"},
+    {
+      "element": "band",
+      "definition": [
+        {"attr": "lineItems*vendorItemNumber", "width": 90},
+        {"attr": "lineItems*item.number", "width": 100},
+        {"attr": "lineItems*item.description1", "width": 100},
+        {"attr": "lineItems*quantity", "width": 60},
+        {"attr": "lineItems*vendorUnit", "width": 45},
+        {"attr": "lineItems*price", "width": 90},
+        {"attr": "lineItems*extendedPrice", "width": 100}
+      ],
+      "options": {"fontBold": true, "border": 0, "padding": 14}
+    }
+  ],
+  "footerElements": [
+    {"element": "bandLine", "size": 2},
+    {
+      "definition": [
+        {"attr": "subtotal", "label": true},
+        {"attr": "freight", "label": true},
+        {"attr": "taxTotal", "label": true},
+        {"attr": "total", "label": true}
+      ],
+      "options": {"fontBold": true, "fontSize": 14, "width": 550, "align": "right"}
+    }
+  ],
+  "pageFooterElements": [
+    {
+      "element": "pageNumber", "definition": [],
+      "options": {"align": "center"}
+    }
+  ]
+}$$);
index dfcbd8a..ffa6b61 100644 (file)
@@ -116,7 +116,7 @@ select xt.add_report_definition('XM.SalesOrder', 0, $${
       "options": {"fontBold": true, "x": 500, "y": 230}
     },
     {
-      "definition": [{"attr": ""}],
+      "definition": [{"attr": "fob"}],
       "options": {"x": 500, "y": 245}
     },
     {
index 6f57b01..20cdb9e 100644 (file)
     "../lib/orm/source/xt/functions/add_primary_key.sql",
     "../lib/orm/source/xt/functions/create_table.sql",
 
+    "public/indexes/apopentax.sql",
+    "public/indexes/aropentax.sql",
+    "public/indexes/asohisttax.sql",
+    "public/indexes/cmheadtax.sql",
+    "public/indexes/cmitemtax.sql",
+    "public/indexes/cobilltax.sql",
+    "public/indexes/cobmisctax.sql",
+    "public/indexes/cohisttax.sql",
     "public/indexes/evntlog.sql",
+    "public/indexes/invchead.sql",
+    "public/indexes/invcheadtax.sql",
     "public/indexes/invcitemtax.sql",
     "public/indexes/shipitem.sql",
+    "public/indexes/taxhist.sql",
+    "public/indexes/voheadtax.sql",
+    "public/indexes/voitemtax.sql",
 
     "public/types/achline.sql",
     "public/types/apaging.sql",
     "public/trigger_functions/wo.sql",
     "public/trigger_functions/womatl.sql",
 
+    "public/tables/bankrecitem.sql",
+    "public/tables/cashrcpt.sql",
     "public/tables/metric.sql",
+    "public/tables/priv.sql",
+    "public/tables/tax.sql",
+    "public/tables/taxpay.sql",
+
     "public/tables/location.sql",
     "public/views/address.sql",
     "public/views/apmemo.sql",
index 55d07b5..fb79c3f 100644 (file)
@@ -37,8 +37,11 @@ BEGIN
   WHERE (invcitem_invchead_id=pInvcheadid);
 
   IF (pType IN ('T', 'X')) THEN
-    SELECT COALESCE(ROUND(SUM(taxdetail_tax), 2), 0.0) INTO _tax
-    FROM calculateTaxDetailSummary('I', pInvcheadid, 'T');
+    SELECT SUM(tax) INTO _tax
+    FROM (SELECT COALESCE(ROUND(SUM(taxdetail_tax), 2), 0.0) AS tax
+          FROM tax
+               JOIN calculateTaxDetailSummary('I', pInvcheadid, 'T')ON (taxdetail_tax_id=tax_id)
+          GROUP BY tax_id) AS data;
   END IF;
 
   IF (pType = 'T') THEN
index 0d5783f..6b711d3 100644 (file)
@@ -36,8 +36,11 @@ BEGIN
   WHERE (quitem_quhead_id=pQuheadid);
 
   IF (pType IN ('T', 'X')) THEN
-    SELECT COALESCE(ROUND(SUM(taxdetail_tax), 2), 0.0) INTO _tax
-    FROM calculateTaxDetailSummary('Q', pQuheadid, 'T');
+    SELECT SUM(tax) INTO _tax
+    FROM (SELECT COALESCE(ROUND(SUM(taxdetail_tax), 2), 0.0) AS tax
+          FROM tax
+               JOIN calculateTaxDetailSummary('Q', pQuheadid, 'T')ON (taxdetail_tax_id=tax_id)
+          GROUP BY tax_id) AS data;
   END IF;
 
   IF (pType = 'T') THEN
index 5e792f3..3c6d188 100644 (file)
@@ -40,8 +40,11 @@ BEGIN
     AND (coitem_status != 'X');
 
   IF (pType IN ('T', 'B', 'X')) THEN
-    SELECT COALESCE(ROUND(SUM(taxdetail_tax), 2), 0.0) INTO _tax
-    FROM calculateTaxDetailSummary('S', pCoheadid, 'T');
+    SELECT SUM(tax) INTO _tax
+    FROM (SELECT COALESCE(ROUND(SUM(taxdetail_tax), 2), 0.0) AS tax
+          FROM tax
+               JOIN calculateTaxDetailSummary('S', pCoheadid, 'T')ON (taxdetail_tax_id=tax_id)
+          GROUP BY tax_id) AS data;
   END IF;
 
   IF (pType IN ('T', 'B', 'C')) THEN
index da8025a..31856f0 100644 (file)
@@ -7,7 +7,9 @@ DECLARE
   _accntid INTEGER;
   _sequence INTEGER;
   _gltransid INTEGER;
+  _result INTEGER;
   _r RECORD;
+  _tax RECORD;
 
 BEGIN
 
@@ -56,6 +58,242 @@ BEGIN
 
   END LOOP;
 
+  IF (fetchMetricBool('CashBasedTax')) THEN
+    -- Cash based tax distributions
+    -- GL Transactions
+    SELECT fetchGLSequence() INTO _sequence;
+    FOR _r IN SELECT *
+              FROM bankrecitem
+             WHERE ( (bankrecitem_cleared)
+               AND   (bankrecitem_bankrec_id=pBankrecid) ) LOOP
+      -- first, debit the tax liability clearing account
+      -- and credit the tax liability distribution account
+      -- for each tax code
+      FOR _tax IN SELECT docnumber, custname, distdate, source, doctype,
+                         tax_sales_accnt_id, tax_dist_accnt_id,
+                         ROUND(currToBase(currid, ROUND(SUM(taxhist_tax),2), taxhist_docdate) * percentpaid, 2) AS taxbasevalue
+                  FROM (
+                        -- Cash receipt, gltrans
+                        SELECT aropen_docnumber AS docnumber, cust_name AS custname,
+                               aropen_curr_id AS currid, gltrans_date AS distdate,
+                               (cashrcptitem_amount / aropen_amount) AS percentpaid,
+                               gltrans_source AS source, gltrans_doctype AS doctype,
+                               tax_sales_accnt_id, tax_dist_accnt_id,
+                               taxhist_tax, taxhist_docdate
+                        FROM gltrans JOIN cashrcpt  ON ((gltrans_source='A/R')
+                                                    AND (gltrans_doctype='CR')
+                                                    AND (gltrans_misc_id=cashrcpt_id))
+                                     JOIN cashrcptitem ON (cashrcptitem_cashrcpt_id=cashrcpt_id)
+                                     JOIN aropen ON (aropen_id=cashrcptitem_aropen_id)
+                                     JOIN custinfo ON (cust_id=aropen_cust_id)
+                                     JOIN cohist ON (cohist_invcnumber=aropen_docnumber AND cohist_doctype=aropen_doctype)
+                                     JOIN cohisttax ON (taxhist_parent_id=cohist_id)
+                                     JOIN tax ON (tax_id=taxhist_tax_id)
+                        WHERE (gltrans_id=_r.bankrecitem_source_id)
+                        -- Cash receipt, sltrans
+                        UNION
+                        SELECT aropen_docnumber AS docnumber, cust_name AS custname,
+                               aropen_curr_id AS currid, sltrans_date AS distdate,
+                               (cashrcptitem_amount / aropen_amount) AS percentpaid,
+                               sltrans_source AS source, sltrans_doctype AS doctype,
+                               tax_sales_accnt_id, tax_dist_accnt_id,
+                               taxhist_tax, taxhist_docdate
+                        FROM sltrans JOIN cashrcpt  ON ((sltrans_source='A/R')
+                                                    AND (sltrans_doctype='CR')
+                                                    AND (sltrans_misc_id=cashrcpt_id))
+                                     JOIN cashrcptitem ON (cashrcptitem_cashrcpt_id=cashrcpt_id)
+                                     JOIN aropen ON (aropen_id=cashrcptitem_aropen_id)
+                                     JOIN custinfo ON (cust_id=aropen_cust_id)
+                                     JOIN cohist ON (cohist_invcnumber=aropen_docnumber AND cohist_doctype=aropen_doctype)
+                                     JOIN cohisttax ON (taxhist_parent_id=cohist_id)
+                                     JOIN tax ON (tax_id=taxhist_tax_id)
+                        WHERE (sltrans_id=_r.bankrecitem_source_id)
+                        -- Cash payment, gltrans
+                        UNION
+                        SELECT apopen_docnumber AS docnumber, vend_name AS vendname,
+                               apopen_curr_id AS currid, gltrans_date AS distdate,
+                               (vohead_amount / apopen_amount) AS percentpaid,
+                               gltrans_source AS source, gltrans_doctype AS doctype,
+                               tax_sales_accnt_id, tax_dist_accnt_id,
+                               taxhist_tax, taxhist_docdate
+                        FROM gltrans JOIN checkhead ON ((gltrans_source='A/P')
+                                                    AND (gltrans_doctype='CK')
+                                                    AND (gltrans_misc_id=checkhead_id))
+                                     JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                     JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                     JOIN vohead ON (vohead_number=apopen_docnumber)
+                                     JOIN vendinfo ON (vend_id=apopen_vend_id)
+                                     JOIN voheadtax ON (taxhist_parent_id=vohead_id)
+                                     JOIN tax ON (tax_id=taxhist_tax_id)
+                        WHERE (gltrans_id=_r.bankrecitem_source_id)
+                        UNION
+                        SELECT apopen_docnumber AS docnumber, vend_name AS vendname,
+                               apopen_curr_id AS currid, gltrans_date AS distdate,
+                               (vohead_amount / apopen_amount) AS percentpaid,
+                               gltrans_source AS source, gltrans_doctype AS doctype,
+                               tax_sales_accnt_id, tax_dist_accnt_id,
+                               taxhist_tax, taxhist_docdate
+                        FROM gltrans JOIN checkhead ON ((gltrans_source='A/P')
+                                                    AND (gltrans_doctype='CK')
+                                                    AND (gltrans_misc_id=checkhead_id))
+                                     JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                     JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                     JOIN vohead ON (vohead_number=apopen_docnumber)
+                                     JOIN vendinfo ON (vend_id=apopen_vend_id)
+                                     JOIN voitem ON (voitem_vohead_id=vohead_id)
+                                     JOIN voitemtax ON (taxhist_parent_id=voitem_id)
+                                     JOIN tax ON (tax_id=taxhist_tax_id)
+                        WHERE (gltrans_id=_r.bankrecitem_source_id)
+                        -- Cash payment, sltrans
+                        UNION
+                        SELECT apopen_docnumber AS docnumber, vend_name AS vendname,
+                               apopen_curr_id AS currid, sltrans_date AS distdate,
+                               (vohead_amount / apopen_amount) AS percentpaid,
+                               sltrans_source AS source, sltrans_doctype AS doctype,
+                               tax_sales_accnt_id, tax_dist_accnt_id,
+                               taxhist_tax, taxhist_docdate
+                        FROM sltrans JOIN checkhead ON ((sltrans_source='A/P')
+                                                    AND (sltrans_doctype='CK')
+                                                    AND (sltrans_misc_id=checkhead_id))
+                                     JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                     JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                     JOIN vohead ON (vohead_number=apopen_docnumber)
+                                     JOIN vendinfo ON (vend_id=apopen_vend_id)
+                                     JOIN voheadtax ON (taxhist_parent_id=vohead_id)
+                                     JOIN tax ON (tax_id=taxhist_tax_id)
+                        WHERE (sltrans_id=_r.bankrecitem_source_id)
+                        UNION
+                        SELECT apopen_docnumber AS docnumber, vend_name AS vendname,
+                               apopen_curr_id AS currid, sltrans_date AS distdate,
+                               (vohead_amount / apopen_amount) AS percentpaid,
+                               sltrans_source AS source, sltrans_doctype AS doctype,
+                               tax_sales_accnt_id, tax_dist_accnt_id,
+                               taxhist_tax, taxhist_docdate
+                        FROM sltrans JOIN checkhead ON ((sltrans_source='A/P')
+                                                    AND (sltrans_doctype='CK')
+                                                    AND (sltrans_misc_id=checkhead_id))
+                                     JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                     JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                     JOIN vohead ON (vohead_number=apopen_docnumber)
+                                     JOIN vendinfo ON (vend_id=apopen_vend_id)
+                                     JOIN voitem ON (voitem_vohead_id=vohead_id)
+                                     JOIN voitemtax ON (taxhist_parent_id=voitem_id)
+                                     JOIN tax ON (tax_id=taxhist_tax_id)
+                        WHERE (sltrans_id=_r.bankrecitem_source_id)
+                       ) AS data
+                  GROUP BY docnumber, custname, currid, distdate, percentpaid,
+                           source, doctype,
+                           tax_sales_accnt_id, tax_dist_accnt_id, taxhist_docdate
+      LOOP
+        SELECT insertIntoGLSeries( _sequence, _tax.source, _tax.doctype, _tax.docnumber,
+                                   _tax.tax_dist_accnt_id, 
+                                   _tax.taxbasevalue,
+                                   COALESCE(_r.bankrecitem_effdate, _tax.distdate), _tax.custname ) INTO _result;
+        IF (_result < 0) THEN
+          RAISE EXCEPTION 'insertIntoGLSeries failed, result=%', _result;
+        END IF;
+        SELECT insertIntoGLSeries( _sequence, _tax.source, _tax.doctype, _tax.docnumber,
+                                   _tax.tax_sales_accnt_id, 
+                                   (_tax.taxbasevalue * -1.0),
+                                   COALESCE(_r.bankrecitem_effdate, _tax.distdate), _tax.custname ) INTO _result;
+        IF (_result < 0) THEN
+          RAISE EXCEPTION 'insertIntoGLSeries failed, result=%', _result;
+        END IF;
+      END LOOP;
+
+      -- second, create a taxpay row for each taxhist
+      FOR _tax IN SELECT taxhist_id, applyid, distdate,
+                         ROUND(taxhist_tax * percentpaid, 2) AS taxpaid
+                  FROM (
+                        -- Cash receipt, gltrans
+                        SELECT taxhist_id, aropen_id AS applyid, gltrans_date AS distdate, taxhist_tax,
+                               (cashrcptitem_amount / aropen_amount) AS percentpaid
+                          FROM gltrans JOIN cashrcpt  ON ((gltrans_source='A/R')
+                                                      AND (gltrans_doctype='CR')
+                                                      AND (gltrans_misc_id=cashrcpt_id))
+                                       JOIN cashrcptitem ON (cashrcptitem_cashrcpt_id=cashrcpt_id)
+                                       JOIN aropen ON (aropen_id=cashrcptitem_aropen_id)
+                                       JOIN cohist ON (cohist_invcnumber=aropen_docnumber AND cohist_doctype=aropen_doctype)
+                                       JOIN cohisttax ON (taxhist_parent_id=cohist_id)
+                          WHERE (gltrans_id=_r.bankrecitem_source_id)
+                        -- Cash receipt, sltrans
+                        UNION
+                        SELECT taxhist_id, aropen_id AS applyid, sltrans_date AS distdate, taxhist_tax,
+                               (cashrcptitem_amount / aropen_amount) AS percentpaid
+                          FROM sltrans JOIN cashrcpt  ON ((sltrans_source='A/R')
+                                                      AND (sltrans_doctype='CR')
+                                                      AND (sltrans_misc_id=cashrcpt_id))
+                                       JOIN cashrcptitem ON (cashrcptitem_cashrcpt_id=cashrcpt_id)
+                                       JOIN aropen ON (aropen_id=cashrcptitem_aropen_id)
+                                       JOIN cohist ON (cohist_invcnumber=aropen_docnumber AND cohist_doctype=aropen_doctype)
+                                       JOIN cohisttax ON (taxhist_parent_id=cohist_id)
+                          WHERE (sltrans_id=_r.bankrecitem_source_id)
+                        -- Cash payment, gltrans
+                        UNION
+                        SELECT taxhist_id, apopen_id AS applyid, gltrans_date AS distdate, taxhist_tax,
+                               (checkitem_amount / apopen_amount) AS percentpaid
+                          FROM gltrans JOIN checkhead  ON ((gltrans_source='A/P')
+                                                       AND (gltrans_doctype='CK')
+                                                       AND (gltrans_misc_id=checkhead_id))
+                                       JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                       JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                       JOIN vohead ON (vohead_number=apopen_docnumber)
+                                       JOIN voheadtax ON (taxhist_parent_id=vohead_id)
+                          WHERE (gltrans_id=_r.bankrecitem_source_id)
+                        UNION
+                        SELECT taxhist_id, apopen_id AS applyid, gltrans_date AS distdate, taxhist_tax,
+                               (checkitem_amount / apopen_amount) AS percentpaid
+                          FROM gltrans JOIN checkhead  ON ((gltrans_source='A/P')
+                                                       AND (gltrans_doctype='CK')
+                                                       AND (gltrans_misc_id=checkhead_id))
+                                       JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                       JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                       JOIN vohead ON (vohead_number=apopen_docnumber)
+                                       JOIN voitem ON (voitem_vohead_id=vohead_id)
+                                       JOIN voitemtax ON (taxhist_parent_id=voitem_id)
+                          WHERE (gltrans_id=_r.bankrecitem_source_id)
+                        -- Cash payment, sltrans
+                        UNION
+                        SELECT taxhist_id, apopen_id AS applyid, sltrans_date AS distdate, taxhist_tax,
+                               (checkitem_amount / apopen_amount) AS percentpaid
+                          FROM sltrans JOIN checkhead  ON ((sltrans_source='A/P')
+                                                       AND (sltrans_doctype='CK')
+                                                       AND (sltrans_misc_id=checkhead_id))
+                                       JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                       JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                       JOIN vohead ON (vohead_number=apopen_docnumber)
+                                       JOIN voheadtax ON (taxhist_parent_id=vohead_id)
+                          WHERE (sltrans_id=_r.bankrecitem_source_id)
+                        UNION
+                        SELECT taxhist_id, apopen_id AS applyid, sltrans_date AS distdate, taxhist_tax,
+                               (checkitem_amount / apopen_amount) AS percentpaid
+                          FROM sltrans JOIN checkhead  ON ((sltrans_source='A/P')
+                                                       AND (sltrans_doctype='CK')
+                                                       AND (sltrans_misc_id=checkhead_id))
+                                       JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                       JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                       JOIN vohead ON (vohead_number=apopen_docnumber)
+                                       JOIN voitem ON (voitem_vohead_id=vohead_id)
+                                       JOIN voitemtax ON (taxhist_parent_id=voitem_id)
+                          WHERE (sltrans_id=_r.bankrecitem_source_id)
+                       ) AS data
+      LOOP
+        INSERT INTO taxpay
+        ( taxpay_taxhist_id, taxpay_apply_id, taxpay_distdate, taxpay_tax )
+        VALUES
+        ( _tax.taxhist_id, _tax.applyid, COALESCE(_r.bankrecitem_effdate, _tax.distdate), _tax.taxpaid );
+      END LOOP;
+
+    END LOOP;
+
+    SELECT postGLSeries(_sequence, fetchJournalNumber('GL-MISC')) INTO _result;
+    IF (_result < 0) THEN
+      RAISE EXCEPTION 'postGLSeries failed, result=%', _result;
+    END IF;
+
+  END IF;
+
+
 -- Mark all the gltrans items that have been cleared as reconciled.
   UPDATE gltrans
      SET gltrans_rec = TRUE
index ef0ee19..268bdee 100644 (file)
@@ -444,7 +444,7 @@ BEGIN
                          ('Credit Return ' || _r.item_number),
                          costcat_asset_accnt_id,
                          getPrjAccntId(_r.cmhead_prj_id, resolveCOSAccount(itemsite_id, _r.cust_id, _r.saletype_id, _r.shipzone_id)), 
-                         _itemlocSeries, _glDate, _r.std_cost) INTO _invhistid
+                         _itemlocSeries, _glDate, (_r.std_cost * _r.qty)) INTO _invhistid
         FROM itemsite, costcat
        WHERE ((itemsite_costcat_id=costcat_id)
           AND (itemsite_id=_r.itemsite_id));
index 1b8fb07..7ee2ad6 100644 (file)
@@ -8,7 +8,9 @@ DECLARE
   _accntid INTEGER;
   _sequence INTEGER;
   _gltransid INTEGER;
+  _result INTEGER;
   _r RECORD;
+  _tax RECORD;
 
 BEGIN
 
@@ -34,6 +36,242 @@ BEGIN
      WHERE (bankrec_id=_bankrecid);
   END IF;
 
+  IF (fetchMetricBool('CashBasedTax')) THEN
+    -- Cash based tax distributions
+    -- GL Transactions
+    SELECT fetchGLSequence() INTO _sequence;
+    FOR _r IN SELECT *
+              FROM bankrecitem
+             WHERE ( (bankrecitem_cleared)
+               AND   (bankrecitem_bankrec_id=pBankrecid) ) LOOP
+      -- first, debit the tax liability clearing account
+      -- and credit the tax liability distribution account
+      -- for each tax code
+      FOR _tax IN SELECT docnumber, custname, distdate, source, doctype,
+                         tax_sales_accnt_id, tax_dist_accnt_id,
+                         ROUND(currToBase(currid, ROUND(SUM(taxhist_tax),2), taxhist_docdate) * percentpaid, 2) AS taxbasevalue
+                  FROM (
+                        -- Cash receipt, gltrans
+                        SELECT aropen_docnumber AS docnumber, cust_name AS custname,
+                               aropen_curr_id AS currid, gltrans_date AS distdate,
+                               (cashrcptitem_amount / aropen_amount) AS percentpaid,
+                               gltrans_source AS source, gltrans_doctype AS doctype,
+                               tax_sales_accnt_id, tax_dist_accnt_id,
+                               taxhist_tax, taxhist_docdate
+                        FROM gltrans JOIN cashrcpt  ON ((gltrans_source='A/R')
+                                                    AND (gltrans_doctype='CR')
+                                                    AND (gltrans_misc_id=cashrcpt_id))
+                                     JOIN cashrcptitem ON (cashrcptitem_cashrcpt_id=cashrcpt_id)
+                                     JOIN aropen ON (aropen_id=cashrcptitem_aropen_id)
+                                     JOIN custinfo ON (cust_id=aropen_cust_id)
+                                     JOIN cohist ON (cohist_invcnumber=aropen_docnumber AND cohist_doctype=aropen_doctype)
+                                     JOIN cohisttax ON (taxhist_parent_id=cohist_id)
+                                     JOIN tax ON (tax_id=taxhist_tax_id)
+                        WHERE (gltrans_id=_r.bankrecitem_source_id)
+                        -- Cash receipt, sltrans
+                        UNION
+                        SELECT aropen_docnumber AS docnumber, cust_name AS custname,
+                               aropen_curr_id AS currid, sltrans_date AS distdate,
+                               (cashrcptitem_amount / aropen_amount) AS percentpaid,
+                               sltrans_source AS source, sltrans_doctype AS doctype,
+                               tax_sales_accnt_id, tax_dist_accnt_id,
+                               taxhist_tax, taxhist_docdate
+                        FROM sltrans JOIN cashrcpt  ON ((sltrans_source='A/R')
+                                                    AND (sltrans_doctype='CR')
+                                                    AND (sltrans_misc_id=cashrcpt_id))
+                                     JOIN cashrcptitem ON (cashrcptitem_cashrcpt_id=cashrcpt_id)
+                                     JOIN aropen ON (aropen_id=cashrcptitem_aropen_id)
+                                     JOIN custinfo ON (cust_id=aropen_cust_id)
+                                     JOIN cohist ON (cohist_invcnumber=aropen_docnumber AND cohist_doctype=aropen_doctype)
+                                     JOIN cohisttax ON (taxhist_parent_id=cohist_id)
+                                     JOIN tax ON (tax_id=taxhist_tax_id)
+                        WHERE (sltrans_id=_r.bankrecitem_source_id)
+                        -- Cash payment, gltrans
+                        UNION
+                        SELECT apopen_docnumber AS docnumber, vend_name AS vendname,
+                               apopen_curr_id AS currid, gltrans_date AS distdate,
+                               (vohead_amount / apopen_amount) AS percentpaid,
+                               gltrans_source AS source, gltrans_doctype AS doctype,
+                               tax_sales_accnt_id, tax_dist_accnt_id,
+                               taxhist_tax, taxhist_docdate
+                        FROM gltrans JOIN checkhead ON ((gltrans_source='A/P')
+                                                    AND (gltrans_doctype='CK')
+                                                    AND (gltrans_misc_id=checkhead_id))
+                                     JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                     JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                     JOIN vohead ON (vohead_number=apopen_docnumber)
+                                     JOIN vendinfo ON (vend_id=apopen_vend_id)
+                                     JOIN voheadtax ON (taxhist_parent_id=vohead_id)
+                                     JOIN tax ON (tax_id=taxhist_tax_id)
+                        WHERE (gltrans_id=_r.bankrecitem_source_id)
+                        UNION
+                        SELECT apopen_docnumber AS docnumber, vend_name AS vendname,
+                               apopen_curr_id AS currid, gltrans_date AS distdate,
+                               (vohead_amount / apopen_amount) AS percentpaid,
+                               gltrans_source AS source, gltrans_doctype AS doctype,
+                               tax_sales_accnt_id, tax_dist_accnt_id,
+                               taxhist_tax, taxhist_docdate
+                        FROM gltrans JOIN checkhead ON ((gltrans_source='A/P')
+                                                    AND (gltrans_doctype='CK')
+                                                    AND (gltrans_misc_id=checkhead_id))
+                                     JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                     JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                     JOIN vohead ON (vohead_number=apopen_docnumber)
+                                     JOIN vendinfo ON (vend_id=apopen_vend_id)
+                                     JOIN voitem ON (voitem_vohead_id=vohead_id)
+                                     JOIN voitemtax ON (taxhist_parent_id=voitem_id)
+                                     JOIN tax ON (tax_id=taxhist_tax_id)
+                        WHERE (gltrans_id=_r.bankrecitem_source_id)
+                        -- Cash payment, sltrans
+                        UNION
+                        SELECT apopen_docnumber AS docnumber, vend_name AS vendname,
+                               apopen_curr_id AS currid, sltrans_date AS distdate,
+                               (vohead_amount / apopen_amount) AS percentpaid,
+                               sltrans_source AS source, sltrans_doctype AS doctype,
+                               tax_sales_accnt_id, tax_dist_accnt_id,
+                               taxhist_tax, taxhist_docdate
+                        FROM sltrans JOIN checkhead ON ((sltrans_source='A/P')
+                                                    AND (sltrans_doctype='CK')
+                                                    AND (sltrans_misc_id=checkhead_id))
+                                     JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                     JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                     JOIN vohead ON (vohead_number=apopen_docnumber)
+                                     JOIN vendinfo ON (vend_id=apopen_vend_id)
+                                     JOIN voheadtax ON (taxhist_parent_id=vohead_id)
+                                     JOIN tax ON (tax_id=taxhist_tax_id)
+                        WHERE (sltrans_id=_r.bankrecitem_source_id)
+                        UNION
+                        SELECT apopen_docnumber AS docnumber, vend_name AS vendname,
+                               apopen_curr_id AS currid, sltrans_date AS distdate,
+                               (vohead_amount / apopen_amount) AS percentpaid,
+                               sltrans_source AS source, sltrans_doctype AS doctype,
+                               tax_sales_accnt_id, tax_dist_accnt_id,
+                               taxhist_tax, taxhist_docdate
+                        FROM sltrans JOIN checkhead ON ((sltrans_source='A/P')
+                                                    AND (sltrans_doctype='CK')
+                                                    AND (sltrans_misc_id=checkhead_id))
+                                     JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                     JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                     JOIN vohead ON (vohead_number=apopen_docnumber)
+                                     JOIN vendinfo ON (vend_id=apopen_vend_id)
+                                     JOIN voitem ON (voitem_vohead_id=vohead_id)
+                                     JOIN voitemtax ON (taxhist_parent_id=voitem_id)
+                                     JOIN tax ON (tax_id=taxhist_tax_id)
+                        WHERE (sltrans_id=_r.bankrecitem_source_id)
+                       ) AS data
+                  GROUP BY docnumber, custname, currid, distdate, percentpaid,
+                           source, doctype,
+                           tax_sales_accnt_id, tax_dist_accnt_id, taxhist_docdate
+      LOOP
+        SELECT insertIntoGLSeries( _sequence, _tax.source, _tax.doctype, _tax.docnumber,
+                                   _tax.tax_dist_accnt_id, 
+                                   (_tax.taxbasevalue * -1.0),
+                                   COALESCE(_r.bankrecitem_effdate, _tax.distdate), _tax.custname ) INTO _result;
+        IF (_result < 0) THEN
+          RAISE EXCEPTION 'insertIntoGLSeries failed, result=%', _result;
+        END IF;
+        SELECT insertIntoGLSeries( _sequence, _tax.source, _tax.doctype, _tax.docnumber,
+                                   _tax.tax_sales_accnt_id, 
+                                   _tax.taxbasevalue,
+                                   COALESCE(_r.bankrecitem_effdate, _tax.distdate), _tax.custname ) INTO _result;
+        IF (_result < 0) THEN
+          RAISE EXCEPTION 'insertIntoGLSeries failed, result=%', _result;
+        END IF;
+      END LOOP;
+
+      -- second, create a taxpay row for each taxhist
+      FOR _tax IN SELECT taxhist_id, applyid, distdate,
+                         ROUND(taxhist_tax * percentpaid, 2) AS taxpaid
+                  FROM (
+                        -- Cash receipt, gltrans
+                        SELECT taxhist_id, aropen_id AS applyid, gltrans_date AS distdate, taxhist_tax,
+                               (cashrcptitem_amount / aropen_amount) AS percentpaid
+                          FROM gltrans JOIN cashrcpt  ON ((gltrans_source='A/R')
+                                                      AND (gltrans_doctype='CR')
+                                                      AND (gltrans_misc_id=cashrcpt_id))
+                                       JOIN cashrcptitem ON (cashrcptitem_cashrcpt_id=cashrcpt_id)
+                                       JOIN aropen ON (aropen_id=cashrcptitem_aropen_id)
+                                       JOIN cohist ON (cohist_invcnumber=aropen_docnumber AND cohist_doctype=aropen_doctype)
+                                       JOIN cohisttax ON (taxhist_parent_id=cohist_id)
+                          WHERE (gltrans_id=_r.bankrecitem_source_id)
+                        -- Cash receipt, sltrans
+                        UNION
+                        SELECT taxhist_id, aropen_id AS applyid, sltrans_date AS distdate, taxhist_tax,
+                               (cashrcptitem_amount / aropen_amount) AS percentpaid
+                          FROM sltrans JOIN cashrcpt  ON ((sltrans_source='A/R')
+                                                      AND (sltrans_doctype='CR')
+                                                      AND (sltrans_misc_id=cashrcpt_id))
+                                       JOIN cashrcptitem ON (cashrcptitem_cashrcpt_id=cashrcpt_id)
+                                       JOIN aropen ON (aropen_id=cashrcptitem_aropen_id)
+                                       JOIN cohist ON (cohist_invcnumber=aropen_docnumber AND cohist_doctype=aropen_doctype)
+                                       JOIN cohisttax ON (taxhist_parent_id=cohist_id)
+                          WHERE (sltrans_id=_r.bankrecitem_source_id)
+                        -- Cash payment, gltrans
+                        UNION
+                        SELECT taxhist_id, apopen_id AS applyid, gltrans_date AS distdate, taxhist_tax,
+                               (checkitem_amount / apopen_amount) AS percentpaid
+                          FROM gltrans JOIN checkhead  ON ((gltrans_source='A/P')
+                                                       AND (gltrans_doctype='CK')
+                                                       AND (gltrans_misc_id=checkhead_id))
+                                       JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                       JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                       JOIN vohead ON (vohead_number=apopen_docnumber)
+                                       JOIN voheadtax ON (taxhist_parent_id=vohead_id)
+                          WHERE (gltrans_id=_r.bankrecitem_source_id)
+                        UNION
+                        SELECT taxhist_id, apopen_id AS applyid, gltrans_date AS distdate, taxhist_tax,
+                               (checkitem_amount / apopen_amount) AS percentpaid
+                          FROM gltrans JOIN checkhead  ON ((gltrans_source='A/P')
+                                                       AND (gltrans_doctype='CK')
+                                                       AND (gltrans_misc_id=checkhead_id))
+                                       JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                       JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                       JOIN vohead ON (vohead_number=apopen_docnumber)
+                                       JOIN voitem ON (voitem_vohead_id=vohead_id)
+                                       JOIN voitemtax ON (taxhist_parent_id=voitem_id)
+                          WHERE (gltrans_id=_r.bankrecitem_source_id)
+                        -- Cash payment, sltrans
+                        UNION
+                        SELECT taxhist_id, apopen_id AS applyid, sltrans_date AS distdate, taxhist_tax,
+                               (checkitem_amount / apopen_amount) AS percentpaid
+                          FROM sltrans JOIN checkhead  ON ((sltrans_source='A/P')
+                                                       AND (sltrans_doctype='CK')
+                                                       AND (sltrans_misc_id=checkhead_id))
+                                       JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                       JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                       JOIN vohead ON (vohead_number=apopen_docnumber)
+                                       JOIN voheadtax ON (taxhist_parent_id=vohead_id)
+                          WHERE (sltrans_id=_r.bankrecitem_source_id)
+                        UNION
+                        SELECT taxhist_id, apopen_id AS applyid, sltrans_date AS distdate, taxhist_tax,
+                               (checkitem_amount / apopen_amount) AS percentpaid
+                          FROM sltrans JOIN checkhead  ON ((sltrans_source='A/P')
+                                                       AND (sltrans_doctype='CK')
+                                                       AND (sltrans_misc_id=checkhead_id))
+                                       JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)
+                                       JOIN apopen ON (apopen_id=checkitem_apopen_id)
+                                       JOIN vohead ON (vohead_number=apopen_docnumber)
+                                       JOIN voitem ON (voitem_vohead_id=vohead_id)
+                                       JOIN voitemtax ON (taxhist_parent_id=voitem_id)
+                          WHERE (sltrans_id=_r.bankrecitem_source_id)
+                       ) AS data
+      LOOP
+        DELETE FROM taxpay
+        WHERE (taxpay_taxhist_id=_tax.taxhist_id)
+          AND (taxpay_apply_id=_tax.applyid)
+          AND (taxpay_distdate=COALESCE(_r.bankrecitem_effdate, _tax.distdate))
+          AND (taxpay_tax=_tax.taxpaid);
+      END LOOP;
+
+    END LOOP;
+
+    SELECT postGLSeries(_sequence, fetchJournalNumber('GL-MISC')) INTO _result;
+    IF (_result < 0) THEN
+      RAISE EXCEPTION 'postGLSeries failed, result=%', _result;
+    END IF;
+
+  END IF;
+
 -- Mark all the gltrans items that have been cleared as unreconciled.
   UPDATE gltrans
      SET gltrans_rec = FALSE
index 8627ad5..c591b02 100644 (file)
@@ -1,5 +1,18 @@
 
-CREATE OR REPLACE FUNCTION toggleBankrecCleared(INTEGER, TEXT, INTEGER, NUMERIC, NUMERIC) RETURNS BOOLEAN AS $$
+CREATE OR REPLACE FUNCTION toggleBankrecCleared(INTEGER, TEXT, INTEGER) RETURNS BOOLEAN AS $$
+-- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple. 
+-- See www.xtuple.com/CPAL for the full text of the software license.
+DECLARE
+  pBankrecid ALIAS FOR $1;
+  pSource    ALIAS FOR $2;
+  pSourceid  ALIAS FOR $3;
+
+BEGIN
+  RETURN toggleBankrecCleared(pBankrecid, pSource, pSourceid, NULL, NULL, NULL);
+END;
+$$ LANGUAGE 'plpgsql';
+
+CREATE OR REPLACE FUNCTION toggleBankrecCleared(INTEGER, TEXT, INTEGER, NUMERIC, NUMERIC, DATE) RETURNS BOOLEAN AS $$
 -- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple. 
 -- See www.xtuple.com/CPAL for the full text of the software license.
 DECLARE
@@ -8,11 +21,11 @@ DECLARE
   pSourceid  ALIAS FOR $3;
   pCurrrate  ALIAS FOR $4;
   pAmount    ALIAS FOR $5;
+  pDate      ALIAS FOR $6;
   _cleared BOOLEAN;
   _r RECORD;
 
 BEGIN
-
   SELECT bankrecitem_id, bankrecitem_cleared INTO _r
     FROM bankrecitem
    WHERE ( (bankrecitem_bankrec_id=pBankrecid)
@@ -23,11 +36,13 @@ BEGIN
     INSERT INTO bankrecitem
     (bankrecitem_bankrec_id, bankrecitem_source,
      bankrecitem_source_id, bankrecitem_cleared,
-     bankrecitem_curr_rate, bankrecitem_amount)
+     bankrecitem_curr_rate, bankrecitem_amount,
+     bankrecitem_effdate)
     VALUES
     (pBankrecid, pSource,
      pSourceid, _cleared,
-     pCurrrate, pAmount);
+     pCurrrate, pAmount,
+     pDate);
   ELSE
     _cleared := FALSE;
     DELETE FROM bankrecitem 
diff --git a/foundation-database/public/indexes/apopentax.sql b/foundation-database/public/indexes/apopentax.sql
new file mode 100644 (file)
index 0000000..893b0ec
--- /dev/null
@@ -0,0 +1,8 @@
+--CREATE INDEX apopentax_taxhist_parent_id_idx on apopentax using btree (taxhist_parent_id);
+select xt.add_index('apopentax', 'taxhist_parent_id','apopentax_taxhist_parent_id_idx', 'btree', 'public');
+
+--CREATE INDEX apopentax_taxhist_taxtype_id_idx on apopentax using btree (taxhist_taxtype_id);
+select xt.add_index('apopentax', 'taxhist_taxtype_id','apopentax_taxhist_taxtype_id_idx', 'btree', 'public');
+
+--CREATE INDEX apopentax_taxhist_parent_type_idx on apopentax using btree (taxhist_parent_id, taxhist_taxtype_id);
+select xt.add_index('apopentax', 'taxhist_parent_id, taxhist_taxtype_id','apopentax_taxhist_parent_type_idx', 'btree', 'public');
diff --git a/foundation-database/public/indexes/aropentax.sql b/foundation-database/public/indexes/aropentax.sql
new file mode 100644 (file)
index 0000000..d850803
--- /dev/null
@@ -0,0 +1,8 @@
+--CREATE INDEX aropentax_taxhist_parent_id_idx on aropentax using btree (taxhist_parent_id);
+select xt.add_index('aropentax', 'taxhist_parent_id','aropentax_taxhist_parent_id_idx', 'btree', 'public');
+
+--CREATE INDEX aropentax_taxhist_taxtype_id_idx on aropentax using btree (taxhist_taxtype_id);
+select xt.add_index('aropentax', 'taxhist_taxtype_id','aropentax_taxhist_taxtype_id_idx', 'btree', 'public');
+
+--CREATE INDEX aropentax_taxhist_parent_type_idx on aropentax using btree (taxhist_parent_id, taxhist_taxtype_id);
+select xt.add_index('aropentax', 'taxhist_parent_id, taxhist_taxtype_id','aropentax_taxhist_parent_type_idx', 'btree', 'public');
diff --git a/foundation-database/public/indexes/asohisttax.sql b/foundation-database/public/indexes/asohisttax.sql
new file mode 100644 (file)
index 0000000..1247dd2
--- /dev/null
@@ -0,0 +1,8 @@
+--CREATE INDEX asohisttax_taxhist_parent_id_idx on asohisttax using btree (taxhist_parent_id);
+select xt.add_index('asohisttax', 'taxhist_parent_id','asohisttax_taxhist_parent_id_idx', 'btree', 'public');
+
+--CREATE INDEX asohisttax_taxhist_taxtype_id_idx on asohisttax using btree (taxhist_taxtype_id);
+select xt.add_index('asohisttax', 'taxhist_taxtype_id','asohisttax_taxhist_taxtype_id_idx', 'btree', 'public');
+
+--CREATE INDEX asohisttax_taxhist_parent_type_idx on asohisttax using btree (taxhist_parent_id, taxhist_taxtype_id);
+select xt.add_index('asohisttax', 'taxhist_parent_id, taxhist_taxtype_id','asohisttax_taxhist_parent_type_idx', 'btree', 'public');
diff --git a/foundation-database/public/indexes/cmheadtax.sql b/foundation-database/public/indexes/cmheadtax.sql
new file mode 100644 (file)
index 0000000..4f60ec9
--- /dev/null
@@ -0,0 +1,8 @@
+--CREATE INDEX cmheadtax_taxhist_parent_id_idx on cmheadtax using btree (taxhist_parent_id);
+select xt.add_index('cmheadtax', 'taxhist_parent_id','cmheadtax_taxhist_parent_id_idx', 'btree', 'public');
+
+--CREATE INDEX cmheadtax_taxhist_taxtype_id_idx on cmheadtax using btree (taxhist_taxtype_id);
+select xt.add_index('cmheadtax', 'taxhist_taxtype_id','cmheadtax_taxhist_taxtype_id_idx', 'btree', 'public');
+
+--CREATE INDEX cmheadtax_taxhist_parent_type_idx on cmheadtax using btree (taxhist_parent_id, taxhist_taxtype_id);
+select xt.add_index('cmheadtax', 'taxhist_parent_id, taxhist_taxtype_id','cmheadtax_taxhist_parent_type_idx', 'btree', 'public');
diff --git a/foundation-database/public/indexes/cmitemtax.sql b/foundation-database/public/indexes/cmitemtax.sql
new file mode 100644 (file)
index 0000000..cb711c2
--- /dev/null
@@ -0,0 +1,8 @@
+--CREATE INDEX cmitemtax_taxhist_parent_id_idx on cmitemtax using btree (taxhist_parent_id);
+select xt.add_index('cmitemtax', 'taxhist_parent_id','cmitemtax_taxhist_parent_id_idx', 'btree', 'public');
+
+--CREATE INDEX cmitemtax_taxhist_taxtype_id_idx on cmitemtax using btree (taxhist_taxtype_id);
+select xt.add_index('cmitemtax', 'taxhist_taxtype_id','cmitemtax_taxhist_taxtype_id_idx', 'btree', 'public');
+
+--CREATE INDEX cmitemtax_taxhist_parent_type_idx on cmitemtax using btree (taxhist_parent_id, taxhist_taxtype_id);
+select xt.add_index('cmitemtax', 'taxhist_parent_id, taxhist_taxtype_id','cmitemtax_taxhist_parent_type_idx', 'btree', 'public');
diff --git a/foundation-database/public/indexes/cobilltax.sql b/foundation-database/public/indexes/cobilltax.sql
new file mode 100644 (file)
index 0000000..b2f44df
--- /dev/null
@@ -0,0 +1,8 @@
+--CREATE INDEX cobilltax_taxhist_parent_id_idx on cobilltax using btree (taxhist_parent_id);
+select xt.add_index('cobilltax', 'taxhist_parent_id','cobilltax_taxhist_parent_id_idx', 'btree', 'public');
+
+--CREATE INDEX cobilltax_taxhist_taxtype_id_idx on cobilltax using btree (taxhist_taxtype_id);
+select xt.add_index('cobilltax', 'taxhist_taxtype_id','cobilltax_taxhist_taxtype_id_idx', 'btree', 'public');
+
+--CREATE INDEX cobilltax_taxhist_parent_type_idx on cobilltax using btree (taxhist_parent_id, taxhist_taxtype_id);
+select xt.add_index('cobilltax', 'taxhist_parent_id, taxhist_taxtype_id','cobilltax_taxhist_parent_type_idx', 'btree', 'public');
diff --git a/foundation-database/public/indexes/cobmisctax.sql b/foundation-database/public/indexes/cobmisctax.sql
new file mode 100644 (file)
index 0000000..7925844
--- /dev/null
@@ -0,0 +1,8 @@
+--CREATE INDEX cobmisctax_taxhist_parent_id_idx on cobmisctax using btree (taxhist_parent_id);
+select xt.add_index('cobmisctax', 'taxhist_parent_id','cobmisctax_taxhist_parent_id_idx', 'btree', 'public');
+
+--CREATE INDEX cobmisctax_taxhist_taxtype_id_idx on cobmisctax using btree (taxhist_taxtype_id);
+select xt.add_index('cobmisctax', 'taxhist_taxtype_id','cobmisctax_taxhist_taxtype_id_idx', 'btree', 'public');
+
+--CREATE INDEX cobmisctax_taxhist_parent_type_idx on cobmisctax using btree (taxhist_parent_id, taxhist_taxtype_id);
+select xt.add_index('cobmisctax', 'taxhist_parent_id, taxhist_taxtype_id','cobmisctax_taxhist_parent_type_idx', 'btree', 'public');
diff --git a/foundation-database/public/indexes/cohisttax.sql b/foundation-database/public/indexes/cohisttax.sql
new file mode 100644 (file)
index 0000000..b5da013
--- /dev/null
@@ -0,0 +1,8 @@
+--CREATE INDEX cohisttax_taxhist_parent_id_idx on cohisttax using btree (taxhist_parent_id);
+select xt.add_index('cohisttax', 'taxhist_parent_id','cohisttax_taxhist_parent_id_idx', 'btree', 'public');
+
+--CREATE INDEX cohisttax_taxhist_taxtype_id_idx on cohisttax using btree (taxhist_taxtype_id);
+select xt.add_index('cohisttax', 'taxhist_taxtype_id','cohisttax_taxhist_taxtype_id_idx', 'btree', 'public');
+
+--CREATE INDEX cohisttax_taxhist_parent_type_idx on cohisttax using btree (taxhist_parent_id, taxhist_taxtype_id);
+select xt.add_index('cohisttax', 'taxhist_parent_id, taxhist_taxtype_id','cohisttax_taxhist_parent_type_idx', 'btree', 'public');
diff --git a/foundation-database/public/indexes/invchead.sql b/foundation-database/public/indexes/invchead.sql
new file mode 100644 (file)
index 0000000..94b61fb
--- /dev/null
@@ -0,0 +1,2 @@
+--CREATE INDEX invchead_invchead_cust_id_idx on invchead using btree (invchead_cust_id);
+select xt.add_index('invchead', 'invchead_cust_id','invchead_invchead_cust_id_idx', 'btree', 'public');
diff --git a/foundation-database/public/indexes/invcheadtax.sql b/foundation-database/public/indexes/invcheadtax.sql
new file mode 100644 (file)
index 0000000..fdad4cf
--- /dev/null
@@ -0,0 +1,8 @@
+--CREATE INDEX invcheadtax_taxhist_parent_id_idx on invcheadtax using btree (taxhist_parent_id);
+select xt.add_index('invcheadtax', 'taxhist_parent_id','invcheadtax_taxhist_parent_id_idx', 'btree', 'public');
+
+--CREATE INDEX invcheadtax_taxhist_taxtype_id_idx on invcheadtax using btree (taxhist_taxtype_id);
+select xt.add_index('invcheadtax', 'taxhist_taxtype_id','invcheadtax_taxhist_taxtype_id_idx', 'btree', 'public');
+
+--CREATE INDEX invcheadtax_taxhist_parent_type_idx on invcheadtax using btree (taxhist_parent_id, taxhist_taxtype_id);
+select xt.add_index('invcheadtax', 'taxhist_parent_id, taxhist_taxtype_id','invcheadtax_taxhist_parent_type_idx', 'btree', 'public');
index af601dc..ff7c07c 100644 (file)
@@ -1,3 +1,8 @@
-DROP INDEX IF EXISTS invcitemtax_taxhist_parent_id_idx;
-CREATE INDEX invcitemtax_taxhist_parent_id_idx ON invcitemtax (taxhist_parent_id);
+--CREATE INDEX invcitemtax_taxhist_parent_id_idx on invcitemtax using btree (taxhist_parent_id);
+select xt.add_index('invcitemtax', 'taxhist_parent_id','invcitemtax_taxhist_parent_id_idx', 'btree', 'public');
 
+--CREATE INDEX invcitemtax_taxhist_taxtype_id_idx on invcitemtax using btree (taxhist_taxtype_id);
+select xt.add_index('invcitemtax', 'taxhist_taxtype_id','invcitemtax_taxhist_taxtype_id_idx', 'btree', 'public');
+
+--CREATE INDEX invcitemtax_taxhist_parent_type_idx on invcitemtax using btree (taxhist_parent_id, taxhist_taxtype_id);
+select xt.add_index('invcitemtax', 'taxhist_parent_id, taxhist_taxtype_id','invcitemtax_taxhist_parent_type_idx', 'btree', 'public');
diff --git a/foundation-database/public/indexes/taxhist.sql b/foundation-database/public/indexes/taxhist.sql
new file mode 100644 (file)
index 0000000..48176dd
--- /dev/null
@@ -0,0 +1,8 @@
+--CREATE INDEX taxhist_taxhist_parent_id_idx on taxhist using btree (taxhist_parent_id);
+select xt.add_index('taxhist', 'taxhist_parent_id','taxhist_taxhist_parent_id_idx', 'btree', 'public');
+
+--CREATE INDEX taxhist_taxhist_taxtype_id_idx on taxhist using btree (taxhist_taxtype_id);
+select xt.add_index('taxhist', 'taxhist_taxtype_id','taxhist_taxhist_taxtype_id_idx', 'btree', 'public');
+
+--CREATE INDEX taxhist_taxhist_parent_type_idx on taxhist using btree (taxhist_parent_id, taxhist_taxtype_id);
+select xt.add_index('taxhist', 'taxhist_parent_id, taxhist_taxtype_id','taxhist_taxhist_parent_type_idx', 'btree', 'public');
diff --git a/foundation-database/public/indexes/voheadtax.sql b/foundation-database/public/indexes/voheadtax.sql
new file mode 100644 (file)
index 0000000..3f7edc6
--- /dev/null
@@ -0,0 +1,8 @@
+--CREATE INDEX voheadtax_taxhist_parent_id_idx on voheadtax using btree (taxhist_parent_id);
+select xt.add_index('voheadtax', 'taxhist_parent_id','voheadtax_taxhist_parent_id_idx', 'btree', 'public');
+
+--CREATE INDEX voheadtax_taxhist_taxtype_id_idx on voheadtax using btree (taxhist_taxtype_id);
+select xt.add_index('voheadtax', 'taxhist_taxtype_id','voheadtax_taxhist_taxtype_id_idx', 'btree', 'public');
+
+--CREATE INDEX voheadtax_taxhist_parent_type_idx on voheadtax using btree (taxhist_parent_id, taxhist_taxtype_id);
+select xt.add_index('voheadtax', 'taxhist_parent_id, taxhist_taxtype_id','voheadtax_taxhist_parent_type_idx', 'btree', 'public');
diff --git a/foundation-database/public/indexes/voitemtax.sql b/foundation-database/public/indexes/voitemtax.sql
new file mode 100644 (file)
index 0000000..79011c6
--- /dev/null
@@ -0,0 +1,8 @@
+--CREATE INDEX voitemtax_taxhist_parent_id_idx on voitemtax using btree (taxhist_parent_id);
+select xt.add_index('voitemtax', 'taxhist_parent_id','voitemtax_taxhist_parent_id_idx', 'btree', 'public');
+
+--CREATE INDEX voitemtax_taxhist_taxtype_id_idx on voitemtax using btree (taxhist_taxtype_id);
+select xt.add_index('voitemtax', 'taxhist_taxtype_id','voitemtax_taxhist_taxtype_id_idx', 'btree', 'public');
+
+--CREATE INDEX voitemtax_taxhist_parent_type_idx on voitemtax using btree (taxhist_parent_id, taxhist_taxtype_id);
+select xt.add_index('voitemtax', 'taxhist_parent_id, taxhist_taxtype_id','voitemtax_taxhist_parent_type_idx', 'btree', 'public');
diff --git a/foundation-database/public/tables/bankrecitem.sql b/foundation-database/public/tables/bankrecitem.sql
new file mode 100644 (file)
index 0000000..eaad3a2
--- /dev/null
@@ -0,0 +1 @@
+select xt.add_column('bankrecitem','bankrecitem_effdate', 'DATE', NULL, 'public');
\ No newline at end of file
diff --git a/foundation-database/public/tables/cashrcpt.sql b/foundation-database/public/tables/cashrcpt.sql
new file mode 100644 (file)
index 0000000..0713ff0
--- /dev/null
@@ -0,0 +1 @@
+select xt.add_column('cashrcpt','cashrcpt_alt_curr_rate', 'NUMERIC', NULL, 'public');
\ No newline at end of file
index 0973a39..cb1e812 100644 (file)
@@ -45,7 +45,7 @@ SELECT COALESCE(SUM(amount),0.0) AS cleared_amount
 <? else ?>
 SELECT gltrans_id AS id, 1 AS altid,
        COALESCE(bankrecitem_cleared, FALSE) AS cleared,
-       gltrans_date AS transdate,
+       COALESCE(bankrecitem_effdate, gltrans_date) AS transdate,
        gltrans_doctype AS doc_type,
        gltrans_docnumber AS doc_number,
        gltrans_notes AS notes,
@@ -77,11 +77,18 @@ SELECT gltrans_id AS id, 1 AS altid,
    AND (NOT COALESCE(checkhead_void, false))
    AND (gltrans_amount > 0)
    AND (gltrans_doctype != 'JP')
-   AND (bankaccnt_id=<? value("bankaccntid") ?>) )
+   AND (bankaccnt_id=<? value("bankaccntid") ?>)
+<? if exists("source") ?>
+   AND ('GL' = <? value("source") ?>)
+<? endif ?>
+<? if exists("sourceid") ?>
+   AND (gltrans_id = <? value("sourceid") ?>)
+<? endif ?>
+ )
  UNION ALL
 SELECT sltrans_id AS id, 2 AS altid,
        COALESCE(bankrecitem_cleared, FALSE) AS cleared,
-       sltrans_date AS transdate,
+       COALESCE(bankrecitem_effdate, sltrans_date) AS transdate,
        sltrans_doctype AS doc_type,
        sltrans_docnumber AS doc_number,
        sltrans_notes AS notes,
@@ -111,11 +118,18 @@ SELECT sltrans_id AS id, 2 AS altid,
    AND (NOT sltrans_rec)
    AND (NOT COALESCE(checkhead_void, false))
    AND (sltrans_amount > 0)
-   AND (bankaccnt_id=<? value("bankaccntid") ?>) )
+   AND (bankaccnt_id=<? value("bankaccntid") ?>)
+<? if exists("source") ?>
+   AND ('SL' = <? value("source") ?>)
+<? endif ?>
+<? if exists("sourceid") ?>
+   AND (sltrans_id = <? value("sourceid") ?>)
+<? endif ?>
+ )
  UNION ALL
 SELECT bankadj_id AS id, 3 AS altid,
        COALESCE(bankrecitem_cleared, FALSE) AS cleared,
-       bankadj_date AS transdate,
+       COALESCE(bankrecitem_effdate, bankadj_date) AS transdate,
        'ADJ' AS doc_type,
        bankadj_docnumber AS doc_number,
        bankadjtype_name AS notes,
@@ -135,6 +149,13 @@ SELECT bankadj_id AS id, 3 AS altid,
  WHERE ( (((bankadjtype_iscredit=true) AND (bankadj_amount > 0)) OR ((bankadjtype_iscredit=false) AND (bankadj_amount < 0)))
    AND (bankadj_bankadjtype_id=bankadjtype_id)
    AND (NOT bankadj_posted)
-   AND (bankadj_bankaccnt_id=<? value("bankaccntid") ?>) )
+   AND (bankadj_bankaccnt_id=<? value("bankaccntid") ?>)
+<? if exists("source") ?>
+   AND ('AD' = <? value("source") ?>)
+<? endif ?>
+<? if exists("sourceid") ?>
+   AND (bankadj_id = <? value("sourceid") ?>)
+<? endif ?>
+ )
 ORDER BY sortdate;
 <? endif ?>
index 82053eb..368a790 100644 (file)
@@ -47,7 +47,7 @@ SELECT gltrans_id AS id, 1 AS altid,
        jrnluse_use AS use, gltrans_journalnumber AS jrnlnum,
        COALESCE(date(jrnluse_date), gltrans_date) AS f_jrnldate,
        COALESCE(bankrecitem_cleared, FALSE) AS cleared,
-       gltrans_date AS f_date,
+       COALESCE(bankrecitem_effdate, gltrans_date) AS f_date,
        gltrans_doctype AS doc_type,
        gltrans_docnumber AS docnumber,
        gltrans_notes AS notes,
@@ -84,13 +84,20 @@ SELECT gltrans_id AS id, 1 AS altid,
    AND (NOT COALESCE(checkhead_void, false))
    AND (gltrans_amount < 0)
    AND (gltrans_doctype != 'JP')
-   AND (bankaccnt_id=<? value("bankaccntid") ?>) )
+   AND (bankaccnt_id=<? value("bankaccntid") ?>)
+<? if exists("source") ?>
+   AND ('GL' = <? value("source") ?>)
+<? endif ?>
+<? if exists("sourceid") ?>
+   AND (gltrans_id = <? value("sourceid") ?>)
+<? endif ?>
+ )
  UNION ALL
 SELECT sltrans_id AS id, 2 AS altid,
        jrnluse_use AS use, sltrans_journalnumber AS jrnlnum,
        COALESCE(date(jrnluse_date), sltrans_date) AS f_jrnldate,
        COALESCE(bankrecitem_cleared, FALSE) AS cleared,
-       sltrans_date AS f_date,
+       COALESCE(bankrecitem_effdate, sltrans_date) AS f_date,
        sltrans_doctype AS doc_type,
        sltrans_docnumber AS docnumber,
        sltrans_notes AS notes,
@@ -125,12 +132,19 @@ SELECT sltrans_id AS id, 2 AS altid,
  WHERE ((NOT sltrans_rec)
    AND (NOT COALESCE(checkhead_void, false))
    AND (sltrans_amount < 0)
-   AND (bankaccnt_id=<? value("bankaccntid") ?>) )
+   AND (bankaccnt_id=<? value("bankaccntid") ?>)
+<? if exists("source") ?>
+   AND ('SL' = <? value("source") ?>)
+<? endif ?>
+<? if exists("sourceid") ?>
+   AND (sltrans_id = <? value("sourceid") ?>)
+<? endif ?>
+ )
  UNION ALL
 SELECT bankadj_id AS id, 3 AS altid,
        '' AS use, NULL AS jrnlnum, bankadj_date AS f_jrnldate,
        COALESCE(bankrecitem_cleared, FALSE) AS cleared,
-       bankadj_date AS f_date,
+       COALESCE(bankrecitem_effdate, bankadj_date) AS f_date,
        'ADJ' AS doc_type,
        bankadj_docnumber AS docnumber,
        bankadjtype_name AS notes,
@@ -150,6 +164,13 @@ SELECT bankadj_id AS id, 3 AS altid,
  WHERE ( (((bankadjtype_iscredit=false) AND (bankadj_amount > 0)) OR ((bankadjtype_iscredit=true) AND (bankadj_amount < 0)))
    AND (bankadj_bankadjtype_id=bankadjtype_id)
    AND (NOT bankadj_posted)
-   AND (bankadj_bankaccnt_id=<? value("bankaccntid") ?>) )
+   AND (bankadj_bankaccnt_id=<? value("bankaccntid") ?>)
+<? if exists("source") ?>
+   AND ('AD' = <? value("source") ?>)
+<? endif ?>
+<? if exists("sourceid") ?>
+   AND (bankadj_id = <? value("sourceid") ?>)
+<? endif ?>
+ )
 ORDER BY jrnldate, jrnlnum, sortdate;
 <? endif ?>
index 221fd42..a81801b 100644 (file)
@@ -32,8 +32,8 @@ FROM (
 ------------BEGIN SALES--------------
 -- All sales tax history including memos 
 SELECT 
-  taxhist_distdate, taxhist_journalnumber,
-  tax_code AS tax, tax_descrip,
+  COALESCE(taxpay_distdate, taxhist_distdate) AS taxhist_distdate,
+  taxhist_journalnumber, tax_code AS tax, tax_descrip,
   COALESCE(taxtype_name,<? value("none") ?>) AS taxtype, taxtype_descrip,
   COALESCE(taxclass_code,<? value("none") ?>) AS taxclass, taxclass_descrip,
   COALESCE(taxauth_code,<? value("none") ?>) AS taxauth, taxauth_name AS taxauth_descrip,
@@ -70,13 +70,13 @@ SELECT
   END AS freightbase,
   CASE
     WHEN (cohist_misc_type = 'F') THEN
-      taxhist_tax / taxhist_curr_rate
+      COALESCE(taxpay_tax, taxhist_tax) / taxhist_curr_rate
     ELSE 0
   END AS freighttax,
   0 AS purchasebase,
-  taxhist_tax AS taxlocal,
-  taxhist_tax / taxhist_curr_rate AS taxbase,
-  taxhist_tax / taxhist_curr_rate AS salestaxbase,
+  COALESCE(taxpay_tax, taxhist_tax) AS taxlocal,
+  COALESCE(taxpay_tax, taxhist_tax) / taxhist_curr_rate AS taxbase,
+  COALESCE(taxpay_tax, taxhist_tax) / taxhist_curr_rate AS salestaxbase,
   0 AS purchasetaxbase,
   'qty' AS qty_xtnumericrole,
   'saleprice' AS unitprice_xtnumericrole,
@@ -94,12 +94,14 @@ FROM cohisttax
  LEFT OUTER JOIN taxzone ON (cohist_taxzone_id=taxzone_id)
  LEFT OUTER JOIN itemsite ON (cohist_itemsite_id=itemsite_id)
  LEFT OUTER JOIN item ON (itemsite_item_id=item_id)
+ LEFT OUTER JOIN taxpay ON (taxpay_taxhist_id=taxhist_id)
+WHERE ((true)
 <? if exists("distDate") ?>
-WHERE ((taxhist_distdate BETWEEN <? value("startDate") ?>
-                             AND <? value("endDate") ?>)
+ AND (taxhist_distdate BETWEEN <? value("startDate") ?>
+                           AND <? value("endDate") ?>)
 <? else ?>
-WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?>
-                             AND <? value("endDate") ?>)
+ AND (taxhist_docdate BETWEEN <? value("startDate") ?>
+                          AND <? value("endDate") ?>)
 <? endif ?>
 <? if exists("tax_id") ?>
  AND (taxhist_tax_id=<? value("tax_id") ?>)
@@ -116,6 +118,9 @@ WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?>
 <? if exists("taxzone_id") ?>
  AND (taxzone_id=<? value("taxzone_id") ?>)
 <? endif ?>
+<? if exists("cashbasedtax") ?>
+ AND (taxpay_id IS NOT NULL)
+<? endif ?>
 )
 <? endif ?>
 --------------END SALES--------------------
@@ -129,8 +134,8 @@ UNION ALL
 <? if exists("showPurchases") ?>
 -- A/P Memo history
 SELECT 
-  taxhist_distdate, taxhist_journalnumber,
-  tax_code AS tax, tax_descrip,
+  COALESCE(taxpay_distdate, taxhist_distdate) AS taxhist_distdate,
+  taxhist_journalnumber, tax_code AS tax, tax_descrip,
   COALESCE(taxtype_name,<? value("none") ?>) AS taxtype, taxtype_descrip,
   COALESCE(taxclass_code,<? value("none") ?>) AS taxclass, taxclass_descrip,
   COALESCE(taxauth_code,<? value("none") ?>) AS taxauth, taxauth_name AS taxauth_descrip,
@@ -154,10 +159,10 @@ SELECT
   0 AS freightbase,
   0 AS freighttax,
   apopen_amount / apopen_curr_rate AS purchasebase,
-  taxhist_tax AS taxlocal,
-  taxhist_tax / taxhist_curr_rate AS taxbase,
+  COALESCE(taxpay_tax, taxhist_tax) AS taxlocal,
+  COALESCE(taxpay_tax, taxhist_tax) / taxhist_curr_rate AS taxbase,
   0 AS salestaxbase,
-  taxhist_tax / taxhist_curr_rate AS purchasetaxbase,
+  COALESCE(taxpay_tax, taxhist_tax) / taxhist_curr_rate AS purchasetaxbase,
   'qty' AS qty_xtnumericrole,
   'purchaseprice' AS unitprice_xtnumericrole,
   'extprice' AS extension_xtnumericrole,
@@ -172,12 +177,14 @@ FROM apopentax
  JOIN curr_symbol ON (curr_id=taxhist_curr_id)
  LEFT OUTER JOIN taxclass ON (tax_taxclass_id=taxclass_id)
  LEFT OUTER JOIN taxauth ON (tax_taxauth_id=taxauth_id)
+ LEFT OUTER JOIN taxpay ON (taxpay_taxhist_id=taxhist_id)
+WHERE ((true)
 <? if exists("distDate") ?>
-WHERE ((taxhist_distdate BETWEEN <? value("startDate") ?>
-                             AND <? value("endDate") ?>)
+ AND (taxhist_distdate BETWEEN <? value("startDate") ?>
+                           AND <? value("endDate") ?>)
 <? else ?>
-WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?>
-                             AND <? value("endDate") ?>)
+ AND (taxhist_docdate BETWEEN <? value("startDate") ?>
+                          AND <? value("endDate") ?>)
 <? endif ?>
 <? if exists("tax_id") ?>
  AND (taxhist_tax_id=<? value("tax_id") ?>)
@@ -195,12 +202,15 @@ WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?>
  AND (false)
 <? endif ?>
  AND (taxhist_distdate IS NOT NULL)
+<? if exists("cashbasedtax") ?>
+ AND (taxpay_id IS NOT NULL)
+<? endif ?>
 )
 UNION ALL
 --Voucher Header History
 SELECT 
-  taxhist_distdate, taxhist_journalnumber,
-  tax_code AS tax, tax_descrip,
+  COALESCE(taxpay_distdate, taxhist_distdate) AS taxhist_distdate,
+  taxhist_journalnumber, tax_code AS tax, tax_descrip,
   COALESCE(taxtype_name,<? value("none") ?>) AS taxtype, taxtype_descrip,
   COALESCE(taxclass_code,<? value("none") ?>) AS taxclass, taxclass_descrip,
   COALESCE(taxauth_code,<? value("none") ?>) AS taxauth, taxauth_name AS taxauth_descrip,
@@ -217,10 +227,10 @@ SELECT
   0 AS freightbase,
   0 AS freighttax,
   0 AS purchasebase,
-  taxhist_tax AS taxlocal,
-  taxhist_tax / taxhist_curr_rate AS taxbase,
+  COALESCE(taxpay_tax, taxhist_tax) AS taxlocal,
+  COALESCE(taxpay_tax, taxhist_tax) / taxhist_curr_rate AS taxbase,
   0 AS salestaxbase,
-  taxhist_tax / taxhist_curr_rate AS purchasetaxbase,
+  COALESCE(taxpay_tax, taxhist_tax) / taxhist_curr_rate AS purchasetaxbase,
   'qty' AS qty_xtnumericrole,
   'purchaseprice' AS unitprice_xtnumericrole,
   'extprice' AS amount_xtnumericrole,
@@ -237,12 +247,14 @@ FROM voheadtax
  LEFT OUTER JOIN taxclass ON (tax_taxclass_id=taxclass_id)
  LEFT OUTER JOIN taxauth ON (tax_taxauth_id=taxauth_id)
  LEFT OUTER JOIN taxzone ON (vohead_taxzone_id=taxzone_id)
+ LEFT OUTER JOIN taxpay ON (taxpay_taxhist_id=taxhist_id)
+WHERE ((true)
 <? if exists("distDate") ?>
-WHERE ((taxhist_distdate BETWEEN <? value("startDate") ?>
-                             AND <? value("endDate") ?>)
+ AND (taxhist_distdate BETWEEN <? value("startDate") ?>
+                           AND <? value("endDate") ?>)
 <? else ?>
-WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?>
-                             AND <? value("endDate") ?>)
+ AND (taxhist_docdate BETWEEN <? value("startDate") ?>
+                          AND <? value("endDate") ?>)
 <? endif ?>
 <? if exists("tax_id") ?>
  AND (taxhist_tax_id=<? value("tax_id") ?>)
@@ -260,12 +272,15 @@ WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?>
  AND (taxzone_id=<? value("taxzone_id") ?>)
 <? endif ?>
  AND (taxhist_distdate IS NOT NULL)
+<? if exists("cashbasedtax") ?>
+ AND (taxpay_id IS NOT NULL)
+<? endif ?>
 )
 UNION ALL
 --Voucher Line Item
 SELECT 
-  taxhist_distdate, taxhist_journalnumber,
-  tax_code AS tax, tax_descrip,
+  COALESCE(taxpay_distdate, taxhist_distdate) AS taxhist_distdate,
+  taxhist_journalnumber, tax_code AS tax, tax_descrip,
   COALESCE(taxtype_name,<? value("none") ?>) AS taxtype, taxtype_descrip,
   COALESCE(taxclass_code,<? value("none") ?>) AS taxclass, taxclass_descrip,
   COALESCE(taxauth_code,<? value("none") ?>) AS taxauth, taxauth_name AS taxauth_descrip,
@@ -282,10 +297,10 @@ SELECT
   0 AS freightbase,
   0 AS freighttax,
   currToBase(vohead_curr_id, COALESCE(SUM(vodist_amount),0), vohead_distdate)  AS purchasebase,
-  taxhist_tax AS taxlocal,
-  taxhist_tax / taxhist_curr_rate AS taxbase,
+  COALESCE(taxpay_tax, taxhist_tax) AS taxlocal,
+  COALESCE(taxpay_tax, taxhist_tax) / taxhist_curr_rate AS taxbase,
   0 AS salestaxbase,
-  taxhist_tax / taxhist_curr_rate AS purchasetaxbase,
+  COALESCE(taxpay_tax, taxhist_tax) / taxhist_curr_rate AS purchasetaxbase,
   'qty' AS qty_xtnumericrole,
   'purchaseprice' AS unitprice_xtnumericrole,
   'extprice' AS amount_xtnumericrole,
@@ -309,12 +324,14 @@ FROM voitemtax
  LEFT OUTER JOIN itemsite ON (poitem_itemsite_id=itemsite_id)
  LEFT OUTER JOIN item ON (itemsite_item_id=item_id)
  LEFT OUTER JOIN expcat ON (expcat_id=poitem_expcat_id)
+ LEFT OUTER JOIN taxpay ON (taxpay_taxhist_id=taxhist_id)
+WHERE ((true)
 <? if exists("distDate") ?>
-WHERE ((taxhist_distdate BETWEEN <? value("startDate") ?>
-                             AND <? value("endDate") ?>)
+ AND (taxhist_distdate BETWEEN <? value("startDate") ?>
+                           AND <? value("endDate") ?>)
 <? else ?>
-WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?>
-                             AND <? value("endDate") ?>)
+ AND (taxhist_docdate BETWEEN <? value("startDate") ?>
+                          AND <? value("endDate") ?>)
 <? endif ?>
 <? if exists("tax_id") ?>
  AND (taxhist_tax_id=<? value("tax_id") ?>)
@@ -332,14 +349,17 @@ WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?>
  AND (taxzone_id=<? value("taxzone_id") ?>)
 <? endif ?>
  AND (taxhist_distdate IS NOT NULL)
+<? if exists("cashbasedtax") ?>
+ AND (taxpay_id IS NOT NULL)
+<? endif ?>
 )
-GROUP BY taxhist_id,taxhist_distdate,tax_code,tax_descrip,
+GROUP BY taxhist_id, taxpay_distdate,taxhist_distdate,tax_code,tax_descrip,
   taxtype_name,taxtype_descrip,taxclass_code,taxclass_descrip,
   taxauth_code,taxauth_descrip,taxzone,taxzone_descrip,curr_abbr,
   vohead_number,pohead_number,item_number,item_descrip1,
   vohead_curr_id,vohead_distdate,vohead_docdate,vend_name,
   expcat_code,expcat_descrip,taxhist_tax,taxhist_curr_rate,
-  voitem_qty, taxhist_journalnumber
+  voitem_qty, taxhist_journalnumber, taxpay_tax
 <? endif ?>
 -------------END PURCHASE--------------
 ORDER BY docdate DESC, docnumber DESC
index be5cc50..123faca 100644 (file)
@@ -7,7 +7,8 @@
 SELECT recv_id AS item_id, 1 AS item_type, 'REC' AS action,
        recv_date AS item_date,
        recv_qty AS qty, 'qty' AS qty_xtnumericrole,
-       recv_purchcost AS unitprice, 'curr' AS unitprice_xtnumericrole,
+       recv_purchcost AS unitprice,
+       'purchprice' AS unitprice_xtnumericrole,
        formatBoolYN(recv_vohead_id=<? value("vohead_id") ?>) AS f_tagged,
        <? value("receiving") ?> AS action_qtdisplayrole,
        0 AS qty_xttotalrole
@@ -22,7 +23,8 @@ UNION
 SELECT poreject_id AS item_id, 2 AS item_type, 'REJ' AS action,
        poreject_date AS item_date,
        poreject_qty * -1 AS qty, 'qty',
-       COALESCE(recv_purchcost, poitem_unitprice) AS unitprice, 'curr' AS unitprice_xtnumericrole,
+       COALESCE(recv_purchcost, poitem_unitprice) AS unitprice,
+       'purchprice' AS unitprice_xtnumericrole,
        formatBoolYN(poreject_vohead_id=<? value("vohead_id") ?>) AS f_tagged,
        <? value("reject") ?> AS action_qtdisplayrole,
        0 AS qty_xttotalrole
index 881fc41..6f9894e 100644 (file)
@@ -3,4 +3,4 @@ insert into metric (metric_name, metric_value)
 select 'UnifiedBuild', 'true'
 where not exists (select c.metric_id from metric c where c.metric_name = 'UnifiedBuild');
 
-SELECT setMetric('ServerVersion', '4.4.1');
+SELECT setMetric('ServerVersion', '4.5.0Beta');
diff --git a/foundation-database/public/tables/priv.sql b/foundation-database/public/tables/priv.sql
new file mode 100644 (file)
index 0000000..fef581f
--- /dev/null
@@ -0,0 +1,4 @@
+insert into priv (priv_module, priv_name, priv_descrip)
+select 'Accounting', 'ChangeCashRecvPostDate',
+       'Can change the distribution date when posting Cash Receipts'
+where not exists (select c.priv_id from priv c where c.priv_name = 'ChangeCashRecvPostDate');
\ No newline at end of file
diff --git a/foundation-database/public/tables/tax.sql b/foundation-database/public/tables/tax.sql
new file mode 100644 (file)
index 0000000..1c3731e
--- /dev/null
@@ -0,0 +1 @@
+select xt.add_column('tax','tax_dist_accnt_id', 'INTEGER', NULL, 'public');
\ No newline at end of file
diff --git a/foundation-database/public/tables/taxpay.sql b/foundation-database/public/tables/taxpay.sql
new file mode 100644 (file)
index 0000000..c9737b5
--- /dev/null
@@ -0,0 +1,7 @@
+select xt.create_table('taxpay', 'public');
+select xt.add_column('taxpay','taxpay_id', 'INTEGER', 'NOT NULL', 'public');
+select xt.add_column('taxpay','taxpay_taxhist_id', 'INTEGER', 'NOT NULL', 'public');
+select xt.add_column('taxpay','taxpay_apply_id', 'INTEGER', 'NOT NULL', 'public');
+select xt.add_column('taxpay','taxpay_distdate', 'DATE', 'NOT NULL', 'public');
+select xt.add_column('taxpay','taxpay_tax', 'NUMERIC', 'NOT NULL', 'public');
+select xt.add_primary_key('taxpay','taxpay_id', 'public');
\ No newline at end of file
index 11eea37..61cd3b3 100644 (file)
@@ -18,7 +18,7 @@ BEGIN
     FROM metric
    WHERE(metric_name='GLFFProfitCenters')
    LIMIT 1;
-  ffProfit := COALESCE(ffSub, false);
+  ffProfit := COALESCE(ffProfit, false);
 
   IF (NEW.accnt_sub IS NOT NULL AND ffSub = false) THEN
     SELECT subaccnt_id
index f8f9577..23b5a07 100644 (file)
 
 .selectable-chart {
   margin: 10px;
-  color: @white;
+  color: @slate-blue;
   overflow: hidden;
+  
+  .xv-list-item {
+    border-bottom: 1px solid grey;
+    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
+    .long {
+      padding-left: 7px;
+      width: 250px;
+    }
+  }
+  
+  .onyx-popup {
+    margin-top:40px;
+    margin-left:200px;
+  }
 
   .chart-title-bar {
     height: @icon-height;
-    background-color: @dark-gray;
+    background-color: @lightest-gray;
     .border-top-radius(10px);
 
     .chart-title {
       padding-top: 8px;
+      color: @black;
       text-align: center;
+      /*font-size: 2em;*/
+      font-weight: normal
     }
 
     .remove-icon {
       top: 0;
       right: 0;
     }
+    
+    .icon-filter {
+       color: @black;
+       position: absolute;
+       right: 35px;
+    }
   }
 
   .chart-bottom {
-    background-color: @charcoal;
+    background-color: @white;
     border: 1px solid @bottom-border;
     border-top: none;
     .border-bottom-radius(10px);
 
     .xv-picker-label {
       width: @picker-label;
-      color: @white;
+      color: @black;
     }
 
     .onyx-button {
       padding: 10px 10px;
     }
   }
+
+  .chart-filters {
+         background-color: @white;
+         
+         -webkit-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);
+         -moz-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);
+         box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);
+  }
+  
+  .chart-filters .xv-parameter-panel {
+         background-color: @ghost;
+         border: 1px solid @smoke;
+         margin: 0 4px 6px 0;
+         width: 100%;
+  }
+  
+  .chart-filters.xv-parameter-panel .onyx-groupbox-header {
+         padding: 6px 10px;
+         border-bottom: 1px solid @smoke;
+         background: @lightest-gray;
+         color: @near-black;
+}
+
+  .chart-filters.xv-parameter-panel .enyo-fittable-columns-layout {
+         padding: 6px 10px;
+         border-bottom: 1px solid @smoke;
+         background: @white;
+    color: @near-black;
+}
+
 }
index 727887c..600d585 100755 (executable)
@@ -1993,700 +1993,744 @@ body {
   border: none;
 }
 /**
- * Default ListItem styles when using a ModelDecorator.
- */
-.xv-list .xv-model-decorator > .xv-list-item .xv-table {
-  display: table;
-  width: 100%;
-  table-layout: fixed;
-}
-.xv-list .xv-model-decorator > .xv-list-item .xv-table .xv-cell {
-  display: table-cell;
-}
-.xv-list .xv-model-decorator > .xv-list-item .xv-list-column.xv-list-attr {
-  /**
-        * Default styling for a model's id (as designated by 'idAttribute')
-        */
-}
-.xv-list .xv-model-decorator > .xv-list-item .xv-list-column.xv-list-attr.xm-attribute-id {
-  color: blue;
+  Styles relating to Lists
+*/
+.xv-list-header {
+  background-color: #d8d8d8;
+  color: #fdfdfd;
+  font-size: .6em;
   font-weight: bold;
-  cursor: pointer;
+  text-transform: uppercase;
+  padding-top: 4px;
+  padding-bottom: 4px;
+  border-bottom: 1px solid #aaaaaa;
 }
-.xv-list .xv-model-decorator > .xv-list-item .xv-list-column.xv-list-attr.xm-attribute-name {
-  font-weight: bold;
+.xv-list-header .xv-list-column.last {
+  border-right: none;
 }
-.xv-list .xv-model-decorator > .xv-list-item .xv-list-column.xv-list-attr.xm-attributetype-number {
-  text-align: right;
+.xv-list-header .xv-list-column.name-column,
+.xv-list-header .xv-list-column.first,
+.xv-list-header .xv-list-column.second,
+.xv-list-header .xv-list-column.third,
+.xv-list-header .xv-list-column.short,
+.xv-list-header .xv-list-column.small,
+.xv-list-header .xv-list-column.medium,
+.xv-list-header .xv-list-column.descr {
+  padding-left: 7px;
 }
-.xv-list .xv-model-decorator > .xv-list-item .xv-list-column.xv-list-attr.xm-attributetype-money {
+/* List */
+.xv-list-column.line-number {
+  width: 30px;
   text-align: right;
 }
-.xv-list .xv-model-decorator > .xv-list-item .xv-list-column.xv-list-attr.xm-attributetype-date {
+.xv-list-column.name-column {
+  width: 200px;
+}
+.xv-list-column.right-column {
+  width: 100px;
   text-align: right;
 }
-.xv-list .xv-model-decorator > .xv-list-item.item-selected .xv-list-attr {
-  color: white;
+.xv-list-column.short {
+  width: 100px;
 }
-.xv-list .xv-model-decorator > .xv-list-item.item-selected .xv-list-attr.xm-attribute-id {
-  color: #ff6529;
+.xv-list-column.small {
+  width: 125px;
 }
-/**
-  Styles related to pickers, combo boxes, and relation widgets
-*/
-.onyx-picker-decorator .onyx-button {
-  padding: 12px 8px 12px 8px;
+.xv-list-column.medium {
   width: 150px;
 }
-.onyx-picker .onyx-menu-item {
-  text-align: left;
-  text-overflow: ellipsis;
-}
-.picker-icon {
-  position: absolute;
-  right: 0;
-  margin: 0 10px 0 2px;
-  color: #070707;
-}
-.xv-picker-button {
-  text-align: left;
+.xv-list-column.first {
+  width: 300px;
 }
-.xv-picker-button .picker-content {
-  max-width: 100px;
-  overflow: hidden;
+.xv-list-column.second {
+  width: 200px;
 }
-.xv-picker-button.disabled {
-  color: #777777;
+.xv-list-column.third {
+  width: 100px;
 }
-.xv-picker-label {
-  color: #070707;
-  padding: 20px 8px 8px 8px;
+.xv-list-column.money,
+.xv-list-column.quantity {
+  width: 75px;
   text-align: right;
-  width: 130px;
 }
-.xv-picker-label.disabled {
-  color: #777777;
+.xv-list-column.descr {
+  width: 200px;
 }
-.xv-combobox .onyx-input-decorator input {
-  width: 145px;
+.xv-list-column.icon {
+  width: 10px;
 }
-.xv-combobox .icon-sort {
-  color: #357ec7;
+.xv-list {
+  background: #f8f8f8;
+}
+.xv-list .xv-list-item > * {
+  display: inline-block;
   vertical-align: middle;
 }
-.xv-combobox-note {
-  padding: 14px 3px 8px 3px;
-  text-align: left;
+.xv-list .xv-list-item {
+  background-color: #fdfdfd;
+  border-bottom: 1px solid #d7d7d7;
+  min-height: 32px;
 }
-/*
-  Styles relating to the grid box
-*/
-/* Entire box including the grid and the summary panel */
-.xv-grid-box {
-  /**
-    This is the most general grid row that
-    is not specific to read-only or selected
-  */
+.xv-list .xv-list-item.header {
+  padding-top: 0;
 }
-.xv-grid-box.small-panel {
-  width: 600px;
+.xv-list .xv-list-item.inactive {
+  background-color: #d8d8d8;
+  color: #070707;
 }
-.xv-grid-box.medium-panel {
-  width: 700px;
+.xv-list .xv-list-item.inactive .xv-list-column .xv-list-attr {
+  background: transparent;
 }
-.xv-grid-box.large-panel {
-  width: 800px;
+.xv-list .xv-list-item.inactive .xv-list-column .xv-list-attr.placeholder {
+  color: #d8d8d8;
 }
-.xv-grid-box .enyo-list-page > *:first-child .xv-grid-row {
-  border-top: 0;
+.xv-list .xv-list-item .xv-list-column .list-icon {
+  padding: 2px;
+  color: #666666;
+  vertical-align: sub;
+  border: 1px solid #efefef;
+  -webkit-border-radius: 2px;
+  -moz-border-radius: 2px;
+  border-radius: 2px;
 }
-.xv-grid-box .xv-above-grid-list {
-  border: 0;
+.xv-list .xv-list-item.item-selected {
+  background: #226b9a;
+  background-color: #1f608c;
+  background-image: -moz-linear-gradient(top, #226b9a, #1a4f77);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#226b9a), to(#1a4f77));
+  background-image: -webkit-linear-gradient(top, #226b9a, #1a4f77);
+  background-image: -o-linear-gradient(top, #226b9a, #1a4f77);
+  background-image: linear-gradient(to bottom, #226b9a, #1a4f77);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff226b9a', endColorstr='#ff1a4f77', GradientType=0);
 }
-.xv-grid-box .xv-scroller {
+.xv-list .xv-list-item.item-selected .xv-list-attr {
+  color: #fdfdfd;
+}
+.xv-list .xv-list-item.item-selected .xv-list-attr.placeholder {
+  font-style: italic;
+  color: #99ccff;
+}
+.xv-list .xv-list-item.item-selected .xv-list-attr.hyperlink {
+  color: #ff6529;
+}
+.xv-list .xv-list-item.item-selected .xv-list-attr.header {
+  background: #99ccff;
+}
+.xv-list .xv-list-item .xv-list-item-gear {
+  position: absolute;
+  right: 0px;
+  z-index: 999;
+}
+.xv-list.xv-grid-list {
   background: #f8f8f8;
 }
-.xv-grid-box .xv-grid-attr.bold {
-  font-weight: bold;
+.xv-list.xv-grid-list .xv-list-item > * {
+  vertical-align: top;
 }
-.xv-grid-box .xv-grid-attr.error {
-  color: #ff0000;
+.xv-list.xv-grid-list .xv-list-item {
+  padding-top: 7px !important;
+  padding-bottom: 9px !important;
+  border-bottom: 1px solid #aaaaaa !important;
+  background: #f8f8f8;
 }
-.xv-grid-box .xv-grid-attr.emphasis {
-  color: #009000;
+.xv-list.xv-grid-list .xv-list-item.item-selected {
+  background: #226b9a;
+  background-color: #1f608c;
+  background-image: -moz-linear-gradient(top, #226b9a, #1a4f77);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#226b9a), to(#1a4f77));
+  background-image: -webkit-linear-gradient(top, #226b9a, #1a4f77);
+  background-image: -o-linear-gradient(top, #226b9a, #1a4f77);
+  background-image: linear-gradient(to bottom, #226b9a, #1a4f77);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff226b9a', endColorstr='#ff1a4f77', GradientType=0);
 }
-.xv-grid-box .xv-grid-attr.warn {
-  color: #ff9c00;
+.xv-list.xv-grid-list .xv-list-item.item-selected .xv-list-attr {
+  color: #fdfdfd;
 }
-.xv-grid-box .xv-grid-attr.italic {
+.xv-list.xv-grid-list .xv-list-item.item-selected .xv-list-attr.placeholder {
   font-style: italic;
+  color: #99ccff;
 }
-.xv-grid-box .xv-grid-attr.placeholder {
-  font-style: italic;
-  color: #93a1a1;
+.xv-list.xv-grid-list .xv-list-item.item-selected .xv-list-attr.hyperlink {
+  color: #ff6529;
 }
-.xv-grid-box .xv-grid-attr.hyperlink {
-  color: blue;
+.xv-list.xv-grid-list .xv-list-item.item-selected .xv-list-attr.header {
+  background: #99ccff;
 }
-.xv-grid-box .xv-gridbox-button {
-  color: #357ec7;
-  font-size: 18px;
-  border: none;
-  background: transparent;
+.xv-list.xv-grid-list .xv-list-item .xv-list-column {
+  vertical-align: top;
 }
-.xv-grid-box .xv-grid-row {
+.xv-list.xv-grid-list .xv-list-item .xv-list-column .xv-list-attr {
   font-size: 12px;
-  background-color: #d8d8d8;
-  border-bottom: 1px solid #aaaaaa;
-  vertical-align: top;
-  /**
-      This is the grid header row
-    */
 }
-.xv-grid-box .xv-grid-row > * {
-  display: inline-block;
+.xv-list.xv-grid-list .xv-list-item .xv-list-column.last {
+  border-right: none;
 }
-.xv-grid-box .xv-grid-row .xv-grid-header {
-  background-color: #d7d7d7;
-  color: #0e0e0e;
-  font-size: .8em;
-  font-weight: bold;
-  text-transform: uppercase;
-  padding-top: 4px;
+.xv-list.xv-grid-list .xv-list-item .xv-list-column.name-column {
+  padding-left: 7px;
 }
-.xv-grid-box .xv-grid-row .xv-grid-header.last {
-  border-right: none;
+.xv-list.xv-grid-list .xv-list-item .xv-list-column.first {
+  padding-left: 7px;
 }
-.xv-grid-box .xv-grid-row > * {
-  padding: 6px 4px;
-  border: none;
+.xv-list.xv-grid-list .xv-list-item .xv-list-column.second {
+  padding-left: 7px;
 }
-.xv-grid-box .xv-grid-row .line-number {
-  vertical-align: top;
-  width: 30px;
-  text-align: right;
+.xv-list.xv-grid-list .xv-list-item .xv-list-column.third {
+  padding-left: 7px;
 }
-.xv-grid-box .xv-grid-row .grid-actions {
-  display: block;
-  padding-left: 30px;
-  border-radius: 4px;
-  border-width: 0;
-  background: #f3f3f3;
-  margin: 6px;
+.xv-list.xv-grid-list .xv-list-item .xv-list-column.short {
+  padding-left: 7px;
 }
-.xv-grid-box .xv-grid-row .grid-actions > * {
-  display: inline-block;
-  width: 100%;
+.xv-list.xv-grid-list .xv-list-item .xv-list-column.small {
+  padding-left: 7px;
 }
-.xv-grid-box .xv-grid-row .grid-item {
-  vertical-align: top;
-  width: 175px;
+.xv-list.xv-grid-list .xv-list-item .xv-list-column.medium {
+  padding-left: 7px;
 }
-.xv-grid-box .xv-grid-row .quantity {
-  vertical-align: top;
-  text-align: right;
-  width: 100px;
+.xv-list.xv-grid-list .xv-list-item .xv-list-column.descr {
+  padding-left: 7px;
 }
-.xv-grid-box .xv-grid-row .percent {
-  vertical-align: top;
-  text-align: right;
-  width: 90px;
+.xv-list.xv-grid-list .xv-list-item .xv-list-column .xv-list-attr {
+  padding: 0px;
 }
-.xv-grid-box .xv-grid-row .price {
-  vertical-align: top;
-  text-align: right;
-  width: 90px;
+.xv-list-attr {
+  padding: 5px;
+  font-size: .8em;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  color: #070707;
 }
-.xv-grid-box .xv-grid-row .date {
-  vertical-align: top;
-  width: 105px;
+.xv-list-attr.header {
+  padding: 4px;
+  background: #d8d8d8;
+  font-size: .7em;
+  font-weight: bold;
+  text-transform: uppercase;
+  color: #fdfdfd;
 }
-.xv-grid-box .xv-grid-row .user {
-  vertical-align: top;
-  width: 100px;
+.xv-list-attr.footer {
+  padding: 4px;
+  background: #d8d8d8;
+  font-size: .7em;
+  font-weight: bold;
+  text-transform: uppercase;
+  color: #070707;
 }
-.xv-grid-box .xv-grid-row.readonly {
-  background: #f8f8f8;
-  min-height: 56px;
+.xv-list-attr.right {
+  position: absolute;
+  right: 10px;
 }
-.xv-grid-box .xv-grid-row.selected {
-  background-color: #fdfdfd;
-  border: 1px solid #ff6529;
+.xv-list-attr.text-align-right {
+  text-align: right;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .onyx-input-decorator {
-  padding: 0;
-  width: 100%;
-  margin: 0;
+.xv-list-attr.bold {
+  font-weight: bold;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .onyx-input-decorator input {
-  width: 100%;
-  font-size: 13px;
+.xv-list-attr.error {
+  color: #ff0000;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .onyx-picker-decorator {
-  padding-top: 6px;
-  width: 100%;
+.xv-list-attr.emphasis {
+  color: #009000;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .onyx-picker-decorator .onyx-button {
-  height: 26px;
-  padding-top: 3px;
-  width: 100%;
-  font-size: 13px;
+.xv-list-attr.warn {
+  color: #ff9c00;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-input {
-  border: none;
+.xv-list-attr.italic {
+  font-style: italic;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-picker-label {
-  display: none;
+.xv-list-attr.placeholder {
+  font-style: italic;
+  color: #777777;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-datewidget {
-  margin-right: 10px;
-  padding-top: 0;
+.xv-list-attr.hyperlink {
+  color: blue;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-datewidget .onyx-input-decorator {
-  padding: 0;
-  width: 100%;
+.xv-list-attr.disabled {
+  color: #777777;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-datewidget .onyx-input-decorator input {
-  width: 85%;
-  font-size: 13px;
+/* Navigator */
+.xv-navigator-header {
+  font-size: small;
+  font-weight: bold;
+  text-transform: uppercase;
+  color: #ff6600;
+  padding-left: 20px;
+  border-bottom: 1px solid #0e0e0e;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-numberwidget {
-  padding-top: 6px;
+.xv-workspace-header {
+  color: #fdfdfd;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  padding: 8px 0 0 8px;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-numberwidget .onyx-input-decorator {
-  padding: 0;
+/**
+ * Default ListItem styles when using a ModelDecorator.
+ */
+.xv-list .xv-model-decorator > .xv-list-item .xv-table {
+  display: table;
   width: 100%;
-  margin: 0;
+  table-layout: fixed;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-numberwidget .onyx-input-decorator input {
-  width: 100%;
-  font-size: 13px;
+.xv-list .xv-model-decorator > .xv-list-item .xv-table .xv-cell {
+  display: table-cell;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-combobox {
-  padding-left: 0;
+.xv-list .xv-model-decorator > .xv-list-item .xv-list-column.xv-list-attr {
+  /**
+        * Default styling for a model's id (as designated by 'idAttribute')
+        */
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-combobox input {
-  padding-top: 3px;
-  width: 80px;
-  font-size: 13px;
+.xv-list .xv-model-decorator > .xv-list-item .xv-list-column.xv-list-attr.xm-attribute-id {
+  color: blue;
+  font-weight: bold;
+  cursor: pointer;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-moneywidget {
-  padding-bottom: 0;
+.xv-list .xv-model-decorator > .xv-list-item .xv-list-column.xv-list-attr.xm-attribute-name {
+  font-weight: bold;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-moneywidget .onyx-input-decorator {
-  padding: 0;
-  width: 100%;
-  margin: 0;
+.xv-list .xv-model-decorator > .xv-list-item .xv-list-column.xv-list-attr.xm-attributetype-number {
+  text-align: right;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-moneywidget .onyx-input-decorator input {
-  width: 100%;
-  font-size: 13px;
+.xv-list .xv-model-decorator > .xv-list-item .xv-list-column.xv-list-attr.xm-attributetype-money {
+  text-align: right;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-relationwidget .onyx-input-decorator {
-  width: 100%;
-  padding-top: 6px;
+.xv-list .xv-model-decorator > .xv-list-item .xv-list-column.xv-list-attr.xm-attributetype-date {
+  text-align: right;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-relationwidget .onyx-input {
-  width: 85%;
-  padding-right: 4px;
+.xv-list .xv-model-decorator > .xv-list-item.item-selected .xv-list-attr {
+  color: white;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-useraccount-widget .xv-subinput {
-  width: 80px;
-  height: 16px;
+.xv-list .xv-model-decorator > .xv-list-item.item-selected .xv-list-attr.xm-attribute-id {
+  color: #ff6529;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-subinput {
-  width: 100%;
+/**
+  Styles related to pickers, combo boxes, and relation widgets
+*/
+.onyx-picker-decorator .onyx-button {
+  padding: 12px 8px 12px 8px;
+  width: 150px;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-input {
-  padding-top: 6px;
-  width: 100%;
-  border: none;
+.onyx-picker .onyx-menu-item {
+  text-align: left;
+  text-overflow: ellipsis;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-label,
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-flexible-label,
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-relationwidget-secondarydescription {
-  display: none;
+.picker-icon {
+  position: absolute;
+  right: 0;
+  margin: 0 10px 0 2px;
+  color: #070707;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-relationwidget-description {
-  text-indent: 0;
-  padding-bottom: 0;
-  padding-top: 8px;
+.xv-picker-button {
+  text-align: left;
 }
-.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-private-item-site-widget {
-  border-bottom: 0;
+.xv-picker-button .picker-content {
+  max-width: 100px;
+  overflow: hidden;
 }
-.xv-grid-box.xv-groupbox .xv-sales-summary-panel {
-  border: none;
-  margin-top: 0;
-  padding-left: 0;
-  padding-right: 0;
+.xv-picker-button.disabled {
+  color: #777777;
 }
-.xv-grid-box.xv-groupbox .xv-sales-summary-panel .xv-sales-summary-total-group {
-  padding: 0;
-  border: none;
+.xv-picker-label {
+  color: #070707;
+  padding: 20px 8px 8px 8px;
+  text-align: right;
+  width: 130px;
 }
-.xv-grid-box.xv-groupbox .xv-sales-summary-panel .xv-sales-summary-total-group .xv-moneywidget {
-  padding-bottom: 0;
-  padding-top: 0;
-}
-.xv-grid-box.xv-groupbox .xv-sales-summary-panel .xv-sales-summary-total-group .xv-moneywidget .xv-input-decorator {
-  padding-bottom: 0;
-  padding-top: 0;
+.xv-picker-label.disabled {
+  color: #777777;
 }
-.xv-grid-box.xv-groupbox .xv-sales-summary-panel .xv-sales-summary-total-group .xv-numberwidget {
-  padding-bottom: 0;
-  padding-top: 0;
+.xv-combobox .onyx-input-decorator input {
+  width: 145px;
 }
-.xv-grid-box.xv-groupbox .xv-sales-summary-panel .xv-sales-summary-total-group .xv-numberwidget .xv-input-decorator {
-  width: 163px;
-  padding-bottom: 0;
-  padding-top: 0;
+.xv-combobox .icon-sort {
+  color: #357ec7;
+  vertical-align: middle;
 }
-.xv-grid-list .xv-list-column {
-  vertical-align: top !important;
+.xv-combobox-note {
+  padding: 14px 3px 8px 3px;
+  text-align: left;
 }
 /*
-  Styles relating to the dashboard
-*/
-/*
-  Variables for widths/colors
+  Styles relating to the grid box
 */
-.dashboard {
-  background-color: #d8d8d8;
-  /*
-    These styles will only be used
-    if the chart is in a dashboard
+/* Entire box including the grid and the summary panel */
+.xv-grid-box {
+  /**
+    This is the most general grid row that
+    is not specific to read-only or selected
   */
 }
-.dashboard .charts-panels {
-  overflow-y: auto;
+.xv-grid-box.small-panel {
+  width: 600px;
 }
-.dashboard .selectable-chart {
-  width: 500px;
-  height: 230px;
+.xv-grid-box.medium-panel {
+  width: 700px;
 }
-.dashboard .selectable-chart .chart-title-bar {
-  width: 500px;
+.xv-grid-box.large-panel {
+  width: 800px;
 }
-.dashboard .nvtooltip {
-  color: black;
+.xv-grid-box .enyo-list-page > *:first-child .xv-grid-row {
+  border-top: 0;
 }
-.selectable-chart {
-  margin: 10px;
-  color: #fdfdfd;
-  overflow: hidden;
+.xv-grid-box .xv-above-grid-list {
+  border: 0;
 }
-.selectable-chart .chart-title-bar {
-  height: 32px;
-  background-color: #373737;
-  -webkit-border-top-right-radius: 10px;
-  -moz-border-radius-topright: 10px;
-  border-top-right-radius: 10px;
-  -webkit-border-top-left-radius: 10px;
-  -moz-border-radius-topleft: 10px;
-  border-top-left-radius: 10px;
+.xv-grid-box .xv-scroller {
+  background: #f8f8f8;
 }
-.selectable-chart .chart-title-bar .chart-title {
-  padding-top: 8px;
-  text-align: center;
+.xv-grid-box .xv-grid-attr.bold {
+  font-weight: bold;
 }
-.selectable-chart .chart-title-bar .remove-icon {
-  position: absolute;
-  top: 0;
-  right: 0;
+.xv-grid-box .xv-grid-attr.error {
+  color: #ff0000;
 }
-.selectable-chart .chart-bottom {
-  background-color: #666666;
-  border: 1px solid #444444;
-  border-top: none;
-  -webkit-border-bottom-right-radius: 10px;
-  -moz-border-radius-bottomright: 10px;
-  border-bottom-right-radius: 10px;
-  -webkit-border-bottom-left-radius: 10px;
-  -moz-border-radius-bottomleft: 10px;
-  border-bottom-left-radius: 10px;
+.xv-grid-box .xv-grid-attr.emphasis {
+  color: #009000;
 }
-.selectable-chart .chart-bottom .xv-picker-label {
-  width: 100px;
-  color: #fdfdfd;
+.xv-grid-box .xv-grid-attr.warn {
+  color: #ff9c00;
 }
-.selectable-chart .chart-bottom .onyx-button {
-  width: 130px;
-  padding: 10px 10px;
+.xv-grid-box .xv-grid-attr.italic {
+  font-style: italic;
 }
-/**
-  Styles relating to Lists
-*/
-.xv-list-header {
+.xv-grid-box .xv-grid-attr.placeholder {
+  font-style: italic;
+  color: #93a1a1;
+}
+.xv-grid-box .xv-grid-attr.hyperlink {
+  color: blue;
+}
+.xv-grid-box .xv-gridbox-button {
+  color: #357ec7;
+  font-size: 18px;
+  border: none;
+  background: transparent;
+}
+.xv-grid-box .xv-grid-row {
+  font-size: 12px;
   background-color: #d8d8d8;
-  color: #fdfdfd;
-  font-size: .6em;
+  border-bottom: 1px solid #aaaaaa;
+  vertical-align: top;
+  /**
+      This is the grid header row
+    */
+}
+.xv-grid-box .xv-grid-row > * {
+  display: inline-block;
+}
+.xv-grid-box .xv-grid-row .xv-grid-header {
+  background-color: #d7d7d7;
+  color: #0e0e0e;
+  font-size: .8em;
   font-weight: bold;
   text-transform: uppercase;
   padding-top: 4px;
-  padding-bottom: 4px;
-  border-bottom: 1px solid #aaaaaa;
 }
-.xv-list-header .xv-list-column.last {
+.xv-grid-box .xv-grid-row .xv-grid-header.last {
   border-right: none;
 }
-.xv-list-header .xv-list-column.name-column,
-.xv-list-header .xv-list-column.first,
-.xv-list-header .xv-list-column.second,
-.xv-list-header .xv-list-column.third,
-.xv-list-header .xv-list-column.short,
-.xv-list-header .xv-list-column.small,
-.xv-list-header .xv-list-column.medium,
-.xv-list-header .xv-list-column.descr {
-  padding-left: 7px;
+.xv-grid-box .xv-grid-row > * {
+  padding: 6px 4px;
+  border: none;
 }
-/* List */
-.xv-list-column.line-number {
+.xv-grid-box .xv-grid-row .line-number {
+  vertical-align: top;
   width: 30px;
   text-align: right;
 }
-.xv-list-column.name-column {
-  width: 200px;
+.xv-grid-box .xv-grid-row .grid-actions {
+  display: block;
+  padding-left: 30px;
+  border-radius: 4px;
+  border-width: 0;
+  background: #f3f3f3;
+  margin: 6px;
 }
-.xv-list-column.right-column {
-  width: 100px;
-  text-align: right;
+.xv-grid-box .xv-grid-row .grid-actions > * {
+  display: inline-block;
+  width: 100%;
 }
-.xv-list-column.short {
-  width: 100px;
+.xv-grid-box .xv-grid-row .grid-item {
+  vertical-align: top;
+  width: 175px;
 }
-.xv-list-column.small {
-  width: 125px;
+.xv-grid-box .xv-grid-row .quantity {
+  vertical-align: top;
+  text-align: right;
+  width: 100px;
 }
-.xv-list-column.medium {
-  width: 150px;
+.xv-grid-box .xv-grid-row .percent {
+  vertical-align: top;
+  text-align: right;
+  width: 90px;
 }
-.xv-list-column.first {
-  width: 300px;
+.xv-grid-box .xv-grid-row .price {
+  vertical-align: top;
+  text-align: right;
+  width: 90px;
 }
-.xv-list-column.second {
-  width: 200px;
+.xv-grid-box .xv-grid-row .date {
+  vertical-align: top;
+  width: 105px;
 }
-.xv-list-column.third {
+.xv-grid-box .xv-grid-row .user {
+  vertical-align: top;
   width: 100px;
 }
-.xv-list-column.money,
-.xv-list-column.quantity {
-  width: 75px;
-  text-align: right;
+.xv-grid-box .xv-grid-row.readonly {
+  background: #f8f8f8;
+  min-height: 56px;
 }
-.xv-list-column.descr {
-  width: 200px;
+.xv-grid-box .xv-grid-row.selected {
+  background-color: #fdfdfd;
+  border: 1px solid #ff6529;
 }
-.xv-list-column.icon {
-  width: 10px;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .onyx-input-decorator {
+  padding: 0;
+  width: 100%;
+  margin: 0;
 }
-.xv-list {
-  background: #f8f8f8;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .onyx-input-decorator input {
+  width: 100%;
+  font-size: 13px;
 }
-.xv-list .xv-list-item > * {
-  display: inline-block;
-  vertical-align: middle;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .onyx-picker-decorator {
+  padding-top: 6px;
+  width: 100%;
 }
-.xv-list .xv-list-item {
-  background-color: #fdfdfd;
-  border-bottom: 1px solid #d7d7d7;
-  min-height: 32px;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .onyx-picker-decorator .onyx-button {
+  height: 26px;
+  padding-top: 3px;
+  width: 100%;
+  font-size: 13px;
 }
-.xv-list .xv-list-item.header {
-  padding-top: 0;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-input {
+  border: none;
 }
-.xv-list .xv-list-item.inactive {
-  background-color: #d8d8d8;
-  color: #070707;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-picker-label {
+  display: none;
 }
-.xv-list .xv-list-item.inactive .xv-list-column .xv-list-attr {
-  background: transparent;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-datewidget {
+  margin-right: 10px;
+  padding-top: 0;
 }
-.xv-list .xv-list-item.inactive .xv-list-column .xv-list-attr.placeholder {
-  color: #d8d8d8;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-datewidget .onyx-input-decorator {
+  padding: 0;
+  width: 100%;
 }
-.xv-list .xv-list-item .xv-list-column .list-icon {
-  padding: 2px;
-  color: #666666;
-  vertical-align: sub;
-  border: 1px solid #efefef;
-  -webkit-border-radius: 2px;
-  -moz-border-radius: 2px;
-  border-radius: 2px;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-datewidget .onyx-input-decorator input {
+  width: 85%;
+  font-size: 13px;
 }
-.xv-list .xv-list-item.item-selected {
-  background: #226b9a;
-  background-color: #1f608c;
-  background-image: -moz-linear-gradient(top, #226b9a, #1a4f77);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#226b9a), to(#1a4f77));
-  background-image: -webkit-linear-gradient(top, #226b9a, #1a4f77);
-  background-image: -o-linear-gradient(top, #226b9a, #1a4f77);
-  background-image: linear-gradient(to bottom, #226b9a, #1a4f77);
-  background-repeat: repeat-x;
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff226b9a', endColorstr='#ff1a4f77', GradientType=0);
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-numberwidget {
+  padding-top: 6px;
 }
-.xv-list .xv-list-item.item-selected .xv-list-attr {
-  color: #fdfdfd;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-numberwidget .onyx-input-decorator {
+  padding: 0;
+  width: 100%;
+  margin: 0;
 }
-.xv-list .xv-list-item.item-selected .xv-list-attr.placeholder {
-  font-style: italic;
-  color: #99ccff;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-numberwidget .onyx-input-decorator input {
+  width: 100%;
+  font-size: 13px;
 }
-.xv-list .xv-list-item.item-selected .xv-list-attr.hyperlink {
-  color: #ff6529;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-combobox {
+  padding-left: 0;
 }
-.xv-list .xv-list-item.item-selected .xv-list-attr.header {
-  background: #99ccff;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-combobox input {
+  padding-top: 3px;
+  width: 80px;
+  font-size: 13px;
 }
-.xv-list .xv-list-item .xv-list-item-gear {
-  position: absolute;
-  right: 0px;
-  z-index: 999;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-moneywidget {
+  padding-bottom: 0;
 }
-.xv-list.xv-grid-list {
-  background: #f8f8f8;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-moneywidget .onyx-input-decorator {
+  padding: 0;
+  width: 100%;
+  margin: 0;
 }
-.xv-list.xv-grid-list .xv-list-item > * {
-  vertical-align: top;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-moneywidget .onyx-input-decorator input {
+  width: 100%;
+  font-size: 13px;
 }
-.xv-list.xv-grid-list .xv-list-item {
-  padding-top: 7px !important;
-  padding-bottom: 9px !important;
-  border-bottom: 1px solid #aaaaaa !important;
-  background: #f8f8f8;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-relationwidget .onyx-input-decorator {
+  width: 100%;
+  padding-top: 6px;
 }
-.xv-list.xv-grid-list .xv-list-item.item-selected {
-  background: #226b9a;
-  background-color: #1f608c;
-  background-image: -moz-linear-gradient(top, #226b9a, #1a4f77);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#226b9a), to(#1a4f77));
-  background-image: -webkit-linear-gradient(top, #226b9a, #1a4f77);
-  background-image: -o-linear-gradient(top, #226b9a, #1a4f77);
-  background-image: linear-gradient(to bottom, #226b9a, #1a4f77);
-  background-repeat: repeat-x;
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff226b9a', endColorstr='#ff1a4f77', GradientType=0);
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-relationwidget .onyx-input {
+  width: 85%;
+  padding-right: 4px;
 }
-.xv-list.xv-grid-list .xv-list-item.item-selected .xv-list-attr {
-  color: #fdfdfd;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-useraccount-widget .xv-subinput {
+  width: 80px;
+  height: 16px;
 }
-.xv-list.xv-grid-list .xv-list-item.item-selected .xv-list-attr.placeholder {
-  font-style: italic;
-  color: #99ccff;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-subinput {
+  width: 100%;
 }
-.xv-list.xv-grid-list .xv-list-item.item-selected .xv-list-attr.hyperlink {
-  color: #ff6529;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-input {
+  padding-top: 6px;
+  width: 100%;
+  border: none;
 }
-.xv-list.xv-grid-list .xv-list-item.item-selected .xv-list-attr.header {
-  background: #99ccff;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-label,
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-flexible-label,
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-relationwidget-secondarydescription {
+  display: none;
 }
-.xv-list.xv-grid-list .xv-list-item .xv-list-column {
-  vertical-align: top;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-relationwidget-description {
+  text-indent: 0;
+  padding-bottom: 0;
+  padding-top: 8px;
 }
-.xv-list.xv-grid-list .xv-list-item .xv-list-column .xv-list-attr {
-  font-size: 12px;
+.xv-grid-box .xv-grid-row.selected .xv-grid-column .xv-private-item-site-widget {
+  border-bottom: 0;
 }
-.xv-list.xv-grid-list .xv-list-item .xv-list-column.last {
-  border-right: none;
+.xv-grid-box.xv-groupbox .xv-sales-summary-panel {
+  border: none;
+  margin-top: 0;
+  padding-left: 0;
+  padding-right: 0;
 }
-.xv-list.xv-grid-list .xv-list-item .xv-list-column.name-column {
-  padding-left: 7px;
+.xv-grid-box.xv-groupbox .xv-sales-summary-panel .xv-sales-summary-total-group {
+  padding: 0;
+  border: none;
 }
-.xv-list.xv-grid-list .xv-list-item .xv-list-column.first {
-  padding-left: 7px;
+.xv-grid-box.xv-groupbox .xv-sales-summary-panel .xv-sales-summary-total-group .xv-moneywidget {
+  padding-bottom: 0;
+  padding-top: 0;
 }
-.xv-list.xv-grid-list .xv-list-item .xv-list-column.second {
-  padding-left: 7px;
+.xv-grid-box.xv-groupbox .xv-sales-summary-panel .xv-sales-summary-total-group .xv-moneywidget .xv-input-decorator {
+  padding-bottom: 0;
+  padding-top: 0;
 }
-.xv-list.xv-grid-list .xv-list-item .xv-list-column.third {
-  padding-left: 7px;
+.xv-grid-box.xv-groupbox .xv-sales-summary-panel .xv-sales-summary-total-group .xv-numberwidget {
+  padding-bottom: 0;
+  padding-top: 0;
 }
-.xv-list.xv-grid-list .xv-list-item .xv-list-column.short {
-  padding-left: 7px;
+.xv-grid-box.xv-groupbox .xv-sales-summary-panel .xv-sales-summary-total-group .xv-numberwidget .xv-input-decorator {
+  width: 163px;
+  padding-bottom: 0;
+  padding-top: 0;
 }
-.xv-list.xv-grid-list .xv-list-item .xv-list-column.small {
-  padding-left: 7px;
+.xv-grid-list .xv-list-column {
+  vertical-align: top !important;
 }
-.xv-list.xv-grid-list .xv-list-item .xv-list-column.medium {
-  padding-left: 7px;
+/*
+  Styles relating to the dashboard
+*/
+/*
+  Variables for widths/colors
+*/
+.dashboard {
+  background-color: #d8d8d8;
+  /*
+    These styles will only be used
+    if the chart is in a dashboard
+  */
 }
-.xv-list.xv-grid-list .xv-list-item .xv-list-column.descr {
-  padding-left: 7px;
+.dashboard .charts-panels {
+  overflow-y: auto;
 }
-.xv-list.xv-grid-list .xv-list-item .xv-list-column .xv-list-attr {
-  padding: 0px;
+.dashboard .selectable-chart {
+  width: 500px;
+  height: 230px;
 }
-.xv-list-attr {
-  padding: 5px;
-  font-size: .8em;
-  white-space: nowrap;
+.dashboard .selectable-chart .chart-title-bar {
+  width: 500px;
+}
+.dashboard .nvtooltip {
+  color: black;
+}
+.selectable-chart {
+  margin: 10px;
+  color: #357ec7;
   overflow: hidden;
-  text-overflow: ellipsis;
-  color: #070707;
 }
-.xv-list-attr.header {
-  padding: 4px;
-  background: #d8d8d8;
-  font-size: .7em;
-  font-weight: bold;
-  text-transform: uppercase;
-  color: #fdfdfd;
+.selectable-chart .xv-list-item {
+  border-bottom: 1px solid grey;
+  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
 }
-.xv-list-attr.footer {
-  padding: 4px;
-  background: #d8d8d8;
-  font-size: .7em;
-  font-weight: bold;
-  text-transform: uppercase;
-  color: #070707;
+.selectable-chart .xv-list-item .long {
+  padding-left: 7px;
+  width: 250px;
 }
-.xv-list-attr.right {
-  position: absolute;
-  right: 10px;
+.selectable-chart .onyx-popup {
+  margin-top: 40px;
+  margin-left: 200px;
 }
-.xv-list-attr.text-align-right {
-  text-align: right;
+.selectable-chart .chart-title-bar {
+  height: 32px;
+  background-color: #efefef;
+  -webkit-border-top-right-radius: 10px;
+  -moz-border-radius-topright: 10px;
+  border-top-right-radius: 10px;
+  -webkit-border-top-left-radius: 10px;
+  -moz-border-radius-topleft: 10px;
+  border-top-left-radius: 10px;
 }
-.xv-list-attr.bold {
-  font-weight: bold;
+.selectable-chart .chart-title-bar .chart-title {
+  padding-top: 8px;
+  color: #070707;
+  text-align: center;
+  /*font-size: 2em;*/
+  font-weight: normal;
 }
-.xv-list-attr.error {
-  color: #ff0000;
+.selectable-chart .chart-title-bar .remove-icon {
+  position: absolute;
+  top: 0;
+  right: 0;
 }
-.xv-list-attr.emphasis {
-  color: #009000;
+.selectable-chart .chart-title-bar .icon-filter {
+  color: #070707;
+  position: absolute;
+  right: 35px;
 }
-.xv-list-attr.warn {
-  color: #ff9c00;
+.selectable-chart .chart-bottom {
+  background-color: #fdfdfd;
+  border: 1px solid #444444;
+  border-top: none;
+  -webkit-border-bottom-right-radius: 10px;
+  -moz-border-radius-bottomright: 10px;
+  border-bottom-right-radius: 10px;
+  -webkit-border-bottom-left-radius: 10px;
+  -moz-border-radius-bottomleft: 10px;
+  border-bottom-left-radius: 10px;
 }
-.xv-list-attr.italic {
-  font-style: italic;
+.selectable-chart .chart-bottom .xv-picker-label {
+  width: 100px;
+  color: #070707;
 }
-.xv-list-attr.placeholder {
-  font-style: italic;
-  color: #777777;
+.selectable-chart .chart-bottom .onyx-button {
+  width: 130px;
+  padding: 10px 10px;
 }
-.xv-list-attr.hyperlink {
-  color: blue;
+.selectable-chart .chart-filters {
+  background-color: #fdfdfd;
+  -webkit-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);
+  -moz-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);
+  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);
 }
-.xv-list-attr.disabled {
-  color: #777777;
+.selectable-chart .chart-filters .xv-parameter-panel {
+  background-color: #f8f8f8;
+  border: 1px solid #d7d7d7;
+  margin: 0 4px 6px 0;
+  width: 100%;
 }
-/* Navigator */
-.xv-navigator-header {
-  font-size: small;
-  font-weight: bold;
-  text-transform: uppercase;
-  color: #ff6600;
-  padding-left: 20px;
-  border-bottom: 1px solid #0e0e0e;
+.selectable-chart .chart-filters.xv-parameter-panel .onyx-groupbox-header {
+  padding: 6px 10px;
+  border-bottom: 1px solid #d7d7d7;
+  background: #efefef;
+  color: #0e0e0e;
 }
-.xv-workspace-header {
-  color: #fdfdfd;
-  white-space: nowrap;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  padding: 8px 0 0 8px;
+.selectable-chart .chart-filters.xv-parameter-panel .enyo-fittable-columns-layout {
+  padding: 6px 10px;
+  border-bottom: 1px solid #d7d7d7;
+  background: #fdfdfd;
+  color: #0e0e0e;
 }
 /**
   Styles relating to widgets in the pullout
index 4edf672..60019d0 100644 (file)
@@ -167,9 +167,7 @@ regexp:true, undef:true, strict:true, trailing:true, white:true */
     };
 
     var formatAddress = function (name, address1, address2, address3, city, state, code, country) {
-      if (!arguments[0]) { return; }
       var address = [];
-
       if (name) { address.push(name); }
       if (address1) {address.push(address1); }
       if (address2) {address.push(address2); }
@@ -193,7 +191,16 @@ regexp:true, undef:true, strict:true, trailing:true, white:true */
       }).join("-")];
     };
 
+    var formatFullName = function (firstName, lastName, honorific, suffix) {
+      var fullName = [];
+      if (honorific) { fullName.push(honorific +  ' '); }
+      fullName.push(firstName + ' ' + lastName);
+      if (suffix) { fullName.push(' ' + suffix); }
+      return fullName;
+    };
+
     var transformFunctions = {
+      fullname: formatFullName,
       address: formatAddress,
       arbl: formatArbl
     };
index 19864c7..b050f76 100644 (file)
@@ -1,5 +1,5 @@
-<package id        = "pbtodist450RC"
-         version   = "4.5.0RC"
+<package id        = "pbtodist450Beta"
+         version   = "4.5.0Beta"
          developer = "xTuple"
          descrip   = "load PostBooks resources"
          updater   = "2.2.4" >
index 1f2b899..3f2a490 100644 (file)
@@ -1,5 +1,5 @@
-<package id        = "dist450RC"
-         version   = "4.5.0RC"
+<package id        = "dist450Beta"
+         version   = "4.5.0Beta"
          developer = "xTuple"
          descrip   = "load PostBooks resources"
          updater   = "2.2.4" >
index 36851f6..db3e6cc 100644 (file)
@@ -1,5 +1,5 @@
-<package id        = "pb450RC"
-         version   = "4.5.0RC"
+<package id        = "pb450Beta"
+         version   = "4.5.0Beta"
          developer = "xTuple"
          descrip   = "load PostBooks resources"
          updater   = "2.2.4" >
index 55caeab..549c254 100644 (file)
@@ -1,5 +1,5 @@
-<package id        = "xtmfg_install450RC"
-         version   = "4.5.0RC"
+<package id        = "xtmfg_install450Beta"
+         version   = "4.5.0Beta"
          developer = "xTuple"
          descrip   = "load PostBooks resources"
          updater   = "2.2.4" >
index 56e5553..64940fa 100644 (file)
@@ -1,5 +1,5 @@
-<package id        = "xtmfg450RC"
-         version   = "4.5.0RC"
+<package id        = "xtmfg450Beta"
+         version   = "4.5.0Beta"
          developer = "xTuple"
          descrip   = "load PostBooks resources"
          updater   = "2.2.4" >
index cb794df..f0c443f 100644 (file)
@@ -726,6 +726,7 @@ TODO deferred to later sprint:
           "XV.InvoiceListItem", function () {
         XT.session.privileges.attributes.ViewMiscInvoices = false;
         XT.session.privileges.attributes.MaintainMiscInvoices = false;
+        XT.session.privileges.attributes.ViewPersonalCRMAccounts = false;
         assert.isFalse(XM.InvoiceListItem.canRead());
 
         XT.session.privileges.attributes.ViewMiscInvoices = true;
@@ -737,6 +738,7 @@ TODO deferred to later sprint:
         assert.isTrue(XM.InvoiceListItem.canRead());
 
         XT.session.privileges.attributes.ViewMiscInvoices = true;
+        XT.session.privileges.attributes.ViewPersonalCRMAccounts = true;
       });
       it("XM.InvoiceListItem is not editable", function () {
         assert.isFalse(XM.InvoiceListItem.canCreate());