-- Data for Name: pkgmetasql; Type: TABLE DATA; Schema: xtdesktop; Owner: admin
--

COPY pkgmetasql (metasql_id, metasql_group, metasql_name, metasql_notes, metasql_query, metasql_lastuser, metasql_lastupdate, metasql_grade) FROM stdin;
470	desktop	cmmntPrefUser	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group:desktop\r\n-- Name:cmmntPrefUser\r\n-- Notes: \r\n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\r\n-- See www.xtuple.com/CPAL for the full text of the software license.\r\n\r\nSELECT usr_id, usr_username\r\nFROM usr \r\nWHERE (usr_username=current_user)\r\nUNION\r\nSELECT usr_id, usr_username AS usr_username\r\nFROM usr\r\nWHERE ((usr_active = true)\r\n    AND(usr_username <> current_user))\r\nORDER BY usr_username; \r\n\r\n\r\n\r\n	\N	\N	0
207	desktop	bankBal	 Forward update balances if applicable Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  bankBal\n-- Notes: \n-- Forward update balances if applicable\n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT forwardUpdateAccount(bankaccnt_accnt_id) AS result \nFROM bankaccnt \nWHERE (NOT fetchmetricbool('ManualForwardUpdate'));\n\n-- Return results\nSELECT bankaccnt_id, bankaccnt_name, SUM(balance) AS balance,\n  'curr' AS balance_xtnumericrole\nFROM (\nSELECT bankaccnt_id, bankaccnt_name, COALESCE(trialbal_ending * -1, 0.0) AS balance\nFROM accnt\n JOIN bankaccnt ON (bankaccnt_accnt_id=accnt_id)\n JOIN trialbal ON (accnt_id=trialbal_accnt_id)\n JOIN (SELECT period_id\n       FROM period\n       JOIN yearperiod ON (period_yearperiod_id=yearperiod_id)\n       JOIN trialbal ON (trialbal_period_id=period_id)\n       WHERE (period_start <= current_date)\n       ORDER BY yearperiod_end desc, period_number desc\n       LIMIT 1) data\n   ON (trialbal_period_id=period_id)\n<? if exists("projectAccounting") ?>\nUNION ALL\nSELECT bankaccnt_id, bankaccnt_name, COALESCE(trialbal_ending * -1, 0.0) AS balance\nFROM xtprjaccnt.prjaccnt p\n JOIN ONLY accnt a ON (a.accnt_id=p.prjaccnt_accnt_id)\n JOIN bankaccnt ON (bankaccnt_accnt_id=a.accnt_id)\n JOIN trialbal ON (p.accnt_id=trialbal_accnt_id)\n JOIN (SELECT period_id\n       FROM period\n       JOIN yearperiod ON (period_yearperiod_id=yearperiod_id)\n       JOIN trialbal ON (trialbal_period_id=period_id)\n       WHERE (period_start <= current_date)\n       ORDER BY yearperiod_end desc, period_number desc\n       LIMIT 1) data\n   ON (trialbal_period_id=period_id)\n<? endif ?>\n) AS accntdata\nGROUP BY bankaccnt_id, bankaccnt_name\nORDER BY bankaccnt_name;\n	\N	\N	0
468	desktop	cmmntPrefSrc	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group:desktop\r\n-- Name:cmmntPrefSrc\r\n-- Notes: \r\n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\r\n-- See www.xtuple.com/CPAL for the full text of the software license.\r\n\r\nSELECT A.id AS id, A.cmntsource_name AS cmntsource_name, A.cmntsource_fullname AS cmntsource_fullname\r\nFROM (SELECT 1 AS id, '' AS cmntsource_name, 'All Sources' AS cmntsource_fullname\r\n      UNION\r\n      SELECT 2, 'ADDR', 'Address'\r\n      <? if exists("xtmfg_exist") ?>\r\n        UNION\r\n        SELECT 3, 'BBH', 'BBOMHead'\r\n        UNION\r\n        SELECT 4, 'BBI', 'BBOMItem'\r\n      <? endif ?>\r\n      UNION\r\n      SELECT 5, 'BMH', 'BOMHead'\r\n      UNION\r\n      SELECT 6, 'BMI', 'BOMItem'\r\n      <? if exists("xtmfg_exist") ?>\r\n        UNION\r\n        SELECT 7, 'BOH', 'BOOHead'\r\n        UNION\r\n        SELECT 8, 'BOI', 'BOOItem'\r\n        UNION\r\n        SELECT 9, 'CRMA', 'CRMAccount'\r\n      <? endif ?>\r\n      UNION\r\n      SELECT 10, 'T', 'Contact'\r\n      UNION\r\n      SELECT 11, 'C', 'Customer'\r\n      UNION\r\n      SELECT 12, 'EMP', 'Employee'\r\n      UNION\r\n      SELECT 13, 'INCDT', 'Incident'\r\n      UNION\r\n      SELECT 14, 'I', 'Item'\r\n      UNION\r\n      SELECT 15, 'IS', 'ItemSite'\r\n      UNION\r\n      SELECT 16, 'IR', 'ItemSource'\r\n      UNION\r\n      SELECT 17, 'L', 'Location'\r\n      <? if exists("xtmfg_exist") ?>\r\n        UNION\r\n        SELECT 18, 'LS', 'LotSerial'\r\n      <? endif ?>\r\n      UNION\r\n      SELECT 19, 'OPP', 'Opportunity'\r\n      UNION\r\n      SELECT 20, 'J', 'Project'\r\n      UNION\r\n      SELECT 21, 'P', 'PurchaseOrder'\r\n      UNION\r\n      SELECT 22, 'PI', 'PurchaseOrderItem'\r\n      <? if exists("xtmfg_exist") ?>\r\n        UNION\r\n        SELECT 23, 'RA', 'ReturnAuth'\r\n      <? endif ?>\r\n      UNION\r\n      SELECT 24, 'RI', 'ReturnAuthItem'\r\n      UNION\r\n      SELECT 25, 'Q', 'Quote'\r\n      UNION\r\n      SELECT 26, 'QI', 'QuoteItem'\r\n      UNION\r\n      SELECT 27, 'S', 'SalesOrder'\r\n      UNION\r\n      SELECT 28, 'SI', 'SalesOrderItem'\r\n      UNION\r\n      SELECT 29, 'TA', 'Task'\r\n      UNION\r\n      SELECT 30, 'TD', 'TodoItem'\r\n      <? if exists("xtmfg_exist") ?>\r\n        UNION\r\n        SELECT 31, 'TO', 'TransferOrder'\r\n        UNION\r\n        SELECT 32, 'TI', 'TransferOrderItem'\r\n      <? endif ?>\r\n      UNION\r\n      SELECT 33, 'V', 'Vendor'\r\n      UNION\r\n      SELECT 34, 'WH', 'Warehouse'\r\n      UNION\r\n      SELECT 35, 'W', 'WorkOrder') AS A\r\nWHERE ((true)\r\n<? if exists("sourceidlist") ?>\r\n   AND (A.id IN (<? literal("sourceidlist") ?>))\r\n<? endif ?>\r\n      )\r\nORDER BY A.id;\r\n	\N	\N	0
469	desktop	cmmntPrefType	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group:desktop\r\n-- Name:cmmntPrefType\r\n-- Notes: \r\n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\r\n-- See www.xtuple.com/CPAL for the full text of the software license.\r\n\r\nSELECT 0 AS id, 'All Types' AS commenttype_name\r\nUNION\r\nSELECT cmnttype_id AS id, cmnttype_name AS commenttype_name\r\nFROM cmnttype \r\nORDER BY commenttype_name;\r\n\r\n\r\n	\N	\N	0
471	desktop	commentConsole	Comment Console Query - update for OPP in 3.8 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  commentConsole\n-- Notes: Comment Console Query - update for OPP in 3.8\n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT\n    comment_source_id,\n    comment_date,\n    cmnttype_name,\n    firstLine(comment_text) AS comment_text,\n    comment_text AS comment_text_qttooltiprole,\n    comment_user,\n    CASE WHEN comment_source = 'OPP' THEN 'OPP-Opportunity'\n         WHEN comment_source = 'T' THEN 'T-Contact'\n         ELSE comment_source END AS comment_source,\n    CASE WHEN cmnttype_name = 'Email Received'              THEN 6.5\n         WHEN cmnttype_name = 'Email Sent'                  THEN 3.5\n         WHEN cmnttype_name = 'Internal Information'        THEN 1\n         WHEN cmnttype_name = 'Left Message'                THEN 1\n         WHEN cmnttype_name = 'Meeting'                     THEN 25\n         WHEN cmnttype_name = 'Outside Meeting'             THEN 35\n         WHEN cmnttype_name = 'Phone Call'                  THEN 7\n         WHEN cmnttype_name = 'Sample Confirmation'         THEN 1\n         WHEN cmnttype_name = 'Sample Request'              THEN 10\n         WHEN cmnttype_name = 'Sent Postcard'               THEN 1\n         WHEN cmnttype_name = 'Trade Show'                  THEN 15\n         ELSE 0 END AS points,\n    'qty' AS points_xttotalrole,\n    CASE\n-- Address\n        WHEN comment_source = 'ADDR' THEN\n              (SELECT addr_line1 || addr_line2 || addr_line3\n               FROM addr\n               WHERE ((addr_id = comment_source_id)\n                  AND (comment_source = 'ADDR')))\n\n-- BBOMHead\n <? if exists("xtmfg_exist") ?>\n        WHEN (comment_source = 'BBH')THEN\n                 (SELECT item_descrip1 || ' - ' || item_number\n                  FROM xtmfg.bbomitem, item\n                  WHERE ((comment_source_id = bbomitem_id)\n                     AND (item_id = bbomitem_parent_item_id)\n                     AND (comment_source = 'BBH')))\n <? endif ?>\n\n-- BBOMItem\n <? if exists("xtmfg_exist") ?>\n        WHEN (comment_source = 'BBI') THEN\n              (\n               (SELECT 'Parent - ' || item.item_descrip1 || ' - ' || item.item_number\n                FROM xtmfg.bbomitem, item\n                WHERE ((comment_source_id = bbomitem_id)\n                   AND (item_id = bbomitem_parent_item_id)\n                   AND (comment_source = 'BBI')))\n                || ' - ' ||\n               (SELECT 'BBOM Item - ' || item.item_descrip1 || ' - ' || item.item_number\n                FROM xtmfg.bbomitem, item\n                WHERE ((comment_source_id = bbomitem_id)\n                   AND (item_id = bbomitem_item_id)\n                   AND (comment_source = 'BBI')))\n              )\n <? endif ?>\n\n-- BOMHead\n          WHEN comment_source = 'BMH' THEN\n              (SELECT item_descrip1 || ' - ' || item_number\n               FROM item\n               JOIN bomhead ON (bomhead_item_id = item_id)\n<? if exists('hasRev') ?>\n               LEFT JOIN rev ON (rev_id = bomhead_rev_id)\n<? endif ?>\n               WHERE (comment_source_id = bomhead_item_id)\n                  AND (comment_source = 'BMH')\n<? if exists('hasRev') ?>\n                  AND (rev_status = 'A' OR coalesce(bomhead_rev_id, -1) < 0)\n<? endif ?>\n               )\n\n-- BOM Item\n        WHEN comment_source = 'BMI' THEN\n              (\n               (SELECT 'Parent - ' || item.item_descrip1 || ' - ' || item.item_number FROM\n                                     public.bomitem,\n                                     public.item\n                                     WHERE bomitem.bomitem_parent_item_id = item.item_id AND\n                                           bomitem_id = comment_source_id\n                                           AND comment_source = 'BMI')\n               || ' - ' ||\n               (SELECT 'BOM Item - ' || item.item_descrip1 || ' - ' || item.item_number FROM\n                                     public.bomitem,\n                                     public.item\n                                     WHERE bomitem.bomitem_item_id = item.item_id AND\n                                           bomitem_id = comment_source_id\n                                           AND comment_source = 'BMI')\n                                           )\n\n-- BOOHead\n <? if exists("xtmfg_exist") ?>\n          WHEN (comment_source = 'BOH') THEN\n              (SELECT item_descrip1 || ' - ' || item_number\n               FROM xtmfg.boohead, item\n               WHERE ((comment_source_id = boohead_item_id)\n                  AND (item_id = boohead_item_id)\n                  AND (comment_source = 'BOH')))\n <? endif ?>\n\n-- BOOItem\n <? if exists("xtmfg_exist") ?>\n          WHEN (comment_source = 'BOI') THEN\n               (SELECT 'Item - ' || item.item_descrip1 || ' - ' ||item.item_number\n               || ' - ' ||\n                      'Operation - ' || booitem_descrip1\n               FROM xtmfg.booitem, item\n               WHERE ((xtmfg.booitem.booitem_item_id = item_id)\n                  AND (booitem_id = comment_source_id)\n                  AND (comment_source = 'BOI')))\n <? endif ?>\n\n-- T  Contact\n        WHEN comment_source = 'T' THEN\n             (SELECT cntct_first_name || ' ' || cntct_last_name FROM cntct\n                     WHERE cntct_id = comment_source_id\n                           AND comment_source = 'T'\n              )\n-- Opportunity\n-- Put this back in after 3.8.0\n/*\n\tWHEN comment_source = 'OPP'  THEN\n              (\n               SELECT ophead_name || ' Account: ' || crmacct_number || ' - ' || crmacct_name || ' Priority: ' || incdtpriority_name || ' - ' || ' Assigned To: ' || ophead_username\n               FROM ophead\n                    LEFT OUTER JOIN crmacct ON (ophead_crmacct_id = crmacct_id)\n                    LEFT OUTER JOIN incdtpriority ON (ophead_priority_id = incdtpriority_id)\n               WHERE\n                    comment_source = 'OPP'\n                    AND comment_source_id = ophead_id\n\t      )\n*/\n-- Customer\n        WHEN comment_source = 'C' THEN\n              (SELECT cust_number || ' - ' || cust_name FROM custinfo WHERE (cust_id = comment_source_id) AND (comment_source = 'C'))\n\n-- Credit Memo - Return Auth\n  <? if exists("xtmfg_exist") ?>\n        WHEN comment_source = 'CRMA' THEN\n              (SELECT 'Credit Memo:  ' || cmhead_number || '  Return Auth: ' || rahead_number || '  Customer  ' || cust_number || ' - ' || cust_name\n                       FROM rahead, cmhead, custinfo\n                       WHERE\n                            ((cmhead_rahead_id = rahead_id)\n                         AND (cmhead_cust_id = cust_id)\n                         AND (cmhead_id = comment_source_id)\n                         AND (comment_source = 'CRMA')))\n <? endif ?>\n\n-- Employee\n        WHEN comment_source = 'EMP' THEN\n              (SELECT emp_code || '-' || emp_name\n               FROM emp\n               WHERE((comment_source_id = emp_id)\n                 AND (comment_source = 'EMP')))\n\n-- Incident\n        WHEN comment_source = 'INCDT' THEN\n              (\n               SELECT incdt_number || ' - ' ||\n                      crmacct_number || ' - ' ||\n                      crmacct_name || ' - ' ||\n                      incdt_summary\n                FROM incdt, crmacct\n                WHERE\n                incdt_id = comment_source_id\n                AND crmacct_id = incdt_crmacct_id\n                AND (comment_source = 'INCDT')\n              )\n\n-- Item\n        WHEN comment_source = 'I' THEN\n              (SELECT item_number || ' - ' || item_descrip1\n                      FROM item WHERE item_id = comment_source_id\n                                 AND (comment_source = 'I'))\n\n-- Item Site\n        WHEN comment_source = 'IS' THEN\n              (\n               SELECT item_number || ' - ' || item_descrip1\n               FROM item, itemsite\n               WHERE itemsite_item_id = item_id\n                     AND itemsite_id = comment_source_id\n                     AND (comment_source = 'IS')\n              )\n\n-- ItemSource\n        WHEN comment_source = 'IR' THEN\n              (\n               SELECT item_number || ' - ' || item_descrip1\n               FROM item, itemsrc\n               WHERE itemsrc_item_id = item_id\n                     AND itemsrc_id = comment_source_id\n                     AND (comment_source = 'IR')\n              )\n\n-- Location\n        WHEN comment_source = 'L' THEN\n              (SELECT location_name || ' - ' || location_descrip\n               FROM location\n               WHERE location_id = comment_source_id\n                AND (comment_source = 'L'))\n\n-- LotSerial\n  <? if exists("xtmfg_exist") ?>\n        WHEN comment_source = 'LS' THEN\n              (SELECT ls_number || '-' || item_number || '-' || item_descrip1 || item_descrip2\n               FROM ls, item\n               WHERE(ls_id = comment_source_id)\n                 AND(ls_item_id = item_id)\n                AND (comment_source = 'LS'))\n <? endif ?>\n-- Project\n        WHEN comment_source = 'J' THEN\n        (\n              SELECT  'Project#: ' || prj_number || ' - Descrip: ' || prj_descrip ||\n                      ' - Status: ' || prj_status || ' - Owner: ' || prj_owner_username || '- Due: ' || prj_due_date\n              FROM prj\n              WHERE\n                   prj_id = comment_source_id\n              AND (comment_source = 'J')\n        )\n-- PO Head\n        WHEN comment_source = 'P' THEN\n              (\n               SELECT pohead_number || ' - ' || vend_number || ' - ' || vend_name\n               FROM pohead, vendinfo\n               WHERE pohead_vend_id = vend_id\n                     AND comment_source_id = pohead_id\n                     AND (comment_source = 'P')\n              )\n-- PO Item\n        WHEN comment_source = 'PI' THEN\n              (\n               SELECT pohead_number || ' - ' || vend_number || ' - ' || vend_name || ' - ' ||\n                      (\n                       SELECT item_number || ' - ' || item_descrip1\n                       FROM poitem, itemsite, item\n                       WHERE poitem_itemsite_id = itemsite_id\n                             AND itemsite_item_id = item_id\n                             AND comment_source_id = poitem_id\n                             AND comment_source = 'PI'\n                      )\n                      || ' - ' || poitem_vend_item_number\n                      || ' - ' || poitem_vend_item_descrip\n               FROM pohead, vendinfo, poitem\n               WHERE pohead_vend_id = vend_id\n                     AND poitem_pohead_id = pohead_id\n                     AND comment_source_id = poitem_id\n                     AND comment_source = 'PI'\n              )\n-- Quote Head\n        WHEN comment_source = 'Q' THEN\n        (\n               SELECT 'Quote#: ' || quhead_number || ' - Customer: ' ||  cust_number || ' - ' || cust_name\n               FROM quhead, custinfo\n               WHERE quhead_cust_id = cust_id\n                     AND quhead_id = comment_source_id\n                     AND comment_source = 'Q'\n        )\n-- Quote Item\n        WHEN comment_source = 'QI' THEN\n        (\n                SELECT 'Quote#:  ' || quhead_number || '  Customer  ' || cust_number || ' - ' ||\n                        cust_name || '  Line #: ' || quitem_linenumber || ' - ' || ' Item#: ' || item_number || ' - ' || item_descrip1 || ' - Order Qty: '                        || formatQty(quitem_qtyord)\n                     FROM quhead, quitem, item, itemsite, custinfo\n\n                 WHERE\n                      quitem_quhead_id = quhead_id\n                      AND quhead_cust_id = cust_id\n                      AND quitem_itemsite_id = itemsite_id\n                      AND itemsite_item_id = item_id\n                      AND quitem_id = comment_source_id\n                      AND comment_source = 'QI'\n        )\n-- Return Auth Head\n  <? if exists("xtmfg_exist") ?>\n        WHEN comment_source = 'RA' THEN\n              (\n               SELECT rahead_number || ' - ' || cust_number || ' - ' || cust_name\n               FROM rahead, custinfo\n               WHERE rahead_cust_id = cust_id\n                     AND rahead_id = comment_source_id\n                     AND comment_source = 'RA'\n              )\n <? endif ?>\n-- SO Head\n        WHEN comment_source = 'S' THEN\n              (\n               SELECT cohead_number || ' - ' ||  cust_number || ' - ' || cust_name\n               FROM cohead, custinfo\n               WHERE cohead_cust_id = cust_id\n                     AND cohead_id = comment_source_id\n                     AND comment_source = 'S'\n              )\n-- SO Item\n        WHEN comment_source = 'SI' THEN\n              (\n                SELECT 'Sales Order:  ' || cohead_number || '  Customer  ' || cust_number || ' - ' ||\n                        cust_name || '  Line #: ' || coitem_linenumber || ' - ' || ' Item#: ' || item_number || ' - ' || item_descrip1 || ' - Order Qty: '                        || formatQty(coitem_qtyord)\n                     FROM cohead, coitem, item, itemsite, custinfo\n\n                 WHERE\n                      coitem_cohead_id = cohead_id\n                      AND cohead_cust_id = cust_id\n                      AND coitem_itemsite_id = itemsite_id\n                      AND itemsite_item_id = item_id\n                      AND coitem_id = comment_source_id\n                      AND comment_source = 'SI'\n                )\n\n-- Task\n        WHEN comment_source = 'TA' THEN\n               (\n                 SELECT prj_number || '-' || prjtask_number || '-' || prjtask_name || '-' || prjtask_descrip\n                 FROM prjtask, prj\n                 WHERE((prjtask_prj_id = prj_id)\n                    AND(prjtask_id = comment_source_id)\n                    AND(comment_source = 'TA'))\n               )\n\n--TodoItem\n        WHEN comment_source = 'TD' THEN\n               (\n                 SELECT todoitem_name || '-' || todoitem_description\n                 FROM todoitem\n                 WHERE((todoitem_id = comment_source_id)\n                    AND(comment_source = 'TD'))\n               )\n\n--Transfer Order Header\n  <? if exists("xtmfg_exist") ?>\n        WHEN comment_source = 'TO' THEN\n              (\n               SELECT 'Transfer#: ' || tohead_number || ' - Status: ' || tohead_status || ' - Source / Dest: ' ||\n                      (SELECT warehous_code FROM whsinfo WHERE warehous_id = tohead_src_warehous_id) || ' / ' ||\n                      (SELECT warehous_code FROM whsinfo WHERE warehous_id = tohead_dest_warehous_id)\n               FROM tohead\n               WHERE tohead_id = comment_source_id\n                 AND comment_source = 'TO'\n              )\n <? endif ?>\n--Transfer Order item\n  <? if exists("xtmfg_exist") ?>\n        WHEN comment_source = 'TI' THEN\n              (\n               SELECT 'Transfer#: ' || tohead_number || ' - Status: ' || tohead_status || ' - Source / Dest: ' ||\n                      (SELECT warehous_code FROM whsinfo WHERE warehous_id = tohead_src_warehous_id) || ' / ' ||\n                      (SELECT warehous_code FROM whsinfo WHERE warehous_id = tohead_dest_warehous_id) ||\n                      ' - Item: ' || item_number || ' - ' || item_descrip1 || ' - Qty: ' || formatQty(toitem_qty_ordered)\n               FROM   tohead, toitem, item\n               WHERE\n                    toitem_item_id = item_id\n                    AND toitem_tohead_id = tohead_id\n                    AND toitem_id = comment_source_id\n                    AND comment_source = 'TI'\n              )\n <? endif ?>\n-- Vendor\n        WHEN comment_source = 'V' THEN\n               (\n                 SELECT 'Vendor Name:  ' || vend_name || ' - Vendor Number: ' || vend_number\n                        FROM vendinfo\n                        WHERE vend_id = comment_source_id\n                          AND comment_source = 'V'\n               )\n\n-- Warehouse\n        WHEN comment_source = 'WH' THEN\n              (SELECT warehous_code || ' - ' || warehous_descrip\n                      FROM whsinfo WHERE warehous_id = comment_source_id\n                                     AND comment_source = 'WH')\n\n-- Work Order\n        WHEN comment_source = 'W' THEN\n              (\n              SELECT\n                         'WO#: ' || wo_number || ' - ' ||\n                         wo_subnumber || ' - ' ||\n                         'Status: ' || wo_status || ' - ' ||\n                         'Ordered: ' || formatQty(wo_qtyord) || ' - ' ||\n                         'Received: ' || formatQty(wo_qtyrcv) || ' - ' ||\n                         'Item: ' || item_number || ' - ' ||\n                         item_descrip1\n             FROM  wo, itemsite, item\n             WHERE wo_itemsite_id = itemsite_id\n                   AND itemsite_item_id = item_id\n                   AND wo_id = comment_source_id\n                   AND comment_source = 'W'\n               )\n-- Unknown\n    ELSE 'Unknown Comment Type'\n    END AS info\nFROM\n    comment, cmnttype\nWHERE\n    comment_cmnttype_id = cmnttype_id\n    <? if exists("commenttype_id") ?>\n         AND cmnttype_id IN (<? literal("commenttype_id") ?>)\n    <? endif ?>\n    --Example: these are the names given to the various comment types like 'General' or "ChangeLog' or those defined by the user.\n    --This query will give you a list of them:\n    --SELECT DISTINCT cmnttype_name, cmnttype_name  FROM cmnttype ORDER BY cmnttype_name;\n-- AND comment_text LIKE '%'\n    --Example: 'Created%' for all comments that start with the work 'Created'\n    --Example: '%question% for all comments that contain the word 'question' anywhere in the comment\n\n     <? if exists("usr_id") ?>\n         AND comment_user IN (SELECT usr_username FROM usr WHERE usr_id IN (<? literal("usr_id") ?>))\n    --  <? elseif exists("usrname") ?>\n     <? endif ?>\n     <? if not exists("show_all") ?>\n         <? if not exists("usr_id") ?>\n            AND comment_user = current_user\n            -- <? value("usrname") ?>\n          <? endif ?>\n     <? endif ?>\n    --This list will show you users who have at least one comment\n    --SELECT DISTINCT comment_user FROM comment ORDER BY comment_user;\n    <? if exists("source") ?>\n      AND comment_source IN (\n      <? foreach("source") ?>\n         <? value("source") ?>\n         <? if isLast("source") ?>\n         <? else ?>\n         ,\n         <? endif ?>\n      <? endforeach ?>\n                            )\n    <? endif ?>\n    --This query will show all comment sources for which there is a comment\n    --SELECT DISTINCT comment_source FROM comment ORDER BY comment_source;\n    --Example: Incidents = 'INCDT'\n   AND CAST(comment_date AS DATE) BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>\nORDER BY\n    comment_date, comment_user, comment_source;\n	\N	\N	0
208	desktop	contacts	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  contacts\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT \n  cntct_id AS id, crmacct_number, crmacct_name,\n  cntct.*, addr.*\nFROM cntct \n  LEFT OUTER JOIN crmacct ON (crmacct_cntct_id_1=cntct_id) \n  LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) \nWHERE (cntct_owner_username=getEffectiveXtUser())\nORDER BY cntct_name;\n	\N	\N	0
209	desktop	crmaccounts	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  crmaccounts\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT \n  crmacct_id AS id, crmacct_number, crmacct_name,\n  cntct.*, addr.*\nFROM crmacct \n  LEFT OUTER JOIN cntct ON (crmacct_cntct_id_1=cntct_id) \n  LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) \nWHERE (crmacct_owner_username=getEffectiveXtUser())\nORDER BY crmacct_number;\n	\N	\N	0
210	desktop	getDates	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  getDates\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT date_trunc(<? value("timeFrame") ?>, current_date) AS startDate,\n       date_trunc(<? value("timeFrame") ?>, current_date) + <? value("interval") ?>  + '-1 day' AS endDate\n	\N	\N	0
211	desktop	glaccountBal	tweak Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  glaccountBal\n-- Notes: tweak\n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT accnt_id, formatGlAccount(accnt_id) AS accnt_id_qtdisplayrole, \n accnt_descrip, accnt_type,\n CASE WHEN(accnt_type='A') THEN <? value("asset") ?>\n WHEN(accnt_type='E') THEN <? value("expense") ?>\n WHEN(accnt_type='L') THEN <? value("liability") ?>\n WHEN(accnt_type='Q') THEN <? value("equity") ?>\n WHEN(accnt_type='R') THEN <? value("revenue") ?>\n ELSE accnt_type\n END AS accnt_type_qtdisplayrole,\n CASE WHEN(accnt_type IN ('A','E')) THEN trialbal_ending * -1 \n ELSE trialbal_ending\n END AS balance,\n period_id,\n 'curr' AS balance_xtnumericrole\nFROM accnt \nJOIN trialbal ON (accnt_id=trialbal_accnt_id)\nJOIN (SELECT period_id\n      FROM period\n      JOIN yearperiod ON (period_yearperiod_id=yearperiod_id)\n      WHERE (period_end >= current_date)\n      ORDER BY yearperiod_end asc, period_number asc\n      LIMIT 1) data\n  ON (trialbal_period_id=period_id)\nWHERE (accnt_id IN (<? literal("accnt_id_list") ?>))\nORDER BY accnt_company, accnt_profit, accnt_number, accnt_sub\n	\N	\N	0
212	desktop	glaccounts	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  glaccounts\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT accnt_id, formatGlAccount(accnt_id) AS accnt_id_qtdisplayrole, \n  accnt_descrip, accnt_type,\n  CASE WHEN(accnt_type='A') THEN <? value("asset") ?>\n  WHEN(accnt_type='E') THEN <? value("expense") ?>\n  WHEN(accnt_type='L') THEN <? value("liability") ?>\n  WHEN(accnt_type='Q') THEN <? value("equity") ?>\n  WHEN(accnt_type='R') THEN <? value("revenue") ?>\n  ELSE accnt_type\nEND AS accnt_type_qtdisplayrole \nFROM accnt;\t\n	\N	\N	0
228	desktop	glforwardupdate	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  glforwardupdate\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT MIN(forwardUpdateAccount(accnt_id)) AS result \nFROM accnt \nWHERE (accnt_id IN (<? literal("accnt_id_list") ?>))\n	\N	\N	0
472	desktop	messageHistory	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\r\n-- Name:  messageHistory\r\n-- Notes:\r\n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\r\n-- See www.xtuple.com/CPAL for the full text of the software license.\r\n\r\nSELECT \r\n  msg_id, \r\n  msg_posted AS sent,\r\n  CASE WHEN (msg_username = geteffectivextuser()) THEN 'me'\r\n       ELSE msg_username END AS from,\r\n  msg_text AS message,\r\n  CASE WHEN msguser_username = geteffectivextuser() THEN 'me'\r\n       ELSE msguser_username END AS to\r\nFROM msg a\r\nLEFT OUTER JOIN msguser ab ON a.msg_id = ab.msguser_msg_id\r\nWHERE (a.msg_username = geteffectivextuser())\r\n\r\nUNION\r\n\r\nSELECT \r\n  msg_id, \r\n  msg_posted AS sent,\r\n  CASE WHEN (msg_username = geteffectivextuser()) THEN 'me'\r\n       ELSE msg_username END AS from,\r\n  msg_text AS message,\r\n  CASE WHEN msguser_username = geteffectivextuser() THEN 'me'\r\n       ELSE msguser_username END AS to\r\nFROM msg c\r\nLEFT OUTER JOIN msguser cd ON c.msg_id = cd.msguser_msg_id\r\nWHERE (cd.msguser_username = geteffectivextuser())\r\n\r\nORDER BY msg_id DESC\r\nLIMIT <? value("limit") ?>\n	\N	\N	0
213	desktop	mfgAct	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  mfgAct\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\n<? if exists("planned") ?> \nSELECT 'L' AS activity, <? value("planned") ?> AS activity_qtdisplayrole, 0 AS seq,\n  COUNT(planord_id) AS count, COALESCE(sum(stdcost(item_id) * planord_qty),0) AS amount, \n  sum(planord_qty) AS qty,\n  'curr' AS amount_xtnumericrole, 'qty' AS qty_xtnumericrole\nFROM planord\n  JOIN itemsite ON (planord_itemsite_id = itemsite_id)\n  JOIN item ON (itemsite_item_id = item_id)\nWHERE (planord_type = 'W')\nHAVING (COUNT(planord_id) > 0)\nUNION\n<? endif ?>\nSELECT 'O' AS activity, <? value("open") ?> AS activity_qtdisplayrole, 4 AS seq,   \n  COUNT(wo_id) AS count, \n  SUM(round((wo_qtyord - wo_qtyrcv) * stdcost(itemsite_item_id),2)) AS amount, \n  SUM(wo_qtyord - wo_qtyrcv) AS qty,\n  'curr' AS amount_xtnumericrole, 'qty' AS qty_xtnumericrole\nFROM wo\n  JOIN itemsite ON (wo_itemsite_id=itemsite_id)\nWHERE (wo_status = 'O')\nHAVING (COUNT(wo_id) > 0)\nUNION ALL\nSELECT 'E' AS activity, <? value("exploded") ?> AS activity_qtdisplayrole, 4 AS seq,   \n  COUNT(wo_id) AS count, \n  SUM(round((wo_qtyord - wo_qtyrcv) * stdcost(itemsite_item_id),2)) AS amount, \n  SUM(wo_qtyord - wo_qtyrcv) AS qty,\n  'curr' AS amount_xtnumericrole, 'qty' AS qty_xtnumericrole\nFROM wo\n  JOIN itemsite ON (wo_itemsite_id=itemsite_id)\nWHERE (wo_status = 'E')\nHAVING (COUNT(wo_id) > 0)\nUNION ALL\nSELECT 'R' AS activity, <? value("released") ?> AS activity_qtdisplayrole, 4 AS seq,   \n  COUNT(wo_id) AS count, \n  SUM(round((wo_qtyord - wo_qtyrcv) * stdcost(itemsite_item_id),2)) AS amount, \n  SUM(wo_qtyord - wo_qtyrcv) AS qty,\n  'curr' AS amount_xtnumericrole, 'qty' AS qty_xtnumericrole\nFROM wo\n  JOIN itemsite ON (wo_itemsite_id=itemsite_id)\nWHERE (wo_status = 'R')\nHAVING (COUNT(wo_id) > 0)\nUNION ALL\nSELECT 'I' AS activity, <? value("inprocess") ?> AS activity_qtdisplayrole, 4 AS seq,   \n  COUNT(wo_id) AS count, \n  SUM(round((wo_qtyord - wo_qtyrcv) * stdcost(itemsite_item_id),2)) AS amount, \n  SUM(wo_qtyord - wo_qtyrcv) AS qty,\n  'curr' AS amount_xtnumericrole, 'qty' AS qty_xtnumericrole\nFROM wo\n  JOIN itemsite ON (wo_itemsite_id=itemsite_id)\nWHERE (wo_status = 'I')\nHAVING (COUNT(wo_id) > 0)\nORDER BY seq;\n	\N	\N	0
214	desktop	mfgHist	Summarized Manufacture History for Desktop Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  mfgHist\n-- Notes: Summarized Manufacture History for Desktop\n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT <? literal("group_id") ?>, <? literal("group_number") ?>,  <? literal("group_name") ?>,\n       sum(invhist_value_after-invhist_value_before) as amount, sum(invhist_qoh_after-invhist_qoh_before) AS qty,\n       'curr' AS amount_xtnumericrole,\n       'qty' AS qty_xtnumericrole,\n       0 AS amount_xttotalrole,\n       0 AS qty_xttotalrole\nFROM invhist\n  JOIN itemsite ON (itemsite_id=invhist_itemsite_id)\n  JOIN plancode ON (plancode_id=itemsite_plancode_id)\n  JOIN item ON (item_id=itemsite_item_id)\n  JOIN classcode ON (classcode_id=item_classcode_id)\nWHERE ((invhist_transtype = 'RM')\n  AND (invhist_ordtype = 'WO')\n  AND ((invhist_transdate > DATE <? value("startDate") ?> - 1 AND\n        invhist_transdate < DATE <? value("endDate") ?> + 1) )\n)\nGROUP BY <? literal("group_id") ?>, <? literal("group_number") ?>, <? literal("group_name") ?>\nORDER BY <? literal("group_number") ?>\n;\n	\N	\N	0
215	desktop	mfgOpen	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  mfgOpen\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT wo_id,\n       CASE WHEN (wo_ordid IS NULL) THEN -1\n            ELSE wo_ordid\n       END AS orderid, wo_status,\n       CASE WHEN (wo_status = 'E') THEN <? value("exploded") ?>\n         WHEN (wo_status = 'I') THEN <? value("inprocess") ?>\n         WHEN (wo_status = 'R') THEN <? value("released") ?>\n         WHEN (wo_status = 'O') THEN <? value("open") ?>\n       END AS wo_status_qtdisplayrole, \n       warehous_code, uom_name,\n       item_number, (item_descrip1 || ' ' || item_descrip2) AS itemdescrip,\n       wo_qtyord, wo_qtyrcv, wo_startdate, wo_duedate,\n       wo_number::TEXT || '-' || wo_subnumber::TEXT AS wonumber,\n       wo_postedvalue, wo_wipvalue,\n       'qty' AS wo_qtyord_xtnumericrole,\n       'qty' AS wo_qtyrcv_xtnumericrole,\n       'curr' AS wo_postedvalue_xtnumericrole,\n       'curr' AS wo_wipvalue_xtnumericrole,\n       CASE WHEN ((wo_startdate<=CURRENT_DATE) AND (wo_status IN ('O','E','S','R'))) THEN 'error'\n       END AS wo_startdate_qtforegroundrole,\n       CASE WHEN (wo_duedate<=CURRENT_DATE) THEN 'error'\n       END AS wo_duedate_qtforegroundrole,\n       CASE WHEN (wo_duedate<=CURRENT_DATE) THEN 'Overdue'\n            ELSE 'On Time'\n       END AS condition,\n       CASE WHEN (wo_duedate<=CURRENT_DATE) THEN 'error' END AS condition_qtforegroundrole\nFROM wo\n  JOIN itemsite ON (wo_itemsite_id=itemsite_id)\n  JOIN whsinfo ON (itemsite_warehous_id=warehous_id)\n  JOIN item ON (itemsite_item_id=item_id)\n  JOIN uom ON (item_inv_uom_id=uom_id)\nWHERE (wo_status != 'C')\nORDER BY wo_number, wo_subnumber;\n	\N	\N	0
216	desktop	payables	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  payables\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT formatMoney(sum(apaging_cur_val)) AS cur_val,\n  formatMoney(sum(apaging_thirty_val)) AS thirty_val,\n  formatMoney(sum(apaging_sixty_val)) AS sixty_val,\n  formatMoney(sum(apaging_ninety_val)) AS ninety_val,\n  formatMoney(sum(apaging_plus_val)) AS plus_val,\n  formatMoney(sum(apaging_total_val)) AS total_val  \nFROM apaging(current_date, false);\n	\N	\N	0
217	desktop	pkgItems	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  pkgItems\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\nSELECT *,\n       CASE WHEN pkgitem_type='P' THEN <? value("package") ?>\n            WHEN pkgitem_type='C' THEN <? value("script") ?>\n            WHEN pkgitem_type='D' THEN <? value("cmd") ?>\n            WHEN pkgitem_type='F' THEN <? value("procedure") ?>\n            WHEN pkgitem_type='G' THEN <? value("trigger") ?>\n            WHEN pkgitem_type='I' THEN <? value("image") ?>\n            WHEN pkgitem_type='M' THEN <? value("metasql") ?>\n            WHEN pkgitem_type='P' THEN <? value("priv") ?>\n            WHEN pkgitem_type='R' THEN <? value("report") ?>\n            WHEN pkgitem_type='S' THEN <? value("schema") ?>\n            WHEN pkgitem_type='T' THEN <? value("table") ?>\n            WHEN pkgitem_type='U' THEN <? value("uiform") ?>\n            WHEN pkgitem_type='V' THEN <? value("view") ?>\n            WHEN pkgitem_type='L' THEN <? value("folder") ?>\n            WHEN pkgitem_type='B' THEN <? value("database") ?>\n            WHEN pkgitem_type='C' THEN <? value("client") ?>\n       ELSE pkgitem_type END AS pkgitem_type_qtdisplayrole\nFROM (\n------ PACKAGE ------\nSELECT pkghead_id AS pkgitem_id, 0 AS seq,\n       0 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'P'::text AS pkgitem_type,\n       pkghead_name AS pkgitem_name,\n       pkghead_descrip AS pkgitem_descrip\n  FROM pkghead\nUNION\n\n------ CLIENT ------\nSELECT pkghead_id AS pkgitem_id, 1 AS seq,\n       1 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'L'::text AS pkgitem_type,\n       <? value("client") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION\n------ COMMANDS ------\nSELECT pkghead_id AS pkgitem_id, 2 AS seq,\n       2 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'L'::text AS pkgitem_type,\n       <? value("cmd") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION \nSELECT cmd_id AS pkgitem_id, 3 AS seq,\n       3 AS xtindentrole,\n       nspname AS pkgname,\n       'D' AS pkgitem_type,\n       cmd_name AS pkgitem_name,\n       cmd_descrip AS pkgitem_descrip \n  FROM cmd\n    JOIN pg_class ON (cmd.tableoid=pg_class.oid)\n    JOIN pg_namespace ON (relnamespace=pg_namespace.oid)\nUNION\n------ IMAGES ------\nSELECT pkghead_id AS pkgitem_id, 4 AS seq,\n       2 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'L'::text AS pkgitem_type,\n       <? value("image") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION \nSELECT image_id AS pkgitem_id, 5 AS seq,\n       3 AS xtindentrole,\n       nspname AS pkgname,\n       'I'::text AS pkgitem_type,\n       image_name AS pkgitem_name,\n       image_descrip AS pkgitem_descrip \n  FROM image\n    JOIN pg_class ON (image.tableoid=pg_class.oid)\n    JOIN pg_namespace ON (relnamespace=pg_namespace.oid)\nUNION \n------ METASQL ------\nSELECT pkghead_id AS pkgitem_id, 6 AS seq,\n       2 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'L'::text AS pkgitem_type,\n       <? value("metasql") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION\nSELECT metasql_id AS pkgitem_id, 7 AS seq,\n       3 AS xtindentrole,\n       nspname AS pkgname,\n       'M' AS pkgitem_type,\n       metasql_group || '-' || metasql_name AS pkgitem_name,\n       metasql_notes AS pkgitem_descrip \n  FROM metasql\n    JOIN pg_class ON (metasql.tableoid=pg_class.oid)\n    JOIN pg_namespace ON (relnamespace=pg_namespace.oid)\nUNION\n------ PRIVILEGES ------\nSELECT pkghead_id AS pkgitem_id, 8 AS seq,\n       2 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'L'::text AS pkgitem_type,\n       <? value("priv") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION\nSELECT pkghead_id AS pkgitem_id, 9 AS seq,\n       3 AS xtindentrole,\n       nspname AS pkgname,\n       'P' AS pkgitem_type,\n       priv_module || '.' || priv_name AS pkgitem_name,\n       priv_descrip AS pkgitem_descrip \n  FROM priv\n    JOIN pg_class ON (priv.tableoid=pg_class.oid)\n    JOIN pg_namespace ON (relnamespace=pg_namespace.oid)\n    JOIN pkghead ON (nspname=pkghead_name)\nUNION \n------ REPORTS ------\nSELECT pkghead_id AS pkgitem_id, 10 AS seq,\n       2 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'L'::text AS pkgitem_type,\n       <? value("report") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION\nSELECT report_id AS pkgitem_id, 11 AS seq,\n       3 AS xtindentrole,\n       nspname AS pkgname,\n       'R' AS pkgitem_type,\n       report_name AS pkgitem_name,\n       report_descrip AS pkgitem_descrip \n  FROM report\n    JOIN pg_class ON (report.tableoid=pg_class.oid)\n    JOIN pg_namespace ON (relnamespace=pg_namespace.oid) \nUNION\n------ SCRIPTS ------\nSELECT pkghead_id AS pkgitem_id, 12 AS seq,\n       2 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'L'::text AS pkgitem_type,\n       <? value("script") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION\nSELECT script_id AS pkgitem_id, 13 AS seq,\n       3 AS xtindentrole,\n       nspname AS pkgname,\n       'C'::text AS pkgitem_type,\n       script_name AS pkgitem_name,\n       script_notes AS pkgitem_descrip\n  FROM script\n    JOIN pg_class ON (script.tableoid=pg_class.oid)\n    JOIN pg_namespace ON (relnamespace=pg_namespace.oid)\nUNION\n------ SCREENS ------\nSELECT pkghead_id AS pkgitem_id, 14 AS seq,\n       2 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'L'::text AS pkgitem_type,\n       <? value("uiform") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION\nSELECT uiform_id AS pkgitem_id, 15 AS seq,\n       3 AS xtindentrole,\n       nspname AS pkgname,\n       'U'::text AS pkgitem_type,\n       uiform_name AS pkgitem_name,\n       uiform_notes AS pkgitem_descrip\n  FROM uiform\n    JOIN pg_class ON (uiform.tableoid=pg_class.oid)\n    JOIN pg_namespace ON (relnamespace=pg_namespace.oid)\nUNION\n------ DATABASE ------\nSELECT pkghead_id AS pkgitem_id, 20 AS seq, \n       1 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'B'::text AS pkgitem_type,\n       <? value("database") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION\n------ FUNCTIONS ------\nSELECT pkghead_id AS pkgitem_id, 21 AS seq,\n       2 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'L'::text AS pkgitem_type,\n       <? value("procedure") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION\nSELECT pg_proc.oid AS pkgitem_id, 22 AS seq,\n       3 AS xtindentrole,\n       nspname AS pkgname,\n       'F' AS pkgitem_type,\n       proname || '(' || oidvectortypes(proargtypes)\n               || ')' AS pkgitem_name,\n       pg_catalog.obj_description(pg_proc.oid, 'pg_proc') AS pkgitem_descrip \n  FROM pg_proc\n       JOIN pg_namespace ON (pronamespace=pg_namespace.oid)\nUNION\n------ SCHEMA ------\nSELECT pkghead_id AS pkgitem_id, 27 AS seq,\n       2 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'L'::text AS pkgitem_type,\n       <? value("schema") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION\nSELECT n.oid AS pkgitem_id, 28 AS seq,\n       3 AS xtindentrole,\n       nspname AS pkgname,\n       'S' AS pkgitem_type,\n       nspname AS pkgitem_name,\n       pg_catalog.obj_description(n.oid, 'pg_namespace') AS pkgitem_descrip \n  FROM pg_namespace n\nUNION\n------ TABLES ------\nSELECT pkghead_id AS pkgitem_id, 29 AS seq,\n       2 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'L'::text AS pkgitem_type,\n       <? value("table") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION\nSELECT c.oid AS pkgitem_id, 30 AS seq,\n       3 AS xtindentrole,\n       nspname AS pkgname,\n       'T' AS pkgitem_type,\n       relname AS pkgitem_name,\n       pg_catalog.obj_description(c.oid, 'pg_class') AS pkgitem_descrip \n  FROM pg_class c\n       JOIN pg_namespace ON (relnamespace=pg_namespace.oid)\n WHERE ((relkind='r')\n   AND  (relname !~ '^pkg(cmd(arg)?|image|metasql|priv|report|script|uiform)$'))\nUNION\n------ TRIGGERS ------\nSELECT pkghead_id AS pkgitem_id, 31 AS seq,\n       2 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'L'::text AS pkgitem_type,\n       <? value("trigger") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION\nSELECT 0 AS pkgitem_id, 32 AS seq,\n       3 AS xtindentrole,\n       trigger_schema AS pkgname,\n       'G' AS pkgitem_type,\n       trigger_name AS pkgitem_name,\n       event_object_table AS pkgitem_descrip \n  FROM information_schema.triggers\n WHERE (trigger_name !~ '^pkg(cmd(arg)?|image|metasql|priv|report|script|uiform)')\nUNION\n------ VIEWS ------\nSELECT pkghead_id AS pkgitem_id, 33 AS seq,\n       2 AS xtindentrole,\n       pkghead_name AS pkgname,\n       'L'::text AS pkgitem_type,\n       <? value("view") ?> AS pkgitem_name,\n       '' AS pkgitem_descrip\n  FROM pkghead\nUNION\nSELECT c.oid AS pkgitem_id, 34 AS seq,\n       3 AS xtindentrole,\n       nspname AS pkgname,\n       'V' AS pkgitem_type,\n       relname AS pkgitem_name,\n       pg_catalog.obj_description(c.oid, 'pg_class') AS pkgitem_descrip \n  FROM pg_class c\n       JOIN pg_namespace ON (relnamespace=pg_namespace.oid)\n WHERE ((relkind='v'))\n) AS pkgitem \nWHERE (pkgname NOT IN ('api','public','pg_catalog'))\nORDER BY pkgname, seq, pkgitem_type_qtdisplayrole, pkgitem_name;\n	\N	\N	0
218	desktop	purchAct	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  purchAct\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\n<? if exists("planned") ?> \nSELECT 'L' AS activity, <? value("planned") ?> AS activity_qtdisplayrole, 0 AS seq,\n  COUNT(planord_id) AS count, COALESCE(sum(stdcost(item_id) * planord_qty),0) AS amount, \n  'curr' AS amount_xtnumericrole\nFROM planord\n  JOIN itemsite ON (planord_itemsite_id = itemsite_id)\n  JOIN item ON (itemsite_item_id = item_id)\nWHERE (planord_type = 'P')\nHAVING (COUNT(planord_id) > 0)\nUNION\n<? endif ?>\nSELECT 'Q' AS activity, <? value("request") ?> AS activity_qtdisplayrole, 2 AS seq,\n  COUNT(pr_id) AS count, COALESCE(sum(stdcost(item_id) * pr_qtyreq),0) AS amount, \n  'curr' AS amount_xtnumericrole\nFROM pr\n  JOIN itemsite ON (pr_itemsite_id = itemsite_id)\n  JOIN item ON (itemsite_item_id = item_id)\nHAVING (COUNT(pr_id) > 0)\nUNION\nSELECT 'U' AS activity, <? value("unreleased") ?> AS activity_qtdisplayrole, 3 AS seq,   \n  COUNT(pohead_id) AS count, COALESCE(sum(amount),0) AS amount, 'curr' AS amount_xtnumericrole\nFROM\n  (SELECT pohead_id,\n    SUM(round((noNeg(poitem_qty_ordered - poitem_qty_received + poitem_qty_returned)) *            \n        currToBase(pohead_curr_id, poitem_unitprice, pohead_orderdate), 2) ) AS amount\n     FROM poitem\n       JOIN pohead ON (poitem_pohead_id=pohead_id)\n     WHERE (pohead_status = 'U')\n   GROUP BY pohead_id) data\nHAVING (COUNT(pohead_id) > 0)\nUNION\nSELECT 'O' AS activity, <? value("open") ?> AS activity_qtdisplayrole, 4 AS seq,   \n  COUNT(pohead_id) AS count, COALESCE(sum(amount),0) AS amount, 'curr' AS amount_xtnumericrole\nFROM\n  (SELECT pohead_id,\n    SUM(round((noNeg(poitem_qty_ordered - poitem_qty_received + poitem_qty_returned)) *            \n        currToBase(pohead_curr_id, poitem_unitprice, pohead_orderdate), 2) ) AS amount\n     FROM poitem\n       JOIN pohead ON (poitem_pohead_id=pohead_id)\n     WHERE (pohead_status = 'O')\n   GROUP BY pohead_id) data\nHAVING (COUNT(pohead_id) > 0)\nUNION\nSELECT 'A' AS activity, <? value("receiving") ?> AS activity_qtdisplayrole, 5 AS seq,   \n  COUNT(recv_id) AS count, COALESCE(sum(recv_value),0) AS amount, 'curr' AS amount_xtnumericrole\nFROM recv\nWHERE (NOT recv_posted)\nHAVING (COUNT(recv_id) > 0)\nUNION\nSELECT 'V' AS activity, <? value("received") ?> AS activity_qtdisplayrole, 6 AS seq,   \n  COUNT(recv_id) AS count, COALESCE(sum(recv_value),0) AS amount, 'curr' AS amount_xtnumericrole\nFROM recv\nWHERE ((recv_posted)\n  AND (NOT recv_invoiced)\n  AND (recv_vohead_id IS NULL)\n  AND (recv_order_type = 'PO'))\nHAVING (COUNT(recv_id) > 0)\nUNION\nSELECT 'I' AS activity, <? value("vouchered") ?> AS activity_qtdisplayrole, 7 AS seq,   \n  COUNT(vohead_id) AS count, COALESCE(sum(amount),0) AS amount, 'curr' AS amount_xtnumericrole\nFROM\n  (SELECT vohead_id,\n    SUM(round(currToBase(vohead_curr_id, vodist_amount, vohead_docdate), 2) ) AS amount\n     FROM vohead\n       JOIN vodist ON (vodist_vohead_id=vohead_id)\n     WHERE ((vohead_pohead_id != -1)\n       AND (NOT vohead_posted))\n   GROUP BY vohead_id) data\nHAVING (COUNT(vohead_id) > 0)\nORDER BY seq;\n	\N	\N	0
219	desktop	purchHist	Summarized Purchase History for Desktop Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  purchHist\n-- Notes: Summarized Purchase History for Desktop\n--        Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n--        See www.xtuple.com/CPAL for the full text of the software license.\n\n--------- VARIANCES -----------\n<? if exists("variances") ?> \nSELECT <? literal("group_id") ?>, <? literal("group_number") ?>,  <? literal("group_name") ?>,\n  sum(qty) AS qty, sum(amount) AS amount,\n  'curr' AS amount_xtnumericrole,\n  'qty' AS qty_xtnumericrole,\n   0 AS amount_xttotalrole,\n   0 AS qty_xttotalrole\nFROM (\nSELECT vend_id, vend_number, vend_name,\n       pohead_agent_username, usr_propername,\n       COALESCE(item_id,-2) AS item_id,\n       COALESCE(item_number,<? value("nonInv") ?>) AS item_number,\n       item_descrip1,\n       recv_qty AS qty, \n       currToBase(vohead_curr_id, sum(vodist_amount) / sum(vodist_qty), vohead_distdate) * recv_qty - recv_value AS amount\nFROM recv\n  JOIN vendinfo ON (recv_vend_id=vend_id)\n  LEFT OUTER JOIN itemsite ON (recv_itemsite_id=itemsite_id)\n  LEFT OUTER JOIN item     ON (itemsite_item_id=item_id)\n  JOIN vodist ON ((vodist_poitem_id=recv_orderitem_id) \n              AND (vodist_vohead_id=recv_vohead_id))\n  JOIN vohead ON ((vodist_vohead_id=vohead_id) \n              AND (vohead_posted))\n  JOIN poitem ON (recv_orderitem_id=poitem_id)\n  JOIN pohead ON (poitem_pohead_id=pohead_id)\n  LEFT OUTER JOIN usr ON (pohead_agent_username=usr_username)\nWHERE (vohead_distdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>\n   AND (recv_order_type='PO'))\nGROUP BY recv_qty, recv_value, vohead_curr_id, vohead_distdate,\n  vend_id, vend_number, vend_name,\n  pohead_agent_username, usr_propername,\n  item_id, item_number, item_descrip1\n) data\nWHERE (amount > 0)\nGROUP BY <? literal("group_id") ?>, <? literal("group_number") ?>, <? literal("group_name") ?>\n\n--------- RECEIPTS -------\n<? elseif exists("receipts") ?> \nSELECT <? literal("group_id") ?>, <? literal("group_number") ?>,  <? literal("group_name") ?>,\n       sum(amount) as amount, sum(qty) AS qty,\n       'curr' AS amount_xtnumericrole,\n       'qty' AS qty_xtnumericrole,\n       0 AS amount_xttotalrole,\n       0 AS qty_xttotalrole\nFROM (\n  SELECT vend_id, vend_number, vend_name,\n         pohead_agent_username, usr_propername,\n         COALESCE(item_id,-2) AS item_id, COALESCE(item_number,<? value("nonInv") ?>) AS item_number,\n         item_descrip1,\n         coalesce(recv_value,0) AS amount,\n         recv_qty AS qty\n  FROM recv\n    JOIN vendinfo ON (vend_id=recv_vend_id)\n    LEFT OUTER JOIN itemsite ON (recv_itemsite_id=itemsite_id)\n    LEFT OUTER JOIN item     ON (itemsite_item_id=item_id)\n    JOIN poitem ON (recv_orderitem_id=poitem_id)\n    JOIN pohead ON (poitem_pohead_id=pohead_id)\n    LEFT OUTER JOIN usr ON (pohead_agent_username=usr_username)\n  WHERE ((recv_date::date BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>)\n    AND (recv_posted)\n    AND (recv_order_type = 'PO'))\n  UNION ALL\n  SELECT vend_id, vend_number, vend_name,\n         pohead_agent_username, usr_propername,\n         COALESCE(item_id,-1) AS item_id, COALESCE(item_number,<? value("nonInv") ?>) AS item_number,\n         item_descrip1,\n         coalesce(poreject_value,0) * -1 AS amount,\n         poreject_qty * -1 AS qty\n  FROM poreject\n    JOIN vendinfo ON (vend_id=poreject_vend_id)\n    JOIN itemsite ON (itemsite_id=poreject_itemsite_id)\n    JOIN item ON (item_id=itemsite_item_id)\n    JOIN poitem ON (poreject_poitem_id=poitem_id)\n    JOIN pohead ON (poitem_pohead_id=pohead_id)\n    LEFT OUTER JOIN usr ON (pohead_agent_username=usr_username)\n  WHERE ((poreject_date::date BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>)\n    AND (poreject_posted))\n) data\nGROUP BY <? literal("group_id") ?>, <? literal("group_number") ?>, <? literal("group_name") ?>\nORDER BY <? literal("group_number") ?>\n;\n<? endif ?>\n	\N	\N	0
220	desktop	purchOpen	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  purchOpen\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT pohead_id, pohead_number, vend_number, vend_name, pohead_shipvia, \n  formatCntctName(pohead_vend_cntct_honorific, \n                  pohead_vend_cntct_first_name, \n                  pohead_vend_cntct_middle, \n                  pohead_vend_cntct_last_name, \n                  pohead_vend_cntct_suffix) AS vend_cntct, \n  pohead_vend_cntct_phone,\n  formatCntctName(pohead_shipto_cntct_honorific, \n                  pohead_shipto_cntct_first_name, \n                  pohead_shipto_cntct_middle, \n                  pohead_shipto_cntct_last_name, \n                  pohead_shipto_cntct_suffix) AS shipto_cntct, \n  pohead_shipto_cntct_phone,\n  min(poitem_duedate)  AS duedate, pohead_status AS status,\n  CASE WHEN (pohead_status = 'O') THEN <? value("open") ?>\n  ELSE <? value("unreleased") ?> END AS status_qtdisplayrole,\n  SUM(round(noNeg(poitem_qty_ordered - poitem_qty_received + poitem_qty_returned) *            \n        currToBase(pohead_curr_id, poitem_unitprice, pohead_orderdate), 2) ) AS amount,\n  CASE WHEN (min(poitem_duedate) <= current_date) THEN 'error' \n  ELSE 'emphasis' END AS duedate_qtforegroundrole,\n  'curr' AS amount_xtnumericrole\nFROM pohead \n  JOIN vendinfo ON (pohead_vend_id=vend_id) \n  JOIN poitem ON (poitem_pohead_id=pohead_id) \nWHERE (poitem_status IN ('U','O'))\nGROUP BY pohead_id, pohead_number, pohead_status, vend_number, vend_name, pohead_shipvia, pohead_vend_cntct_id, \n  pohead_shipto_cntct_id, pohead_vend_cntct_phone, pohead_shipto_cntct_phone, pohead_vend_cntct_honorific,   \n  pohead_vend_cntct_first_name,  pohead_vend_cntct_middle, pohead_vend_cntct_last_name, pohead_vend_cntct_suffix,\n  pohead_shipto_cntct_honorific, pohead_shipto_cntct_first_name, pohead_shipto_cntct_middle, pohead_shipto_cntct_last_name, \n  pohead_shipto_cntct_suffix\nORDER BY pohead_number;\t\n	\N	\N	0
221	desktop	receivables	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  receivables\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT formatMoney(sum(araging_cur_val)) AS cur_val,\n  formatMoney(sum(araging_thirty_val)) AS thirty_val,\n  formatMoney(sum(araging_sixty_val)) AS sixty_val,\n  formatMoney(sum(araging_ninety_val)) AS ninety_val,\n  formatMoney(sum(araging_plus_val)) AS plus_val,\n  formatMoney(sum(araging_total_val)) AS total_val \nFROM araging(current_date, false);\n	\N	\N	0
222	desktop	salesAct	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  salesAct\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT 'Q' AS activity, <? value("quotes") ?> AS activity_qtdisplayrole, 0 AS seq,\n  COUNT(quhead_id) AS count, COALESCE(sum(amount),0) AS amount, 'curr' AS amount_xtnumericrole   \nFROM \n (SELECT quhead_id,\n    SUM(round((noNeg(quitem_qtyord) * quitem_qty_invuomratio) *            \n        (currToBase(quhead_curr_id, quitem_price, quhead_quotedate) / quitem_price_invuomratio), 2) ) AS amount\n     FROM quitem\n       JOIN quhead ON (quitem_quhead_id=quhead_id)\n     WHERE ( COALESCE(quhead_expire,current_date + 1) > current_date\n       AND   quhead_status != 'C'  )\n   GROUP BY quhead_id) data\nHAVING (COUNT(quhead_id) > 0)\nUNION \nSELECT 'O' AS activity, <? value("open") ?> AS activity_qtdisplayrole,  1 AS seq,   \n  COUNT(cohead_id) AS count, COALESCE(sum(amount),0) AS amount, 'curr' AS amount_xtnumericrole\nFROM\n  (SELECT cohead_id,\n    SUM(round((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) *            \n        (currToBase(cohead_curr_id, coitem_price, cohead_orderdate) / coitem_price_invuomratio), 2) ) AS amount\n     FROM coitem\n       JOIN cohead ON (coitem_cohead_id=cohead_id)\n     WHERE ( coitem_status = 'O' )\n   GROUP BY cohead_id) data\nHAVING (COUNT(cohead_id) > 0)\nUNION\nSELECT 'P' AS activity, <? value("print") ?> AS activity_qtdisplayrole, 2 AS seq,   \n  COUNT(cohead_id) AS count, COALESCE(sum(amount),0) AS amount, 'curr' AS amount_xtnumericrole\nFROM\n  (SELECT cohead_id,\n    SUM(round((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) *            \n        (currToBase(cohead_curr_id, coitem_price, cohead_orderdate) / coitem_price_invuomratio), 2) ) AS amount\n     FROM coitem\n       JOIN cohead ON (coitem_cohead_id=cohead_id)\n       JOIN pack ON ((pack_head_type='SO')\n                 AND (pack_head_id=cohead_id))\n     WHERE ( (coitem_status = 'O')\n      AND (NOT pack_printed) )\n   GROUP BY cohead_id) data\nHAVING (COUNT(cohead_id) > 0)\nUNION\nSELECT 'S' AS activity, <? value("ship") ?> AS activity_qtdisplayrole, 3 AS seq,   \n  COUNT(cohead_id) AS count, COALESCE(sum(amount),0) AS amount, 'curr' AS amount_xtnumericrole\nFROM\n  (SELECT cohead_id,\n    SUM(round((shipitem_qty * coitem_qty_invuomratio) *            \n        (currToBase(cohead_curr_id, coitem_price, cohead_orderdate) / coitem_price_invuomratio), 2) ) AS amount\n     FROM coitem\n       JOIN cohead ON (coitem_cohead_id=cohead_id)\n       JOIN shipitem ON (shipitem_orderitem_id=coitem_id)\n       JOIN shiphead ON ((shiphead_order_type='SO')\n                    AND (shipitem_shiphead_id=shiphead_id))\n     WHERE ( (coitem_status = 'O')\n      AND (NOT shiphead_shipped) )\n   GROUP BY cohead_id) data\nHAVING (COUNT(cohead_id) > 0)\nUNION\nSELECT 'B' AS activity, <? value("bill") ?> AS activity_qtdisplayrole, 4 AS seq,   \n  COUNT(cohead_id) AS count, COALESCE(sum(amount),0) AS amount, 'curr' AS amount_xtnumericrole\nFROM\n  (SELECT cohead_id,\n     CASE WHEN ( \n      -- For kits only when entire kit has shipped\n      item_type != 'K' OR NOT coitem_id IN (\n        SELECT sub.coitem_id\n          FROM coitem sub\n         WHERE((sub.coitem_cohead_id=coitem_cohead_id)\n           AND (sub.coitem_linenumber=coitem_linenumber)\n           AND (sub.coitem_subnumber > 0)\n           AND ((sub.coitem_qtyord - sub.coitem_qtyshipped + sub.coitem_qtyreturned) > 0))\n      )) THEN\n      -- Total shipped not invoiced minus any already selected for billing not invoiced\n      SUM(round(((shipitem_qty -\n      COALESCE((SELECT sum(cobill_qty) \n                FROM cobill \n                WHERE ((cobill_coitem_id=coitem_id \n                  AND (cobill_invcitem_id IS NULL)\n                  ))),0) \n       * coitem_qty_invuomratio) *            \n          (currToBase(cohead_curr_id, coitem_price, cohead_orderdate) / coitem_price_invuomratio)),2))\n     ELSE 0\n     END AS amount\n     FROM coitem\n       JOIN itemsite ON (coitem_itemsite_id=itemsite_id)\n       JOIN item ON (itemsite_item_id=item_id)\n       JOIN cohead ON (coitem_cohead_id=cohead_id)\n       JOIN custinfo ON (cust_id=cohead_cust_id)\n       JOIN shipitem ON (shipitem_orderitem_id=coitem_id)\n       JOIN shiphead ON ((shiphead_order_type='SO')\n                 AND (shiphead_id=shipitem_shiphead_id))\n     WHERE ( (coitem_cohead_id=cohead_id)\n      AND (coitem_status = 'O')\n      AND (shiphead_shipped)\n      AND (NOT shipitem_invoiced)\n      AND (shipitem_qty > COALESCE((SELECT sum(cobill_qty)\n                                    FROM cobill\n                                    WHERE cobill_coitem_id=coitem_id AND cobill_invcitem_id IS NULL), 0)) )\n   GROUP BY cohead_id, coitem_id, coitem_qtyord, coitem_qtyshipped, coitem_qtyreturned, \n            cust_partialship, item_type) data\nHAVING (COUNT(cohead_id) > 0)\nUNION\nSELECT 'I' AS activity, <? value("invoice") ?> AS activity_qtdisplayrole, 5 AS seq,   \n  COUNT(cohead_id) AS count, COALESCE(sum(amount),0) AS amount, 'curr' AS amount_xtnumericrole\nFROM\n  (SELECT cohead_id,\n    SUM(round((cobill_qty * coitem_qty_invuomratio) *            \n        (currToBase(cohead_curr_id, coitem_price, cohead_orderdate) / coitem_price_invuomratio), 2) ) AS amount\n     FROM coitem\n       JOIN cohead ON (coitem_cohead_id=cohead_id)\n       JOIN cobill ON (cobill_coitem_id=coitem_id)\n     WHERE ( (coitem_status = 'O')\n      AND (cobill_invcitem_id IS NULL) )\n   GROUP BY cohead_id) data\nHAVING (COUNT(cohead_id) > 0)\nUNION\nSELECT 'T' AS activity, <? value("post") ?> AS activity_qtdisplayrole, 5 AS seq,   \n  COUNT(invchead_id) AS count, COALESCE(sum(amount),0) AS amount, 'curr' AS amount_xtnumericrole\nFROM\n  (SELECT invchead_id,\n    SUM(round((invcitem_billed * invcitem_qty_invuomratio) * (invcitem_price / COALESCE(invcitem_price_invuomratio,1)),2)\n ) AS amount\n     FROM invcitem\n       JOIN invchead ON (invcitem_invchead_id=invchead_id)\n     WHERE ( NOT invchead_posted )\n   GROUP BY invchead_id) data\nHAVING (COUNT(invchead_id) > 0)\nORDER BY seq;\n	\N	\N	0
223	desktop	salesHist	Summarized Sales History for Desktop Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  salesHist\n-- Notes: Summarized Sales History for Desktop\n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\n--------- BOOKINGS -----------\n<? if exists("bookings") ?>\nSELECT <? literal("group_id") ?>, <? literal("group_number") ?>, <? literal("group_name") ?>,\n       sum(round((coitem_qtyord * coitem_qty_invuomratio) *\n                     (currtobase(cohead_curr_id, coitem_price, cohead_orderdate) / coitem_price_invuomratio), 2)) AS amount,\n       sum(coitem_qtyord) AS qty,\n       'curr' AS amount_xtnumericrole,\n       'qty' AS qty_xtnumericrole,\n       0 AS amount_xttotalrole,\n       0 AS qty_xttotalrole\nFROM coitem\n  JOIN cohead ON (coitem_cohead_id=cohead_id)\n  JOIN custinfo ON (cust_id=cohead_cust_id)\n  JOIN salesrep ON (salesrep_id=cohead_salesrep_id)\n  JOIN itemsite ON (itemsite_id=coitem_itemsite_id)\n  JOIN item ON (item_id=itemsite_item_id)\n  JOIN prodcat ON (item_prodcat_id=prodcat_id)\nWHERE (cohead_orderdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>)\nAND (coitem_status != 'X')\nGROUP BY <? literal("group_id") ?>, <? literal("group_number") ?>, <? literal("group_name") ?>\nORDER BY <? literal("group_number") ?>;\n\n--------- SALES HISTORY -------\n<? elseif exists("sales") ?> \nSELECT <? literal("group_id") ?>, <? literal("group_number") ?>, <? literal("group_name") ?>,\n       sum(round((cohist_qtyshipped * currtobase(cohist_curr_id, cohist_unitprice, cohist_invcdate)), 2)) AS amount,\n       sum(cohist_qtyshipped) AS qty,\n       'curr' AS amount_xtnumericrole,\n       'qty' AS qty_xtnumericrole,\n       0 AS amount_xttotalrole,\n       0 AS qty_xttotalrole\nFROM cohist \n  JOIN custinfo ON (cust_id=cohist_cust_id)\n  JOIN salesrep ON (salesrep_id=cohist_salesrep_id)\n  JOIN itemsite ON (itemsite_id=cohist_itemsite_id)\n  JOIN item ON (item_id=itemsite_item_id)\n  JOIN prodcat ON (item_prodcat_id=prodcat_id)\nWHERE (cohist_invcdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>)\nGROUP BY <? literal("group_id") ?>, <? literal("group_number") ?>, <? literal("group_name") ?>\nORDER BY <? literal("group_number") ?>;\n<? endif ?>\n	\N	\N	0
224	desktop	salesOpen	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license. Change from showing open amount to total amount	-- Group: desktop\n-- Name:  salesOpen\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n-- Change from showing open amount to total amount\n\nSELECT cohead_id, cohead_number, cust_number, cohead_shipvia, \n  cohead_billtoname, \n  formatCntctName(cohead_billto_cntct_honorific, \n                  cohead_billto_cntct_first_name, \n                  cohead_billto_cntct_middle, \n                  cohead_billto_cntct_last_name, \n                  cohead_billto_cntct_suffix) AS billto_cntct, \n  cohead_billto_cntct_phone,\n  cohead_shiptoname, \n  formatCntctName(cohead_shipto_cntct_honorific, \n                  cohead_shipto_cntct_first_name, \n                  cohead_shipto_cntct_middle, \n                  cohead_shipto_cntct_last_name, \n                  cohead_shipto_cntct_suffix) AS shipto_cntct, \n  cohead_shipto_cntct_phone,\n  getSoSchedDate(cohead_id) AS scheddate, \n  calcSalesOrderAmt(cohead_id) AS amount,\n  CASE WHEN (getSoSchedDate(cohead_id) <= current_date) THEN 'error' \n  ELSE 'emphasis' END AS scheddate_qtforegroundrole,\n  'curr' AS amount_xtnumericrole\nFROM cohead \n  JOIN custinfo ON (cohead_cust_id=cust_id) \nWHERE (cohead_status='O')\nORDER BY cohead_number;\n\n--  min(coitem_scheddate) AS scheddate, \n--  sum(round((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) *            \n--     (currToBase(cohead_curr_id, coitem_price, cohead_orderdate) / coitem_price_invuomratio), 2) ) AS amount,\n--  CASE WHEN (min(coitem_scheddate) <= current_date) THEN 'error' \n--  ELSE 'emphasis' END AS scheddate_qtforegroundrole,\n--  'curr' AS amount_xtnumericrole\n--FROM cohead \n--  JOIN custinfo ON (cohead_cust_id=cust_id) \n--  JOIN coitem ON (coitem_cohead_id=cohead_id) \n--  JOIN itemsite ON (coitem_itemsite_id=itemsite_id) \n--  JOIN whsinfo ON (itemsite_warehous_id=warehous_id) \n--WHERE (coitem_status='O')\n--GROUP BY cohead_shipvia, cohead_billtoname, cohead_billto_cntct_id, cohead_billto_cntct_phone, \n--  cohead_shiptoname, cohead_shipto_cntct_id, cohead_shipto_cntct_phone, cohead_id, cohead_number, \n--  cust_number, cohead_billtoname, cohead_shiptoname, \n--  cohead_billto_cntct_honorific, cohead_billto_cntct_first_name, \n--  cohead_billto_cntct_middle, cohead_billto_cntct_last_name, cohead_billto_cntct_suffix,\n--  cohead_shipto_cntct_honorific, cohead_shipto_cntct_first_name, cohead_shipto_cntct_middle, \n--  cohead_shipto_cntct_last_name, cohead_shipto_cntct_suffix\n--ORDER BY cohead_number;\n	\N	\N	0
473	desktop	sendMessageToUser	User Message query. Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\r\n-- Name:  sendMessageToUser\r\n-- Notes: User Message query.\r\n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\r\n-- See www.xtuple.com/CPAL for the full text of the software license.\r\n\r\nSELECT \r\npostmessage(\r\n( SELECT usr_username FROM usr WHERE usr_id = <? value("usr_id") ?>),\r\n <? value("message") ?>\r\n            );\n	\N	\N	0
225	desktop	todoDelete	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  todoDelete\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nDELETE FROM todoitem WHERE (todoitem_id=<? value("todoitem_id") ?>);\n	\N	\N	0
226	desktop	todoList	Select the list of activities that need attention including to-do items, incidents, tasks, and projects. Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  todoList\n-- Notes: Select the list of activities that need attention\n--        including to-do items, incidents, tasks, and projects.\n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\n------ TO DO ITEMS-------\n  SELECT todoitem_id AS id, 1 AS altId, todoitem_owner_username AS owner, \n         <? value("todo") ?> AS type, incdtpriority_order AS seq,\n         incdtpriority_name AS priority, \n         todoitem_name AS name, \n         firstLine(todoitem_description) AS descrip, \n         todoitem_status AS status, todoitem_start_date as start, \n         todoitem_due_date AS due, \n         todoitem_username AS usr, CAST(incdt_number AS text) AS number,\n         crmacct_number, crmacct_name, \n         cust_number AS cust,\n         CASE WHEN (todoitem_status != 'C'AND \n                    todoitem_due_date < CURRENT_DATE) THEN 'expired'\n              WHEN (todoitem_status != 'C'AND \n                    todoitem_due_date > CURRENT_DATE) THEN 'future'\n         END AS due_qtforegroundrole \n    FROM todoitem LEFT OUTER JOIN incdt ON (incdt_id=todoitem_incdt_id) \n                  LEFT OUTER JOIN crmacct ON (crmacct_id=todoitem_crmacct_id) \n                  LEFT OUTER JOIN custinfo ON (cust_id=crmacct_cust_id) \n                  LEFT OUTER JOIN incdtpriority ON (incdtpriority_id=todoitem_priority_id) \n   WHERE ((todoitem_active)\n      AND (todoitem_status != 'C')\n      AND ((todoitem_owner_username=<? value("owner_username") ?>) \n      OR (todoitem_username=<? value("assigned_username") ?>))) \n  UNION \n------ INCIDENTS ------\n  SELECT incdt_id AS id, 2 AS altId, incdt_owner_username AS owner, \n         <? value("incident") ?> AS type, incdtpriority_order AS seq,\n         incdtpriority_name AS priority, \n         incdt_summary AS name, \n         firstLine(incdt_descrip) AS descrip, \n         incdt_status AS status, CAST(incdt_timestamp AS date) AS start, \n         null AS due, \n         incdt_assigned_username AS usr, CAST(incdt_number AS text) AS number,\n         crmacct_number, crmacct_name,\n         cust_number AS cust, \n         NULL AS due_qtforegroundrole \n    FROM incdt LEFT OUTER JOIN crmacct ON (crmacct_id=incdt_crmacct_id) \n               LEFT OUTER JOIN custinfo ON (cust_id=crmacct_cust_id) \n               LEFT OUTER JOIN incdtpriority ON (incdtpriority_id=incdt_incdtpriority_id) \n   WHERE ((incdt_status != 'L')\n      AND ((incdt_owner_username=<? value("owner_username") ?>) \t  \n      OR (incdt_assigned_username=<? value("assigned_username") ?>)))\n------ TASKS ------\n   UNION \n    SELECT prjtask_id AS id, 3 AS altId, prjtask_owner_username AS owner, \n           <? value("task") ?> AS type, NULL AS seq, NULL AS priority, \n           prjtask_number || '-' || prjtask_name AS name, \n           firstLine(prjtask_descrip) AS descrip, \n           prjtask_status AS status,  prjtask_start_date AS start, \n           prjtask_due_date AS due, \n           prjtask_username AS usr, prj_number,\n           '' AS crmacct_number, '' AS crmacct_name, '' AS cust, \n           CASE WHEN (prjtask_status != 'C'AND \n                      prjtask_due_date < CURRENT_DATE) THEN 'expired'\n                WHEN (prjtask_status != 'C'AND \n                      prjtask_due_date > CURRENT_DATE) THEN 'future'\n           END AS due_qtforegroundrole \n      FROM prj, prjtask \n     WHERE((prj_id=prjtask_prj_id) \n      AND (prjtask_status != 'C')\n      AND ((prjtask_owner_username=<? value("owner_username") ?>) \n      OR (prjtask_username=<? value("assigned_username") ?>))) \n------ PROJECTS ------\n    UNION \n    SELECT prj_id AS id, 4 AS altId, prj_owner_username AS owner, \n           <? value("project") ?> AS type, NULL AS seq, NULL AS priority, \n           prj_number || '-' || prj_name AS name, \n           firstLine(prj_descrip) AS descrip, \n           prj_status AS status,  prj_start_date AS start, \n           prj_due_date AS due, \n           prj_username AS usr, NULL AS number,\n           '' AS crmacct_number, '' AS crmacct_name,'' AS cust, \n           CASE WHEN (prj_status != 'C'AND \n                      prj_due_date < CURRENT_DATE) THEN 'expired'\n                WHEN (prj_status != 'C'AND \n                      prj_due_date > CURRENT_DATE) THEN 'future'\n           END AS due_qtforegroundrole \n      FROM prj \n     WHERE ((prj_status != 'C')\n        AND ((prj_owner_username=<? value("owner_username") ?>) \n        OR (prj_username=<? value("assigned_username") ?>)))\nORDER BY due, seq, usr; \n	\N	\N	0
227	desktop	userOnline	 Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple. See www.xtuple.com/CPAL for the full text of the software license.	-- Group: desktop\n-- Name:  userOnline\n-- Notes: \n-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n-- See www.xtuple.com/CPAL for the full text of the software license.\n\nSELECT usersonline.*,\n       0 AS cnt_internal_xttotalrole,\n       0 AS cnt_external_xttotalrole\nFROM xtdesktop.usersonline();\n	\N	\N	0
494	desktop	userShortcuts	Return list of User defined hotkey preferences for use in xtDesktop Shortcuts.  Shortcuts names derive programatically from the action	-- Group: desktop\n-- Name:  userShortcuts\n-- Notes: Return list of User defined hotkey preferences for use in xtDesktop Shortcuts.  Shortcuts names derive programatically from the action\nSELECT usrpref_id, \n  usrpref_value AS menuAction,\n  TRIM(initcap(regexp_replace(split_part(regexp_replace(usrpref_value, E'dsp|_', E' '), '.', 2), E'([A-Z])', E'\\ \\\\1','g'))) AS menuAction_qtdisplayrole,\n  CASE WHEN LEFT(usrpref_name,1) = 'F' THEN 1\n            WHEN SUBSTRING(usrpref_name,2,1) ~ '[0-9]' THEN 3 \n            ELSE 2 END AS sort\nFROM usrpref\nWHERE usrpref_username = getEffectiveXtUser()\nAND length(usrpref_name) = 2\nORDER BY sort, usrpref_name;\n	\N	\N	0
\.


--
-- Data for Name: pkgpriv; Type: TABLE DATA; Schema: xtdesktop; Owner: admin
--

COPY pkgpriv (priv_id, priv_module, priv_name, priv_descrip, priv_seq) FROM stdin;
640	Desktop	AccessAdditionalUser	Controls access to additional Users	\N
580	Desktop	ViewBankAccountsDock	Allows the user to view the Bank Accounts dock widget on the Desktop	\N
581	Desktop	ViewExtensionsDock	Allows the user to view the Extensions dock widget on the Desktop	\N
582	Desktop	ViewGLAccountsDock	Allows the user to view Monitored General Ledger Accounts dock widget on the Desktop	\N
583	Desktop	ViewManufactureActivitiesDock	Allows the user to view the Manufacture Activities dock widget on the Desktop	\N
584	Desktop	ViewManufactureHistoryDock	Allows the user to view the Manufacture History dock widget on the Desktop	\N
585	Desktop	ViewMyAccountsDock	Allows the user to view the My (CRM) Accounts dock widget on the Desktop	\N
586	Desktop	ViewMyContactsDock	Allows the user to view the My Contact dock widget on the Desktop	\N
587	Desktop	ViewTodoDock	Allows the user to view the To Do dock widget on the Desktop	\N
588	Desktop	ViewPayablesDock	Allows the user to view the Payables dock widget on the Desktop	\N
589	Desktop	ViewPurchaseActivitiesDock	Allows the user to view the Purchase Activities dock widget on the Desktop	\N
590	Desktop	ViewPurchaseHistoryDock	Allows the user to view the Purchase History dock widget on the Desktop	\N
591	Desktop	ViewPurchaseOrdersDock	Allows the user to view the open purchase orders dock widget on the Desktop	\N
592	Desktop	ViewReceivablesDock	Allows the user to view the Purchase History dock widget on the Desktop	\N
593	Desktop	ViewSalesActivitiesDock	Allows the user to view the Sales Activities dock widget on the Desktop	\N
594	Desktop	ViewSalesHistoryDock	Allows the user to view the Sales History dock widget on the Desktop	\N
595	Desktop	ViewSalesOrdersDock	Allows the user to view the Sales Orders dock widget on the Desktop	\N
596	Desktop	ViewWorkOrdersDock	Allows the user to view the Work Orders dock widget on the Desktop	\N
597	Desktop	ViewUsersOnlineDock	Allows the user to view the Users Online doc	\N
598	Desktop	ViewCRMDesktop	Allows the user to view the CRM Desktop page	\N
599	Desktop	ViewSalesDesktop	Allows the user to view the Sales Desktop page	\N
600	Desktop	ViewPurchaseDesktop	Allows the user to view the Purchase Desktop page	\N
601	Desktop	ViewManufactureDesktop	Allows the user to view the Manufacture Desktop page	\N
602	Desktop	ViewAccountingDesktop	Allows the user to view the Accounting Desktop page	\N
603	Desktop	ViewMaintenanceDesktop	Allows the user to view the Maintenance Desktop page	\N
641	Desktop	viewSocialDesktop	Allows the user to view the Social Desktop page	\N
642	Desktop	viewMsgHistoryDock	Allows the user to view the Message History dock widget on the Desktop	\N
643	Desktop	viewSendMsgDock	Allows the user to view the Sed Message dock widget on the Desktop	\N
\.


--
-- Data for Name: pkgreport; Type: TABLE DATA; Schema: xtdesktop; Owner: admin
--

COPY pkgreport (report_id, report_name, report_sys, report_source, report_descrip, report_grade, report_loaddate) FROM stdin;
\.


--
-- Data for Name: pkgscript; Type: TABLE DATA; Schema: xtdesktop; Owner: admin
--

COPY pkgscript (script_id, script_name, script_order, script_enabled, script_source, script_notes) FROM stdin;
70	dockExtensions	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockExtensions;\nvar _extensions;\nvar _extensionsIsDirty = true;\n\n/*!\n  Initializes Extensions dock widget and places it in the main window.\n*/\nfunction initDockExtensions()\n{\n  _dockExtensions = mainwindow.findChild("_dockExtensions");\n  _extensions = mainwindow.findChild("_extensions");\n\n  // Set columns on list\n  _extensions.addColumn(qsTr("Name"), -1, Qt.AlignLeft, true, "pkgitem_name");\n  _extensions.addColumn(qsTr("Description"), -1, Qt.AlignLeft, false, "pkgitem_descrip");\n  _extensions.addColumn(qsTr("Type"), -1, Qt.AlignLeft, false, "pkgitem_type");\n\n  // Connect Signals and Slots\n  _dtTimer.timeout.connect(refreshExtensions);\n\n  _extensions.itemSelected.connect(openWindowExtensions);\n  _extensions["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuExtensions);\n\n  _dockExtensions.visibilityChanged.connect(fillListExtensions);\n\n  // Handle privilge control\n  var act = _dockExtensions.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewExtensionsDock"))\n  {\n    _dockExtensions.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewExtensionsDock");\n  _menuDesktop.appendAction(act);\n\n  fillListExtensions();\n}\n\n/*!\n  Fills the list with active sales data.\n*/\nfunction fillListExtensions()\n{\n  _dockExtensions = mainwindow.findChild("_dockExtensions");\n  _extensions = mainwindow.findChild("_extensions");\n\n  if (_dockExtensions.visible && _extensionsIsDirty)\n  {\n    var params = new Object;\n    params.script = qsTr("Scripts");\n    params.cmd = qsTr("Custom Commands");\n    params.procedure = qsTr("Stored Procedures");\n    params.trigger = qsTr("Triggers");\n    params.image = qsTr("Images");\n    params.metasql = qsTr("MetaSQL");\n    params.priv = qsTr("Privileges");\n    params.report = qsTr("Reports");\n    params.schema = qsTr("Schema");\n    params.table = qsTr("Tables");\n    params.uiform = qsTr("Screens");\n    params.view = qsTr("Views");\n    params.folder = qsTr("Folder");\n    params.client = qsTr("Client");\n    params.database = qsTr("Database");\n\n    _extensions.populate(toolbox.executeDbQuery("desktop","pkgItems", params))\n \n    _extensionsIsDirty = false;\n  }\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowExtensions()\n{\n  var ui;\n  var run = false;\n  var type = _extensions.currentItem().rawValue("pkgitem_type");\n  var params = new Object;\n  params.mode = "view";\n  \n  // Make sure we can open the window for this activity\n  if (!privilegeCheckExtensions(type))\n    return;\n\n  // Determine which window to open\n  if (type == "P")\n  {\n    ui = "package";\n    params.pkghead_id = _extensions.id();\n  }\n  else if (type == "C")\n  {\n    ui = "scriptEditor";\n    params.script_id = _extensions.id();\n  }\n  else if (type == "D")\n  {\n    ui = "customCommand";\n    params.cmd_id = _extensions.id();\n  }\n  else if (type == "I")\n  {\n    ui = "image";\n    params.image_id = _extensions.id();\n  }\n  else if (type == "M")\n    ui = "metasqls";\n  else if (type == "R")\n    ui = "reports";\n  else if (type == "U")\n  {\n    ui = "uiform";\n    params.uiform_id = _extensions.id();\n  }\n\n  // Open the window and perform any handling required\n  win = toolbox.openWindow(ui);\n  if (type == "M")\n  {\n    win.hide();\n    win.findChild("_list").setId(_extensions.id());\n    win.sEdit();\n    win.close();\n  }\n  else if (type == "R")\n  {\n    win.hide();\n    win.findChild("_report").setId(_extensions.id());\n    win.sEdit();\n    win.close();\n  }\n  else if (type == "U")\n  {\n    win.hide();\n    toolbox.lastWindow().set(params);\n    win.sEdit();\n  }\n  else\n  {\n    toolbox.lastWindow().set(params);\n    if (toolbox.lastWindow().exec())\n      fillListExtensions();\n  }\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on an Extension item.\n*/\nfunction populateMenuExtensions(pMenu, pItem)\n{\n  var menuItem;\n  var type = pItem.rawValue("pkgitem_type");\n  var enable = privilegeCheckExtensions(type);\n\n  // If not a type we have an editor for get out\n  if ((type != "P") &&\n      (type != "C") &&\n      (type != "D") &&\n      (type != "I") &&\n      (type != "M") &&\n      (type != "R") &&\n      (type != "U"))\n    return;\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowExtensions);\n}\n\n/*!\n  Returns whether user has privileges to view detail on the selected extension type.\n*/\nfunction privilegeCheckExtensions(type)\n{\n  if (type == "P")\n    return privileges.check("ViewPackages+#superuser")\n  else if (type == "C")\n    return privileges.check("MaintainScripts");\n  else if (type == "D") \n    return privileges.check("MaintainCustomCommands");\n  else if (type == "I") \n    return privileges.check("MaintainImages");\n  else if (type == "M")\n    return privileges.check("MaintainMetaSQL") ||\n           privileges.check("ViewMetaSQL");\n  else if (type == "R") \n    return privileges.check("MaintainReports");\n  else if (type == "U")\n    return privileges.check("MaintainScreens");\n\n  return false;\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshExtensions()\n{\n  _extensionsIsDirty = true;\n  fillListExtensions();\n}\n	
67	contact	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\ninclude("dockMyContacts");\n\n// Connect this window so that the My Contacts dock list gets updated\nvar _contactList = mainwindow.findChild("_contactList");\n\n// Connect this window so that the My Contacts dock list gets updated\n//new method for buttonbox, added for 3.8\n  var _buttonBox = mywindow.findChild("_buttonBox");\n  toolbox.coreDisconnect(_buttonBox, "accepted()", mywindow, "sSave()");\n  _buttonBox.accepted.connect(save);\n\n//method prior to 3.8 core release\n//var _save = mywindow.findChild("_save");\n//toolbox.coreDisconnect(_save, "clicked()", mydialog, "sSave()");\n//_save.clicked.connect(save);\n\nfunction save()\n{\n  mydialog.sSave();\n  fillListMyCntcts();\n}\n\n	
133	desktopMenuBar	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nfunction setupDesktopMenu() {\n\n  _mainMenu = mainwindow.findChild("_mainMenu");\n  _shortcutMenu = mainwindow.findChild("_shortcutMenu");\n  _employee = mainwindow.findChild("_employee");\n\n  _mainMenu.addColumn(qsTr("MAIN MENU"), -1, Qt.AlignLeft, true, "menuItem");\n\n  _mainMenu.setStyleSheet(desktopStyle);\n  _shortcutMenu.setStyleSheet(desktopStyle);\n  _mainMenu.alternatingRowColors = false;\n  _shortcutMenu.alternatingRowColors = false;\n  _shortcutMenu.maximumHeight = 400;\n  _shortcutMenu.addColumn(qsTr("SHORTCUTS"), -1, Qt.AlignLeft, true, "menuAction");\n\n  shortcutsMenuPopulateList();\n\n  var _employeeSql = "SELECT 0 as sort, crmacct_name, crmacct_usr_username "\n                + "FROM emp JOIN crmacct ON (emp_id=crmacct_emp_id) "\n                + "WHERE crmacct_usr_username = geteffectivextuser() "\n                + "UNION SELECT 1 as sort, geteffectivextuser(), usr_propername "\n                + "FROM usr WHERE usr_username = geteffectivextuser() "\n                + "ORDER BY 1 ASC LIMIT 1;       ";\n  var _employeeData = toolbox.executeQuery(_employeeSql);\n  if (_employeeData.first()){\n    _employee.text = _employeeData.value("crmacct_name");\n    _employee.wordWrap = true;\n  }\n\n_employee.setStyleSheet(imageStyle);\n\n\n  _mainMenu["itemClicked(XTreeWidgetItem*, int)"].connect(mainMenuClicked);\n  _shortcutMenu["itemClicked(XTreeWidgetItem*, int)"].connect(shortcutMenuClicked);\n  mainwindow["emitSignal(QString, QString)"].connect(refreshShortcuts);\n\n  // Populate Shortcuts Right Click menu\n  _shortcutMenu["populateMenu(QMenu *,XTreeWidgetItem *, int)"].connect(shortcutsPopulateMenu);\n\n}\n\nfunction refreshShortcuts(source, type) {\n  if (source == "xtdesktop")\n    shortcutsMenuPopulateList();\n}\n\nfunction shortcutsMenuPopulateList() {\n\n  var menu = [ "menu.prod",  "menu.im",    "menu.sched",\n               "menu.purch", "menu.manu",  "menu.crm",\n               "menu.sales", "menu.accnt", "menu.sys" ],\n     scMaxLength = 25,\n     sep = qsTr(" > "),\n     scq, column, idx, item, i, j, path, longText;\n\n  function getPath(objName, menu) {\n    var actions, item, i, submenu;\n    if (! menu) {\n      return; // menu.sched is only defined if xtmfg is installed\n    } else if (menu.objectName === objName) {\n      return [ menu ];\n    } else if (menu.menu || menu.actions) {\n      if (menu.menu) {\n        submenu = menu.menu();\n        actions = (submenu && submenu.actions) ? submenu.actions() : [];\n      } else\n        actions = menu.actions();\n      for (i = 0; i < actions.length; i++) {\n        item = getPath(objName, actions[i]);\n        if (item) {\n          item.unshift(menu);\n          return item;\n        }\n      }\n    }\n  }\n  \n  _shortcutMenu.clear();\n  scq = toolbox.executeDbQuery("desktop", "userShortcuts", new Object);\n\n  _shortcutMenu.populate(scq);\n  \n  column = _shortcutMenu.column('menuAction');\n  for (idx = _shortcutMenu.topLevelItemCount - 1; idx >= 0; idx--) {\n    item = _shortcutMenu.topLevelItem(idx);\n    for (i = 0; i < menu.length; i++) {\n      path = getPath(item.rawValue('menuAction'), mainwindow.findChild(menu[i]));\n      if (path && path.length) {\n        longText = path.map(function (elem) { return elem.text ? elem.text : "" })\n                       .filter(function (elem) { return elem; })\n                       .join(sep);\n        longText = longText.replace(/(\\.\\.\\.|&)/g, "");\n        break;\n      }\n    }\n    if (longText) {\n      if (longText.length < scMaxLength)\n        item.setData(column, Qt.DisplayRole, longText);\n      else {\n        // shorten the shortcut to a '>' boundary if it looks too long\n        for (j = i = longText.indexOf(sep);\n             longText.length - j > scMaxLength && j > 0;\n             j = longText.indexOf(sep, j + 1)) {\n          i = j;\n        }\n        item.setData(column, Qt.DisplayRole, "..." + longText.substring(i));\n      }\n      item.setData(column, Qt.ToolTipRole, longText);\n    }\n  }\n}\n\nfunction shortcutsPopulateMenu(pMenu, pItem, pCol){\n  var mCode;\n  var currentItem = _shortcutMenu.currentItem();\n  if(currentItem != null) {\n    mCode = pMenu.addAction(qsTr("Edit Shortcuts..."));\n    mCode.enabled = privileges.check("MaintainPreferencesSelf");\n    mCode.triggered.connect(shortcutsMenuOpenPrefs);\n  }\n}\n\nfunction shortcutsMenuOpenPrefs() {\n  var hotkeys = toolbox.openWindow("hotkeys", mainwindow, 0, 1);\n  var params = new Object;\n  params.currentUser = true;\n  toolbox.lastWindow().set(params);\n  if (hotkeys.exec() > 0)\n    shortcutsMenuPopulateList();\n}\n  \nfunction mainMenuClicked(wdgt, item) {\n  _shortcutMenu.setCurrentItem(-1);\n  _desktopStack.currentIndex = (wdgt.id() - 1);\n}\n\nfunction shortcutMenuClicked(wdgt, item) {\n  _mainMenu.setCurrentItem(-1);\n  var param = new Object;\n  param.action = wdgt.id();\n\n  var _actionSQL = "SELECT usrpref_value FROM usrpref "\n\t\t+ " WHERE (usrpref_username = geteffectivextuser() "\n                 + " and usrpref_id = <? value('action') ?>);";\n  var _scAction = toolbox.executeQuery(_actionSQL, param);\n  if (_scAction.first()){\n    var priv = mainwindow.findChild(_scAction.value("usrpref_value"));\n    if (priv && priv.enabled)\n      mainwindow.findChild(_scAction.value("usrpref_value")).trigger();\n    else\n      QMessageBox.information(mainwindow, qsTr("Insufficient Privileges"), qsTr("You have insufficient permissions for this action"));\n  } else {\n    QMessageBox.critical(mainwindow, qsTr("Error"), qsTr("Could not find the shortcut action"));\n    return false;\n  }\n}\n	
68	desktopNotice	0	t	/*\n * This file is part of the xtdesktop package for xTuple ERP: PostBooks edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nmydialog.accepted.connect(save)\n\nfunction save()\n{\n  preferences.set("NoDesktopNotice",!mydialog.findChild("_remind").checked)\n}\n	
69	dockBankBal	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockBankBal;\nvar _bankBal;\nvar _bankBalIsDirty = true;\n\n/*!\n  Initializes Bank Balance dock widget and places it in the main window.\n*/\nfunction initDockBankBal()\n{\n  _dockBankBal = mainwindow.findChild("_dockBankBal");\n  _bankBal = mainwindow.findChild("_bankBal");\n\n  // Set columns on list\n  _bankBal.addColumn(qsTr("Name"), -1,  Qt.AlignLeft,   true, "bankaccnt_name");\n  _bankBal.addColumn(qsTr("Balance"), -1,  Qt.AlignRight,  true, "balance");\n\n  // Connect Signals and Slots\n  _dtTimer.timeout.connect(refreshBankBal);\n  mainwindow.bankAccountsUpdated.connect(refreshBankBal);\n  mainwindow.bankAdjustmentsUpdated.connect(refreshBankBal);\n  mainwindow.cashReceiptsUpdated.connect(refreshBankBal);\n  mainwindow.checksUpdated.connect(refreshBankBal);\n  mainwindow.glSeriesUpdated.connect(refreshBankBal);\n\n  _bankBal.itemSelected.connect(openWindowBankBal);\n  _bankBal["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuBankBal);\n\n  _dockBankBal.visibilityChanged.connect(fillListBankBal);\n\n  // Handle privilge control\n  var act = _dockBankBal.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewBankAccountsDock"))\n  {\n    _dockBankBal.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewBankAccountsDock");\n  _menuDesktop.appendAction(act);\n\n  fillListBankBal();\n}\n\n/*!\n  Fills the list with bank account data.\n*/\nfunction fillListBankBal()\n{\n  _dockBankBal = mainwindow.findChild("_dockBankBal");\n  _bankBal = mainwindow.findChild("_bankBal");\n\n  if (_dockBankBal.visible && _bankBalIsDirty)\n  {\n    var params = new Object;\n    if (metrics.boolean("EnableProjectAccounting"))\n      params.projectAccounting = true;\n    var qry = toolbox.executeDbQuery("desktop","bankBal", params);\n    _bankBal.populate(qry);\n    _bankBalIsDirty = false;\n  }\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowBankBal()\n{\n  // Make sure we can open the window\n  if (!privilegeCheckBankBal())\n    return;\n\n  // Open the window and perform any handling required\n  toolbox.openWindow("reconcileBankaccount");\n  var w = toolbox.lastWindow().findChild("_bankaccnt").setId(_bankBal.id());\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on a bank account item.\n*/\nfunction populateMenuBankBal(pMenu, pItem)\n{\n  var menuItem;\n  var enable = privilegeCheckBankBal();\n\n  menuItem = pMenu.addAction(qsTr("Reconcile..."));\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowBankBal);\n}\n\n/*!\n  Returns whether user has privileges to view detail.\n*/\nfunction privilegeCheckBankBal(act)\n{\n  return privileges.check("MaintainBankRec");\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshBankBal()\n{\n  _bankBalIsDirty = true;\n  fillListBankBal();\n}\n	
71	dockGLAccounts	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _b1GLAccounts;\nvar _b2GLAccounts;\nvar _dockGLAccounts;\nvar _glAccounts;\nvar _glAccountsIsDirty = true;\nvar _periodId = -1;\n\n/*!\n  Initializes Monitored Accounts dock widget and places it in the main window.\n*/\nfunction initDockGLAccounts()\n{\n  // Set up objects\n  _dockGLAccounts = mainwindow.findChild("_dockGLAccounts");\n  _glAccounts = mainwindow.findChild("_glAccounts");\n\n  _b1GLAccounts = _dockGLAccounts.findChild("_button1");\n  _b2GLAccounts = _dockGLAccounts.findChild("_button2");\n  _labelGLAccounts = _dockGLAccounts.findChild("_label");\n\n  // Set icons\n  var iReload = new QIcon;\n  iReload.addDbImage("reload_16");\n  _b1GLAccounts.icon = iReload;\n  _b1GLAccounts.text = "";\n  _b1GLAccounts.toolTip = qsTr("Reload");\n\n  var iGear = new QIcon();\n  iGear.addDbImage("gear_16");\n  _b2GLAccounts.icon = iGear;\n  _b2GLAccounts.text = "";\n  _b2GLAccounts.toolTip = qsTr("Preferences...");\n\n  // Set columns on list\n  _glAccounts.addColumn(qsTr("Number"), -1, Qt.AlignLeft, true, "accnt_id");\n  _glAccounts.addColumn(qsTr("Description"), -1, Qt.AlignLeft, true, "accnt_descrip");\n  _glAccounts.addColumn(qsTr("Type"), -1, Qt.AlignLeft, true, "accnt_type");\n  _glAccounts.addColumn(qsTr("Balance"), -1, Qt.AlignRight, true, "balance");\n\n  // Connect Signals and Slots\n  _b1GLAccounts.clicked.connect(refreshGLAccounts);\n  _b2GLAccounts.clicked.connect(preferencesGLAccounts);\n\n  _dtTimer.timeout.connect(refreshGLAccounts);\n  mainwindow.bankAdjustmentsUpdated.connect(refreshGLAccounts);\n  mainwindow.checksUpdated.connect(refreshGLAccounts);\n  mainwindow.creditMemosUpdated.connect(refreshGLAccounts);\n  mainwindow.cashReceiptsUpdated.connect(refreshGLAccounts);\n  mainwindow.glSeriesUpdated.connect(refreshGLAccounts);\n  mainwindow.invoicesUpdated.connect(refreshGLAccounts);\n  mainwindow.paymentsUpdated.connect(refreshGLAccounts);\n  mainwindow.standardPeriodsUpdated.connect(refreshGLAccounts);\n  mainwindow.vouchersUpdated.connect(refreshGLAccounts);\n  mainwindow.workOrderMaterialsUpdated.connect(refreshGLAccounts);\n  mainwindow.workOrderOperationsUpdated.connect(refreshGLAccounts);\n  mainwindow.workOrdersUpdated.connect(refreshGLAccounts);\n\n  _glAccounts.itemSelected.connect(openWindowGLAccounts);\n  _glAccounts["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuGLAccounts);\n\n  _dockGLAccounts.visibilityChanged.connect(fillListGLAccounts);\n\n  // Handle privilge control\n  var act = _dockGLAccounts.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewGLAccountsDock"))\n  {\n    _dockGLAccounts.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewGLAccountsDock");\n  _menuDesktop.appendAction(act);\n  fillListGLAccounts();\n}\n\n/*!\n  Fills the list with sales history data based on parameters determined by\n  sales history preferences.\n\n  @sa preferencesGLAccounts()\n*/\nfunction fillListGLAccounts()\n{\n  _dockGLAccounts = mainwindow.findChild("_dockGLAccounts");\n  _glAccounts = mainwindow.findChild("_glAccounts");\n\n  if (!_dockGLAccounts.visible || !_glAccountsIsDirty)\n    return;\n\n  _glAccounts.clear();\n  var accntIdList = preferences.value("MonitoredAccounts");\n  if(!accntIdList.length)\n    return;\n\n  var params = new Object;\n  params.asset = qsTr("Asset");\n  params.liability = qsTr("Liability");\n  params.revenue = qsTr("Revenue");\n  params.expense = qsTr("Expense");\n  params.equity = qsTr("Equity");\n  params.accnt_id_list = accntIdList;\n\n  // Forward update if applicable\n  if (!metrics.boolean("ManualForwardUpdate"))\n   toolbox.executeDbQuery("desktop","glforwardupdate", params);\n\n  var qry = toolbox.executeDbQuery("desktop","glaccountBal", params);\n  if (qry.first())\n  {\n    _periodId = qry.value("period_id");\n    _glAccounts.populate(qry);\n  }\n\n    _glAccountsIsDirty = false;\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowGLAccounts()\n{\n  var ui;\n  var params = new Object;\n  params.period_id = _periodId;\n  params.accnt_id = _glAccounts.id();\n  params.run = true;\n\n  // Make sure we can open the window\n  if (!privilegeCheckGLAccounts())\n    return;\n\n  // Open the window and perform any special handling required\n  toolbox.openWindow("dspGLTransactions");\n  toolbox.lastWindow().set(params);\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on sales history.\n*/\nfunction populateMenuGLAccounts(pMenu)\n{\n  var menuItem;\n  var enable = privilegeCheckGLAccounts();\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowGLAccounts);\n}\n\n/*!\n  Returns whether user has privileges to view Sales History detail.\n*/\nfunction privilegeCheckGLAccounts()\n{\n  var returnval = privileges.check("ViewGLTransactions");\n  print("privilegeCheckGLAccounts returning " + returnval);\n  return returnval;\n}\n\n/*! \n  Launches the preferences window where the user can set sales data output preferences.\n*/\nfunction preferencesGLAccounts()\n{\n  params = new Object;\n\n  var newdlg = toolbox.openWindow("preferencesSelections", mainwindow,\n                                  Qt.ApplicationModal, Qt.Dialog);\n  toolbox.lastWindow().set(params);\n  if (newdlg.exec())\n    refreshGLAccounts();\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshGLAccounts()\n{\n  _glAccountsIsDirty = true;\n  fillListGLAccounts();\n}\n	
127	dockMessageHistory	0	t	var _b1MessageHistory;\nvar _b2MessageHistory;\nvar _dockMessageHistory;\nvar _messageHistory;\nvar _limitmessageHistory;\nvar _messageHistoryIsDirty = true;\nvar _periodId = -1;\n\nfunction initDockMessageHistory()\n{  \n  // Set up objects\n  _dockMessageHistory = mainwindow.findChild("_dockMessageHistory");\n  _messageHistory     = mainwindow.findChild("_messageHistory");\n\n  _b1MessageHistory = _dockMessageHistory.findChild("_button3");\n  _b2MessageHistory = _dockMessageHistory.findChild("_button4");\n\n  // Set icons\n  var iReload = new QIcon;\n  iReload.addDbImage("reload_16");\n  _b1MessageHistory.icon = iReload;\n  _b1MessageHistory.text = "";\n  _b1MessageHistory.toolTip = qsTr("Reload");\n\n  var iGear = new QIcon();\n  iGear.addDbImage("gear_16");\n  _b2MessageHistory.icon = iGear;\n  _b2MessageHistory.text = "";\n  _b2MessageHistory.toolTip = qsTr("Preferences...");\n\n  // Set columns on list\n  _messageHistory.addColumn("Date",    75, 1, true, "sent");\n  _messageHistory.addColumn("From",    75, 1, true, "from");\n  _messageHistory.addColumn("To",      75, 1, true, "to")\n  _messageHistory.addColumn("Message", -1, 1, true, "message");\n\n  // Connect Signals and Slots\n  _b1MessageHistory.clicked.connect(refreshMessageHistory);\n  _b2MessageHistory.clicked.connect(preferencesMessageHistory);\n\n  _messageHistory["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuMessageHistory);\n  _messageHistory["itemDoubleClicked(QTreeWidgetItem*, int)"].connect(myOpen);\n\n  mainwindow["tick()"].connect(refreshMessageHistory);\n  mainwindow.setUpListener("messagePosted");\n  mainwindow["messageNotify()"].connect(refreshMessageHistory);\n\n  // Don't show if no privs\n  var act = _dockMessageHistory.toggleViewAction();\n  if (!privileges.check("viewMsgHistoryDock"))\n  {  \n    _dockMessageHistory.hide();\n    act.enabled = false;\n  }\n  else\n  {\n    _dockMessageHistory.show();\n    act.enabled = true;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("viewMsgHistoryDock");\n  _menuDesktop.appendAction(act);\n\n  fillListMessageHistory();\n}\n\nfunction fillListMessageHistory()\n{\n  _dockMessageHistory = mainwindow.findChild("_dockMessageHistory");\n  _messageHistory     = mainwindow.findChild("_messageHistory");\n\n  _messageHistory.clear();\n\n  var params = new Object;\n  params.limit = _limitmessageHistory;\n\n  _messageHistory.populate(toolbox.executeDbQuery("desktop","messageHistory", params));\n  _messageHistoryIsDirty = false;\n}\n\nfunction populateMenuMessageHistory(pMenu)\n{\n  try\n  {\n    var menuItem = pMenu.addAction(qsTr("Open..."));\n    menuItem.triggered.connect(myOpen);\n  }\n  catch (e)\n  {\n    QMessageBox.critical(mainwindow, "dockMessageHistory",\n                         "populateMenuMessageHistory exception: " + e);\n  }\n}\n\nfunction preferencesMessageHistory()\n{\n  try\n  {\n    params = new Object;\n    params.path = "desktop/messageHistory";\n    params.limit = _limitmessageHistory;\n    var newdlg = toolbox.openWindow("preferencesNumber", mainwindow,\n                                     Qt.ApplicationModal, Qt.Dialog);\n    toolbox.lastWindow().set(params);\n    if (newdlg.exec())\n    {\n      loadPreferencesMessageHistory();\n      refreshMessageHistory();\n    }\n  }\n  catch (e)\n  {\n    QMessageBox.critical(mainwindow, "dockMessageHistory",\n                         "preferencesMessageHistory exception: " + e);\n  }\n}\n\nfunction loadPreferencesMessageHistory()\n{\n  // Load preferences\n  _limitmessageHistory = preferences.value("desktop/messageHistory/limit");\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshMessageHistory()\n{\n  try\n  {\n    mainwindow.sSystemMessageAdded();\n    messageHistoryIsDirty = true;\n    fillListMessageHistory();\n  }\n  catch (e)\n  {\n    QMessageBox.critical(mainwindow, "dockMessageHistory",\n                         "refreshMessageHistory exception: " + e);\n  }\n}\n\nfunction myOpen()\n{\n  try\n  {\n    var params = new Object;\n    params.msg_id = _messageHistory.id();\n    var q = "SELECT msguser_id "\n          + "FROM msguser "\n          + "WHERE (msguser_msg_id = <? value('msg_id') ?>);";\n    var data = toolbox.executeQuery(q, params);\n    if (data.first())\n      params.msguser_id = data.value("msguser_id");\n    else if (data.lastError().type != QSqlError.NoError)\n    {\n      QMessageBox.critical(mainwindow, qsTr("Database Error"),\n                           data.lastError().text);\n      return;\n    }\n\n    params.mode = "acknowledge";\n    var newwnd = toolbox.openWindow("systemMessage", mainwindow, Qt.ApplicationModal, Qt.Dialog);\n    toolbox.lastWindow().set(params);\n    newwnd.exec();\n    refreshMessageHistory();\n  }\n  catch (e)\n  {\n    QMessageBox.critical(mainwindow, "dockMessageHistory",\n                         "myOpen exception: " + e);\n  }\n}\n	
72	dockMfgActive	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockMfgAct;\nvar _MfgAct;\nvar _mfgActIsDirty = true;\n\n/*!\n  Initializes Mfg. Activity dock widget and places it in the main window.\n*/\nfunction initDockMfgAct()\n{\n  _dockMfgAct = mainwindow.findChild("_dockMfgAct");\n  _mfgAct = mainwindow.findChild("_mfgAct");\n\n  // Set columns on list\n  _mfgAct.addColumn(qsTr("Type"), -1,  Qt.AlignLeft,   true, "activity");\n  _mfgAct.addColumn(qsTr("#"), 40,  Qt.AlignRight,  true, "count");\n  _mfgAct.addColumn(qsTr("Amount"), -1,  Qt.AlignRight,  true, "amount");\n  _mfgAct.addColumn(qsTr("Qty"), -1,  Qt.AlignRight,  false, "qty");\n\n  // Connect Signals and Slots\n  _dtTimer.timeout.connect(refreshMfgAct);\n  mainwindow.workOrdersUpdated.connect(refreshMfgAct);\n  mainwindow.workOrderMaterialsUpdated.connect(refreshMfgAct);\n  mainwindow.workOrderOperationsUpdated.connect(refreshMfgAct);\n\n  _mfgAct.itemSelected.connect(openWindowMfgAct);\n  _mfgAct["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuMfgAct);\n\n  _dockMfgAct.visibilityChanged.connect(fillListMfgAct);\n\n  // Handle privilge control\n  var act = _dockMfgAct.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewManufactureActivitiesDock"))\n  {\n    _dockMfgAct.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewManufactureActivitiesDock");\n  _menuDesktop.appendAction(act);\n\n  fillListMfgAct();\n}\n\n/*!\n  Fills the list with active Purch data.\n*/\nfunction fillListMfgAct()\n{\n  _dockMfgAct = mainwindow.findChild("_dockMfgAct");\n  _mfgAct = mainwindow.findChild("_mfgAct");\n\n  if (_dockMfgAct.visible && _mfgActIsDirty)\n  {\n    var params = new Object;\n    if (metrics.value("Application") != "PostBooks")\n      params.planned = qsTr("Planned");\n    params.open = qsTr("Open");\n    params.exploded = qsTr("Exploded");\n    params.released = qsTr("Released");\n    params.inprocess = qsTr("In Process");\n\n    _mfgAct.populate(toolbox.executeDbQuery("desktop","mfgAct", params));\n  }\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowMfgAct()\n{\n  var ui;\n  var run = false;\n  var act = _mfgAct.currentItem().rawValue("activity");\n  \n  // Make sure we can open the window for this activity\n  if (!privilegeCheckMfgAct(act))\n    return;\n\n  // Determine which window to open\n  if (act == "L")\n    ui = "dspPlannedOrders";\n  else\n    ui = "dspWoSchedule";\n\n  // Open the window and perform any handling required\n  var win = toolbox.openWindow(ui);\n  if (act == "L")\n  {\n//    win.findChild("_purchase").forgetful = true;\n//    win.findChild("_manufacture").forgetful = true;\n//    win.findChild("_transfer").forgetful = true;\n//    win.findChild("_purchase").checked = false;\n//    win.findChild("_manufacture").checked = true;\n//    win.findChild("_transfer").checked = false;\n//    if (act == 'O')\n//      win.findChild("_open").checked = true;\n//    else if (act == 'E')\n//      win.findChild("_exploded").checked = true;\n//    else if (act == 'R')\n//      win.findChild("_released").checked = true;\n//    else if (act == 'I')\n//      win.findChild("_inprocess").checked = true;\n//    win.findChild("_warehouse").setAll();\n    var params = new Object();\n    params.type = "W";\n    toolbox.lastWindow().set(params);\n  }\n  else\n  {\n    var params = new Object();\n    params.status = act;\n    toolbox.lastWindow().set(params);\n  }\n\n\n  win.sFillList();\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on a Purch Activity item.\n*/\nfunction populateMenuMfgAct(pMenu, pItem)\n{\n  var menuItem;\n  var act = pItem.rawValue("activity");\n  var enable = privilegeCheckMfgAct(act);\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowMfgAct);\n}\n\n/*!\n  Returns whether user has privileges to view detail on the selected Manufacture Activity.\n*/\nfunction privilegeCheckMfgAct(act)\n{\n  if (act == "L") // Planned Orders\n    return privileges.check("ViewPlannedOrders");\n  else // Work Orders\n    return (privileges.check("ViewWorkOrders") || \n            privileges.check("EditWorkOrders"));\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshMfgAct()\n{\n  _mfgActIsDirty = true;\n  fillListMfgAct();\n}\n	
73	dockMfgHist	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _b1MfgHist;\nvar _b2MfgHist;\nvar _dockMfgHist;\nvar _groupByMfgHist;\nvar _timeFrameMfgHist;\nvar _typeMfgHist;\nvar _labelMfgHist;\nvar _mfgHist;\nvar _mfgHistIsDirty = true;\n\n/*!\n  Initializes Sales History dock widget and places it in the main window.\n*/\nfunction initDockMfgHist()\n{\n  // Set up objects\n  _dockMfgHist = mainwindow.findChild("_dockMfgHist");\n  _mfgHist = mainwindow.findChild("_mfgHist");\n\n  _b1MfgHist = _dockMfgHist.findChild("_button1");\n  _b2MfgHist = _dockMfgHist.findChild("_button2");\n  _labelMfgHist = _dockMfgHist.findChild("_label");\n\n  // Set icons\n  var iReload = new QIcon;\n  iReload.addDbImage("reload_16");\n  _b1MfgHist.icon = iReload;\n  _b1MfgHist.text = "";\n  _b1MfgHist.toolTip = qsTr("Reload");\n\n  var iGear = new QIcon();\n  iGear.addDbImage("gear_16");\n  _b2MfgHist.icon = iGear;\n  _b2MfgHist.text = "";\n  _b2MfgHist.toolTip = qsTr("Preferences...");\n\n  // Load local preferences\n  loadPreferencesMfgHist();\n\n  // Set columns on list\n  setColumnsMfgHist();\n\n  // Connect Signals and Slots\n  _b1MfgHist.clicked.connect(refreshMfgHist);\n  _b2MfgHist.clicked.connect(preferencesMfgHist);\n\n  _dtTimer.timeout.connect(refreshMfgHist);\n  mainwindow.purchaseOrderReceiptsUpdated.connect(refreshMfgHist);\n  mainwindow.vouchersUpdated.connect(refreshMfgHist);\n\n  _mfgHist.itemSelected.connect(openWindowMfgHist);\n  _mfgHist["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuMfgHist);\n\n  _dockMfgHist.visibilityChanged.connect(fillListMfgHist);\n\n  // Handle privilge control\n  var act = _dockMfgHist.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewManufactureHistoryDock"))\n  {\n    _dockMfgHist.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewManufactureHistoryDock");\n  _menuDesktop.appendAction(act);\n\n  fillListMfgHist();\n}\n\n/*!\n  Fills the list with sales history data based on parameters determined by\n  sales history preferences.\n\n  @sa preferencesMfgHist()\n*/\nfunction fillListMfgHist()\n{\n  _dockMfgHist = mainwindow.findChild("_dockMfgHist");\n  _mfgHist = mainwindow.findChild("_mfgHist");\n\n  if (!_dockMfgHist.visible || !_mfgHistIsDirty) \n    return;\n\n  var timeFrame;\n  var type;\n  var params = getDatesMfgHist();\n \n  if (_groupByMfgHist == "classcode")\n  {\n    params.group_id = "classcode_id";\n    params.group_number = "classcode_code";\n    params.group_name = "classcode_descrip";\n  }\n  else if (_groupByMfgHist == "item")\n  {\n    params.group_id = "item_id";\n    params.group_number = "item_number";\n    params.group_name = "item_descrip1";\n  }\n  else if (_groupByMfgHist == "plancode")\n  {\n    params.group_id = "plancode_id";\n    params.group_number = "plancode_code";\n    params.group_name = "plancode_name";\n  }\n\n  _mfgHist.populate(toolbox.executeDbQuery("desktop","mfgHist", params));\n\n  type = qsTr("Receipts");\n\n  if (_timeFrameMfgHist == "day")\n    timeFrame = qsTr("Today");\n  else if (_timeFrameMfgHist == "week")\n    timeFrame = qsTr("this Week");\n  else if (_timeFrameMfgHist == "month")\n    timeFrame = qsTr("this Month");\n  else if (_timeFrameMfgHist == "year")\n    timeFrame = qsTr("this Year");\n\n  _labelMfgHist.text = type + " " + timeFrame;\n\n  _mfgHistIsDirty = false;\n}\n\n/*!\n  Returns an object with a list containing @a startDate and @a endDate\n  that is used for fetching data and opening windows using the date range\n  stored in local preferences.\n \n  @sa preferencesMfgHist()\n  @sa openWindowMfgHist()\n  @sa fillListMfgHist()\n*/\nfunction getDatesMfgHist()\n{\n  var params = new Object;\n\n  params.timeFrame = _timeFrameMfgHist;\n  params.interval = "1 " + _timeFrameMfgHist;\n\n  var q = toolbox.executeDbQuery("desktop", "getDates", params);\n\n  if (q.first())\n  {\n    params.startDate = q.value("startDate");\n    params.endDate = q.value("endDate");\n  }\n\n  return params;\n}\n\n/*! \n  Loads local Sales History preferences into memory.\n\n  @sa preferencesMfgHist()\n*/\nfunction loadPreferencesMfgHist()\n{\n  // Load preferences\n  _groupByMfgHist = preferences.value("desktop/mfgHist/groupBy");\n  _timeFrameMfgHist = preferences.value("desktop/mfgHist/timeFrame");\n  _typeMfgHist = preferences.value("desktop/mfgHist/type")\n  \n  // Set to defaults if no values\n  _groupByMfgHist = (_groupByMfgHist.length ? _groupByMfgHist : "plancode");\n  _timeFrameMfgHist = (_timeFrameMfgHist.length ? _timeFrameMfgHist : "year");\n  _typeMfgHist = (_typeMfgHist.length ? _typeMfgHist : "receipts");\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowMfgHist()\n{\n  var ui;\n  var params = getDatesMfgHist();\n  params.run = true;\n\n  // TO DO: Work it out so totals launch a window too\n  if (_mfgHist.id() == -1)\n    return;\n  \n  // Make sure we can open the window\n  if (!privilegeCheckMfgHist())\n    return;\n\n  // Determine which window to open\n  if (_groupByMfgHist == "classcode")\n  {\n    ui = "dspInventoryHistory";\n    params.classcode_id = _mfgHist.id();\n  }\n  else if (_groupByMfgHist == "item")\n  {\n    ui = "dspInventoryHistory";\n    params.item_id = _mfgHist.id();\n  }\n  else if (_groupByMfgHist == "plancode")\n  {\n    ui = "dspInventoryHistory";\n    params.plancode_id = _mfgHist.id();\n  }\n  params.transtype = "R";\n  params.ordertype = "WO";\n  params.run = true;\n\n  // Open the window and perform any special handling required\n  toolbox.openWindow(ui);\n  toolbox.lastWindow().set(params);\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on sales history.\n*/\nfunction populateMenuMfgHist(pMenu)\n{\n  var menuItem;\n  var enable = privilegeCheckMfgHist();\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowMfgHist);\n}\n\n/*!\n  Returns whether user has privileges to view Sales History detail.\n*/\nfunction privilegeCheckMfgHist()\n{\n  return privileges.check("ViewInventoryHistory");\n}\n\n/*! \n  Set up columns depending on local preferences.\n\n  @sa preferencesMfgHist()\n*/\nfunction setColumnsMfgHist()\n{\n  _mfgHist.columnCount = 0;\n\n  if (_groupByMfgHist == "classcode")\n  {\n    _mfgHist.addColumn(qsTr("Class Code"),  -1, Qt.AlignLeft, true, "classcode_code");\n    _mfgHist.addColumn(qsTr("Description"), -1, Qt.AlignLeft, false, "classcode_descrip");\n  }\n  else if (_groupByMfgHist == "item")\n  {\n    _mfgHist.addColumn(qsTr("Item Number"), -1, Qt.AlignLeft, true, "item_number");\n    _mfgHist.addColumn(qsTr("Description"), -1, Qt.AlignLeft, false, "item_descrip1");\n  }\n  else if (_groupByMfgHist == "plancode")\n  {\n    _mfgHist.addColumn(qsTr("Planner Code"),  -1, Qt.AlignLeft, true, "plancode_code");\n    _mfgHist.addColumn(qsTr("Description"), -1, Qt.AlignLeft, false, "plancode_descrip");\n  }\n\n  _mfgHist.addColumn(qsTr("Amount"), -1, Qt.AlignRight, true, "amount");\n  _mfgHist.addColumn(qsTr("Qty."), -1, Qt.AlignRight, false, "qty");\n}\n\n/*! \n  Launches the preferences window where the user can set sales data output preferences.\n*/\nfunction preferencesMfgHist()\n{\n  params = new Object;\n  params.path = "desktop/mfgHist";\n  params.groupBy = _groupByMfgHist;\n  params.timeFrame = _timeFrameMfgHist;\n  params.type = _typeMfgHist;\n\n  var newdlg = toolbox.openWindow("preferencesHistory", mainwindow,\n                                  Qt.ApplicationModal, Qt.Dialog);\n  toolbox.lastWindow().set(params);\n  if (newdlg.exec())\n  {\n    loadPreferencesMfgHist();\n    setColumnsMfgHist();\n    refreshMfgHist();\n  }\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshMfgHist()\n{\n  _mfgHistIsDirty = true;\n  fillListMfgHist();\n}\n	
74	dockMfgOpen	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockMfgOpen;\nvar _mfgOpen;\nvar _mfgOpenIsDirty = true;\n\n/*!\n  Initializes Work Order dock widget and places it in the main window.\n*/\nfunction initDockMfgOpen()\n{\n  _dockMfgOpen = mainwindow.findChild("_dockMfgOpen");\n  _mfgOpen = mainwindow.findChild("_mfgOpen");\n\n  // Set columns on list\n  _mfgOpen.addColumn(qsTr("Order#"), XTreeWidget.orderColumn,  Qt.AlignLeft,   true, "wonumber");\n  _mfgOpen.addColumn(qsTr("Item#"), XTreeWidget.itemColumn,  Qt.AlignLeft,  true, "item_number");\n  _mfgOpen.addColumn(qsTr("Description"), -1,  Qt.AlignLeft,  true, "itemdescrip");\n  if (metrics.boolean("MultiWhs"))\n    _mfgOpen.addColumn(qsTr("Whs."), XTreeWidget.whsColumn,  Qt.AlignLeft,  true, "warehous_code");\n  _mfgOpen.addColumn(qsTr("Status"), XTreeWidget.moneyColumn,  Qt.AlignLeft,  true, "wo_status");\n  _mfgOpen.addColumn(qsTr("Ordered"), XTreeWidget.qtyColumn,  Qt.AlignRight,  true, "wo_qtyord"); \n  _mfgOpen.addColumn(qsTr("Received"), XTreeWidget.qtyColumn,  Qt.AlignRight,  true, "wo_qtyrcv");  \n  _mfgOpen.addColumn(qsTr("UOM"), XTreeWidget.uomColumn,  Qt.AlignLeft, true, "uom_name"); \n  _mfgOpen.addColumn(qsTr("Start Date"), XTreeWidget.dateColumn,  Qt.AlignLeft, false, "wo_startdate"); \n  _mfgOpen.addColumn(qsTr("Due Date"), XTreeWidget.dateColumn,  Qt.AlignLeft, true, "wo_duedate"); \n  _mfgOpen.addColumn(qsTr("Condition"), XTreeWidget.statusColumn,  Qt.AlignLeft, false, "condition"); \n  if (privileges.check("ViewCosts"))\n  {\n    _mfgOpen.addColumn(qsTr("Posted Value"), XTreeWidget.moneyColumn,  Qt.AlignRight, false, "wo_postedvalue");\n    _mfgOpen.addColumn(qsTr("WIP Value"), XTreeWidget.moneyColumn,  Qt.AlignRight, true, "wo_wipvalue");\n  }\n\n  // Connect Signals and Slots\n  _dtTimer.timeout.connect(refreshMfgOpen);\n  mainwindow.workOrdersUpdated.connect(refreshMfgOpen);\n  mainwindow.workOrderMaterialsUpdated.connect(refreshMfgOpen);\n  mainwindow.workOrderOperationsUpdated.connect(refreshMfgOpen);\n\n  _mfgOpen.itemSelected.connect(openWindowMfgOpen);\n  _mfgOpen["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuMfgOpen);\n\n  _dockMfgOpen.visibilityChanged.connect(fillListMfgOpen);\n\n  // Handle privilge control\n  var act = _dockMfgOpen.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewWorkOrdersDock"))\n  {\n    _dockMfgOpen.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewWorkOrdersDock");\n  _menuDesktop.appendAction(act);\n\n  fillListMfgOpen();\n}\n\n/*!\n  Fills the list with open sales data.\n*/\nfunction fillListMfgOpen()\n{\n  _dockMfgOpen = mainwindow.findChild("_dockMfgOpen");\n  _mfgOpen = mainwindow.findChild("_mfgOpen");\n\n  if (!_dockMfgOpen.visible || !_mfgOpenIsDirty)\n    return;\n\n  params = new Object;\n  params.open = qsTr("Open");\n  params.exploded = qsTr("Exploded");\n  params.released = qsTr("Released");\n  params.inprocess = qsTr("In Process");\n\n  _mfgOpen.populate(toolbox.executeDbQuery("desktop","mfgOpen",params), true);\n\n  _mfgOpenIsDirty = false;\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowMfgOpen()\n{ \n  // Make sure we can open the window for this activity\n  if (!privilegeCheckMfgOpen)\n    return;\n\n  params = new Object;\n  params.wo_id = _mfgOpen.id();\n  if (privileges.check("MaintainWorkOrders"))\n    params.mode = "edit";\n  else\n    params.mode = "view";\n\n  // Open the window and perform any handling required\n  var wo = toolbox.openWindow("workOrder");\n  wo.set(params);\n\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on a Sales Order item.\n*/\nfunction populateMenuMfgOpen(pMenu, pItem)\n{\n  var menuItem;\n  var enable = privilegeCheckMfgOpen();\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowMfgOpen);\n}\n\n/*!\n  Returns whether user has privileges to view detail on the selected Sales Order.\n*/\nfunction privilegeCheckMfgOpen()\n{\n  return privileges.check("ViewWorkOrders") || \n         privileges.check("MaintainWorkOrders");\n\n  return false;\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshMfgOpen()\n{\n  _mfgOpenIsDirty = true;\n  fillListMfgOpen();\n}\n	
75	dockMyAccounts	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockMyaccounts;\nvar _accountList;\n\n/*!\n  Initializes the My Accounts dock widget and places it in the main window.\n*/\nfunction initDockAccounts()\n{\n  var _accountListIsDirty = true;\n  _dockMyaccounts = mainwindow.findChild("_dockMyaccounts");\n  _accountList = mainwindow.findChild("_accountList");\n\n  _accountList.addColumn(qsTr("Number"), XTreeWidget.itemColumn, Qt.AlignLeft,  false, "crmacct_number");\n  _accountList.addColumn(qsTr("Name"), -1, Qt.AlignLeft,  true, "crmacct_name");\n  _accountList.addColumn(qsTr("Contact"), -1, Qt.AlignLeft  , false, "cntct_name" );\n  _accountList.addColumn(qsTr("Phone"), -1, Qt.AlignLeft, false, "cntct_phone" );\n  _accountList.addColumn(qsTr("Email"), -1, Qt.AlignLeft, false, "cntct_email" );\n  _accountList.addColumn(qsTr("Address"), -1, Qt.AlignLeft  , false, "addr_line1" );\n  _accountList.addColumn(qsTr("City"), XTreeWidget.docTypeColumn, Qt.AlignLeft  , false, "addr_city" );\n  _accountList.addColumn(qsTr("State"), XTreeWidget.orderColumn, Qt.AlignLeft  , false, "addr_state" );\n  _accountList.addColumn(qsTr("Country"), XTreeWidget.orderColumn, Qt.AlignLeft  , false, "addr_country" );\n  _accountList.addColumn(qsTr("Postal Code"), XTreeWidget.docTypeColumn, Qt.AlignLeft  , false, "addr_postalcode" );\n\n  mainwindow.crmAccountsUpdated.connect(refreshMyAccts);\n  mainwindow.customersUpdated.connect(refreshMyAccts);\n  mainwindow.vendorsUpdated.connect(refreshMyAccts);\n\n  _accountList.itemSelected.connect(openWindowMyAccts);\n  _accountList["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuMyAccts);\n\n  _dockMyaccounts.visibilityChanged.connect(fillListMyAccts);\n\n  // Handle privilege control\n  var act = _dockMyaccounts.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewMyAccountsDock"))\n  {\n    _dockMyaccounts.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewMyAccountsDock");\n  _menuDesktop.appendAction(act);\n\n  fillListMyAccts();\n\n  function fillListMyAccts()\n  {\n    if (! _dockMyaccounts || ! _accountList || !_dockMyaccounts.visible || !_accountListIsDirty)\n      return;\n\n    _accountList.populate(toolbox.executeDbQuery("desktop", "crmaccounts",\n                                                 { owner_username: mainwindow.username()} ));\n\n    _accountListIsDirty = false;\n  }\n\n  function openWindowMyAccts()\n  {\n    if (!privilegeCheckMyAccts())\n      return;\n\n    params = { crmacct_id: _accountList.id() };\n    if (privileges.check("MaintainAllCRMAccounts") || privileges.check("MaintainPersonalCRMAccounts"))\n      params.mode = "edit"\n    else\n      params.mode = "view"\n\n    // Open the window and perform any special handling required\n    var win = toolbox.openWindow("crmaccount");\n    win.set(params);\n  }\n\n  function populateMenuMyAccts(pMenu)\n  {\n    var menuItem;\n\n    menuItem = pMenu.addAction(_open);\n    menuItem.enabled = privilegeCheckMyAccts();\n    menuItem.triggered.connect(openWindowMyAccts);\n  }\n\n  function privilegeCheckMyAccts()\n  {\n    return privileges.check("MaintainAllCRMAccounts") || privileges.check("MaintainPersonalAccounts") ||\n           privileges.check("ViewAllCRMAccounts") || privileges.check("ViewPersonalCRMAccounts");\n  }\n\n  function refreshMyAccts()\n  {\n    _accountListIsDirty = true;\n    fillListMyAccts();\n  }\n}\n	
76	dockMyContacts	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockMycontacts;\nvar _contactList;\n\n/*!\n  Initializes the My Contacts dock widget and places it in the main window.\n*/\nfunction initDockMyCntcts()\n{\n  _dockMycontacts = mainwindow.findChild("_dockMycontacts");\n  _contactList = mainwindow.findChild("_contactList");\n\n  // Set columns on list\n  _contactList.addColumn(qsTr("Name"), -1, Qt.AlignLeft  , true, "cntct_name" );\n  _contactList.addColumn(qsTr("Account#"), XTreeWidget.itemColumn, Qt.AlignLeft, false, "crmacct_number");\n  _contactList.addColumn(qsTr("Account Name"), -1, Qt.AlignLeft,  false, "crmacct_name");\n  _contactList.addColumn(qsTr("Phone"), -1, Qt.AlignLeft, true, "cntct_phone" );\n  _contactList.addColumn(qsTr("Email"), -1, Qt.AlignLeft, false, "cntct_email" );\n  _contactList.addColumn(qsTr("Address"), -1, Qt.AlignLeft  , false, "addr_line1" );\n  _contactList.addColumn(qsTr("City"), XTreeWidget.docTypeColumn, Qt.AlignLeft  , false, "addr_city" );\n  _contactList.addColumn(qsTr("State"), XTreeWidget.orderColumn, Qt.AlignLeft  , false, "addr_state" );\n  _contactList.addColumn(qsTr("Country"), XTreeWidget.orderColumn, Qt.AlignLeft  , false, "addr_country" );\n  _contactList.addColumn(qsTr("Postal Code"), XTreeWidget.docTypeColumn, Qt.AlignLeft  , false, "addr_postalcode" );\n\n  _dtTimer.timeout.connect(fillListMyCntcts);\n\n  _contactList.itemSelected.connect(openWindowMyCntcts);\n  _contactList["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuMyCntcts);\n\n  _dockMycontacts.visibilityChanged.connect(fillListMyCntcts);\n\n  // Handle privilge control\n  var act = _dockMycontacts.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewMyContactsDock"))\n  {\n    _dockMycontacts.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewMyContactsDock");\n  _menuDesktop.appendAction(act);\n\n  fillListMyCntcts();\n}\n\n/*!\n  Fills the My Contacts list with Contacts owned by the current user.\n*/\nfunction fillListMyCntcts()\n{\n  _dockMycontacts = mainwindow.findChild("_dockMycontacts");\n  _contactList = mainwindow.findChild("_contactList");\n\n  if (!_dockMycontacts.visible)\n    return;\n\n  _contactList = mainwindow.findChild("_contactList");\n  _contactList.populate(toolbox.executeDbQuery("desktop", "contacts"));\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowMyCntcts()\n{\n  // Make sure we can open the window\n  if (!privilegeCheckMyCntcts())\n    return;\n\n  // Determine which contact to open\n  params = new Object;\n  if (privileges.check("MaintainAllContacts") || privileges.check("MaintainPersonalContacts"))\n    params.mode = "edit";\n  else\n    params.mode = "view";\n  params.cntct_id = _contactList.id();\n\n  // Open the window and perform any special handling required\n  var newdlg = toolbox.openWindow("contact");\n  newdlg.set(params);\n  newdlg.exec();\n}\n\n/*!\n  Adds actions to \\a pMenu, typically from a right click on My Contacts.\n*/\nfunction populateMenuMyCntcts(pMenu)\n{\n  var menuItem;\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = privilegeCheckMyCntcts();\n  menuItem.triggered.connect(openWindowMyCntcts);\n}\n\n/*!\n  Returns whether user has privileges to view My Contact detail.\n*/\nfunction privilegeCheckMyCntcts()\n{\n  return privileges.check("MaintainAllContacts") || privileges.check("MaintainPersonalContacts") ||\n         privileges.check("ViewAllContacts") || privileges.check("ViewPersonalContacts");\n}\n	
77	dockMyTodo	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockMytodo;\nvar _todoList;\n\n/*!\n  Initializes To Do dock widget and places it in the main window.\n*/\nfunction initDockTodo()\n{\n  _dockMytodo = mainwindow.findChild("_dockMytodo");\n  _todoList = mainwindow.findChild("_todoList");\n\n  if (_todoList)\n  {\n    _todoList.addColumn(qsTr("Type"), XTreeWidget.userColumn, Qt.AlignCenter, true, "type");\n    _todoList.addColumn(qsTr("Priority"), XTreeWidget.userColumn, Qt.AlignLeft, false, "priority");\n    _todoList.addColumn(qsTr("Assigned To"), XTreeWidget.userColumn, Qt.AlignLeft, false, "usr");\n    _todoList.addColumn(qsTr("Name"), -1, Qt.AlignLeft, true, "name");\n    _todoList.addColumn(qsTr("Description"), -1, Qt.AlignLeft,   true, "descrip");\n    _todoList.addColumn(qsTr("Status"), XTreeWidget.statusColumn, Qt.AlignLeft, false, "status");\n    _todoList.addColumn(qsTr("Start Date"), XTreeWidget.dateColumn, Qt.AlignLeft, true, "start");\n    _todoList.addColumn(qsTr("Due Date"), XTreeWidget.dateColumn, Qt.AlignLeft, true, "due");\n    _todoList.addColumn(qsTr("Parent#"), XTreeWidget.orderColumn, Qt.AlignLeft, false, "number");\n    _todoList.addColumn(qsTr("Customer#"), XTreeWidget.orderColumn, Qt.AlignLeft, false, "cust");\n    _todoList.addColumn(qsTr("Account#"), XTreeWidget.orderColumn, Qt.AlignLeft, true, "crmacct_number");\n    _todoList.addColumn(qsTr("Account Name"), 100, Qt.AlignLeft, false, "crmacct_name");\n    _todoList.addColumn(qsTr("Owner"), XTreeWidget.userColumn, Qt.AlignLeft, false,"owner");\n\n    _todoList.itemSelected.connect(openWindowToDo);\n    _todoList["populateMenu(QMenu*,XTreeWidgetItem*,int)"].connect(populateMenuToDo);\n\n    if (_dockMytodo)\n    {\n      _dtTimer.timeout.connect(fillListToDo);\n      _dockMytodo.visibilityChanged.connect(fillListToDo);\n\n      // Handle privilege control\n      var act = _dockMytodo.toggleViewAction();\n\n      if (!privileges.check("ViewTodoDock"))\n      {\n        _dockMytodo.hide();\n        act.enabled = false;\n      }\n\n      // Allow rescan to let them show if privs granted\n      act.setData("ViewTodoDock");\n      _menuDesktop.appendAction(act);\n    }\n\n    fillListToDo();\n  }\n\n  function deleteToDo()\n  {\n    var answer = QMessageBox.question(mainwindow,\n                       qsTr("Delete To Do?"),\n                       qsTr("This will permenantly delete the To Do item.  Are you sure?"),\n                       QMessageBox.Yes | QMessageBox.No,\n                       QMessageBox.Yes);\n    if(answer == QMessageBox.No)\n      return;\n\n    toolbox.executeDbQuery("desktop","todoDelete", { todoitem_id: _todoList.id() } );\n    fillListToDo();\n  }\n\n  function openWindowToDo()\n  {\n    params = new Object;\n    actId = _todoList.altId();\n    act = toDoAct(actId);\n\n    // Make sure we can open the window\n    if (!privilegeCheckToDo(act))\n      return;\n\n    // Determine which window to open\n    if (act == "D") // To Do\n    {\n      ui = "todoItem";\n      if (privileges.check("MaintainAllToDoItems") || privileges.check("MaintainPersonalToDoItems"))\n        params.mode = "edit";\n      else\n        params.mode = "view";\n      params.todoitem_id = _todoList.id();\n    }\n    else if (act == "I")\n    {\n      ui = "incident";\n      if (privileges.check("MaintainAllIncidents") || privileges.check("MaintainPersonalIncidents"))\n        params.mode = "edit";\n      else\n        params.mode = "view";\n      params.incdt_id = _todoList.id();\n    }\n    else if (act == "T")\n    {\n      ui = "task";\n      if (privileges.check("MaintainAllProjects") || privileges.check("MaintainPersonalProjects"))\n        params.mode = "edit";\n      else\n        params.mode = "view"\n      params.prjtask_id = _todoList.id();\n    }\n    else if (act == "P")\n    {\n      ui = "project";\n      if (privileges.check("MaintainAllProjects") || privileges.check("MaintainPersonalProjects"))\n        params.mode = "edit";\n      else\n        params.mode = "view";\n      params.prj_id = _todoList.id();\n    }\n\n    // Open the window and perform any special handling required\n    var newdlg = toolbox.openWindow(ui);\n    newdlg.set(params);\n    newdlg.exec()\n  }\n\n  function toDoAct(actId)\n  {\n    if (actId == 1)\n      return "D";\n    else if (actId == 2)\n      return "I";\n    else if (actId == 3)\n      return "T";\n    else if (actId == 4)\n      return "P"\n\n    return "";\n  }\n\n  function populateMenuToDo(pMenu)\n  {\n    var act = toDoAct(_todoList.altId());\n    var menuItem;\n\n    menuItem = pMenu.addAction(_open);\n    menuItem.enabled = privilegeCheckToDo(act);\n    \n    menuItem.triggered.connect(openWindowToDo);\n\n    if (act == "D")\n    {\n      menuItem = pMenu.addAction(qsTr("Delete"));\n      menuItem.enabled = privileges.check("MaintainAllToDoItems") || \n                         privileges.check("MaintainPersonalToDoItems");\n      menuItem.triggered.connect(deleteToDo);\n    }\n  }\n\n  function privilegeCheckToDo(act)\n  {\n    if (act == "D") // To Do list\n      return privileges.check("MaintainAllToDoItems") || privileges.check("MaintainPersonalToDoItems") ||\n             privileges.check("ViewAllToDoItems") || privileges.check("ViewPersonalToDoItems");\n    else if (act == "I") // Incidents\n      return privileges.check("MaintainAllIncidents") || privileges.check("MaintainPersonalIncidents") ||\n             privileges.check("ViewAllIncidents") || privileges.check("ViewPersonalIncidents");\n    else if (act == "P" || act == "T") // Projects and Tasks\n      return privileges.check("MaintainAllProjects") || privileges.check("MaintainPersonalProjects") ||\n             privileges.check("ViewAllProjects") || privileges.check("ViewPersonalProjects");\n\n    return false;\n  }\n\n}\n\n  function fillListToDo()\n  {\n    if (!_dockMytodo || !_dockMytodo.visible || !_todoList)\n      return;\n\n    var params = {\n      todo:              qsTr("To-do"),\n      incident:          qsTr("Incident"),\n      task:              qsTr("Task"),\n      project:           qsTr("Project"),\n      todoList:          true,\n      incidents:         true,\n      projects:          true,\n      assigned_username: mainwindow.username(),\n      owner_username:    mainwindow.username(),\n    };\n    _todoList.populate(toolbox.executeDbQuery("desktop", "todoList", params), true);\n  }\n	
78	dockPayables	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockPayables;\nvar _payables;\nvar _payablesIsDirty = true;\n\n/*!\n  Initializes Bank Balance dock widget and places it in the main window.\n*/\nfunction initDockPayables()\n{\n  _dockPayables = mainwindow.findChild("_dockPayables");\n  _ap = mainwindow.findChild("_ap");\n  _ap.rootIsDecorated = false;\n\n  // Set columns on list\n  _ap.addColumn(qsTr("Status"), -1,  Qt.AlignLeft,   true);\n  _ap.addColumn(qsTr("Balance"), -1,  Qt.AlignRight,  true);\n\n  // Connect Signals and Slots\n  _dtTimer.timeout.connect(refreshPayables);\n  mainwindow.checksUpdated.connect(refreshPayables);\n  mainwindow.paymentsUpdated.connect(refreshPayables);\n  mainwindow.vouchersUpdated.connect(refreshPayables);\n\n  _ap.itemSelected.connect(openWindowPayables);\n  _ap["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuPayables);\n\n  _dockPayables.visibilityChanged.connect(fillListPayables);\n\n  // Handle privilge control\n  var act = _dockPayables.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewPayablesDock"))\n  {\n    _dockPayables.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewPayablesDock");\n  _menuDesktop.appendAction(act);\n\n  fillListPayables();\n}\n\n/*!\n  Fills the list with bank account data.\n*/\nfunction fillListPayables()\n{\n  _dockPayables = mainwindow.findChild("_dockPayables");\n  _ap = mainwindow.findChild("_ap");\n\n  if (!_dockPayables.visible || !_payablesIsDirty)\n    return;\n\n  var q = toolbox.executeDbQuery("desktop","payables");\n  q.first();\n  \n  _ap.clear();\n  var item1 = new XTreeWidgetItem(_ap, 0, qsTr("0+ Days"), q.value("cur_val"));\n  var item2 = new XTreeWidgetItem(_ap, 1, qsTr("0-30 Days"), q.value("thirty_val"));\n  var item3 = new XTreeWidgetItem(_ap, 2, qsTr("31-60 Days"), q.value("sixty_val"));\n  var item4 = new XTreeWidgetItem(_ap, 3, qsTr("61-90 Days"), q.value("ninety_val"));\n  var item5 = new XTreeWidgetItem(_ap, 4, qsTr("90+ days"), q.value("plus_val"));\n  var item6 = new XTreeWidgetItem(_ap, 5, qsTr("Total Open"), q.value("total_val"));\n\n  _payablesIsDirty = false;\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowPayables()\n{\n  // Make sure we can open the window\n  if (!privilegeCheckPayables())\n    return;\n\n  var params = new Object;\n  params.run = true;\n\n  var asOfDate = mainwindow.dbDate();\n  var startDate = new Date();\n  var endDate = new Date();\n\n  // Open the window and perform any handling required\n  toolbox.openWindow("dspAPOpenItemsByVendor");\n\n  if (_ap.id() == 0)\n  {\n    startDate.setDate(asOfDate.getDate());\n    toolbox.lastWindow().findChild("_dates").setStartDate(startDate);\n  }\n  else if (_ap.id() == 1)\n  {\n    startDate.setDate(asOfDate.getDate() -30);\n    endDate.setDate(asOfDate.getDate() -1);\n    toolbox.lastWindow().findChild("_dates").setStartDate(startDate);\n    toolbox.lastWindow().findChild("_dates").setEndDate(endDate);\n  }\n  else if (_ap.id() == 2)\n  {\n    startDate.setDate(asOfDate.getDate() -60);\n    endDate.setDate(asOfDate.getDate() -31);\n    toolbox.lastWindow().findChild("_dates").setStartDate(startDate);\n    toolbox.lastWindow().findChild("_dates").setEndDate(endDate);\n  }\n  else if (_ap.id() == 3)\n  {\n    startDate.setDate(asOfDate.getDate() -90);\n    endDate.setDate(asOfDate.getDate() -61);\n    toolbox.lastWindow().findChild("_dates").setStartDate(startDate);\n    toolbox.lastWindow().findChild("_dates").setEndDate(endDate);\n  }\n  else if (_ap.id() == 4)\n  {\n    endDate.setDate(asOfDate.getDate() -91);\n    toolbox.lastWindow().findChild("_dates").setEndDate(endDate);\n  }\n\n  toolbox.lastWindow().set(params);\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on a bank account item.\n*/\nfunction populateMenuPayables(pMenu, pItem)\n{\n  var menuItem;\n  var enable = privilegeCheckPayables();\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowPayables);\n}\n\n/*!\n  Returns whether user has privileges to view detail.\n*/\nfunction privilegeCheckPayables(act)\n{\n  return privileges.check("ViewAPOpenItems");\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshPayables()\n{\n  _payablesIsDirty = true;\n  fillListPayables();\n}\n	
79	dockPurchActive	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockPurchAct;\nvar _purchAct;\nvar _purchActIsDirty = true;\n\n/*!\n  Initializes Purch Activity dock widget and places it in the main window.\n*/\nfunction initDockPurchAct()\n{\n  _dockPurchAct = mainwindow.findChild("_dockPurchAct");\n  _purchAct = mainwindow.findChild("_purchAct");\n\n  // Set columns on list\n  _purchAct.addColumn(qsTr("Type"), -1,  Qt.AlignLeft,   true, "activity");\n  _purchAct.addColumn(qsTr("#"), 40,  Qt.AlignRight,  true, "count");\n  _purchAct.addColumn(qsTr("Amount"), -1,  Qt.AlignRight,  true, "amount");\n\n  // Connect Signals and Slots\n  _dtTimer.timeout.connect(refreshPurchAct);\n  mainwindow.purchaseOrdersUpdated.connect(refreshPurchAct);\n  mainwindow.purchaseOrderReceiptsUpdated.connect(refreshPurchAct);\n  mainwindow.purchaseRequestsUpdated.connect(refreshPurchAct);\n  mainwindow.vouchersUpdated.connect(refreshPurchAct);\n\n  _purchAct.itemSelected.connect(openWindowPurchAct);\n  _purchAct["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuPurchAct);\n\n  _dockPurchAct.visibilityChanged.connect(fillListPurchAct);\n\n  // Handle privilge control\n  var act = _dockPurchAct.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewPurchaseActivitiesDock"))\n  {\n    _dockPurchAct.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewPurchaseActivitiesDock");\n  _menuDesktop.appendAction(act);\n\n  fillListPurchAct();\n}\n\n/*!\n  Fills the list with active Purch data.\n*/\nfunction fillListPurchAct()\n{\n  _dockPurchAct = mainwindow.findChild("_dockPurchAct");\n  _purchAct = mainwindow.findChild("_purchAct");\n\n  if (!_dockPurchAct.visible || !_purchActIsDirty)\n    return;\n\n  var params = new Object;\n  if (metrics.value("Application") != "PostBooks")\n  {\n    params.planned = qsTr("Planned");\n    params.firmed = qsTr("Firmed");\n  }\n  params.request = qsTr("Requests");\n  params.unreleased = qsTr("Unreleased");\n  params.open = qsTr("Open");\n  params.receiving = qsTr("At Receiving");\n  params.received = qsTr("Received");\n  params.vouchered = qsTr("Vouchered");\n\n  _purchAct.populate(toolbox.executeDbQuery("desktop","purchAct", params));\n\n  _purchActIsDirty = false;\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowPurchAct()\n{\n  var ui;\n  var run = false;\n  var act = _purchAct.currentItem().rawValue("activity");\n  \n  // Make sure we can open the window for this activity\n  if (!privilegeCheckPurchAct(act))\n    return;\n\n  // Determine which window to open\n  if (act == "L")\n    ui = "dspPlannedOrders";\n  else if (act == "Q")\n    ui = "dspPurchaseReqsByPlannerCode";\n  else if (act == "U" || act == "O")\n    ui = "unpostedPurchaseOrders";\n  else if (act == "A")\n    ui = "unpostedPoReceipts";\n  else if (act == "V")\n    ui = "dspUninvoicedReceivings";\n  else if (act == "I")\n    ui = "openVouchers";\n\n  // Open the window and perform any handling required\n  toolbox.openWindow(ui);\n  if (act == "L")\n  {\n//    toolbox.lastWindow().findChild("_purchase").forgetful = true;\n//    toolbox.lastWindow().findChild("_manufacture").forgetful = true;\n//    toolbox.lastWindow().findChild("_transfer").forgetful = true;\n//    toolbox.lastWindow().findChild("_purchase").checked = true;\n//    toolbox.lastWindow().findChild("_manufacture").checked = false;\n//    toolbox.lastWindow().findChild("_transfer").checked = false;\n    var params = new Object();\n    params.type = "P";\n    toolbox.lastWindow().set(params);\n    toolbox.lastWindow().sFillList();\n  }\n  if (act == "U" || act == "O") // Set options for open P/O list\n  {\n    var showUnreleased = toolbox.lastWindow().findChild("_showUnreleased");\n    var showOpen = toolbox.lastWindow().findChild("_showOpen");\n    showUnreleased.forgetful = true;\n    showOpen.forgetful = true;\n    if (act == "U")\n    {\n      showUnreleased.checked = true;\n      showOpen.checked = false;\n    }\n    else\n    {\n      showUnreleased.checked = false;\n      showOpen.checked = true;\n    }\n    toolbox.lastWindow().sFillList();\n  }\n  else if (act == "Q" || act == "V") \n  {\n    toolbox.lastWindow().findChild("_warehouse").setAll();\n    toolbox.lastWindow().sFillList();\n  }\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on a Purch Activity item.\n*/\nfunction populateMenuPurchAct(pMenu, pItem)\n{\n  var menuItem;\n  var act = pItem.rawValue("activity");\n  var enable = privilegeCheckPurchAct(act);\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowPurchAct);\n}\n\n/*!\n  Returns whether user has privileges to view detail on the selected Purch Activity.\n*/\nfunction privilegeCheckPurchAct(act)\n{\n  if (act == "L") // Planned Orders\n    return privileges.check("ViewPlannedOrders");\n  else if (act == "Q") // Purchase Requests\n    return privileges.check("ViewPurchaseRequests");\n  else if (act == "U" || act == "O") // Purchase Orders\n    return privileges.check("ViewPurchaseOrders") || \n           privileges.check("MaintainPurchaseOrders");\n  else if (act == "A") // At Receiving\n    return privileges.check("EnterReceipts");\n  else if (act == "V") // Unvouchered Receipts\n    return privileges.check("ViewUninvoicedReceipts") || \n           privileges.check("MaintainUninvoicedReceipts");\n  else if (act == "I") // Unposted Vouchers\n    return privileges.check("ViewVouchers") || \n           privileges.check("MaintainVouchers");\n\n  return false;\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshPurchAct()\n{\n  _purchActIsDirty = true;\n  fillListPurchAct();\n}\n	
80	dockPurchHist	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _b1PurchHist;\nvar _b2PurchHist;\nvar _dockPurchHist;\nvar _groupByPurchHist;\nvar _timeFramePurchHist;\nvar _typePurchHist;\nvar _labelPurchHist;\nvar _purchHist;\nvar _purchHistIsDirty = true;\n\n/*!\n  Initializes Sales History dock widget and places it in the main window.\n*/\nfunction initDockPurchHist()\n{\n  // Set up objects\n  _dockPurchHist = mainwindow.findChild("_dockPurchHist");\n  _purchHist = mainwindow.findChild("_purchHist");\n\n  _b1PurchHist = _dockPurchHist.findChild("_button1");\n  _b2PurchHist = _dockPurchHist.findChild("_button2");\n  _labelPurchHist = _dockPurchHist.findChild("_label");\n\n  // Set icons\n  var iReload = new QIcon;\n  iReload.addDbImage("reload_16");\n  _b1PurchHist.icon = iReload;\n  _b1PurchHist.text = "";\n  _b1PurchHist.toolTip = qsTr("Reload");\n\n  var iGear = new QIcon();\n  iGear.addDbImage("gear_16");\n  _b2PurchHist.icon = iGear;\n  _b2PurchHist.text = "";\n  _b2PurchHist.toolTip = qsTr("Preferences...");\n\n  // Load local preferences\n  loadPreferencesPurchHist();\n\n  // Set columns on list\n  setColumnsPurchHist();\n\n  // Connect Signals and Slots\n  _b1PurchHist.clicked.connect(refreshPurchHist);\n  _b2PurchHist.clicked.connect(preferencesPurchHist);\n\n  _dtTimer.timeout.connect(refreshPurchHist);\n  mainwindow.purchaseOrderReceiptsUpdated.connect(refreshPurchHist);\n  mainwindow.vouchersUpdated.connect(refreshPurchHist);\n\n  _purchHist.itemSelected.connect(openWindowPurchHist);\n  _purchHist["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuPurchHist);\n\n  _dockPurchHist.visibilityChanged.connect(fillListPurchHist);\n\n  // Handle privilge control\n  var act = _dockPurchHist.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewPurchaseHistoryDock"))\n  {\n    _dockPurchHist.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewPurchaseHistoryDock");\n  _menuDesktop.appendAction(act);\n\n  fillListPurchHist();\n}\n\n/*!\n  Fills the list with sales history data based on parameters determined by\n  sales history preferences.\n\n  @sa preferencesPurchHist()\n*/\nfunction fillListPurchHist()\n{\n  _dockPurchHist = mainwindow.findChild("_dockPurchHist");\n  _purchHist = mainwindow.findChild("_purchHist");\n\n  if (!_dockPurchHist.visible || !_purchHistIsDirty) \n    return;\n\n  var timeFrame;\n  var type;\n  var params = getDatesPurchHist();\n  params.nonInv = qsTr("Non-Inventory");\n\n  if (_typePurchHist == "variances")\n    params.variances = true;\n  else\n    params.receipts = true;\n \n  if (_groupByPurchHist == "vend")\n  {\n    params.group_id = "vend_id";\n    params.group_number = "vend_number";\n    params.group_name = "vend_name";\n  }\n  else if (_groupByPurchHist == "item")\n  {\n    params.group_id = "item_id";\n    params.group_number = "item_number";\n    params.group_name = "item_descrip1";\n  }\n  else if (_groupByPurchHist == "agent")\n  {\n    params.group_id = "1";\n    params.group_number = "pohead_agent_username";\n    params.group_name = "usr_propername";\n  }\n\n  _purchHist.populate(toolbox.executeDbQuery("desktop","purchHist", params));\n\n  if ("variances" in params)\n    type = qsTr("Variances");\n  else\n    type = qsTr("Receipts");\n\n  if (_timeFramePurchHist == "day")\n    timeFrame = qsTr("Today");\n  else if (_timeFramePurchHist == "week")\n    timeFrame = qsTr("this Week");\n  else if (_timeFramePurchHist == "month")\n    timeFrame = qsTr("this Month");\n  else if (_timeFramePurchHist == "year")\n    timeFrame = qsTr("this Year");\n\n  _labelPurchHist.text = type + " " + timeFrame;\n\n  _purchHistIsDirty = false;\n}\n\n/*!\n  Returns an object with a list containing @a startDate and @a endDate\n  that is used for fetching data and opening windows using the date range\n  stored in local preferences.\n \n  @sa preferencesPurchHist()\n  @sa openWindowPurchHist()\n  @sa fillListPurchHist()\n*/\nfunction getDatesPurchHist()\n{\n  var params = new Object;\n\n  params.timeFrame = _timeFramePurchHist;\n  params.interval = "1 " + _timeFramePurchHist;\n\n  var q = toolbox.executeDbQuery("desktop", "getDates", params);\n\n  if (q.first())\n  {\n    params.startDate = q.value("startDate");\n    params.endDate = q.value("endDate");\n  }\n\n  return params;\n}\n\n/*! \n  Loads local Sales History preferences into memory.\n\n  @sa preferencesPurchHist()\n*/\nfunction loadPreferencesPurchHist()\n{\n  // Load preferences\n  _groupByPurchHist = preferences.value("desktop/purchHist/groupBy");\n  _timeFramePurchHist = preferences.value("desktop/purchHist/timeFrame");\n  _typePurchHist = preferences.value("desktop/purchHist/type")\n  \n  // Set to defaults if no values\n  _groupByPurchHist = (_groupByPurchHist.length ? _groupByPurchHist : "vend");\n  _timeFramePurchHist = (_timeFramePurchHist.length ? _timeFramePurchHist : "year");\n  _typePurchHist = (_typePurchHist.length ? _typePurchHist : "receipts");\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowPurchHist()\n{\n  var ui;\n  var params = getDatesPurchHist();\n  params.run = true;\n\n  // TO DO: Work it out so totals launch a window too\n  if (_purchHist.id() == -1)\n    return;\n  \n  // Make sure we can open the window\n  if (!privilegeCheckPurchHist())\n    return;\n\n  // Determine which window to open\n  if (_groupByPurchHist == "vend")\n  {\n    if (_typePurchHist == "variances")\n      ui = "dspPoPriceVariancesByVendor";\n    else\n      ui = "dspPoItemReceivingsByVendor";\n    params.cust_id = _purchHist.id();\n  }\n  else if (_groupByPurchHist == "item")\n  {\n    if (_purchHist.id() == -2)\n    {\n      QMessageBox.warning(mainwindow, qsTr("Unsupported Action"),\n        qsTr("Drill down on Non-Inventory Items is not yet supported"));\n      return;\n    }\n    if (_typePurchHist == "variances")\n      ui = "dspPoPriceVariancesByItem";\n    else\n      ui = "dspPoItemReceivingsByItem";\n    params.prodcat_id = _purchHist.id();\n  }\n  else if (_groupByPurchHist == "agent")\n  {\n    if (_typePurchHist == "variances")\n      ui = "dspPoPriceVariancesByVendor";\n    else\n      ui = "dspPoItemReceivingsByDate";\n    params.salesrep_id = _purchHist.id();\n  }\n\n  // Open the window and perform any special handling required\n  toolbox.openWindow(ui);\n  var warehouse = toolbox.lastWindow().findChild("_warehouse");\n  warehouse.setAll();\n  if (_typePurchHist == "receipts")\n  {\n    toolbox.lastWindow().findChild("_showUnvouchered").forgetful = true;\n    toolbox.lastWindow().findChild("_showUnvouchered").checked = true;   \n  }\n  if (_groupByPurchHist == "vend")\n  {\n    if (_typePurchHist == "variances")\n      toolbox.lastWindow().findChild("_vendorGroup").setVendId(_purchHist.id());\n    else\n      toolbox.lastWindow().findChild("_vendor").setId(_purchHist.id());\n  }\n  else if (_groupByPurchHist == "item")\n    toolbox.lastWindow().findChild("_item").setId(_purchHist.id());  \n  else if (_groupByPurchHist == "agent")\n  {\n    toolbox.lastWindow().findChild("_selectedPurchasingAgent").checked = true;\n    toolbox.lastWindow().findChild("_agent").code = \n      _purchHist.currentItem().rawValue("pohead_agent_username")\n  }\n\n  var dates = toolbox.lastWindow().findChild("_dates");\n  dates.setStartDate(params.startDate);\n  dates.setEndDate(params.endDate);\n  toolbox.lastWindow().sFillList();\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on sales history.\n*/\nfunction populateMenuPurchHist(pMenu)\n{\n  var menuItem;\n  var enable = privilegeCheckPurchHist();\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowPurchHist);\n}\n\n/*!\n  Returns whether user has privileges to view Sales History detail.\n*/\nfunction privilegeCheckPurchHist()\n{\n  if (_typePurchHist == "variances")\n    return privileges.check("ViewVendorPerformance");\n  else if (_typePurchHist == "receipts")\n    return privileges.check("ViewReceiptsReturns");\n   \n  return false;\n}\n\n/*! \n  Set up columns depending on local preferences.\n\n  @sa preferencesPurchHist()\n*/\nfunction setColumnsPurchHist()\n{\n  _purchHist.columnCount = 0;\n\n  if (_groupByPurchHist == "vend")\n  {\n    _purchHist.addColumn(qsTr("Vendor"),  -1, Qt.AlignLeft, true, "vend_number");\n    _purchHist.addColumn(qsTr("Name"), -1, Qt.AlignLeft, false, "vend_name");\n  }\n  else if (_groupByPurchHist == "item")\n  {\n    _purchHist.addColumn(qsTr("Item Number"), -1, Qt.AlignLeft, true, "item_number");\n    _purchHist.addColumn(qsTr("Description"), -1, Qt.AlignLeft, false, "item_descrip1");\n  }\n  else if (_groupByPurchHist == "agent")\n  {\n    _purchHist.addColumn(qsTr("Purch. Agent"),  -1, Qt.AlignLeft, true, "pohead_agent_username");\n    _purchHist.addColumn(qsTr("Name"), -1, Qt.AlignLeft, false, "usr_propername");\n  }\n\n  _purchHist.addColumn(qsTr("Amount"), -1, Qt.AlignRight, true, "amount");\n  _purchHist.addColumn(qsTr("Qty."), -1, Qt.AlignRight, false, "qty");\n}\n\n/*! \n  Launches the preferences window where the user can set sales data output preferences.\n*/\nfunction preferencesPurchHist()\n{\n  params = new Object;\n  params.path = "desktop/purchHist";\n  params.groupBy = _groupByPurchHist;\n  params.timeFrame = _timeFramePurchHist;\n  params.type = _typePurchHist;\n\n  var newdlg = toolbox.openWindow("preferencesHistory", mainwindow,\n                                  Qt.ApplicationModal, Qt.Dialog);\n  toolbox.lastWindow().set(params);\n  if (newdlg.exec())\n  {\n    loadPreferencesPurchHist();\n    setColumnsPurchHist();\n    refreshPurchHist();\n  }\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshPurchHist()\n{\n  _purchHistIsDirty = true;\n  fillListPurchHist();\n}\n	
81	dockPurchOpen	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockPurchOpen;\nvar _purchOpen;\nvar _purchOpenIsDirty = true;\n\n/*!\n  Initializes Open Purchase Order dock widget and places it in the main window.\n*/\nfunction initDockPurchOpen()\n{\n  _dockPurchOpen = mainwindow.findChild("_dockPurchOpen");\n  _purchOpen = mainwindow.findChild("_purchOpen");\n\n  // Set columns on list\n  _purchOpen.addColumn(qsTr("Order#"), XTreeWidget.orderColumn, Qt.AlignLeft, true, "pohead_number");\n  _purchOpen.addColumn(qsTr("Vendor#"), XTreeWidget.orderColumn, Qt.AlignLeft, true, "vend_number");\n  _purchOpen.addColumn(qsTr("Name"), -1,  Qt.AlignLeft, true, "vend_name");\n  _purchOpen.addColumn(qsTr("Contact"), -1,  Qt.AlignLeft, true, "vend_cntct");\n  _purchOpen.addColumn(qsTr("Phone"), -1,  Qt.AlignLeft, true, "pohead_vend_cntct_phone"); \n  _purchOpen.addColumn(qsTr("Status"), -1, Qt.AlignLeft,  true, "status");\n  _purchOpen.addColumn(qsTr("Ship Contact"), -1,  Qt.AlignLeft, false, "shipto_cntct");\n  _purchOpen.addColumn(qsTr("Ship Phone"), -1,  Qt.AlignLeft, false, "pohead_shipto_cntct_phone"); \n  _purchOpen.addColumn(qsTr("Ship Via"), -1,  Qt.AlignLeft, true, "pohead_shipvia"); \n  _purchOpen.addColumn(qsTr("Due Date"), XTreeWidget.dateColumn,  Qt.AlignLeft,  true, "duedate");\n  _purchOpen.addColumn(qsTr("Amount"), XTreeWidget.moneyColumn,  Qt.AlignRight,  true, "amount");\n\n  // Connect Signals and Slots\n  _dtTimer.timeout.connect(refreshPurchOpen);\n  mainwindow.purchaseOrderReceiptsUpdated.connect(refreshPurchOpen);\n  mainwindow.purchaseOrdersUpdated.connect(refreshPurchOpen);\n\n  _purchOpen.itemSelected.connect(openWindowPurchOpen);\n  _purchOpen["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuPurchOpen);\n\n  _dockPurchOpen.visibilityChanged.connect(fillListPurchOpen);\n\n  // Handle privilge control\n  var act = _dockPurchOpen.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewPurchaseOrdersDock"))\n  {\n    _dockPurchOpen.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewPurchaseOrdersDock");\n  _menuDesktop.appendAction(act);\n\n  fillListPurchOpen();\n}\n\n/*!\n  Fills the list with open purchase data.\n*/\nfunction fillListPurchOpen()\n{\n  _dockPurchOpen = mainwindow.findChild("_dockPurchOpen");\n  _purchOpen = mainwindow.findChild("_purchOpen");\n\n  if (!_dockPurchOpen.visible || !_purchOpenIsDirty)\n    return;\n\n  var params = new Object;\n  params.open = qsTr("Open");\n  params.unreleased = qsTr("Unreleased");\n\n  _purchOpen.populate(toolbox.executeDbQuery("desktop","purchOpen",params));\n  _purchOpenIsDirty = false;\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowPurchOpen()\n{ \n  // Make sure we can open the window for this activity\n  if (!privilegeCheckPurchOpen)\n    return;\n\n  params = new Object;\n  params.pohead_id = _purchOpen.id();\n  if (privileges.check("MaintainPurchaseOrders"))\n    params.mode = "edit";\n  else\n    params.mode = "view";\n\n  // Open the window and perform any handling required\n  var po = toolbox.openWindow("purchaseOrder");\n  po.set(params);\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on a Purchase Order item.\n*/\nfunction populateMenuPurchOpen(pMenu, pItem)\n{\n  var menuItem;\n  var enable = privilegeCheckPurchOpen();\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowPurchOpen);\n}\n\n/*!\n  Returns whether user has privileges to view detail on the selected Purchase Order.\n*/\nfunction privilegeCheckPurchOpen()\n{\n  return privileges.check("ViewPurchaseOrders") || \n         privileges.check("MaintainPurchaseOrders");\n\n  return false;\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshPurchOpen()\n{\n  _purchOpenIsDirty = true;\n  fillListPurchOpen();\n}\n	
82	dockReceivables	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockReceivables;\nvar _receivables;\nvar _receivablesIsDirty = true;\n\n/*!\n  Initializes Bank Balance dock widget and places it in the main window.\n*/\nfunction initDockReceivables()\n{\n  _dockReceivables = mainwindow.findChild("_dockReceivables");\n  _ar = mainwindow.findChild("_ar");\n  _ar.rootIsDecorated = false;\n\n  // Set columns on list\n  _ar.addColumn(qsTr("Status"), -1,  Qt.AlignLeft,   true);\n  _ar.addColumn(qsTr("Balance"), -1,  Qt.AlignRight,  true);\n\n  // Connect Signals and Slots\n  _dtTimer.timeout.connect(refreshReceivables);\n  mainwindow.checksUpdated.connect(refreshReceivables);\n  mainwindow.paymentsUpdated.connect(refreshReceivables);\n  mainwindow.vouchersUpdated.connect(refreshReceivables);\n\n  _ar.itemSelected.connect(openWindowReceivables);\n  _ar["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuReceivables);\n\n  _dockReceivables.visibilityChanged.connect(fillListReceivables);\n\n  // Handle privilge control\n  var act = _dockReceivables.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewReceivablesDock"))\n  {\n    _dockReceivables.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewReceivablesDock");\n  _menuDesktop.appendAction(act);\n\n  fillListReceivables();\n}\n\n/*!\n  Fills the list with bank account data.\n*/\nfunction fillListReceivables()\n{\n  _dockReceivables = mainwindow.findChild("_dockReceivables");\n  _ar = mainwindow.findChild("_ar");\n\n  if (!_dockReceivables.visible || !_receivablesIsDirty)\n    return;\n\n  var q = toolbox.executeDbQuery("desktop","receivables");\n  q.first();\n  \n  _ar.clear();\n  var item1 = new XTreeWidgetItem(_ar, 0, qsTr("0+ Days"), q.value("cur_val"));\n  var item2 = new XTreeWidgetItem(_ar, 1, qsTr("0-30 Days"), q.value("thirty_val"));\n  var item3 = new XTreeWidgetItem(_ar, 2, qsTr("31-60 Days"), q.value("sixty_val"));\n  var item4 = new XTreeWidgetItem(_ar, 3, qsTr("61-90 Days"), q.value("ninety_val"));\n  var item5 = new XTreeWidgetItem(_ar, 4, qsTr("90+ days"), q.value("plus_val"));\n  var item6 = new XTreeWidgetItem(_ar, 5, qsTr("Total Open"), q.value("total_val"));\n\n  _receivablesIsDirty = false;\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowReceivables()\n{\n  // Make sure we can open the window\n  if (!privilegeCheckReceivables())\n    return;\n\n  var params = new Object;\n  params.run = true;\n  params.byDueDate = true;\n\n  var asOfDate = mainwindow.dbDate();\n  var startDate = new Date();\n  var endDate = new Date();\n\n  // Open the window and perform any handling required\n  toolbox.openWindow("dspAROpenItems");\n\n  if (_ar.id() == 0)\n  {\n    startDate.setDate(asOfDate.getDate());\n    toolbox.lastWindow().findChild("_dates").setStartDate(startDate);\n  }\n  else if (_ar.id() == 1)\n  {\n    startDate.setDate(asOfDate.getDate() -30);\n    endDate.setDate(asOfDate.getDate() -1);\n    toolbox.lastWindow().findChild("_dates").setStartDate(startDate);\n    toolbox.lastWindow().findChild("_dates").setEndDate(endDate);\n  }\n  else if (_ar.id() == 2)\n  {\n    startDate.setDate(asOfDate.getDate() -60);\n    endDate.setDate(asOfDate.getDate() -31);\n    toolbox.lastWindow().findChild("_dates").setStartDate(startDate);\n    toolbox.lastWindow().findChild("_dates").setEndDate(endDate);\n  }\n  else if (_ar.id() == 3)\n  {\n    startDate.setDate(asOfDate.getDate() -90);\n    endDate.setDate(asOfDate.getDate() -61);\n    toolbox.lastWindow().findChild("_dates").setStartDate(startDate);\n    toolbox.lastWindow().findChild("_dates").setEndDate(endDate);\n  }\n  else if (_ar.id() == 4)\n  {\n    endDate.setDate(asOfDate.getDate() -91);\n    toolbox.lastWindow().findChild("_dates").setEndDate(endDate);\n  }\n\n  toolbox.lastWindow().set(params);\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on a bank account item.\n*/\nfunction populateMenuReceivables(pMenu, pItem)\n{\n  var menuItem;\n  var enable = privilegeCheckReceivables();\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowReceivables);\n}\n\n/*!\n  Returns whether user has privileges to view detail.\n*/\nfunction privilegeCheckReceivables(act)\n{\n  return privileges.check("ViewAROpenItems");\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshReceivables()\n{\n  _receivablesIsDirty = true;\n  fillListReceivables();\n}\n	
83	dockSalesActive	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockSalesAct;\nvar _salesAct;\n\n/*!\n  Initializes Sales Activity dock widget and places it in the main window.\n*/\nfunction initDockSalesAct()\n{\n  var _salesActIsDirty = true;\n\n  _dockSalesAct = mainwindow.findChild("_dockSalesAct");\n  _salesAct = mainwindow.findChild("_salesAct");\n\n  _salesAct.addColumn(qsTr("Type"), -1,  Qt.AlignLeft,   true, "activity");\n  _salesAct.addColumn(qsTr("#"), 40,  Qt.AlignRight,  true, "count");\n  _salesAct.addColumn(qsTr("Amount"), -1,  Qt.AlignRight,  true, "amount");\n\n  _dtTimer.timeout.connect(refreshSalesAct);\n  mainwindow.billingSelectionUpdated.connect(refreshSalesAct);\n  mainwindow.invoicesUpdated.connect(refreshSalesAct);\n  mainwindow.quotesUpdated.connect(refreshSalesAct)\n  mainwindow.salesOrdersUpdated.connect(refreshSalesAct);\n\n  _salesAct.itemSelected.connect(openWindowSalesAct);\n  _salesAct["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuSalesAct);\n\n  _dockSalesAct.visibilityChanged.connect(fillListSalesAct);\n\n  // Handle privilege control\n  var act = _dockSalesAct.toggleViewAction();\n\n  if (!privileges.check("ViewSalesActivitiesDock"))\n  {\n    _dockSalesAct.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewSalesActivitiesDock");\n  _menuDesktop.appendAction(act);\n  fillListSalesAct();\n\n  function fillListSalesAct()\n  {\n    if (! _dockSalesAct || !_dockSalesAct.visible || !_salesActIsDirty)\n      return;\n\n    var params = {\n      quotes:   qsTr("Quotes"),\n      open:     qsTr("Orders"),\n      print:    qsTr("To Print"),\n      pick:     qsTr("Pick"),\n      ship:     qsTr("At Shipping"),\n      bill:     qsTr("Shipped"),\n      invoice:  qsTr("To Bill"),\n      post:     qsTr("Invoiced"),\n    };\n\n    _salesAct.populate(toolbox.executeDbQuery("desktop", "salesAct", params));\n    _salesActIsDirty = false;\n  }\n\n  function openWindowSalesAct()\n  {\n    var ui;\n    var run = false;\n    var act = _salesAct.currentItem().rawValue("activity");\n    \n    // Make sure we can open the window for this activity\n    if (!privilegeCheckSalesAct(act))\n      return;\n\n    // Determine which window to open\n    if (act == "Q")\n    {\n      ui = "quotes";\n      run = true;\n    }\n    else if (act == "O")\n    {\n      ui = "openSalesOrders";\n      run = true;\n    }\n    else if (act == "P")\n      ui = "packingListBatch";\n    else if (act == "S")\n    {\n      ui = "maintainShipping";\n      run = true;\n    }\n    else if (act == "B")\n      ui = "uninvoicedShipments";\n    else if (act == "I")\n      ui = "dspBillingSelections";\n    else if (act == "T")\n      ui = "unpostedInvoices";\n\n    // Open the window and perform any handling required\n    toolbox.openWindow(ui);\n    if (run)\n      toolbox.lastWindow().sFillList();\n  }\n\n  function populateMenuSalesAct(pMenu, pItem)\n  {\n    var menuItem;\n    var act = pItem.rawValue("activity");\n    var enable = privilegeCheckSalesAct(act);\n\n    menuItem = pMenu.addAction(_open);\n    menuItem.enabled = enable;\n    menuItem.triggered.connect(openWindowSalesAct);\n  }\n\n  function privilegeCheckSalesAct(act)\n  {\n    if (act == "Q") // Quote\n      return privileges.check("ViewQuotes") || \n             privileges.check("MaintainQuotes")\n    else if (act == "O") // Open Sales Orders\n      return privileges.check("ViewSalesOrders") || \n             privileges.check("MaintainSalesOrders");\n    else if (act == "P") // Packlist Batch\n      return privileges.check("ViewPackingListBatch") || \n             privileges.check("MaintainPackingListBatch");\n    else if (act == "S") // Shipping\n      return privileges.check("ViewShipping");\n    else if (act == "B" || \n             act == "I" || \n             act == "T") // Billing, Invoicing\n      return privileges.check("SelectBilling");\n\n    return false;\n  }\n\n  function refreshSalesAct()\n  {\n    _salesActIsDirty = true;\n    fillListSalesAct();\n  }\n}\n	
84	dockSalesHistory	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _b1SalesHist;\nvar _b2SalesHist;\nvar _dockSalesHist;\nvar _groupBySalesHist;\nvar _timeFrameSalesHist;\nvar _typeSalesHist;\nvar _labelSalesHist;\nvar _salesHist;\nvar _salesHistIsDirty = true;\n\n/*!\n  Initializes Sales History dock widget and places it in the main window.\n*/\nfunction initDockSalesHist()\n{\n  // Set up objects\n  _dockSalesHist = mainwindow.findChild("_dockSalesHist");\n  _salesHist = mainwindow.findChild("_salesHist");\n\n  _b1SalesHist = _dockSalesHist.findChild("_button1");\n  _b2SalesHist = _dockSalesHist.findChild("_button2");\n  _labelSalesHist = _dockSalesHist.findChild("_label");\n\n  // Set icons\n  var iReload = new QIcon;\n  iReload.addDbImage("reload_16");\n  _b1SalesHist.icon = iReload;\n  _b1SalesHist.text = "";\n  _b1SalesHist.toolTip = qsTr("Reload");\n\n  var iGear = new QIcon();\n  iGear.addDbImage("gear_16");\n  _b2SalesHist.icon = iGear;\n  _b2SalesHist.text = "";\n  _b2SalesHist.toolTip = qsTr("Preferences...");\n\n  // Load local preferences\n  loadPreferencesSalesHist();\n\n  // Set columns on list\n  setColumnsSalesHist();\n\n  // Populate the data\n  fillListSalesHist();\n\n  // Connect Signals and Slots\n  _b1SalesHist.clicked.connect(refreshSalesHist);\n  _b2SalesHist.clicked.connect(preferencesSalesHist);\n\n  _dtTimer.timeout.connect(refreshSalesHist);\n  mainwindow.salesOrdersUpdated.connect(refreshSalesHist);\n\n  _salesHist.itemSelected.connect(openWindowSalesHist);\n  _salesHist["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuSalesHist);\n\n  _dockSalesHist.visibilityChanged.connect(fillListSalesHist);\n\n  // Handle privilge control\n  var act = _dockSalesHist.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewSalesHistoryDock"))\n  {\n    _dockSalesHist.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewSalesHistoryDock");\n  _menuDesktop.appendAction(act);\n\n  fillListSalesHist();\n}\n\n/*!\n  Fills the list with sales history data based on parameters determined by\n  sales history preferences.\n\n  @sa preferencesSalesHist()\n*/\nfunction fillListSalesHist()\n{\n  _dockSalesHist = mainwindow.findChild("_dockSalesHist");\n  _salesHist = mainwindow.findChild("_salesHist");\n\n  if (!_dockSalesHist.visible || !_salesHistIsDirty)\n    return;\n\n  var timeFrame;\n  var type;\n  var params = getDatesSalesHist();\n\n  if (_typeSalesHist == "bookings")\n    params.bookings = true;\n  else\n    params.sales = true;\n \n  if (_groupBySalesHist == "cust")\n  {\n    params.group_id = "cust_id";\n    params.group_number = "cust_number";\n    params.group_name = "cust_name";\n  }\n  else if (_groupBySalesHist == "prodcat")\n  {\n    params.group_id = "prodcat_id";\n    params.group_number = "prodcat_code";\n    params.group_name = "prodcat_descrip";\n  }\n  else if (_groupBySalesHist == "salesrep")\n  {\n    params.group_id = "salesrep_id";\n    params.group_number = "salesrep_number";\n    params.group_name = "salesrep_name";\n  }\n\n  _salesHist.populate(toolbox.executeDbQuery("desktop","salesHist", params));\n\n  if ("bookings" in params)\n    type = qsTr("Bookings");\n  else\n    type = qsTr("Sales");\n\n  if (_timeFrameSalesHist == "day")\n    timeFrame = qsTr("Today");\n  else if (_timeFrameSalesHist == "week")\n    timeFrame = qsTr("this Week");\n  else if (_timeFrameSalesHist == "month")\n    timeFrame = qsTr("this Month");\n  else if (_timeFrameSalesHist == "year")\n    timeFrame = qsTr("this Year");\n\n  _labelSalesHist.text = type + " " + timeFrame;\n\n  _salesHistIsDirty = false;\n}\n\n/*!\n  Returns an object with a list containing @a startDate and @a endDate\n  that is used for fetching data and opening windows using the date range\n  stored in local preferences.\n \n  @sa preferencesSalesHist()\n  @sa openWindowSalesHist()\n  @sa fillListSalesHist()\n*/\nfunction getDatesSalesHist()\n{\n  var params = new Object;\n\n  params.timeFrame = _timeFrameSalesHist;\n  params.interval = "1 " + _timeFrameSalesHist;\n\n  var q = toolbox.executeDbQuery("desktop", "getDates", params);\n\n  if (q.first())\n  {\n    params.startDate = q.value("startDate");\n    params.endDate = q.value("endDate");\n  }\n\n  return params;\n}\n\n/*! \n  Loads local Sales History preferences into memory.\n\n  @sa preferencesSalesHist()\n*/\nfunction loadPreferencesSalesHist()\n{\n  // Load preferences\n  _groupBySalesHist = preferences.value("desktop/salesHist/groupBy");\n  _timeFrameSalesHist = preferences.value("desktop/salesHist/timeFrame");\n  _typeSalesHist = preferences.value("desktop/salesHist/type")\n  \n  // Set to defaults if no values\n  _groupBySalesHist = (_groupBySalesHist.length ? _groupBySalesHist : "cust");\n  _timeFrameSalesHist = (_timeFrameSalesHist.length ? _timeFrameSalesHist : "year");\n  _typeSalesHist = (_typeSalesHist.length ? _typeSalesHist : "bookings");\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowSalesHist()\n{\n  var ui;\n  var params = getDatesSalesHist();\n  params.run = true;\n\n  // TO DO: Work it out so totals launch a window too\n  if (_salesHist.id() == -1)\n    return;\n  \n  // Make sure we can open the window\n  if (!privilegeCheckSalesHist())\n    return;\n\n  // Determine which window to open\n  if (_typeSalesHist == "bookings")\n    ui = "dspBookings";\n  else\n    ui = "dspSalesHistory";\n  if (_groupBySalesHist == "cust")\n    params.cust_id = _salesHist.id();\n  else if (_groupBySalesHist == "prodcat")\n    params.prodcat_id = _salesHist.id();\n  else if (_groupBySalesHist == "salesrep")\n    params.salesrep_id = _salesHist.id();\n\n  // Open the window and perform any special handling required\n  toolbox.openWindow(ui);\n  toolbox.lastWindow().set(params);\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on sales history.\n*/\nfunction populateMenuSalesHist(pMenu)\n{\n  var menuItem;\n  var enable = privilegeCheckSalesHist();\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowSalesHist);\n}\n\n/*!\n  Returns whether user has privileges to view Sales History detail.\n*/\nfunction privilegeCheckSalesHist()\n{\n  return privileges.check("ViewSalesHistory");\n}\n\n/*! \n  Set up columns depending on local preferences.\n\n  @sa preferencesSalesHist()\n*/\nfunction setColumnsSalesHist()\n{\n  _salesHist.columnCount = 0;\n\n  if (_groupBySalesHist == "cust")\n  {\n    _salesHist.addColumn(qsTr("Customer"),  -1, Qt.AlignLeft, true, "cust_number");\n    _salesHist.addColumn(qsTr("Name"), -1, Qt.AlignLeft, false, "cust_name");\n  }\n  else if (_groupBySalesHist == "prodcat")\n  {\n    _salesHist.addColumn(qsTr("Product Category"), -1, Qt.AlignLeft, true, "prodcat_code");\n    _salesHist.addColumn(qsTr("Description"), -1, Qt.AlignLeft, false, "prodcat_descrip");\n  }\n  else if (_groupBySalesHist == "salesrep")\n  {\n    _salesHist.addColumn(qsTr("Sales Rep."),  -1, Qt.AlignLeft, true, "salesrep_number");\n    _salesHist.addColumn(qsTr("Name"), -1, Qt.AlignLeft, false, "salesrep_name");\n  }\n\n  _salesHist.addColumn(qsTr("Amount"), -1, Qt.AlignRight, true, "amount");\n  _salesHist.addColumn(qsTr("Qty."), -1, Qt.AlignRight, false, "qty");\n}\n\n/*! \n  Launches the preferences window where the user can set sales data output preferences.\n*/\nfunction preferencesSalesHist()\n{\n  params = new Object;\n  params.path = "desktop/salesHist";\n  params.groupBy = _groupBySalesHist;\n  params.timeFrame = _timeFrameSalesHist;\n  params.type = _typeSalesHist;\n\n  var newdlg = toolbox.openWindow("preferencesHistory", mainwindow,\n                                  Qt.ApplicationModal, Qt.Dialog);\n  toolbox.lastWindow().set(params);\n  if (newdlg.exec())\n  {\n    loadPreferencesSalesHist();\n    setColumnsSalesHist();\n    refreshSalesHist();\n  }\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshSalesHist()\n{\n  _salesHistIsDirty = true;\n  fillListSalesHist();\n}\n	
85	dockSalesOpen	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockSalesOpen;\nvar _salesOpen;\nvar _salesOpenIsDirty = true;\n\n/*!\n  Initializes Open Sales Order dock widget and places it in the main window.\n*/\nfunction initDockSalesOpen()\n{\n  _dockSalesOpen = mainwindow.findChild("_dockSalesOpen");\n  _salesOpen = mainwindow.findChild("_salesOpen");\n\n  // Set columns on list\n  _salesOpen.addColumn(qsTr("Order#"), XTreeWidget.orderColumn,  Qt.AlignLeft,   true, "cohead_number");\n  _salesOpen.addColumn(qsTr("Customer#"), XTreeWidget.orderColumn,  Qt.AlignLeft,  true, "cust_number");\n  _salesOpen.addColumn(qsTr("Bill To"), -1,  Qt.AlignLeft,  true, "cohead_billtoname");\n  _salesOpen.addColumn(qsTr("Bill Contact"), -1,  Qt.AlignLeft,  false, "billto_cntct");\n  _salesOpen.addColumn(qsTr("Bill Phone"), -1,  Qt.AlignLeft,  false, "cohead_billto_cntct_phone"); \n  _salesOpen.addColumn(qsTr("Ship To"), -1, Qt.AlignLeft,  true, "cohead_shiptoname");\n  _salesOpen.addColumn(qsTr("Ship Contact"), -1,  Qt.AlignLeft,  false, "shipto_cntct");\n  _salesOpen.addColumn(qsTr("Ship Phone"), -1,  Qt.AlignLeft,  false, "cohead_shipto_cntct_phone");\n  _salesOpen.addColumn(qsTr("Ship Via"), -1,  Qt.AlignLeft,  true, "cohead_shipvia"); \n  _salesOpen.addColumn(qsTr("Sched. Date"), XTreeWidget.dateColumn,  Qt.AlignLeft,  true, "scheddate");\n  _salesOpen.addColumn(qsTr("Amount"), XTreeWidget.moneyColumn,  Qt.AlignRight,  true, "amount");\n\n  // Connect Signals and Slots\n  _dtTimer.timeout.connect(refreshSalesOpen);\n  mainwindow.invoicesUpdated.connect(refreshSalesOpen);\n  mainwindow.salesOrdersUpdated.connect(refreshSalesOpen);\n\n  _salesOpen.itemSelected.connect(openWindowSalesOpen);\n  _salesOpen["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuSalesOpen);\n\n  _dockSalesOpen.visibilityChanged.connect(fillListSalesOpen);\n\n  // Handle privilge control\n  var act = _dockSalesOpen.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewSalesOrdersDock"))\n  {\n    _dockSalesOpen.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewSalesOrdersDock");\n  _menuDesktop.appendAction(act);\n\n  fillListSalesOpen();\n}\n\n/*!\n  Fills the list with open sales data.\n*/\nfunction fillListSalesOpen()\n{\n  _dockSalesOpen = mainwindow.findChild("_dockSalesOpen");\n  _salesOpen = mainwindow.findChild("_salesOpen");\n\n  if (!_dockSalesOpen.visible || !_salesOpenIsDirty)\n    return;\n\n  _salesOpen.populate(toolbox.executeDbQuery("desktop","salesOpen"));\n\n  _salesOpenIsDirty = false;\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowSalesOpen()\n{ \n  // Make sure we can open the window for this activity\n  if (!privilegeCheckSalesOpen)\n    return;\n\n  params = new Object;\n  params.sohead_id = _salesOpen.id();\n  if (privileges.check("MaintainSalesOrders"))\n    params.mode = "edit";\n  else\n    params.mode = "view";\n\n  // Open the window and perform any handling required\n  var so = toolbox.openWindow("salesOrder");\n  so.set(params);\n\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on a Sales Order item.\n*/\nfunction populateMenuSalesOpen(pMenu, pItem)\n{\n  var menuItem;\n  var enable = privilegeCheckSalesOpen();\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowSalesOpen);\n}\n\n/*!\n  Returns whether user has privileges to view detail on the selected Sales Order.\n*/\nfunction privilegeCheckSalesOpen()\n{\n  return privileges.check("ViewSalesOrders") || \n         privileges.check("MaintainSalesOrders");\n\n  return false;\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshSalesOpen()\n{\n  _salesOpenIsDirty = true;\n  fillListSalesOpen();\n}\n	
128	dockSendMessage	0	t	var _dockSendMessage;\nvar _usr;\nvar _message;\nvar _send;\nvar _sendMessageIsDirty = true;\nvar _periodId = -1;\nvar _b1CommentConsole;\nvar _b2CommentConsole;\nvar _commentConsole;\nvar _commentConsoleIsDirty = true;\nvar _periodId = -1;\n\nfunction initDockSendMessage()\n{\n  // Set up objects\n  _dockSendMessage = mainwindow.findChild("_dockSendMessage");\n  _usr             = mainwindow.findChild("_usr");\n  _message         = mainwindow.findChild("_message");\n  _send            = mainwindow.findChild("_send");\n\n  _commentConsole   = mainwindow.findChild("_commentConsole");\n\n  _b1CommentConsole = mainwindow.findChild("_button1");\n  _b2CommentConsole = mainwindow.findChild("_button2");\n\n  // Set icons\n  var iReload = new QIcon;\n  iReload.addDbImage("reload_16");\n  _b1CommentConsole.icon = iReload;\n  _b1CommentConsole.text = "";\n  _b1CommentConsole.toolTip = qsTr("Reload");\n\n  var iGear = new QIcon();\n  iGear.addDbImage("gear_16");\n  _b2CommentConsole.icon = iGear;\n  _b2CommentConsole.text = "";\n  _b2CommentConsole.toolTip = qsTr("Preferences...");\n\n  // Set columns on list\n  _commentConsole.addColumn("Date",           75,  1, true, "comment_date");\n  _commentConsole.addColumn("Comment Type",   115, 1, true, "cmnttype_name");\n  _commentConsole.addColumn("Text",           90,  1, true, "comment_text");\n  _commentConsole.addColumn("Source",         115, 1, true, "comment_source")\n  _commentConsole.addColumn("User",           65,  1, true, "comment_user")\n  _commentConsole.addColumn("Detail",         -1,  1, true, "info");\n  _commentConsole.addColumn("Points",         40,  3, true, "points");\n\n  mainwindow.itemsitesUpdated.connect(refreshCommentConsole);\n  mainwindow.warehousesUpdated.connect(refreshCommentConsole);\n  mainwindow.customersUpdated.connect(refreshCommentConsole)\n  mainwindow.employeeUpdated.connect(refreshCommentConsole);\n  mainwindow.vendorsUpdated.connect(refreshCommentConsole);\n  mainwindow.returnAuthorizationsUpdated.connect(refreshCommentConsole);\n  mainwindow.salesOrdersUpdated.connect(refreshCommentConsole)\n  mainwindow.quotesUpdated.connect(refreshCommentConsole);\n  mainwindow.workOrdersUpdated.connect(refreshCommentConsole);\n  mainwindow.purchaseOrdersUpdated.connect(refreshCommentConsole);\n  mainwindow.bomsUpdated.connect(refreshCommentConsole)\n  mainwindow.bbomsUpdated.connect(refreshCommentConsole);\n  mainwindow.boosUpdated.connect(refreshCommentConsole);\n  mainwindow.projectsUpdated.connect(refreshCommentConsole);\n  mainwindow.crmAccountsUpdated.connect(refreshCommentConsole)\n  mainwindow.transferOrdersUpdated.connect(refreshCommentConsole);\n\n  _b1CommentConsole.clicked.connect(refreshCommentConsole);\n  _b2CommentConsole.clicked.connect(preferencesCommentConsole);\n\n  _commentConsole["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuCommentConsole);\n\n  mainwindow["tick()"].connect(refreshCommentConsole);\n\n  var act = _dockSendMessage.toggleViewAction();\n  if (!privileges.check("viewSendMsgDock"))\n  {\n    _dockSendMessage.hide();\n    act.enabled = false;\n  }\n  else\n  {\n    _dockSendMessage.show();\n    act.enabled = true;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("viewSendMsgDock");\n  _menuDesktop.appendAction(act);\n\n  _usr["newId(int)"].connect(sHandleButtons);\n  _send.clicked.connect(send);\n\n  fillListCommentConsole();\n}\n\nfunction getParams()\n{\n  var params = new Object;\n\n  params.message = _message.plainText;\n  if (_usr.id() > 0)\n    params.usr_id = _usr.id();\n\n  return params;\n}\n\nfunction sHandleButtons()\n{\n  var qry = "SELECT usr_id FROM usr WHERE usr_username = current_user;";\n  var data = toolbox.executeQuery(qry, -1);\n  if (data.first())\n    var currenttUsr_id = data.value("usr_id");\n\n  if (currenttUsr_id == _usr.id())\n  {\n    if (QMessageBox.information(mainwindow, qsTr("Send Message?"),\n                            qsTr("You are trying to Send Message to Yourself."\n                              +" Are you sure that you really want to Continue?."),\n           QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes) == QMessageBox.No)\n    {\n      _usr.clear();\n      return;\n    }\n  }\n\n  _send.enabled = (_usr.id() >= 0);\n}\n\nfunction send()\n{\n  var params = getParams();\n  var qry = toolbox.executeDbQuery("desktop", "sendMessageToUser", params);\n  QMessageBox.information(mainwindow,'Sent','Message Sent');\n  clear();\n}\n\nfunction set(input)\n{\n  if ("user" in input)\n    _usr.setUsername(input.user);\n  else\n   QMessageBox.warning(mywindow, "Message", "Could not set username");\n}\n\nfunction clear()\n{\n  _usr.clear();\n  _message.clear();\n}\n\nfunction fillListCommentConsole()\n{\n  _commentConsole = mainwindow.findChild("_commentConsole");\n\n  var cmmntTypeList = preferences.value("MonitoredCommentTypes");\n  var cmmntSrcList = preferences.value("MonitoredCommentSrcs");\n  var cmmntUsrList = preferences.value("MonitoredCommentUsrs");\n\n  var params = new Object;\n\n  var getDate = "SELECT CURRENT_DATE + CAST(<? literal('startOffSet') ?> AS INTEGER) AS start,"\n              + "       CURRENT_DATE + CAST(<? literal('endOffSet')   ?> AS INTEGER) AS end,"\n              + "       EXISTS(SELECT 1"\n              + "                FROM pg_class JOIN pg_namespace n ON relnamespace = n.oid"\n              + "               WHERE relname = 'rev') AS hasRev,"\n              + "       EXISTS(SELECT 1 FROM pkghead WHERE pkghead_name = 'xtmfg') AS hasMFG"\n              + ";";\n\n  params.startOffSet = ((preferences.value("MonitoredCommentStrtDate") != '')?preferences.value("MonitoredCommentStrtDate"):-1);\n  params.endOffSet   = ((preferences.value("MonitoredCommentEndDate")  != '')?preferences.value("MonitoredCommentEndDate"):0);\n  var data = toolbox.executeQuery(getDate, params);\n  if (data.first())\n  {\n    params.startDate = data.value("start");\n    params.endDate   = data.value("end");\n    if (data.value("hasRev"))\n      params.hasRev  = 'hasRev';    // mql uses <? if exists() ?>\n    if (data.value("hasMFG"))\n      params.xtmfg_exist = 'hasMFG';\n  }\n  else if (data.lastError().type != QSqlError.NoError)\n  {\n    QMessageBox.critical(mainwindow, qsTr("Database Error"),\n                         data.lastError().text);\n    return;\n  }\n\n  _commentConsole.clear();\n\n  if (cmmntTypeList.length)\n    params.commenttype_id = cmmntTypeList;\n\n  if (cmmntSrcList.length)\n  {\n    params.sourceidlist = cmmntSrcList;\n    var sourceList = new Array();\n    var data = toolbox.executeDbQuery("desktop","cmmntPrefSrc", params);\n    var i = 0;\n    while (data.next())\n      sourceList.push(data.value("cmntsource_name"));\n    params.source = sourceList;\n  }\n\n  if(cmmntUsrList.length)\n    params.usr_id = cmmntUsrList;\n\n  _commentConsole.populate(toolbox.executeDbQuery("desktop","commentConsole", params));\n  _commentConsoleIsDirty = false;\n}\n\nfunction populateMenuCommentConsole(pMenu, pItem, pCol)\n{\n  try\n  {\n    var doctype = pItem.text("comment_source");\n\n    // undo oddities in the desktop-commentConsole mql\n    if (doctype == 'T-Contact')\n      doctype = 'T';\n    else if (doctype == 'OPP-Opportunity')\n      doctype = 'OPP';\n\n    var lookup = {},\n        editAct,\n        viewAct\n    ;\n\n    // TODO: put more detail in the source table then use that instead\n    lookup['ADDR']  = { editPriv: "MaintainAddresses", viewPriv: "ViewAddresses",\n                        id: "addr_id", uiform: "address",                  wflags: Qt.Dialog };\n    lookup['BBH']   = { editPriv: "MaintainBBOMs",     viewPriv: "ViewBBOMs",\n                        id: "bbomhead_id", uiform: "bbom",                     wflags: Qt.Window };\n    lookup['BBI']   = { editPriv: "MaintainBBOMs",     viewPriv: "ViewBBOMs",\n                        id: "bbomitem_id", uiform: "bbomItem",             wflags: Qt.Dialog };\n    lookup['BMH']   = { editPriv: "MaintainBOMs",      viewPriv: "ViewBOMs",\n                        id: "bomhead_id", uiform: "BOM",                   wflags: Qt.Window };\n    lookup['BIM']   = { editPriv: "MaintainBOMs",      viewPriv: "ViewBOMs",\n                        id: "bomitem_id", uiform: "bomItem",               wflags: Qt.Dialog };\n    lookup['BOH']   = { editPriv: "MaintainBOOs",      viewPriv: "ViewBOOs",\n                        id: "boohead_id", uiform: "boo",                      wflags: Qt.Dialog };\n    lookup['BOI']   = { editPriv: "MaintainBOOs",      viewPriv: "ViewBOOs",\n                        id: "booitem_id", uiform: "booItem",               wflags: Qt.Dialog };\n    lookup['CRMA']  = { editPriv: "MaintainPersonalCRMAccounts MaintainAllCRMAccounts",\n                        viewPriv: "ViewPersonalCRMAccounts     ViewAllCRMAccounts",\n                        id: "crmacct_id", uiform: "crmaccount",            wflags: Qt.Window };\n    lookup['T']     = { editPriv: "MaintainPersonalContacts    MaintainAllContacts",\n                        viewPriv: "ViewPersonalContacts        ViewAllContacts",\n                        id: "cntct_id", uiform: "contact",                 wflags: Qt.Dialog };\n    lookup['C']     = { editPriv: "MaintainCustomerMasters", viewPriv: "ViewCustomerMasters",\n                        id: "cust_id", uiform: "customer",                 wflags: Qt.Window };\n    lookup['EMP']   = { editPriv: "MaintainEmployees",       viewPriv: "ViewEmployees",\n                        id: "emp_id", uiform: "employee",                  wflags: Qt.Dialog };\n    lookup['INCDT'] = { editPriv: "MaintainPersonalIncidents   MaintainAllIncidents",\n                        viewPriv: "ViewPersonalIncidents       ViewAllIncidents",\n                        id: "incdt_id", uiform: "incident",                wflags: Qt.Window };\n    lookup['I']     = { editPriv: "MaintainItemMasters",    viewPriv: "ViewItemMasters",\n                        id: "item_id", uiform: "item",                     wflags: Qt.Window };\n    lookup['IS']    = { editPriv: "MaintainItemSites",      viewPriv: "ViewItemSites",\n                        id: "itemsite_id", uiform: "itemSite",             wflags: Qt.Dialog };\n    lookup['IR']    = { editPriv: "MaintainItemSources",    viewPriv: "ViewItemSources",\n                        id: "itemsrc_id", uiform: "itemSource",            wflags: Qt.Dialog };\n    lookup['L']     = { editPriv: "MaintainLocations",      viewPriv: "ViewLocations",\n                        id: "location_id", uiform: "location",             wflags: Qt.Dialog };\n    lookup['LS']    = { editPriv: "",                       viewPriv: "",\n                        id: "ls_id", uiform: "lotSerial",                  wflags: Qt.Dialog };\n    lookup['OPP']   = { editPriv: "MaintainPersonalOpportunities MaintainAllOpportunities",\n                        viewPriv: "ViewPersonalOpportunities     ViewAllOpportunities",\n                        id: "ophead_id", uiform: "opportunity",            wflags: Qt.Dialog };\n    lookup['J']     = { editPriv: "MaintainPersonalProjects      MaintainAllProjects",\n                        viewPriv: "ViewPersonalProjects          ViewAllProjects",\n                        id: "prj_id", uiform: "project",                   wflags: Qt.Dialog };\n    lookup['P']     = { editPriv: "MaintainPurchaseOrders", viewPriv: "ViewPurchaseOrders",\n                        id: "pohead_id", uiform: "purchaseOrder",          wflags: Qt.Window };\n    lookup['PI']    = { editPriv: "MaintainPurchaseOrders", viewPriv: "ViewPurchaseOrders",\n                        id: "poitem_id", uiform: "purchaseOrderItem",      wflags: Qt.Dialog };\n    lookup['RA']    = { editPriv: "MaintainReturns",        viewPriv: "ViewReturns",\n                        id: "rahead_id", uiform: "returnAuthorization",    wflags: Qt.Window };\n    lookup['RI']    = { editPriv: "MaintainReturns",        viewPriv: "ViewReturns",\n                        id: "raitem_id", uiform: "returnAuthorizationItem",wflags: Qt.Dialog };\n    lookup['Q']     = { editPriv: "MaintainQuotes",         viewPriv: "ViewQuotes",\n                        id: "quhead_id", uiform: "salesOrder",             wflags: Qt.Window };\n    lookup['QI']    = { editPriv: "MaintainQuotes",         viewPriv: "ViewQuotes",\n                        id: "soitem_id", uiform: "salesOrderItem",         wflags: Qt.Dialog };\n    lookup['S']     = { editPriv: "MaintainSalesOrders",    viewPriv: "ViewSalesOrders",\n                        id: "sohead_id", uiform: "salesOrder",             wflags: Qt.Window };\n    lookup['SI']    = { editPriv: "MaintainSalesOrders",    viewPriv: "ViewSalesOrders",\n                        id: "soitem_id", uiform: "salesOrderItem",         wflags: Qt.Dialog };\n    lookup['TA']    = { editPriv: "MaintainPersonalProjects  MaintainAllProjects",\n                        viewPriv: "ViewPersonalProjects      ViewAllProjects",\n                        id: "prjtask_id", uiform: "task",                  wflags: Qt.Dialog };\n    lookup['TD']    = { editPriv: "MaintainPersonalToDoItems MaintainAllToDoItems",\n                        viewPriv: "ViewPersonalToDoItems     ViewAllToDoItems",\n                        id: "todoitem_id", uiform: "todoItem",             wflags: Qt.Dialog };\n    lookup['TO']    = { editPriv: "MaintainTransferOrders", viewPriv: "ViewTransferOrders",\n                        id: "tohead_id", uiform: "transferOrder",          wflags: Qt.Window };\n    lookup['TI']    = { editPriv: "MaintainTransferOrders", viewPriv: "ViewTransferOrders",\n                        id: "toitem_id", uiform: "transferOrderItem",      wflags: Qt.Dialog };\n    lookup['V']     = { editPriv: "MaintainVendors",        viewPriv: "ViewVendors",\n                        id: "vend_id", uiform: "vendor",                   wflags: Qt.Window };\n    lookup['WH']    = { editPriv: "MaintainWarehouses",     viewPriv: "ViewWarehouses",\n                        id: "warehous_id", uiform: "warehouse",            wflags: Qt.Dialog };\n    lookup['W']     = { editPriv: "MaintainWorkOrders",     viewPriv: "MaintainWorkOrders",\n                        id: "wo_id", uiform: "workOrder",                  wflags: Qt.Window };\n\n    _commentConsole = mainwindow.findChild("_commentConsole");\n\n    if(pMenu == null)\n      pMenu = _commentConsole.findChild("_menu");\n    if(pMenu != null)\n    {\n      editAct = pMenu.addAction(qsTr("Edit"));\n      editAct.enabled = privileges.check(lookup[doctype].editPriv);\n      editAct.triggered.connect(editDoctype);\n\n      viewAct = pMenu.addAction(qsTr("View"));\n      viewAct.enabled = privileges.check(lookup[doctype].editPriv + " " + lookup[doctype].viewPriv);\n      viewAct.triggered.connect(viewDoctype);\n    }\n\n    function editDoctype() {\n      var mode = "edit";\n      if (doctype == "Q" || doctype == "QI")\n        mode = "editQuote";\n\n      openDoctype(mode);\n    }\n\n    function viewDoctype() {\n      var mode = "view";\n      if (doctype == "Q" || doctype == "QI")\n        mode = "viewQuote";\n      openDoctype(mode);\n    }\n\n    function openDoctype(mode) {\n      try {\n        var params  = { mode: mode },\n            docdesc = lookup[doctype],\n            q;\n        params[docdesc.id] = _commentConsole.id();\n\n        // BOM window takes an item_id, not a bomhead_id!\n        if (doctype == "BMH") {\n          q = toolbox.executeQuery("SELECT bomhead_item_id, bomhead_rev_id"\n                                 + "  FROM bomhead"\n                                 + " WHERE bomhead_id = <? value('bomhead_id') ?>;",\n                                   params);\n          if (q.first()) {\n            params.item_id = q.value("bomhead_item_id");\n            params.revision_id = q.value("bomhead_rev_id");\n          } else if (q.lastError() != QSqlError.NoError) {\n            throw q.lastError().text;\n          }\n        }\n\n        var newdlg = toolbox.openWindow(docdesc.uiform, mainwindow,\n                                        (docdesc.wflags == Qt.Dialog) ? Qt.ApplicationModal : Qt.NonModal,\n                                        docdesc.wflags);\n        newdlg.set(params);\n        if (newdlg.exec) {\n          newdlg.exec();\n        }\n      } catch (e) {\n        QMessageBox.critical(mainwindow, "dockSendMessage",\n                             "Could not open a window for source " + doctype + ": " + e);\n\n      }\n    }\n  }\n  catch (e)\n  {\n    QMessageBox.critical(mainwindow, "dockSendMessage",\n                         "populateMenuCommentConsole exception: " + e);\n  }\n}\n\nfunction preferencesCommentConsole()\n{\n  try\n  {\n  \tparams = new Object;\n    var newdlg = toolbox.openWindow("preferencesComment", mainwindow,\n                                  Qt.ApplicationModal, Qt.Dialog);\n    toolbox.lastWindow().set(params);\n    if (newdlg.exec())\n      refreshCommentConsole();\n  }\n  catch (e)\n  {\n    QMessageBox.critical(mainwindow, "dockSendMessage",\n                         "preferencesCommentConsole exception: " + e);\n  }\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshCommentConsole()\n{\n  try\n  {\n  \t_commentConsoleIsDirty = true;\n    fillListCommentConsole();\n  }\n  catch (e)\n  {\n    QMessageBox.critical(mainwindow, "dockSendMessage",\n                         "refreshCommentConsole exception: " + e);\n  }\n}\n	
86	dockUserOnline	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _dockUserOnline;\nvar _userOnline;\nvar _userOnlineIsDirty = true;\n\n/*!\n  Initializes Open Sales Order dock widget and places it in the main window.\n*/\nfunction initDockUserOnline()\n{\n  _dockUserOnline = mainwindow.findChild("_dockUserOnline");\n  _userOnline = mainwindow.findChild("_userOnline");\n\n  // Set columns on list\n  _userOnline.addColumn(qsTr("Username"), -1,  Qt.AlignLeft, true, "usr_username");\n  _userOnline.addColumn(qsTr("Proper Name"), -1,  Qt.AlignLeft, true, "usr_propername");\n  _userOnline.addColumn(qsTr("Email"), -1,  Qt.AlignLeft, true, "usr_email");\n  _userOnline.addColumn(qsTr("# Internal"), -1,  Qt.AlignLeft, true, "cnt_internal");\n  _userOnline.addColumn(qsTr("# External"), -1,  Qt.AlignLeft, true, "cnt_external");\n  _userOnline.addColumn(qsTr("Client Start"), XTreeWidget.timeDateColumn, Qt.AlignLeft, true, "client_start"); \n  _userOnline.addColumn(qsTr("Query Start"), XTreeWidget.timeDateColumn, Qt.AlignLeft, true, "query_start");\n  _userOnline.addColumn(qsTr("Client Address"), -1,  Qt.AlignLeft, true, "client_addr");\n\n  // Connect Signals and Slots\n  _dtTimer.timeout.connect(refreshUserOnline);\n\n  _userOnline.itemSelected.connect(openWindowUserOnline);\n  _userOnline["populateMenu(QMenu*,XTreeWidgetItem*,int)"]\n    .connect(populateMenuUserOnline);\n\n  _dockUserOnline.visibilityChanged.connect(refreshUserOnline);\n\n  // Handle privilge control\n  var act = _dockUserOnline.toggleViewAction();\n\n  // Don't show if no privs\n  if (!privileges.check("ViewUsersOnlineDock"))\n  {\n    _dockUserOnline.hide();\n    act.enabled = false;\n  }\n\n  // Allow rescan to let them show if privs granted\n  act.setData("ViewUsersOnlineDock");\n  _menuDesktop.appendAction(act);\n\n  fillListUserOnline();\n}\n\n/*!\n  Fills the list with open sales data.\n*/\nfunction fillListUserOnline()\n{\n  _dockUserOnline = mainwindow.findChild("_dockUserOnline");\n  _userOnline = mainwindow.findChild("_userOnline");\n\n  if (!_dockUserOnline.visible || !_userOnlineIsDirty)\n    return;\n\n  _userOnline.populate(toolbox.executeDbQuery("desktop","userOnline"));\n  _userOnlineIsDirty = false;\n}\n\n/*! \n  Opens the window associated with the selected item.\n*/\nfunction openWindowUserOnline()\n{ \n  // Make sure we can open the window for this activity\n  if (!privilegeCheckUserOnline() ||\n      !_userOnline.currentItem().rawValue("usr_username").length)\n    return;\n\n  params = new Object;\n  params.username = _userOnline.currentItem().rawValue("usr_username");\n  if (privilegeCheckUserOnline())\n    params.mode="edit";\n\n  // Open the window and perform any handling required\n  var user = toolbox.openWindow("user");\n  user.set(params);\n  if (user.exec())\n    refreshUserOnline();\n}\n\n/*!\n  Adds actions to @a pMenu, typically from a right click on a user record.\n*/\nfunction populateMenuUserOnline(pMenu, pItem)\n{\n  if (!_userOnline.currentItem().rawValue("usr_username").length)\n    return;\n\n  var menuItem;\n  var enable = privilegeCheckUserOnline();\n\n  menuItem = pMenu.addAction(_open);\n  menuItem.enabled = enable;\n  menuItem.triggered.connect(openWindowUserOnline);\n}\n\n/*!\n  Returns whether user has privileges to view detail on the selected User.\n*/\nfunction privilegeCheckUserOnline()\n{\n  return privileges.check("MaintainUsers");\n\n  return false;\n}\n\n/*!\n  Refreshes data if the window is visible, or the next time it becomes visible\n*/\nfunction refreshUserOnline()\n{\n  _userOnlineIsDirty = true;\n  fillListUserOnline();\n}\n	
134	hotkey	0	t	var _save = mywindow.findChild("_save");\n\nfunction refreshShortcuts() {\n  mainwindow.sEmitSignal("xtdesktop", "refreshShortcuts");\n}\n\n_save.clicked.connect(refreshShortcuts);	
87	incident	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\ninclude("dockMyTodo");\n\n// Connect this window so that the To Do dock list gets updated\nmydialog.finished.connect(fillListToDo);\n	
135	initMenu	10	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\n\n// Import code from related scripts\ninclude("stylesheets");\ninclude("dockBankBal");\ninclude("dockExtensions");\ninclude("dockGLAccounts");\ninclude("dockMessageHistory");\ninclude("dockMfgActive");\ninclude("dockMfgHist");\ninclude("dockMfgOpen");\ninclude("dockMyAccounts");\ninclude("dockMyContacts");\ninclude("dockMyTodo");\ninclude("dockPayables");\ninclude("dockPurchActive");\ninclude("dockPurchHist");\ninclude("dockPurchOpen");\ninclude("dockReceivables");\ninclude("dockSalesActive");\ninclude("dockSalesHistory");\ninclude("dockSalesOpen");\ninclude("dockSendMessage");\ninclude("dockUserOnline");\ninclude("desktopMenuBar");\n\nvar _desktopStack = toolbox.createWidget("QStackedWidget", mainwindow, "_desktopStack");\nvar _open = qsTr("Open...");\nvar _dtTimer = new QTimer(mainwindow);\nvar _windows = new Array();\nvar _vToolBarActions      = []; // used only in addToolBarAction()\nvar showDashboardAnything = false;\n\nvar _mainMenu;\nvar _employee;\n\nvar _menuDesktop = new QMenu(qsTr("Desktop"),mainwindow);\nvar _menuToolBar = new QMenu(mainwindow);\nvar _menuWindow = mainwindow.findChild("menu.window");\n\n// Create Menu items for setup windows\nvar _menuSetup = new QMenu(qsTr("Setup"),mainwindow);\n\n// Add desktop to main window\naddAction("sys.currencies","currencies","CreateNewCurrency","CreateNewCurrency");\naddAction("sys.exchangeRates","currencyConversions","MaintainCurrencyRates","ViewCurrencyRates");\n\n// Set up refresh timer\n_dtTimer.setInterval(metrics.value("desktop/timer"));\n_dtTimer.start();\n\n// Setup the desktop layout\nvar _desktopWidget = toolbox.createWidget("QWidget", mainwindow, "_desktopWidget");\n_desktopWidget.setStyleSheet(desktopStyle);\n_desktopLayout = toolbox.createLayout("QHBoxLayout", mainwindow, "_desktopLayout");\n_desktopMenu = toolbox.loadUi("desktopMenuBar", mainwindow);\n_desktopMenu.maximumWidth = 250;\n_desktopLayout.addWidget(_desktopMenu);\n_desktopLayout.addWidget(_desktopStack);\n_desktopWidget.setLayout(_desktopLayout);\n\nvar _desktopParent = mainwindow.showTopLevel() ? mainwindow : null;\nif (_desktopParent)\n{\n  _desktopParent.setCentralWidget(_desktopWidget);\n\n  setupDesktopMenu();\n\n  // Set up browser for Welcome Page\n  var _welcome = new QWebView(mainwindow);\n  var welcomeUrl = (function () {\n  var databaseURL  = mainwindow.databaseURL(),\n        string       = databaseURL.split("/"),\n        hostName     = string[2].substring(0, string[2].indexOf(":")),\n        databaseName = string[3],\n        urlString = metrics.value("desktop/welcome")\n                  + "?client=desktop" + "&hostname=" + hostName\n                  + "&organization=" + databaseName\n                  + "&edition=" + metrics.value("Application")\n                  + "&version=" + metrics.value("ServerVersion")\n    ;\n    return new QUrl(urlString);\n  })();\n  _welcome.objectName = "_welcome";\n  _welcome["loadFinished(bool)"].connect(loadLocalHtml);\n  _welcome["linkClicked(const QUrl &)"].connect(openUrl);\n  _welcome.load(welcomeUrl);\n  _welcome.page().linkDelegationPolicy = QWebPage.DelegateAllLinks;\n  _desktopStack.addWidget(_welcome);\n  addToolBarAction(qsTr("Welcome"), "home_32");\n\n  if (showDashboardAnything) {\n    var _home = new QWebView(mainwindow);\n    _home["loadFinished(bool)"].connect(missingxTupleServer);\n    _home["linkClicked(const QUrl &)"].connect(openUrl);\n    var homeURL = "https://" + metrics.value("WebappHostname")\n                + ":" + metrics.value("WebappPort")\n                + "/" + mainwindow.databaseURL().split("/")[3];\n                + "/npm/xtuple-dashboard-anything/public/index.html";\n    _home.load(new QUrl(homeURL));\n    _home.page().linkDelegationPolicy = QWebPage.DelegateAllLinks;\n    _desktopStack.addWidget(_home);\n    addToolBarAction(qsTr("Dashboard"), "home_32");\n  }\n\n  // Initialize additional desktop UIs and Dock Widgets\n  // (Init functions come from the code pulled in by the include statements)\n  addDesktop("desktopCRM", "clients_32", "ViewCRMDesktop");\n  initDockTodo();\n  initDockAccounts();\n  initDockMyCntcts();\n\n  addDesktop("desktopSales", "reward_32", "ViewSalesDesktop");\n  initDockSalesAct();\n  initDockSalesHist();\n  initDockSalesOpen();\n\n  addDesktop("desktopAccounting", "accounting_32", "ViewAccountingDesktop");\n  initDockPayables();\n  initDockReceivables();\n  initDockBankBal();\n  initDockGLAccounts();\n\n  addDesktop("desktopPurchase", "order_32", "ViewPurchaseDesktop");\n  initDockPurchAct();\n  initDockPurchHist();\n  initDockPurchOpen();\n\n  addDesktop("desktopManufacture", "industry_32", "ViewManufactureDesktop");\n  initDockMfgAct();\n  initDockMfgHist();\n  initDockMfgOpen();\n\n  addDesktop("desktopSocial", "social", "viewSocialDesktop");\n  initDockUserOnline();\n  initDockMessageHistory();\n  initDockSendMessage();\n\n  var maintWin = addDesktop("desktopMaintenance", "gear_32", "ViewMaintenanceDesktop");\n  initDockExtensions();\n\n  // Handle window actions\n  _menuWindow.aboutToShow.connect(prepareWindowMenu);\n\n  if (metrics.boolean("MultiWhs"))\n  {\n    var button = mainwindow.findChild("_sites");\n    button.label = qsTr("Sites");\n    button.actionName = "im.warehouses";\n  }\n}\nelse\n{\n  if (!preferences.boolean("NoDesktopNotice"))\n    toolbox.openWindow("desktopNotice",mainwindow, Qt.WindowModal, Qt.Dialog);\n}\n\n/*!\n  Adds screen with name of @a uiName to the desktop stack so long as the user has\n  been granted the privilege @a privName. The @a windowTitle of the UI object is \n  added to the Desktop Dock so that when it is clicked, the associated window is \n  selected on the Desktop.\n*/\nfunction addDesktop(uiName, imageName, privilege)\n{\n  // Get the UI and add to desktop stack\n  var desktop = toolbox.loadUi(uiName);\n  _desktopStack.addWidget(desktop);\n  _windows.push(desktop);\n  addToolBarAction(desktop.windowTitle, imageName, privilege);\n  desktop.restoreState();\n  \n  return desktop;\n}\n\n/*!\n  Add a button with @a label and @a imageName to the left desktop toolbar\n*/\nfunction addToolBarAction(label, imageName, privilege)\n{\n  var act,\n      icn = new QIcon(),\n      menuItem;\n  icn.addDbImage(imageName);\n\n  // create an action in an invisible menu to ensure priv rescans work\n  act = _menuToolBar.addAction(icn, label);\n  if (act) {\n    act.checkable = true;\n    if (privilege)\n    {\n      act.setEnabled(privileges.check(privilege));\n      act.setData(privilege);\n    }\n\n    _vToolBarActions.push(act);\n\n    if (!privilege || privileges.check(privilege))\n      menuItem = new XTreeWidgetItem(_mainMenu, _vToolBarActions.length,\n                                     _vToolBarActions.length, label);\n  }\n  else {\n    print('addToolbarAction() could not add ' + label);\n  }\n}\n\n/*!\n  Loads a local HTML page from the database if the xTuple welcome page\n  fails to load.\n*/\nfunction loadLocalHtml(ok)\n{\n  if (!ok)\n  {\n    // Page didn't load, so load internal HTML saying we aren't connected\n    var q = toolbox.executeQuery("SELECT xtdesktop.fetchWelcomeHtml() AS html");\n    q.first();\n    _welcome.setHtml(q.value("html"));\n  }\n  // We don't want to deal with loading any more web pages.  Let OS do it\n  _welcome.page().linkDelegationPolicy = QWebPage.DelegateAllLinks;;\n}\n\nfunction missingxTupleServer(ok)\n{\n  if (!ok)\n  {\n    // xTuple Server is not available or didn't load, so load internal HTML saying we aren't connected\n    var q = toolbox.executeQuery("SELECT xtdesktop.fetchxTupleServerHtml() AS html");\n    q.first();\n    _home.setHtml(q.value("html"));\n  }\n  // We don't want to deal with loading any more web pages.  Let OS do it\n  _home.page().linkDelegationPolicy = QWebPage.DelegateAllLinks;;\n}\n\n/*!\n  Launches links clicked on home page into new local browser window\n*/\nfunction openUrl(url)\n{\n  toolbox.openUrl(new QUrl(url).toString());\n}\n\n/*!\n  Adds desktop to the window menu\n*/\nfunction prepareWindowMenu()\n{\n  // TO DO: Make this more modular\n  var idx = _desktopStack.currentIndex;\n  _dockMycontacts.toggleViewAction().visible = (idx == 1);\n  _dockMyaccounts.toggleViewAction().visible = (idx == 1);\n  _dockMytodo.toggleViewAction().visible = (idx == 1);\n  _dockSalesAct.toggleViewAction().visible = (idx == 2);\n  _dockSalesHist.toggleViewAction().visible = (idx == 2);\n  _dockSalesOpen.toggleViewAction().visible = (idx == 2);\n  _dockBankBal.toggleViewAction().visible = (idx == 3);\n  _dockPayables.toggleViewAction().visible = (idx == 3);\n  _dockReceivables.toggleViewAction().visible = (idx == 3);\n  _dockGLAccounts.toggleViewAction().visible = (idx == 3);\n  _dockPurchAct.toggleViewAction().visible = (idx == 4);\n  _dockPurchHist.toggleViewAction().visible = (idx == 4);\n  _dockPurchOpen.toggleViewAction().visible = (idx == 4);\n  _dockMfgAct.toggleViewAction().visible = (idx == 5);\n  _dockMfgHist.toggleViewAction().visible = (idx == 5);\n  _dockMfgOpen.toggleViewAction().visible = (idx == 5);\n  _dockSendMessage.toggleViewAction().visible = (idx == 6);\n  _dockMessageHistory.toggleViewAction().visible = (idx == 6);\n  _dockUserOnline.toggleViewAction().visible = (idx == 6);\n  _dockExtensions.toggleViewAction().visible = (idx == 7);\n//  _dockUserOnline.toggleViewAction().visible = (idx == 7);\n  _menuWindow.addSeparator();\n  _menuWindow.addMenu(_menuDesktop);\n}\n\nfunction addAction(actionName, slotName, editPriv, viewPriv)\n{\n  var tempaction;\n  tmpaction = new QAction(mainwindow);\n  tmpaction.enabled = privileges.value(editPriv) || privileges.value(viewPriv);\n  tmpaction.setData(editPriv + " " + viewPriv);\n  tmpaction.objectName = actionName;\n  tmpaction.triggered.connect(this, slotName);\n  _menuSetup.appendAction(tmpaction);\n}\n\nfunction openSetup(uiName)\n{\n  var params = new Object;\n  params.uiName = uiName;\n  var wnd = toolbox.openWindow("setup", mainwindow);\n  toolbox.lastWindow().set(params);\n  wnd.exec();\n}\n\nfunction currencies()\n{\n  openSetup("currencies");\n}\n\nfunction currencyConversions()\n{\n  openSetup("currencyConversions");\n}\n	
129	preferencesComment	0	t	try\r\n{\r\n  var _usr       = mywindow.findChild("_usr");\r\n  var _type      = mywindow.findChild("_type");\r\n  var _source    = mywindow.findChild("_source");\r\n  var _dates     = mywindow.findChild("_dates");\r\n  var startdate;\r\n  var enddate;\r\n\r\n  if (!privileges.check("AccessAdditionalUser"))\r\n    _usr.hide();\r\n  else if(privileges.check("AccessAdditionalUser"))\r\n    _usr.show();\r\n\r\n  _type.addColumn("Comment Type",  -1,  1, true, "commenttype_name");\r\n  _source.addColumn("Comment Source",  -1,  1, false, "cmntsource_name");\r\n  _source.addColumn("Comment Source",  -1,  1, true, "cmntsource_fullname");\r\n  _usr.addColumn("User Name",  -1,  1, true, "usr_username");\r\n\r\n  populate();\r\n  mydialog.accepted.connect(save);\r\n}\r\ncatch (e)\r\n{\r\n  QMessageBox.critical(mywindow, "preferencesComment",\r\n                       "preferencesComment.js exception: " + e);\r\n}\r\n\r\nfunction set(params)\r\n{\r\n  var prefusr = preferences.value("MonitoredCommentUsrs");\r\n  var preftyp = preferences.value("MonitoredCommentTypes");\r\n  var prefsrc = preferences.value("MonitoredCommentSrcs");\r\n\r\n  var getDate = "SELECT CURRENT_DATE + CAST(<? literal(\\"offSet\\") ?> AS INTEGER) AS datevalue;";\r\n\r\n  params.offSet = ((preferences.value("MonitoredCommentStrtDate") != '')?preferences.value("MonitoredCommentStrtDate"):-1);\r\n  var data = toolbox.executeQuery(getDate, params);\r\n  if (data.first())\r\n    _dates.setStartDate(data.value("datevalue"));\r\n  else if (data.lastError().type != QSqlError.NoError)\r\n  {\r\n    QMessageBox.critical(mainwindow, qsTr("Database Error"),\r\n                         data.lastError().text);\r\n    return;\r\n  }\r\n\r\n  params.offSet = ((preferences.value("MonitoredCommentEndDate") != '')?preferences.value("MonitoredCommentEndDate"):0);\r\n  var data = toolbox.executeQuery(getDate, params);\r\n  if (data.first())\r\n    _dates.setEndDate(data.value("datevalue"));\r\n  else if (data.lastError().type != QSqlError.NoError)\r\n  {\r\n    QMessageBox.critical(mainwindow, qsTr("Database Error"),\r\n                         data.lastError().text);\r\n    return;\r\n  }\r\n\r\n  if (prefusr == '')\r\n  {\r\n    var qry = "SELECT usr_id FROM usr WHERE (usr_username = current_user);";\r\n    var data = toolbox.executeQuery(qry, -1);\r\n    if (data.first())\r\n      _usr.setId(data.value("usr_id"));\r\n    else if (data.lastError().type != QSqlError.NoError)\r\n    {\r\n      QMessageBox.critical(mainwindow, qsTr("Database Error"),\r\n                           data.lastError().text);\r\n      return;\r\n    }\r\n  }\r\n  else\r\n  {\r\n    var usrList = new Array();\r\n    usrList = prefusr.split(",");\r\n    for (var i in usrList)\r\n      _usr.setId(usrList[i], false);\r\n  }\r\n\r\n  var typList = new Array();\r\n  if (preftyp == '')\r\n    _type.setId(0);\r\n  else\r\n  {\r\n    typList = preftyp.split(",");\r\n    for (var j in typList)\r\n      _type.setId(typList[j], false);\r\n  }\r\n\r\n  var srcList = new Array();\r\n  if (prefsrc == '')\r\n    _source.setId(1);\r\n  else\r\n  {\r\n    srcList = prefsrc.split(",");\r\n    for (var k in srcList)\r\n      _source.setId(srcList[k], false);\r\n  }\r\n}\r\n\r\nfunction populate()\r\n{\r\n  try\r\n  {\r\n    _type.clear();\r\n    _type.populate(toolbox.executeDbQuery("desktop","cmmntPrefType"));\r\n    _source.clear();\r\n    _source.populate(toolbox.executeDbQuery("desktop","cmmntPrefSrc"));\r\n    if (privileges.check("AccessAdditionalUser"))\r\n    {\r\n      _usr.clear();\r\n      _usr.populate(toolbox.executeDbQuery("desktop","cmmntPrefUser"));\r\n    }\r\n  }\r\n  catch (e)\r\n  {\r\n    QMessageBox.critical(mywindow, "preferencesComment",\r\n                         "populateType exception: " + e);\r\n  }\r\n}\r\n\r\nfunction save()\r\n{\r\n  var typList = new Array();\r\n  var emptyList = new Array();\r\n  var selectedTyp = _type.selectedItems();\r\n  for (var i = 0; i < selectedTyp.length; i++)\r\n  {\r\n    if (selectedTyp[i].id() != 0)\n    {\r\n      typList[i] = selectedTyp[i].id();\n      preferences.set("MonitoredCommentTypes",  typList.join(","));\n    }\r\n    else\n    {\n      preferences.set("MonitoredCommentTypes",  emptyList.join(","));\r\n      break;\n    }\r\n  }\r\n\r\n  var srcList = new Array();\r\n  var selectedSrc = _source.selectedItems();\r\n  for (var i = 0; i < selectedSrc.length; i++)\r\n  {\r\n    if (selectedSrc[i].id() != 1)\n    {\r\n      srcList[i] = selectedSrc[i].id();\n      preferences.set("MonitoredCommentSrcs",  srcList.join(","));\n    }\r\n    else\n    {\n      preferences.set("MonitoredCommentSrcs",  emptyList.join(","));\r\n      break;\n    }\r\n  }\r\n\r\n  if (privileges.check("AccessAdditionalUser"))\r\n  {\r\n    var usrList = new Array();\r\n    var selectedUsr = _usr.selectedItems();\r\n    for (var i = 0; i < selectedUsr.length; i++)\r\n      usrList[i] = selectedUsr[i].id();\r\n    preferences.set("MonitoredCommentUsrs",  usrList.join(","));\r\n  }\r\n\r\n  var params = new Object();\r\n  params.startdate1 = _dates.startDate;\r\n  var qryStdate = "SELECT (<? value(\\"startdate1\\") ?>::DATE - (current_date)) AS difference1;";\r\n  var data1 = toolbox.executeQuery(qryStdate,params);\r\n  if (data1.first())\r\n    var strtDateoffSet = data1.value("difference1");\r\n  else if (data1.lastError().type != QSqlError.NoError)\r\n  {\r\n    QMessageBox.critical(mywindow, qsTr("Database Error"),\r\n                         data1.lastError().text);\r\n    mywindow.reject();\r\n  }\r\n\r\n  params.enddate1 = _dates.endDate;\r\n  var qryEnddate = "SELECT (<? value(\\"enddate1\\") ?>::DATE - (current_date)) AS difference2;";\r\n  var data2 = toolbox.executeQuery(qryEnddate,params);\r\n  if (data2.first())\r\n    var endDateoffSet = data2.value("difference2");\r\n  else if (data2.lastError().type != QSqlError.NoError)\r\n  {\r\n    QMessageBox.critical(mywindow, qsTr("Database Error"),\r\n                         data2.lastError().text);\r\n    mywindow.reject();\r\n  }\r\n\r\n  if (endDateoffSet - strtDateoffSet > 7)\n  {\n    strtDateoffSet = endDateoffSet - 7;\n    QMessageBox.critical(mywindow, qsTr("Comment Date Limit"),\r\n                         qsTr("Comment Start Date changed to honor 7 day limit"));\r\n  }\r\n\r\n  preferences.set("MonitoredCommentStrtDate", strtDateoffSet);\r\n  preferences.set("MonitoredCommentEndDate", endDateoffSet);\r\n}\r\n	
89	preferencesHistory	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar _groupBy = mywindow.findChild("_groupBy");\nvar _timeFrame = mywindow.findChild("_timeFrame");\nvar _type = mywindow.findChild("_type");\n\nvar _path;\n\n// Populate timeFrame combo\n_timeFrame.append(0, qsTr("Today"), "day");\n_timeFrame.append(1, qsTr("This Week"), "week");\n_timeFrame.append(2, qsTr("This Month"), "month");\n_timeFrame.append(3, qsTr("This Year"), "year");\n\nmydialog.accepted.connect(save);\n\n/*!\n  Parameters @a params are passed to set up selection criteria for the window\n*/\nfunction set(params)\n{\n  if ("path" in params)\n  {\n    _path = params.path;\n    if (_path == "desktop/salesHist")\n    {\n      _type.append(0, qsTr("Bookings"), "bookings");\n      _type.append(1, qsTr("Sales"), "sales");\n\n      _groupBy.append(0, qsTr("Customer"), "cust");\n      _groupBy.append(1, qsTr("Product Category"), "prodcat");\n      _groupBy.append(2, qsTr("Sales Rep"), "salesrep");\n\n      mywindow.windowTitle = qsTr("Sales History Preferences");\n    }\n    else if (_path == "desktop/purchHist")\n    {\n      _type.append(0, qsTr("Receipts"), "receipts");\n      _type.append(1, qsTr("Variances"), "variances");\n\n      _groupBy.append(0, qsTr("Vendor"), "vend");\n      _groupBy.append(1, qsTr("Item"), "item");\n      _groupBy.append(2, qsTr("Purchase Agent"), "agent");\n\n      mywindow.windowTitle = qsTr("Purchase History Preferences");\n    }\n    else if (_path == "desktop/mfgHist")\n    {\n      _type.append(0, qsTr("Receipts"), "receipts");\n      _type.enabled = false;\n\n      _groupBy.append(0, qsTr("Class Code"), "classcode");\n      _groupBy.append(1, qsTr("Item"), "item");\n      _groupBy.append(2, qsTr("Planner Code"), "plancode");\n\n      mywindow.windowTitle = qsTr("Manufacture History Preferences");\n    }\n  }\n\n  if ("type" in params)\n    _type.code = params.type;\n\n  if ("groupBy" in params)\n    _groupBy.code = params.groupBy;\n\n  if ("timeFrame" in params)\n    _timeFrame.code = params.timeFrame;\n\n}\n\n/*!\n  Saves selection preferences to the local machine.\n*/\nfunction save()\n{\n  // Save preferences to local machine\n  preferences.set(_path + "/type", _type.code);\n  preferences.set(_path + "/groupBy", _groupBy.code);\n  preferences.set(_path + "/timeFrame", _timeFrame.code);\n}\n\n	
130	preferencesNumber	0	t	try\r\n{\r\n  var _limit = mywindow.findChild("_limit");\r\n  var _path;\r\n\r\n  mydialog.accepted.connect(mysave);\r\n}\r\ncatch (e)\r\n{\r\n  QMessageBox.critical(mainwindow, "preferencesNumber",\r\n                      "preferencesNumber.js exception: " + e);\r\n}\r\n\r\nfunction set(params)\r\n{\r\n  if ("path" in params)\r\n    _path = params.path;\r\n\r\n  if ("limit" in params)\r\n    _limit.value = params.limit;\r\n  else\r\n    _limit.value = 10;\r\n}\r\n\r\nfunction mysave()\r\n{\r\n  try\r\n  {\r\n    preferences.set(_path + "/limit", _limit.value);\r\n  }\r\n  catch (e)\r\n  {\r\n    QMessageBox.critical(mainwindow, "preferencesNumber",\r\n                        "mysave exception: " + e);\r\n  }\r\n}\n	
90	preferencesSelections	0	t	/*\n * This file is part of the xtdesktop package for xTuple ERP: PostBooks edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\nvar _gl = mywindow.findChild("_gl");\n\n// Set columns on list\n_gl.addColumn(qsTr("Account#"),    -1, Qt.AlignLeft, true, "accnt_id");\n_gl.addColumn(qsTr("Description"), -1, Qt.AlignLeft, true, "accnt_descrip");\n_gl.addColumn(qsTr("Type"),        -1, Qt.AlignLeft, true, "accnt_type" );\n\nparams = new Object;\nparams.asset = qsTr("Asset");\nparams.liability = qsTr("Liability");\nparams.revenue = qsTr("Revenue");\nparams.expense = qsTr("Expense");\nparams.equity = qsTr("Equity");\n\n_gl.populate(toolbox.executeDbQuery("desktop", "glaccounts", params));\n\nfunction set(params)\n{\n  // Select accounts previously selected\n  var pref = preferences.value("MonitoredAccounts");\n  var accntList = new Array();\n  accntList = pref.split(",");\n  for (i in accntList)  \n  {\n    _gl.setId(accntList[i], false);\n  }\n}\n\nfunction save()\n{\n  var accntList = new Array();\n  var selected = _gl.selectedItems();\n  for (var i = 0; i < selected.length; i++)\n    accntList[i] = selected[i].id();\n\n  preferences.set("MonitoredAccounts",  accntList.join(","));\n}\n\n// Connect save on Ok\nmydialog.accepted.connect(save);\n	
91	project	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\ninclude("dockMyTodo");\n\n// Connect this window so that the To Do dock list gets updated\nmydialog.finished.connect(fillListToDo);\n	
131	sendMessageToUser	0	t	//debugger;\n\nvar _usr       = mywindow.findChild("_usr");\nvar _message   = mywindow.findChild("_message");\nvar _send      = mywindow.findChild("_send");\n\nfunction getParams() \n{\n  var params = new Object;\n\n  params.message = _message.plainText;\n  if (_usr.id() > 0)\n    params.usr_id = _usr.id();\n\n  return params;\n}\n\nfunction sHandleButtons()\n{\n  var qry = "SELECT usr_id FROM usr WHERE usr_username = current_user;";\n  var data = toolbox.executeQuery(qry, -1);\n  if (data.first())\n    var currenttUsr_id = data.value("usr_id");\n\n  if (currenttUsr_id == _usr.id())\n  {\n    if (QMessageBox.information(mainwindow, qsTr("Send Message?"),\n                            qsTr("You are trying to Send Reply Message to Yourself."\n                              +"\\nAre you sure that you really want to Continue?."),\n           QMessageBox.Yes | QMessageBox.Default, QMessageBox.No | QMessageBox.Escape) == QMessageBox.No)\n    {\n      _usr.clear();\n      return;\n    }\n    else\n      _send.enabled = (_usr.id() >= 0);\n  }\n  else\n    _send.enabled = (_usr.id() >= 0);\n}\n\nfunction send()\n{\n  var params = getParams();    \n  var qry = toolbox.executeDbQuery("desktop", "sendMessageToUser", params);\n  QMessageBox.information(mywindow,'Sent','Message Sent');\n  mywindow.close();\n}\n\nfunction set(input)\n{\n  if ("user" in input)\n    _usr.setUsername(input.user);\n  else\n   QMessageBox.warning(mywindow, "Message", "Could not set username");\n}\n\n_usr["newId(int)"].connect(sHandleButtons);\n_send.clicked.connect(send);\nmywindow.findChild("_close").clicked.connect(mywindow, "close");\n	
136	stylesheets	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\nvar selectedFg          = "#0177FF",\n    selectedBg          = "#FFF",\n    uncheckedFg         = "#99bbff",\n    bigBoxBorderColor   = "#AAA",\n    smallBoxBorderColor = "#E8E8E8",\n    smallBoxBg          = "#E8E8E8",\n    generalFontSize     = "10pt",\n    borderRadius        = "4px",\n    groupBoxPadding     = "1ex",\n    groupBoxTitleFontSize=generalFontSize,\n    tableHeadingFontSize= "10pt",\n    multiButtonMargin   = "0.5ex",\n    windowBg            = "#FAAFAAFAA",\n    toolbarBg           = "#DFFDFFDFF",\n    layeredWindowBg     = windowBg,\n    ;\n\nswitch (mainwindow.getWindowSystem()) {\n  case mainwindow.MAC: generalFontSize       = "12pt";\n                       groupBoxTitleFontSize = "10pt";\n                       layerdWindowBg        = "transparent";\n                       break;\n  case mainwindow.X11: tableHeadingFontSize = "9pt";\n                       break;\n  case mainwindow.WIN: groupBoxPadding = "3ex;";\n                       break;\n}\n\nvar imageStyle = [ "* {",\n    "border: none;",\n    "font: 14px;",\n"}"\n].join(" ");\n\nvar generalStyle = [ "* {",\n    "font-family: Open Sans, Helvetica, Verdana, sans-serif;", \n    "font-size: " + generalFontSize + ";",\n    "font-weight: regular;",\n    "color: rgb(68, 68, 68);",\n    "background-color: " + selectedBg + ";",\n    "selection-color: " + selectedFg + ";",\n    "selection-background-color: " + selectedBg + ";",\n"}",\n"*:focus {",\n  "border-color: " + selectedFg + ";",\n"}",\n"*:disabled {",\n  "color: " + bigBoxBorderColor + ";",\n"}",\n"QScrollBar:horizontal {",\n "border: 1px solid " + smallBoxBorderColor + ";",\n "border-radius: " + borderRadius + ";",\n "background: " + smallBoxBg + ";",\n "height: 10px;",\n "margin: 0px 0px 0px 0px;",\n"}",\n"QScrollBar:vertical {",\n  "border: 1px solid " + smallBoxBorderColor + ";",\n  "border-radius: " + borderRadius + ";",\n  "background: " + smallBoxBg + ";",\n  "width: 10px;",\n  "margin: 0px 0 0px 0;",\n "}",\n "QScrollBar::add-line:vertical {",\n     "background: " + bigBoxBorderColor + ";",\n     "height: 0px;",\n     "subcontrol-position: bottom;",\n     "subcontrol-origin: margin;",\n "}",\n "QScrollBar::add-line:horizontal {",\n     "background: " + bigBoxBorderColor + ";",\n     "width: 0px;",\n     "subcontrol-position: bottom;",\n     "subcontrol-origin: margin;",\n "}",\n "QScrollBar::sub-line:vertical {",\n     "background: " + bigBoxBorderColor + ";",\n     "height: 0px;",\n     "subcontrol-position: top;",\n     "subcontrol-origin: margin;",\n "}",\n "QScrollBar::sub-line:horizontal {",\n     "background: " + bigBoxBorderColor + ";",\n     "width: 0px;",\n     "subcontrol-position: top;",\n     "subcontrol-origin: margin;",\n "}",\n"QScrollBar::down-arrow:vertical {",\n     "width: 20px;",\n     "height: 20px;",\n"}",\n"QScrollBar::up-arrow:vertical {",\n     "width: 10px;",\n     "height: 20px;",\n"}", \n"QScrollBar::down-arrow:horizontal {",\n     "width: 20px;",\n     "height: 20px;",\n     "background: " + selectedBg + ";",\n"}",\n"QScrollBar::up-arrow:horizontal {",\n     "width: 10px;",\n     "height: 20px;",\n     "background: " + selectedBg + ";",\n"}",\n"QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {",\n     "background: none;",\n "}",\n"QScrollBar::handle {",\n  "background-color: " + bigBoxBorderColor + ";",\n  "border: 1px solid " + bigBoxBorderColor + ";",\n  "border-radius: " + borderRadius + ";",\n"}",\n"QStatusBar {",\n //"background-color: rgb(1, 119, 255);",\n"}",\n"#desktopCollaborateLit, #desktopAccountingLit, #desktopManufactureLit, #_notice, #desktopPurchaseLit, #desktopSalesLit, #desktopSociallit {",\n "text-transform: lowercase;",\n "font-size: 18px;",\n "color: " + selectedFg + ";",\n "font-weight: 200;",\n"}",\n"QMenu {",\n  "border: 1px solid " + bigBoxBorderColor + ";",\n"}",\n"QCheckBox {",\n  "margin: " + multiButtonMargin + ";",\n  "background-color: transparent;",\n"}",\n/* this checkbox styling is really ugly but will do if we cannot find a better solution\n"QCheckBox::indicator:checked:focus {",\n  "background-color: " + selectedFg + ";",\n"}",\n"QCheckBox::indicator:unchecked:focus {",\n  "background-color: " + uncheckedFg + ";",\n"}",\n*/\n"QGroupBox {",\n  "text-transform: uppercase;",\n  "font-size: " + groupBoxTitleFontSize + ";",\n  "border-top: 1px solid " + smallBoxBorderColor + ";",\n  "border-left: 1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #e8e8e8, stop: 0.05 #e8e8e8, stop: 0.06 #FFFFFF, stop: 1 #FFFFFF);",\n  "border-right: 1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #e8e8e8, stop: 0.05 #e8e8e8, stop: 0.06 #FFFFFF, stop: 1 #FFFFFF);",\n  "margin-top: 1ex;",\n  "padding: " + groupBoxPadding + ";",\n"}",\n"QGroupBox::title {",\n "color: rgb(138, 138, 138);",\n "subcontrol-origin: margin;",\n "subcontrol-position: top center;",\n "padding: 0 3px;",\n"}",\n"QTabBar::tab:selected {",\n"background-color: " + selectedBg + ";",\n"color: " + selectedFg + ";",\n "border-bottom-color: " + selectedBg + ";",\n"}",\n"QTabBar::tab:!selected {",\n"background-color: " + selectedBg + ";",\n"color: #666;",\n"}",\n "QTabBar::tab:disabled {",\n"background-color: " + selectedBg + ";",\n"color: " +  bigBoxBorderColor + ";",\n "border-bottom-color: " + bigBoxBorderColor + ";",\n"}",\n"QTabBar::tab {",   \n  "border: 1px solid " + bigBoxBorderColor + ";",\n    "border-top-left-radius: " + borderRadius + ";",\n    "border-top-right-radius: " + borderRadius + ";",\n    "min-width: 8ex;",\n    "padding-top: 2px;",\n"padding-bottom: 2px;",\n"padding-left: 4px;",\n"padding-right: 4px;",\n"}", \n"MenuButton::label {",\n "max-width: 90%;",\n"}",\n"VirtualClusterLineEdit QLabel {",\n  "background-color: none;",\n"}",\n"QComboBox {",\n  "padding-left:   4px;",\n  "padding-right:  4px;",\n  "padding-top:    2px;",\n  "padding-bottom: 2px;",\n  "margin: 2px;",\n  "border-radius: " + borderRadius + ";",\n  "border: 1px solid " + bigBoxBorderColor + ";",\n"}",\n"QComboBox:selected {",\n  "border: 2px solid " + selectedFg + ";",\n"}",\n"QComboBox::editable:selected {",\n  "border: 2px solid " + selectedFg + ";",\n"}",\n"QHeaderView::section {",\n  "color: black;", // font-size doesn't work without this. why not?\n  "font-size: "        + tableHeadingFontSize + ";",\n  "background-color: " + smallBoxBg + ";",\n"}",\n"QLabel {",\n  "background: transparent;",\n"}",\n"QMainWindow, XDialog, XWidget {",\n  "background: " + windowBg + ";",\n"}",\n"QMainWindow QMainWindow, QMainWindow XWidget {",\n  "background: " + layeredWindowBg + ";",\n"}",\n"QMenuBar::item:selected {",\n  "background: " + selectedBg + ";",\n  "selection-background-color:" + smallBoxBg + ";",\n"}",\n"QMenuBar::item:pressed {",\n  "background: " + selectedBg + ";", \n  "color: "      + selectedFg + ";",\n  "border-left:  1px solid " + bigBoxBorderColor + ";",\n  "border-right: 1px solid " + bigBoxBorderColor + ";",\n"}",\n"QMenuBar::item:hover {",\n  "color: " + selectedFg + ";",\n"}",\n"QPushButton {",\n  "border-radius: " + borderRadius + ";",\n  "border:  1px solid " + bigBoxBorderColor + ";",\n  "margin:  0.75ex;",\n  "padding: 0.50ex;",\n"}",\n"QPushButton:default {",\n  "color:" + selectedFg + ";",\n  "border:  1px solid " + bigBoxBorderColor + ";",\n"}",\n"QPushButton:hover {",\n  "color: "            + selectedFg + ";",\n  "background-color: " + selectedBg + ";",\n  "border-color: "     + selectedFg + ";",\n  "border-width: 2px;",\n"}",\n"QPushButton:pressed {",\n  "color: "            + selectedBg + ";",\n  "background-color: " + selectedFg + ";",\n"}",\n"QRadioButton {",\n  "margin: " + multiButtonMargin + ";",\n"}",\n"QRadioButton::indicator {",\n  "background-color: " + bigBoxBorderColor + ";",\n  "width: 10px;",\n  "height: 10px;",\n"}",\n"QRadioButton::indicator::unchecked {",\n  "background-color: " + selectedBg + ";",\n  "border: 2px solid " + bigBoxBorderColor + ";",\n  "border-radius: 7px;",\n"}",\n"QRadioButton::indicator:unchecked:hover {",\n  "background-color: " + selectedFg + ";",\n  "border: 2px solid " + selectedBg + ";",  \n  "border-radius: 7px;",\n"}",\n"QRadioButton::indicator:unchecked:pressed {",\n  "background-color: " + selectedFg + ";",\n  "border: 2px solid " + smallBoxBg + ";",\n  "border-radius: 7px;",\n"}",\n"QRadioButton::indicator::checked {",\n  "background-color: " + selectedFg + ";",\n  "border: 2px solid " + selectedBg + ";",\n  "border-radius: 7px;",\n"}",\n"QRadioButton::indicator:checked:hover {",\n  "background-color: " + selectedFg + ";",\n  "border: 2px solid " + selectedBg + ";",\n  "border-radius: 7px;",\n"}",\n"QRadioButton::indicator:checked:pressed {",\n  "background-color: " + selectedFg + ";",\n  "border: 2px solid " + selectedBg + ";",\n  "border-radius: 7px;",\n"}",\n"QTextEdit, QPlainTextEdit {",\n "font-family: courier new, courier, monospace;",\n"}",\n"QTextEdit:focus, QPlainTextEdit:focus {",\n  "border: 2px solid " + selectedFg + ";",\n"}",\n"QToolBar {",\n  "background: "       + toolbarBg + ";",\n  "color: "            + selectedFg + ";",\n  "border: 1px solid " + smallBoxBorderColor + ";",\n"}",\n"QToolBar::separator {",\n  "color: "            + selectedFg + ";",\n  "background-color: " + selectedBg + ";",\n  "image: none;",\n  "border: 1px solid " + bigBoxBorderColor + ";",\n  "width: 0px;",\n"}",\n"QToolBar::handle {",\n  "background-color: " + bigBoxBorderColor + ";",\n  "border: 1px solid " + bigBoxBorderColor + ";",\n  "image: none;",\n  "width: 2px;",\n  "height: 2px;",\n"}",\n"QToolButton {",\n  "background-color: transparent;",\n  "selection-color: " + selectedFg + ";",\n"}",\n"QToolButton:hover {",\n  "border-top: none;",\n  "border-left: none;",\n  "border-right: none;",\n  "border-bottom: 1px solid " + selectedFg + ";",\n"}",\n"QToolButton:on {",\n  "border: 1px solid " + selectedFg + ";",\n  "selection-color: " + selectedFg + ";",\n  "color: " + selectedFg + ";",\n"}",\n\n"ParameterWidget QToolButton {",\n  "border-radius: " + borderRadius + ";",\n  "border:  1px solid " + bigBoxBorderColor + ";",\n  "margin:  0.75ex;",\n  "padding: 0.50ex;",\n"}",\n"ParameterWidget QToolButton:default {",\n  "color:" + selectedFg + ";",\n  "border:  1px solid " + smallBoxBorderColor + ";",\n"}",\n"ParameterWidget QToolButton:hover {",\n  "border:  1px solid " + selectedFg + ";",\n  "background-color: "  + selectedBg + ";",\n"}",\n"ParameterWidget QToolButton:pressed {",\n  "color: "            + selectedBg + ";",\n  "background-color: " + selectedFg + ";",\n"}",\n\n"QTreeView::item:selected QWidget {",\n  "min-height: 16px;",\n"}",\n"QTreeView QScrollBar:horizontal {",\n  "min-height: 10px;",\n  "height: 10px;",\n"}",\n\n"QTreeView::item:selected QComboBox {",\n  "color: " + selectedFg + ";",\n  "font-size: " + generalFontSize + ";",\n  "min-height: 15pt;", // generalFontSize + a bit\n  "padding: 1px;",\n  "margin: 0px;",\n"}",\n\n"QTreeWidget  {",\n  "selection-background-color: transparent;",\n"}"\n].join(" ");\n\nvar desktopStyle = generalStyle +\n[ "QTreeView {",\n    "border-style: none;",\n  "}",\n  "QPushButton {",\n    "border: none;",\n  "}",\n  "QWidget#dockWidgetContents QPushButton#_send {",\n    "border-radius: " + borderRadius + ";",\n    "border:  1px solid " + bigBoxBorderColor + ";",\n    "margin:  0.75ex;",\n    "padding: 0.50ex;",\n  "}",\n  "QHeaderView::section {",\n    "background-color: transparent;",\n  "}",\n].join(" ");\n\ntry {\n  if (! preferences.boolean("xtdesktop/useNativeStyle")) {\n    QApplication.setStyleSheet(generalStyle);\n  }\n} catch(e) {\n  QMessageBox.critical(mainwindow, "QApplication Error", e.message);\n}\n	
132	systemMessage	0	t	//debugger;\n\nvar _save  = mywindow.findChild("_save");\nvar layout = toolbox.widgetGetLayout(_save);\nvar _user  = mywindow.findChild("_user");\n\nvar _reply = toolbox.createWidget("QPushButton", mywindow, "_reply");\n_reply.text = qsTr("Reply");\nlayout.insertWidget(0, _reply);\n\n_reply.clicked.connect(sendReply);\n\nfunction sendReply() \n{\n  var params = new Object;\n  params.user = _user.text;\n\n  var newwnd = toolbox.openWindow("sendMessageToUser", mywindow, Qt.ApplicationModal, Qt.Dialog);\n  toolbox.lastWindow().set(params);\n  newwnd.exec();\n  mydialog.sClose();\n}\n	
92	task	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\ninclude("dockMyTodo");\n\n// Connect this window so that the To Do dock list gets updated\nmydialog.finished.connect(fillListToDo);\n	
93	todoItem	0	t	/*\n * This file is part of the xTuple ERP: PostBooks Edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\ninclude("dockMyTodo");\n\n// Connect this window so that the To Do dock list gets updated\nmydialog.finished.connect(fillListToDo);\n	
94	userPreferences	0	t	/*\n * This file is part of the xtdesktop package for xTuple ERP: PostBooks edition, a free and\n * open source Enterprise Resource Planning software suite,\n * Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\n * It is licensed to you under the Common Public Attribution License\n * version 1.0, the full text of which (including xTuple-specific Exhibits)\n * is available at www.xtuple.com/CPAL.  By using this software, you agree\n * to be bound by its terms.\n */\n\n(function () {\n  var _buttonBox      = mywindow.findChild("_buttonBox"),\n      _interfaceWorkspace = mywindow.findChild("_interfaceWorkspace"),\n      _layout         = toolbox.widgetGetLayout(_interfaceWorkspace),\n      _useNativeStyle = toolbox.createWidget("QCheckBox", mywindow, "_useNativeStyle"),\n      _prefs          = preferences,\n      _selectedUser   = mywindow.findChild("_selectedUser"),\n      _user           = mywindow.findChild("_user")\n  ;\n\n  _buttonBox.accepted.connect(save);\n  _interfaceWorkspace.toggled.connect(desktopNotice);\n  _user["newID(int)"].connect(sUserChanged);\n\n  if (_prefs.value("xtdesktop/useNativeStyle").length) {\n    _useNativeStyle.checked = _prefs.boolean("xtdesktop/useNativeStyle");\n  }\n  \n  _layout.addWidget(_useNativeStyle, 2, 1);\n  _useNativeStyle.text = qsTr("Use Native Application Styling");\n\n  function desktopNotice()\n  {\n    if (_interfaceWorkspace.checked &&\n        !preferences.boolean("NoDesktopNotice"))\n      toolbox.openWindow("desktopNotice", mywindow, Qt.WindowModal, Qt.Dialog);\n  }\n\n  function save()\n  {\n    if (_selectedUser.checked) {\n      toolbox.executeQuery("select setUserPreference(<? value('user') ?>,"\n                                               + " 'xtdesktop/useNativeStyle',"\n                                               + " <? value('bool') ?>);",\n                          { user: _user.text,\n                            bool: (_useNativeStyle.checked ? 't' : 'f') });\n    } else\n      _prefs.set("xtdesktop/useNativeStyle", _useNativeStyle.checked);\n  }\n\n  function sUserChanged(id)\n  {\n    var q;\n    if (_selectedUser.checked && _user.isValid()) {\n      q = toolbox.executeQuery("select usrpref_value from usrpref"\n                             + " where usrpref_name = 'xtdesktop/useNativeStyle'"\n                             + "   and usrpref_username = <? value('user') ?>;",\n                               { user: _user.text });\n      if (q.first()) {\n        _useNativeStyle.checked = (q.value("usrpref_value") == 't');\n      } else if (q.lastError().type != QSqlError.NoError) {\n        QMessageBox.critical(mywindow, qsTr("Error"), q.lastError().text);\n      } else {\n        _useNativeStyle.checked = false;\n      }\n    }\n  }\n\n})();\n	
\.


--
-- Data for Name: pkguiform; Type: TABLE DATA; Schema: xtdesktop; Owner: admin
--

COPY pkguiform (uiform_id, uiform_name, uiform_order, uiform_enabled, uiform_source, uiform_notes) FROM stdin;
35	desktopAccounting	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <comment>This file is part of the xtdesktop package for xTuple ERP: PostBooks Edition, a free and\nopen source Enterprise Resource Planning software suite,\nCopyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\nIt is licensed to you under the Common Public Attribution License\nversion 1.0, the full text of which (including xTuple-specific Exhibits)\nis available at www.xtuple.com/CPAL.  By using this software, you agree\nto be bound by its terms.</comment>\n <class>desktopAccounting</class>\n <widget class="QMainWindow" name="desktopAccounting">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>876</width>\n    <height>554</height>\n   </rect>\n  </property>\n  <property name="windowTitle">\n   <string>Accounting</string>\n  </property>\n  <property name="documentMode">\n   <bool>true</bool>\n  </property>\n  <property name="dockOptions">\n   <set>QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks</set>\n  </property>\n  <widget class="QWidget" name="centralwidget">\n   <layout class="QGridLayout" name="gridLayout">\n    <item row="0" column="0">\n     <widget class="QLabel" name="desktopAccountingLit">\n      <property name="font">\n       <font>\n        <pointsize>14</pointsize>\n        <weight>75</weight>\n        <bold>true</bold>\n       </font>\n      </property>\n      <property name="text">\n       <string>Accounting</string>\n      </property>\n     </widget>\n    </item>\n    <item row="1" column="0" rowspan="2">\n     <widget class="QGroupBox" name="_apGroup">\n      <property name="title">\n       <string>Payables</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_7">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_apAging">\n         <property name="image">\n          <string notr="true">taxes_clock_48</string>\n         </property>\n         <property name="label">\n          <string>Aging</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">ap.dspAPAging</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="0">\n        <widget class="MenuButton" name="_apWorkbench">\n         <property name="image">\n          <string notr="true">check_write_48</string>\n         </property>\n         <property name="label">\n          <string>Workbench</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">ap.workbench</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string>dspBillingSelections</string>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="2" column="0">\n        <widget class="MenuButton" name="_vendorWorkbench">\n         <property name="image">\n          <string notr="true">customers_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Vendor</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">po.vendorWorkBench</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="1" column="1" rowspan="2">\n     <widget class="QGroupBox" name="_arGroup">\n      <property name="title">\n       <string>Receivables</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_6">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_arAging">\n         <property name="image">\n          <string notr="true">collection_account_clock_48</string>\n         </property>\n         <property name="label">\n          <string>Aging</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">ar.dspARAging</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="0">\n        <widget class="MenuButton" name="_arWorkbench">\n         <property name="image">\n          <string notr="true">collection_account_write_48</string>\n         </property>\n         <property name="label">\n          <string>Workbench</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">ar.arWorkBench</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string>dspBillingSelections</string>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="2" column="0">\n        <widget class="MenuButton" name="_customerWorkbench">\n         <property name="image">\n          <string notr="true">customers_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Customer</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.customerWorkbench</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="1" column="2">\n     <widget class="QGroupBox" name="_glGroup">\n      <property name="title">\n       <string>General Ledger</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_3">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="2">\n        <widget class="MenuButton" name="_chartOfAccounts">\n         <property name="image">\n          <string notr="true">company_write_48</string>\n         </property>\n         <property name="label">\n          <string>Chart of Accounts</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">gl.accountNumbers</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="4">\n        <widget class="MenuButton" name="_budget">\n         <property name="image">\n          <string notr="true">reward_write_48</string>\n         </property>\n         <property name="label">\n          <string>Budget</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">gl.maintainBudgets</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="4">\n        <widget class="MenuButton" name="_standardJournal">\n         <property name="image">\n          <string notr="true">accounting_write_48</string>\n         </property>\n         <property name="label">\n          <string>Standard Journal</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">gl.listStandardJournals</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="2">\n        <widget class="MenuButton" name="_journalSeries">\n         <property name="image">\n          <string notr="true">accounting_ok_48</string>\n         </property>\n         <property name="label">\n          <string>Journal Series</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">gl.unpostedEntries</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="1" column="3">\n     <widget class="QGroupBox" name="_bankGroup">\n      <property name="title">\n       <string>Bank Accounts</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_4">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_bankAdjustment">\n         <property name="image">\n          <string notr="true">bank_write_48</string>\n         </property>\n         <property name="label">\n          <string>Adjustment</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">gl.adjustmentEditList</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="0">\n        <widget class="MenuButton" name="_bankReconcile">\n         <property name="image">\n          <string notr="true">bank_ok_48</string>\n         </property>\n         <property name="label">\n          <string>Reconcile</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">gl.reconcileBankaccnt</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="2" column="2" colspan="2">\n     <widget class="QGroupBox" name="_reportGroup">\n      <property name="title">\n       <string>Reporting</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_5">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="2">\n        <widget class="MenuButton" name="_financialStatements">\n         <property name="image">\n          <string notr="true">spreadsheet_48</string>\n         </property>\n         <property name="label">\n          <string>Financial Statements</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">gl.viewFinancialReport</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="1">\n        <widget class="MenuButton" name="_trialBalance">\n         <property name="image">\n          <string notr="true">balance_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Trial Balance</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">gl.dspTrialBalances</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_glTransactions">\n         <property name="image">\n          <string notr="true">accounting_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Transactions</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">gl.dspGLTransactions</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n   </layout>\n  </widget>\n  <widget class="QDockWidget" name="_dockBankBal">\n   <property name="windowTitle">\n    <string>Bank Accounts</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>1</number>\n   </attribute>\n   <widget class="QWidget" name="_dockBankBalContents">\n    <layout class="QGridLayout" name="gridLayout_9">\n     <property name="margin">\n      <number>0</number>\n     </property>\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_bankBal">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n  <widget class="QDockWidget" name="_dockPayables">\n   <property name="windowTitle">\n    <string>Payables</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>1</number>\n   </attribute>\n   <widget class="QWidget" name="_dockPayablesContents">\n    <layout class="QGridLayout" name="gridLayout_2">\n     <property name="margin">\n      <number>0</number>\n     </property>\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_ap">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n  <widget class="QDockWidget" name="_dockReceivables">\n   <property name="windowTitle">\n    <string>Receivables</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>1</number>\n   </attribute>\n   <widget class="QWidget" name="_dockReceivablesContents">\n    <layout class="QGridLayout" name="gridLayout_8">\n     <property name="margin">\n      <number>0</number>\n     </property>\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_ar">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n  <widget class="QDockWidget" name="_dockGLAccounts">\n   <property name="windowTitle">\n    <string>Monitored Accounts</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>8</number>\n   </attribute>\n   <widget class="QWidget" name="_dockGlContents">\n    <layout class="QGridLayout" name="gridLayout_10">\n     <property name="leftMargin">\n      <number>0</number>\n     </property>\n     <property name="topMargin">\n      <number>0</number>\n     </property>\n     <property name="rightMargin">\n      <number>0</number>\n     </property>\n     <property name="bottomMargin">\n      <number>3</number>\n     </property>\n     <property name="verticalSpacing">\n      <number>3</number>\n     </property>\n     <item row="0" column="0" colspan="4">\n      <widget class="XTreeWidget" name="_glAccounts">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="2">\n      <widget class="QPushButton" name="_button1">\n       <property name="maximumSize">\n        <size>\n         <width>16</width>\n         <height>16</height>\n        </size>\n       </property>\n       <property name="text">\n        <string>b</string>\n       </property>\n       <property name="flat">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="3">\n      <widget class="QPushButton" name="_button2">\n       <property name="maximumSize">\n        <size>\n         <width>16</width>\n         <height>16</height>\n        </size>\n       </property>\n       <property name="text">\n        <string>b</string>\n       </property>\n       <property name="flat">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="1">\n      <spacer name="horizontalSpacer_2">\n       <property name="orientation">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name="sizeHint" stdset="0">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>MenuButton</class>\n   <extends>QWidget</extends>\n   <header>menubutton.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XTreeWidget</class>\n   <extends>QTreeWidget</extends>\n   <header>xtreewidget.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n	
36	desktopCRM	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <comment>This file is part of the xtdesktop package for xTuple ERP: PostBooks Edition, a free and\nopen source Enterprise Resource Planning software suite,\nCopyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\nIt is licensed to you under the Common Public Attribution License\nversion 1.0, the full text of which (including xTuple-specific Exhibits)\nis available at www.xtuple.com/CPAL.  By using this software, you agree\nto be bound by its terms.</comment>\n <class>desktopCRM</class>\n <widget class="QMainWindow" name="desktopCRM">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>893</width>\n    <height>554</height>\n   </rect>\n  </property>\n  <property name="windowTitle">\n   <string>CRM</string>\n  </property>\n  <property name="documentMode">\n   <bool>true</bool>\n  </property>\n  <property name="dockNestingEnabled">\n   <bool>true</bool>\n  </property>\n  <widget class="QWidget" name="centralwidget">\n   <layout class="QGridLayout" name="gridLayout_4">\n    <item row="0" column="0" colspan="3">\n     <widget class="QLabel" name="desktopCollaborateLit">\n      <property name="font">\n       <font>\n        <pointsize>14</pointsize>\n        <weight>75</weight>\n        <bold>true</bold>\n       </font>\n      </property>\n      <property name="text">\n       <string>Corporate Relationship Management</string>\n      </property>\n     </widget>\n    </item>\n    <item row="1" column="0" rowspan="2">\n     <widget class="QGroupBox" name="_personalGroup">\n      <property name="title">\n       <string>Personal</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_6">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="2" column="0">\n        <widget class="MenuButton" name="_eventManager">\n         <property name="image">\n          <string notr="true">lamp_48</string>\n         </property>\n         <property name="label">\n          <string>Event Manager</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sys.eventManager</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="0">\n        <widget class="MenuButton" name="_todoCalendar">\n         <property name="image">\n          <string notr="true">calendar_month_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>To Do Calendar</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">crm.todoListCalendar</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_todo">\n         <property name="image">\n          <string notr="true">notepad_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>To Do List</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">crm.todoList</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="1" column="1" rowspan="2">\n     <widget class="QGroupBox" name="_corporateGroup">\n      <property name="title">\n       <string>Corporate</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_7">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_accounts">\n         <property name="image">\n          <string notr="true">clients_48</string>\n         </property>\n         <property name="label">\n          <string>Accounts</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">crm.crmaccounts</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="0">\n        <widget class="MenuButton" name="_contacts">\n         <property name="image">\n          <string notr="true">execute_48</string>\n         </property>\n         <property name="label">\n          <string>Contacts</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">crm.contacts</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="3" column="0">\n        <widget class="MenuButton" name="_addresses">\n         <property name="image">\n          <string notr="true">book_48</string>\n         </property>\n         <property name="label">\n          <string>Address Book</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">crm.addresses</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="1" column="2">\n     <widget class="QGroupBox" name="_preSalesGroup">\n      <property name="title">\n       <string>Pre-Sales</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_3">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="1" column="2">\n        <widget class="MenuButton" name="_prospects">\n         <property name="image">\n          <string notr="true">customers_help_48</string>\n         </property>\n         <property name="label">\n          <string>Prospects</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.prospects</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="3" column="2">\n        <widget class="MenuButton" name="_quotes">\n         <property name="image">\n          <string notr="true">order_help_48</string>\n         </property>\n         <property name="label">\n          <string>Quotes</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.listQuotes</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="3" column="4">\n        <widget class="MenuButton" name="_quotesByItem">\n         <property name="image">\n          <string notr="true">order_search_48</string>\n         </property>\n         <property name="label">\n          <string>Quotes by Item</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.dspQuoteOrderLookupByItem</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="4">\n        <widget class="MenuButton" name="_opportunities">\n         <property name="image">\n          <string notr="true">money_bag_write_48</string>\n         </property>\n         <property name="label">\n          <string>Opportunities</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">crm.listOpportunity</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string>dspBillingSelections</string>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="1" column="3" rowspan="2">\n     <widget class="QGroupBox" name="_projectGroup">\n      <property name="title">\n       <string>Project</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_projects">\n         <property name="image">\n          <string notr="true">spreadsheet_48</string>\n         </property>\n         <property name="label">\n          <string>Projects</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">pm.projects</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="0">\n        <widget class="MenuButton" name="_timeSheets">\n         <property name="image">\n          <string notr="true">time_sheet_write_48</string>\n         </property>\n         <property name="label">\n          <string>Time &amp; Expense</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">pm.teSheets</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="2" column="0">\n        <widget class="MenuButton" name="_projectOrders">\n         <property name="image">\n          <string notr="true">spreadsheet_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Project Orders</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">pm.dspOrderActivityByProject</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="2" column="2">\n     <widget class="QGroupBox" name="_accountGroup">\n      <property name="title">\n       <string>Account Management</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_2">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="1">\n        <widget class="MenuButton" name="_customer">\n         <property name="image">\n          <string notr="true">customers_48</string>\n         </property>\n         <property name="label">\n          <string>Customer Workbench</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.customerWorkbench</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_incidents">\n         <property name="image">\n          <string notr="true">chat_48</string>\n         </property>\n         <property name="label">\n          <string>Incidents</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">crm.incidentList</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n   </layout>\n  </widget>\n  <widget class="QDockWidget" name="_dockMytodo">\n   <property name="windowTitle">\n    <string>To Do</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>8</number>\n   </attribute>\n   <widget class="QWidget" name="_dockTodoContents">\n    <layout class="QGridLayout" name="gridLayout_10">\n     <property name="margin">\n      <number>0</number>\n     </property>\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_todoList">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n  <widget class="QDockWidget" name="_dockMycontacts">\n   <property name="windowTitle">\n    <string>My Contacts</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>1</number>\n   </attribute>\n   <widget class="QWidget" name="_dockMycontactsContents">\n    <layout class="QGridLayout" name="gridLayout_8">\n     <property name="margin">\n      <number>0</number>\n     </property>\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_contactList">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n  <widget class="QDockWidget" name="_dockMyaccounts">\n   <property name="windowTitle">\n    <string>My Accounts</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>1</number>\n   </attribute>\n   <widget class="QWidget" name="_dockMyaccountsContent">\n    <layout class="QGridLayout" name="gridLayout_9">\n     <property name="margin">\n      <number>0</number>\n     </property>\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_accountList">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>MenuButton</class>\n   <extends>QWidget</extends>\n   <header>menubutton.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XTreeWidget</class>\n   <extends>QTreeWidget</extends>\n   <header>xtreewidget.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n	
37	desktopMaintenance	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <comment>This file is part of the xtdesktop package for xTuple ERP: PostBooks Edition, a free and\nopen source Enterprise Resource Planning software suite,\nCopyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\nIt is licensed to you under the Common Public Attribution License\nversion 1.0, the full text of which (including xTuple-specific Exhibits)\nis available at www.xtuple.com/CPAL.  By using this software, you agree\nto be bound by its terms.</comment>\n <class>desktopMaintenance</class>\n <widget class="QMainWindow" name="desktopMaintenance">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>905</width>\n    <height>563</height>\n   </rect>\n  </property>\n  <property name="windowTitle">\n   <string>Maintenance</string>\n  </property>\n  <property name="documentMode">\n   <bool>true</bool>\n  </property>\n  <property name="dockOptions">\n   <set>QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks</set>\n  </property>\n  <widget class="QWidget" name="centralwidget">\n   <layout class="QGridLayout" name="gridLayout_3">\n    <item row="0" column="0">\n     <widget class="QLabel" name="desktopAccountingLit">\n      <property name="font">\n       <font>\n        <family>Open Sans,Helvetica,Verdana,sans-serif</family>\n        <pointsize>-1</pointsize>\n        <weight>25</weight>\n        <bold>false</bold>\n       </font>\n      </property>\n      <property name="text">\n       <string>Maintenance</string>\n      </property>\n     </widget>\n    </item>\n    <item row="1" column="0">\n     <widget class="QGroupBox" name="_productsGroup">\n      <property name="title">\n       <string>Products</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_7">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_items">\n         <property name="image">\n          <string notr="true">inventory_categories_48</string>\n         </property>\n         <property name="label">\n          <string>Items</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">pd.listItems</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="2" column="0">\n        <widget class="MenuButton" name="_bom">\n         <property name="image">\n          <string notr="true">inventory_write_48</string>\n         </property>\n         <property name="label">\n          <string>Bill of Materials</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">pd.listBOMs</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="0">\n        <layout class="QHBoxLayout" name="horizontalLayout_4">\n         <item>\n          <spacer name="horizontalSpacer_7">\n           <property name="orientation">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name="sizeHint" stdset="0">\n            <size>\n             <width>0</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item>\n          <widget class="XLabel" name="_arrow_1">\n           <property name="image">\n            <string notr="true">ImgDownArrow</string>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name="horizontalSpacer_8">\n           <property name="orientation">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name="sizeHint" stdset="0">\n            <size>\n             <width>0</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n        </layout>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="1" column="1">\n     <widget class="QGroupBox" name="_inventoryGroup">\n      <property name="title">\n       <string>Inventory</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_6">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_sites">\n         <property name="image">\n          <string notr="true">store_house_48</string>\n         </property>\n         <property name="label">\n          <string>Site</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">im.warehouse</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="2" column="0">\n        <widget class="MenuButton" name="_locations">\n         <property name="image">\n          <string notr="true">cabinet_48</string>\n         </property>\n         <property name="label">\n          <string>Locations</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">im.warehousesLocations</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string>dspBillingSelections</string>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="0">\n        <layout class="QHBoxLayout" name="horizontalLayout_5">\n         <item>\n          <spacer name="horizontalSpacer_9">\n           <property name="orientation">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name="sizeHint" stdset="0">\n            <size>\n             <width>0</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item>\n          <widget class="XLabel" name="_arrow_2">\n           <property name="image">\n            <string notr="true">ImgDownArrow</string>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name="horizontalSpacer_10">\n           <property name="orientation">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name="sizeHint" stdset="0">\n            <size>\n             <width>0</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n        </layout>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="1" column="2">\n     <widget class="QGroupBox" name="_pricingGroup">\n      <property name="title">\n       <string>Pricing</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_priceSchedules">\n         <property name="image">\n          <string notr="true">reward_clock_48</string>\n         </property>\n         <property name="label">\n          <string>Schedules</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.pricingSchedules</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="2" column="0">\n        <widget class="MenuButton" name="_priceSchedAssignments">\n         <property name="image">\n          <string notr="true">customers_write_48</string>\n         </property>\n         <property name="label">\n          <string>Assignments</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.pricingScheduleAssignments</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="0">\n        <layout class="QHBoxLayout" name="horizontalLayout">\n         <item>\n          <spacer name="horizontalSpacer_2">\n           <property name="orientation">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name="sizeHint" stdset="0">\n            <size>\n             <width>0</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item>\n          <widget class="XLabel" name="_arrow_3">\n           <property name="image">\n            <string notr="true">ImgDownArrow</string>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name="horizontalSpacer">\n           <property name="orientation">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name="sizeHint" stdset="0">\n            <size>\n             <width>0</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n        </layout>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="1" column="3">\n     <widget class="QGroupBox" name="_securityGroup">\n      <property name="title">\n       <string>Security</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_4">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="2" column="0">\n        <widget class="MenuButton" name="_users">\n         <property name="image">\n          <string notr="true">user_48</string>\n         </property>\n         <property name="label">\n          <string>Users</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sys.maintainUsers</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_roles">\n         <property name="image">\n          <string notr="true">group_48</string>\n         </property>\n         <property name="label">\n          <string>Roles</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sys.maintainGroups</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="0">\n        <layout class="QHBoxLayout" name="horizontalLayout_2">\n         <item>\n          <spacer name="horizontalSpacer_3">\n           <property name="orientation">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name="sizeHint" stdset="0">\n            <size>\n             <width>0</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item>\n          <widget class="XLabel" name="_arrow_4">\n           <property name="image">\n            <string notr="true">ImgDownArrow</string>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name="horizontalSpacer_4">\n           <property name="orientation">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name="sizeHint" stdset="0">\n            <size>\n             <width>0</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n        </layout>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="1" column="4">\n     <widget class="QGroupBox" name="_currencyGroup">\n      <property name="title">\n       <string>Currency</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_8">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_currencies">\n         <property name="image">\n          <string notr="true">coin_48</string>\n         </property>\n         <property name="label">\n          <string>Currencies</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sys.currencies</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="2" column="0">\n        <widget class="MenuButton" name="_exchangeRates">\n         <property name="image">\n          <string>coin_clock_48</string>\n         </property>\n         <property name="label">\n          <string>Exchange Rates</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sys.exchangeRates</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="0">\n        <layout class="QHBoxLayout" name="horizontalLayout_3">\n         <item>\n          <spacer name="horizontalSpacer_5">\n           <property name="orientation">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name="sizeHint" stdset="0">\n            <size>\n             <width>0</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item>\n          <widget class="XLabel" name="_arrow_5">\n           <property name="image">\n            <string notr="true">ImgDownArrow</string>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name="horizontalSpacer_6">\n           <property name="orientation">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name="sizeHint" stdset="0">\n            <size>\n             <width>0</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n        </layout>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="2" column="0" colspan="5">\n     <widget class="QGroupBox" name="_designGroup">\n      <property name="title">\n       <string>Design</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_5">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="5">\n        <widget class="MenuButton" name="_commands">\n         <property name="image">\n          <string notr="true">calculation_write_48</string>\n         </property>\n         <property name="label">\n          <string>Commands</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sys.customCommands</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="4">\n        <widget class="MenuButton" name="_scripts">\n         <property name="image">\n          <string notr="true">script_write_48</string>\n         </property>\n         <property name="label">\n          <string>Scripts</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sys.scripts</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="3">\n        <widget class="MenuButton" name="_screens">\n         <property name="image">\n          <string notr="true">window_write_48</string>\n         </property>\n         <property name="label">\n          <string>Screens</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sys.uiforms</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="1">\n        <widget class="MenuButton" name="_reports">\n         <property name="image">\n          <string notr="true">spreadsheet_write_48</string>\n         </property>\n         <property name="label">\n          <string>Reports</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sys.reports</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_metasql">\n         <property name="image">\n          <string notr="true">export_database_write_48</string>\n         </property>\n         <property name="label">\n          <string>MetaSQL</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sys.metasqls</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n   </layout>\n  </widget>\n  <widget class="QDockWidget" name="_dockExtensions">\n   <property name="windowTitle">\n    <string>Extensions</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>1</number>\n   </attribute>\n   <widget class="QWidget" name="_dockExtensionsContents">\n    <layout class="QGridLayout" name="gridLayout_9">\n     <property name="margin">\n      <number>0</number>\n     </property>\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_extensions">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>MenuButton</class>\n   <extends>QWidget</extends>\n   <header>menubutton.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XLabel</class>\n   <extends>QLabel</extends>\n   <header>xlabel.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XTreeWidget</class>\n   <extends>QTreeWidget</extends>\n   <header>xtreewidget.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n	
38	desktopManufacture	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <comment>This file is part of the xtdesktop package for xTuple ERP: PostBooks Edition, a free and\nopen source Enterprise Resource Planning software suite,\nCopyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\nIt is licensed to you under the Common Public Attribution License\nversion 1.0, the full text of which (including xTuple-specific Exhibits)\nis available at www.xtuple.com/CPAL.  By using this software, you agree\nto be bound by its terms.</comment>\n <class>desktopManufacture</class>\n <widget class="QMainWindow" name="desktopManufacture">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>882</width>\n    <height>554</height>\n   </rect>\n  </property>\n  <property name="windowTitle">\n   <string>Manufacture</string>\n  </property>\n  <property name="documentMode">\n   <bool>true</bool>\n  </property>\n  <property name="dockNestingEnabled">\n   <bool>true</bool>\n  </property>\n  <widget class="QWidget" name="centralwidget">\n   <layout class="QGridLayout" name="gridLayout">\n    <item row="0" column="0">\n     <widget class="QLabel" name="desktopManufactureLit">\n      <property name="font">\n       <font>\n        <pointsize>14</pointsize>\n        <weight>75</weight>\n        <bold>true</bold>\n       </font>\n      </property>\n      <property name="text">\n       <string>Manufacture</string>\n      </property>\n     </widget>\n    </item>\n    <item row="1" column="0">\n     <widget class="QGroupBox" name="_planGroup">\n      <property name="title">\n       <string>Plan</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_6">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_inventoryAvail">\n         <property name="image">\n          <string notr="true">inventory_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Inventory Availability</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">im.dspInventoryAvailability</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="1">\n        <widget class="XLabel" name="_arrow_1">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="2">\n        <widget class="MenuButton" name="_newWo">\n         <property name="image">\n          <string notr="true">industry_add_48</string>\n         </property>\n         <property name="label">\n          <string>Create Work Order</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.newWorkOrder</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="3">\n        <widget class="XLabel" name="_arrow_2">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="4">\n        <widget class="MenuButton" name="_maintainMaterial">\n         <property name="image">\n          <string notr="true">availability_write_48</string>\n         </property>\n         <property name="label">\n          <string>Material Requirements</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.maintainWoMaterialRequirements</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="5">\n        <widget class="XLabel" name="_arrow_3">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="8">\n        <widget class="MenuButton" name="_releaseWo">\n         <property name="image">\n          <string notr="true">industry_next_48</string>\n         </property>\n         <property name="label">\n          <string>Release</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.releaseWorkOrdersByPlannerCode</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="6">\n        <widget class="MenuButton" name="_printWo">\n         <property name="image">\n          <string notr="true">printer_48</string>\n         </property>\n         <property name="label">\n          <string>Print</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.printTraveler</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="7">\n        <widget class="XLabel" name="_arrow_4">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="2" column="0">\n     <widget class="QGroupBox" name="_processGroup">\n      <property name="title">\n       <string>Process</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_5">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="5">\n        <widget class="XLabel" name="_arrow_6">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="12">\n        <widget class="XLabel" name="_arrow_8">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="4">\n        <widget class="MenuButton" name="_issueMatl">\n         <property name="image">\n          <string notr="true">barcode_ok_48</string>\n         </property>\n         <property name="label">\n          <string>Issue Material</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.issueWoMaterialItem</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="13">\n        <widget class="MenuButton" name="_closeWo">\n         <property name="image">\n          <string notr="true">industry_close_48</string>\n         </property>\n         <property name="label">\n          <string>Close Work Order</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.closeWorkOrder</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="4">\n        <widget class="MenuButton" name="_returnMatl">\n         <property name="image">\n          <string notr="true">barcode_back_48</string>\n         </property>\n         <property name="label">\n          <string>Return Material</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.returnWoMaterialItem</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="2">\n        <widget class="XLabel" name="_arrow_5">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="8">\n        <widget class="XLabel" name="_arrow_7">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="9">\n        <widget class="MenuButton" name="_woCost">\n         <property name="image">\n          <string notr="true">coin_stack_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Costing</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.dspJobCosting</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="13">\n        <widget class="MenuButton" name="_woHistory">\n         <property name="image">\n          <string notr="true">history_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>History</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.dspWoHistoryByClassCode</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="6">\n        <widget class="MenuButton" name="_postProduction">\n         <property name="image">\n          <string notr="true">industry_ok_48</string>\n         </property>\n         <property name="label">\n          <string>Post Production</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.postProduction</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="9">\n        <widget class="MenuButton" name="_scrap">\n         <property name="image">\n          <string notr="true">trash_ok_48</string>\n         </property>\n         <property name="label">\n          <string>Post Scrap</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.scrapWoMaterialFromWo</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="1">\n        <widget class="MenuButton" name="_workOrderSchedule">\n         <property name="image">\n          <string notr="true">industry_clock_48</string>\n         </property>\n         <property name="label">\n          <string>Order Schedule</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.dspWoSchedule</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="1">\n        <widget class="MenuButton" name="_woAvail">\n         <property name="image">\n          <string notr="true">availability_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Material Availability</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.dspInventoryAvailabilityByWorkOrder</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="6">\n        <widget class="MenuButton" name="_correctProdPost">\n         <property name="image">\n          <string notr="true">industry_back_48</string>\n         </property>\n         <property name="label">\n          <string>Correct Production</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">wo.correctProductionPosting</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n   </layout>\n  </widget>\n  <widget class="QDockWidget" name="_dockMfgAct">\n   <property name="allowedAreas">\n    <set>Qt::AllDockWidgetAreas</set>\n   </property>\n   <property name="windowTitle">\n    <string>Manufacture Activities</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>1</number>\n   </attribute>\n   <widget class="QWidget" name="_dockMfgActContents">\n    <layout class="QGridLayout" name="gridLayout_3">\n     <property name="margin">\n      <number>0</number>\n     </property>\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_mfgAct">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n  <widget class="QDockWidget" name="_dockMfgHist">\n   <property name="windowTitle">\n    <string>Manufacture History</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>1</number>\n   </attribute>\n   <widget class="QWidget" name="_dockMfgHistContents">\n    <layout class="QGridLayout" name="gridLayout_2">\n     <property name="leftMargin">\n      <number>0</number>\n     </property>\n     <property name="topMargin">\n      <number>0</number>\n     </property>\n     <property name="rightMargin">\n      <number>0</number>\n     </property>\n     <property name="bottomMargin">\n      <number>3</number>\n     </property>\n     <property name="verticalSpacing">\n      <number>3</number>\n     </property>\n     <item row="0" column="0" colspan="3">\n      <widget class="XTreeWidget" name="_mfgHist">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="0">\n      <widget class="QLabel" name="_label">\n       <property name="sizePolicy">\n        <sizepolicy hsizetype="Expanding" vsizetype="Preferred">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name="text">\n        <string>label</string>\n       </property>\n       <property name="alignment">\n        <set>Qt::AlignCenter</set>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="1">\n      <widget class="QPushButton" name="_button1">\n       <property name="maximumSize">\n        <size>\n         <width>16</width>\n         <height>16</height>\n        </size>\n       </property>\n       <property name="text">\n        <string>b</string>\n       </property>\n       <property name="flat">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="2">\n      <widget class="QPushButton" name="_button2">\n       <property name="maximumSize">\n        <size>\n         <width>16</width>\n         <height>16</height>\n        </size>\n       </property>\n       <property name="text">\n        <string>b</string>\n       </property>\n       <property name="flat">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n  <widget class="QDockWidget" name="_dockMfgOpen">\n   <property name="allowedAreas">\n    <set>Qt::AllDockWidgetAreas</set>\n   </property>\n   <property name="windowTitle">\n    <string>Work Orders</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>8</number>\n   </attribute>\n   <widget class="QWidget" name="_dockMfgOpenContents">\n    <layout class="QGridLayout" name="gridLayout_4">\n     <property name="margin">\n      <number>0</number>\n     </property>\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_mfgOpen">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>MenuButton</class>\n   <extends>QWidget</extends>\n   <header>menubutton.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XLabel</class>\n   <extends>QLabel</extends>\n   <header>xlabel.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XTreeWidget</class>\n   <extends>QTreeWidget</extends>\n   <header>xtreewidget.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n	
40	desktopPurchase	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <comment>This file is part of the xtdesktop package for xTuple ERP: PostBooks Edition, a free and\nopen source Enterprise Resource Planning software suite,\nCopyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\nIt is licensed to you under the Common Public Attribution License\nversion 1.0, the full text of which (including xTuple-specific Exhibits)\nis available at www.xtuple.com/CPAL.  By using this software, you agree\nto be bound by its terms.</comment>\n <class>desktopPurchase</class>\n <widget class="QMainWindow" name="desktopPurchase">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>886</width>\n    <height>554</height>\n   </rect>\n  </property>\n  <property name="windowTitle">\n   <string>Purchase</string>\n  </property>\n  <property name="documentMode">\n   <bool>true</bool>\n  </property>\n  <property name="dockNestingEnabled">\n   <bool>true</bool>\n  </property>\n  <widget class="QWidget" name="centralwidget">\n   <layout class="QGridLayout" name="gridLayout">\n    <item row="0" column="0">\n     <widget class="QLabel" name="desktopPurchaseLit">\n      <property name="font">\n       <font>\n        <pointsize>14</pointsize>\n        <weight>75</weight>\n        <bold>true</bold>\n       </font>\n      </property>\n      <property name="text">\n       <string>Purchase</string>\n      </property>\n     </widget>\n    </item>\n    <item row="1" column="0" colspan="2">\n     <widget class="QGroupBox" name="_purchaseGroup">\n      <property name="title">\n       <string>Order</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_8">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="3">\n        <widget class="MenuButton" name="_purchaseRequests">\n         <property name="image">\n          <string notr="true">order_help_48</string>\n         </property>\n         <property name="label">\n          <string>Purchase Requests</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">po.dspPurchaseRequestsByPlannerCode</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="5">\n        <widget class="MenuButton" name="_purchaseOrders">\n         <property name="image">\n          <string notr="true">order_add_48</string>\n         </property>\n         <property name="label">\n          <string>Create Purchase Order</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">po.newPurchaseOrder</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="9">\n        <widget class="MenuButton" name="_purchaseOrdersItemsByDate">\n         <property name="image">\n          <string notr="true">printer_48</string>\n         </property>\n         <property name="label">\n          <string>Print</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">po.printPurchaseOrder</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="1">\n        <widget class="MenuButton" name="_inventoryAvail">\n         <property name="image">\n          <string notr="true">inventory_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Inventory Availability</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">im.dspInventoryAvailability</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="2">\n        <widget class="XLabel" name="_arrow_2">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="4">\n        <widget class="XLabel" name="_arrow_3">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="6">\n        <widget class="XLabel" name="_arrow_4">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="11">\n        <widget class="MenuButton" name="_releasePlannedOrders">\n         <property name="image">\n          <string notr="true">order_next_48</string>\n         </property>\n         <property name="label">\n          <string>Release</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">po.listUnpostedPurchaseOrders</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="10">\n        <widget class="XLabel" name="_arrow_5">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="2" column="0">\n     <widget class="QGroupBox" name="_receivingGroup">\n      <property name="title">\n       <string>Receive</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_9">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_enterReceipts">\n         <property name="image">\n          <string notr="true">barcode_ok_48</string>\n         </property>\n         <property name="label">\n          <string>Enter Receipts</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sr.enterReceipt</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="0">\n        <widget class="MenuButton" name="_unpostedReceipts">\n         <property name="image">\n          <string notr="true">inventory_48</string>\n         </property>\n         <property name="label">\n          <string>Unposted Receipts</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sr.postReceipts</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="2" column="1">\n     <widget class="QGroupBox" name="_paymentGroup">\n      <property name="title">\n       <string>Payment</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_10">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="1">\n        <widget class="MenuButton" name="_vouchers">\n         <property name="image">\n          <string notr="true">taxes_ok_48</string>\n         </property>\n         <property name="label">\n          <string>Vouchers</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">po.listUnpostedVouchers</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="6">\n        <widget class="MenuButton" name="_selectForPayment">\n         <property name="image">\n          <string notr="true">stamp_48</string>\n         </property>\n         <property name="label">\n          <string>Select for Payment</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">ap.selectPayments</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="6">\n        <widget class="MenuButton" name="_selectedPayments">\n         <property name="image">\n          <string notr="true">stamp_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Selected Payments</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">ap.listSelectPayments</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="9">\n        <widget class="MenuButton" name="_checkRegister">\n         <property name="image">\n          <string notr="true">check_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Check Register</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">ap.dspCheckRegister</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="9">\n        <widget class="MenuButton" name="_viewCheckRun">\n         <property name="image">\n          <string notr="true">check_ok_48</string>\n         </property>\n         <property name="label">\n          <string>Check Run</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">ap.viewCheckRun</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="4">\n        <widget class="MenuButton" name="_apAging">\n         <property name="image">\n          <string notr="true">taxes_clock_48</string>\n         </property>\n         <property name="label">\n          <string>Aging</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">ap.dspAPAging</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string>dspTimePhasedOpenAPItems</string>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string>ViewAPOpenItems</string>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="1">\n        <widget class="MenuButton" name="_uninvoicedReceipts">\n         <property name="image">\n          <string notr="true">inventory_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Uninvoiced Receipts</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">ap.uninvoicedReceipts</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="4">\n        <widget class="MenuButton" name="_apOpenItemsByVendor">\n         <property name="image">\n          <string notr="true">taxes_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Open Items</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">ap.dspOpenAPItemsByVendor</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="3">\n        <widget class="XLabel" name="_arrow_6">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="5">\n        <widget class="XLabel" name="_arrow_7">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="7">\n        <widget class="XLabel" name="_arrow_8">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n   </layout>\n  </widget>\n  <widget class="QDockWidget" name="_dockPurchAct">\n   <property name="allowedAreas">\n    <set>Qt::AllDockWidgetAreas</set>\n   </property>\n   <property name="windowTitle">\n    <string>Purchase Activities</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>1</number>\n   </attribute>\n   <widget class="QWidget" name="_dockPurchActContents">\n    <layout class="QGridLayout" name="gridLayout_3">\n     <property name="margin">\n      <number>0</number>\n     </property>\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_purchAct">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n  <widget class="QDockWidget" name="_dockPurchHist">\n   <property name="windowTitle">\n    <string>Purchase History</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>1</number>\n   </attribute>\n   <widget class="QWidget" name="_dockPurchHistContents">\n    <layout class="QGridLayout" name="gridLayout_2">\n     <property name="leftMargin">\n      <number>0</number>\n     </property>\n     <property name="topMargin">\n      <number>0</number>\n     </property>\n     <property name="rightMargin">\n      <number>0</number>\n     </property>\n     <property name="bottomMargin">\n      <number>3</number>\n     </property>\n     <property name="verticalSpacing">\n      <number>3</number>\n     </property>\n     <item row="0" column="0" colspan="3">\n      <widget class="XTreeWidget" name="_purchHist">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="0">\n      <widget class="QLabel" name="_label">\n       <property name="sizePolicy">\n        <sizepolicy hsizetype="Expanding" vsizetype="Preferred">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name="text">\n        <string>label</string>\n       </property>\n       <property name="alignment">\n        <set>Qt::AlignCenter</set>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="1">\n      <widget class="QPushButton" name="_button1">\n       <property name="maximumSize">\n        <size>\n         <width>16</width>\n         <height>16</height>\n        </size>\n       </property>\n       <property name="text">\n        <string>b</string>\n       </property>\n       <property name="flat">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="2">\n      <widget class="QPushButton" name="_button2">\n       <property name="maximumSize">\n        <size>\n         <width>16</width>\n         <height>16</height>\n        </size>\n       </property>\n       <property name="text">\n        <string>b</string>\n       </property>\n       <property name="flat">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n  <widget class="QDockWidget" name="_dockPurchOpen">\n   <property name="allowedAreas">\n    <set>Qt::AllDockWidgetAreas</set>\n   </property>\n   <property name="windowTitle">\n    <string>Purchase Orders</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>8</number>\n   </attribute>\n   <widget class="QWidget" name="_dockPurchOpenContents">\n    <layout class="QGridLayout" name="gridLayout_4">\n     <property name="margin">\n      <number>0</number>\n     </property>\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_purchOpen">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>MenuButton</class>\n   <extends>QWidget</extends>\n   <header>menubutton.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XLabel</class>\n   <extends>QLabel</extends>\n   <header>xlabel.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XTreeWidget</class>\n   <extends>QTreeWidget</extends>\n   <header>xtreewidget.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n	
41	desktopSales	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <comment>This file is part of the xtdesktop package for xTuple ERP: PostBooks Edition, a free and\nopen source Enterprise Resource Planning software suite,\nCopyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\nIt is licensed to you under the Common Public Attribution License\nversion 1.0, the full text of which (including xTuple-specific Exhibits)\nis available at www.xtuple.com/CPAL.  By using this software, you agree\nto be bound by its terms.</comment>\n <class>desktopSales</class>\n <widget class="QMainWindow" name="desktopSales">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>873</width>\n    <height>554</height>\n   </rect>\n  </property>\n  <property name="windowTitle">\n   <string>Sales</string>\n  </property>\n  <property name="documentMode">\n   <bool>true</bool>\n  </property>\n  <property name="dockOptions">\n   <set>QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks</set>\n  </property>\n  <widget class="QWidget" name="centralwidget">\n   <layout class="QGridLayout" name="gridLayout_2">\n    <item row="0" column="0">\n     <widget class="QLabel" name="desktopSalesLit">\n      <property name="font">\n       <font>\n        <pointsize>14</pointsize>\n        <weight>75</weight>\n        <bold>true</bold>\n       </font>\n      </property>\n      <property name="text">\n       <string>Sales</string>\n      </property>\n     </widget>\n    </item>\n    <item row="1" column="0">\n     <widget class="QGroupBox" name="_orderGroup">\n      <property name="title">\n       <string>Order</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_prospects">\n         <property name="image">\n          <string notr="true">customers_write_48</string>\n         </property>\n         <property name="label">\n          <string>Prospects</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.prospects</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="1">\n        <widget class="XLabel" name="_arrow_1">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="2">\n        <widget class="MenuButton" name="_customers">\n         <property name="image">\n          <string notr="true">customers_add_48</string>\n         </property>\n         <property name="label">\n          <string>New Customer</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.enterNewCustomer</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="0">\n        <widget class="MenuButton" name="_quotes">\n         <property name="image">\n          <string notr="true">order_write_48</string>\n         </property>\n         <property name="label">\n          <string>Quotes</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.listQuotes</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="1">\n        <widget class="XLabel" name="_arrow_2">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="2">\n        <widget class="MenuButton" name="_salesOrders">\n         <property name="image">\n          <string notr="true">order_add_48</string>\n         </property>\n         <property name="label">\n          <string>New Sales Order</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.newSalesOrder</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="1" column="1">\n     <widget class="QGroupBox" name="_shipGroup">\n      <property name="title">\n       <string>Ship</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_3">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="1" column="1">\n        <widget class="MenuButton" name="_printPackingLists">\n         <property name="image">\n          <string notr="true">printer_48</string>\n         </property>\n         <property name="label">\n          <string>Print Packing Lists</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sr.packingListBatch</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="2">\n        <widget class="XLabel" name="_arrow_3">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="4">\n        <widget class="MenuButton" name="_issueToShipping">\n         <property name="image">\n          <string notr="true">barcode_ok_48</string>\n         </property>\n         <property name="label">\n          <string>Issue To Shipping</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sr.issueToShipping</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="5">\n        <widget class="XLabel" name="_arrow_4">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="1" column="6">\n        <widget class="MenuButton" name="_shipOrder">\n         <property name="image">\n          <string notr="true">dispatch_order_ok_48</string>\n         </property>\n         <property name="label">\n          <string>Ship</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sr.shipOrder</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="6">\n        <widget class="MenuButton" name="_maintainShipping">\n         <property name="image">\n          <string notr="true">dispatch_order_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Maintain Shipping</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">sr.maintainShippingContents</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="4">\n        <widget class="MenuButton" name="_invAvailability">\n         <property name="image">\n          <string notr="true">order_zoom_48</string>\n         </property>\n         <property name="label">\n          <string>Inventory Availability</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.dspInventoryAvailabilityByCustomerType</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="1">\n        <widget class="MenuButton" name="_backlog">\n         <property name="image">\n          <string notr="true">order_clock_48</string>\n         </property>\n         <property name="label">\n          <string>Backlog</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.dspSummarizedBacklogByWarehouse</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n    <item row="2" column="0" colspan="2">\n     <widget class="QGroupBox" name="_billGroup">\n      <property name="title">\n       <string>Bill</string>\n      </property>\n      <layout class="QGridLayout" name="gridLayout_4">\n       <property name="margin">\n        <number>6</number>\n       </property>\n       <property name="spacing">\n        <number>0</number>\n       </property>\n       <item row="0" column="0">\n        <widget class="MenuButton" name="_selectForBilling">\n         <property name="image">\n          <string notr="true">stamp_48</string>\n         </property>\n         <property name="label">\n          <string>Select for Billing</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.uninvoicedShipments</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="2">\n        <widget class="MenuButton" name="_createInvoices">\n         <property name="image">\n          <string notr="true">taxes_add_48</string>\n         </property>\n         <property name="label">\n          <string>Create Invoices</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.dspBillingSelections</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string>dspBillingSelections</string>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="4">\n        <widget class="MenuButton" name="_postInvoices">\n         <property name="image">\n          <string notr="true">taxes_ok_48</string>\n         </property>\n         <property name="label">\n          <string>Post Invoices</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">so.listUnpostedInvoices</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="6">\n        <widget class="MenuButton" name="_aging">\n         <property name="image">\n          <string notr="true">taxes_clock_48</string>\n         </property>\n         <property name="label">\n          <string>Aging</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">ar.dspARAging</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="8">\n        <widget class="MenuButton" name="_cashReceipts">\n         <property name="image">\n          <string notr="true">payment_ok_48</string>\n         </property>\n         <property name="label">\n          <string>Cash Receipts</string>\n         </property>\n         <property name="actionName" stdset="0">\n          <string notr="true">ar.cashReceiptEditList</string>\n         </property>\n         <property name="ui" stdset="0">\n          <string/>\n         </property>\n         <property name="editPrivilege" stdset="0">\n          <string/>\n         </property>\n         <property name="viewPrivilege" stdset="0">\n          <string/>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="7">\n        <widget class="XLabel" name="_arrow_8">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="5">\n        <widget class="XLabel" name="_arrow_7">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="3">\n        <widget class="XLabel" name="_arrow_6">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n       <item row="0" column="1">\n        <widget class="XLabel" name="_arrow_5">\n         <property name="sizePolicy">\n          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name="image">\n          <string notr="true">ImgRightArrow</string>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </item>\n   </layout>\n  </widget>\n  <widget class="QDockWidget" name="_dockSalesAct">\n   <property name="windowTitle">\n    <string>Sales Activities</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>1</number>\n   </attribute>\n   <widget class="QWidget" name="_dockActContents">\n    <layout class="QGridLayout" name="gridLayout_7">\n     <property name="margin">\n      <number>0</number>\n     </property>\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_salesAct">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n  <widget class="QDockWidget" name="_dockSalesHist">\n   <property name="windowTitle">\n    <string>Sales History</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>1</number>\n   </attribute>\n   <widget class="QWidget" name="_dockHistContents">\n    <layout class="QGridLayout" name="gridLayout_8">\n     <property name="leftMargin">\n      <number>0</number>\n     </property>\n     <property name="topMargin">\n      <number>0</number>\n     </property>\n     <property name="rightMargin">\n      <number>0</number>\n     </property>\n     <property name="bottomMargin">\n      <number>3</number>\n     </property>\n     <property name="verticalSpacing">\n      <number>3</number>\n     </property>\n     <item row="0" column="0" colspan="3">\n      <widget class="XTreeWidget" name="_salesHist">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="0">\n      <widget class="QLabel" name="_label">\n       <property name="sizePolicy">\n        <sizepolicy hsizetype="Expanding" vsizetype="Preferred">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name="text">\n        <string>label</string>\n       </property>\n       <property name="alignment">\n        <set>Qt::AlignCenter</set>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="1">\n      <widget class="QPushButton" name="_button1">\n       <property name="maximumSize">\n        <size>\n         <width>16</width>\n         <height>16</height>\n        </size>\n       </property>\n       <property name="text">\n        <string>b</string>\n       </property>\n       <property name="flat">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="2">\n      <widget class="QPushButton" name="_button2">\n       <property name="maximumSize">\n        <size>\n         <width>16</width>\n         <height>16</height>\n        </size>\n       </property>\n       <property name="text">\n        <string>b</string>\n       </property>\n       <property name="flat">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n  <widget class="QDockWidget" name="_dockSalesOpen">\n   <property name="windowTitle">\n    <string>Sales Orders</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>8</number>\n   </attribute>\n   <widget class="QWidget" name="_dockSalesOpenContents">\n    <layout class="QGridLayout" name="gridLayout_10">\n     <property name="margin">\n      <number>0</number>\n     </property>\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_salesOpen">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>MenuButton</class>\n   <extends>QWidget</extends>\n   <header>menubutton.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XLabel</class>\n   <extends>QLabel</extends>\n   <header>xlabel.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XTreeWidget</class>\n   <extends>QTreeWidget</extends>\n   <header>xtreewidget.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n	
64	desktop	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <comment>This file is part of the xTuple ERP: PostBooks Edition, a free and\nopen source Enterprise Resource Planning software suite,\nCopyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\nIt is licensed to you under the Common Public Attribution License\nversion 1.0, the full text of which (including xTuple-specific Exhibits)\nis available at www.xtuple.com/CPAL.  By using this software, you agree\nto be bound by its terms.</comment>\n <class>desktop</class>\n <widget class="QWidget" name="desktop">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>24</width>\n    <height>24</height>\n   </rect>\n  </property>\n  <property name="windowTitle">\n   <string>Desktop</string>\n  </property>\n  <layout class="QGridLayout" name="_layout"/>\n </widget>\n <resources/>\n <connections/>\n</ui>\n	container ui for the desktop webview
65	desktopMenuBar	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <comment>This file is part of the xTuple ERP: PostBooks Edition, a free and\nopen source Enterprise Resource Planning software suite,\nCopyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.\nIt is licensed to you under the Common Public Attribution License\nversion 1.0, the full text of which (including xTuple-specific Exhibits)\nis available at www.xtuple.com/CPAL.  By using this software, you agree\nto be bound by its terms.</comment>\n <class>desktopMenuBar</class>\n <widget class="QWidget" name="desktopMenuBar">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>226</width>\n    <height>680</height>\n   </rect>\n  </property>\n  <property name="windowTitle">\n   <string/>\n  </property>\n  <property name="styleSheet">\n   <string notr="true">background-color: rgb(255, 255, 255);</string>\n  </property>\n  <layout class="QVBoxLayout" name="verticalLayout">\n   <item>\n    <widget class="XTreeWidget" name="_shortcutMenu">\n     <property name="maximumSize">\n      <size>\n       <width>16777215</width>\n       <height>16777215</height>\n      </size>\n     </property>\n     <property name="verticalScrollBarPolicy">\n      <enum>Qt::ScrollBarAsNeeded</enum>\n     </property>\n     <property name="autoScroll">\n      <bool>false</bool>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <widget class="XTreeWidget" name="_mainMenu">\n     <property name="maximumSize">\n      <size>\n       <width>16777215</width>\n       <height>16777215</height>\n      </size>\n     </property>\n     <property name="verticalScrollBarPolicy">\n      <enum>Qt::ScrollBarAsNeeded</enum>\n     </property>\n     <property name="autoScroll">\n      <bool>false</bool>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <layout class="QHBoxLayout" name="horizontalLayout">\n     <item>\n      <widget class="XLabel" name="_employee">\n       <property name="maximumSize">\n        <size>\n         <width>100</width>\n         <height>100</height>\n        </size>\n       </property>\n       <property name="styleSheet">\n        <string notr="true">font: 75 12pt &quot;Verdana&quot;;</string>\n       </property>\n       <property name="text">\n        <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Employee&lt;/p&gt;&lt;p&gt;Name&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>ImageCluster</class>\n   <extends>QWidget</extends>\n   <header>imagecluster.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XLabel</class>\n   <extends>QLabel</extends>\n   <header>xlabel.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XTreeWidget</class>\n   <extends>QTreeWidget</extends>\n   <header>xtreewidget.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n	
39	desktopNotice	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <comment>This file is part of the xtdesktop package for xTuple ERP: PostBooks Edition, a free and\nopen source Enterprise Resource Planning software suite,\nCopyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\nIt is licensed to you under the Common Public Attribution License\nversion 1.0, the full text of which (including xTuple-specific Exhibits)\nis available at www.xtuple.com/CPAL.  By using this software, you agree\nto be bound by its terms.</comment>\n <class>desktopNotice</class>\n <widget class="QDialog" name="desktopNotice">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>211</width>\n    <height>109</height>\n   </rect>\n  </property>\n  <property name="windowTitle">\n   <string>Notice</string>\n  </property>\n  <layout class="QGridLayout" name="gridLayout">\n   <item row="0" column="0">\n    <widget class="QLabel" name="_notice">\n     <property name="sizePolicy">\n      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n     <property name="text">\n      <string>Note: The xTuple Desktop is only available when user preferences are set to show windows as free-floating.</string>\n     </property>\n     <property name="wordWrap">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item row="1" column="0">\n    <widget class="QCheckBox" name="_remind">\n     <property name="text">\n      <string>Remind me about this again.</string>\n     </property>\n     <property name="checked">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item row="2" column="0">\n    <widget class="QDialogButtonBox" name="_buttonBox">\n     <property name="orientation">\n      <enum>Qt::Horizontal</enum>\n     </property>\n     <property name="standardButtons">\n      <set>QDialogButtonBox::Ok</set>\n     </property>\n     <property name="centerButtons">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <resources/>\n <connections>\n  <connection>\n   <sender>_buttonBox</sender>\n   <signal>accepted()</signal>\n   <receiver>desktopNotice</receiver>\n   <slot>accept()</slot>\n   <hints>\n    <hint type="sourcelabel">\n     <x>248</x>\n     <y>254</y>\n    </hint>\n    <hint type="destinationlabel">\n     <x>157</x>\n     <y>274</y>\n    </hint>\n   </hints>\n  </connection>\n  <connection>\n   <sender>_buttonBox</sender>\n   <signal>rejected()</signal>\n   <receiver>desktopNotice</receiver>\n   <slot>reject()</slot>\n   <hints>\n    <hint type="sourcelabel">\n     <x>316</x>\n     <y>260</y>\n    </hint>\n    <hint type="destinationlabel">\n     <x>286</x>\n     <y>274</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n	
42	preferencesHistory	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <comment>This file is part of the xtdesktop package for xTuple ERP: PostBooks Edition, a free and\nopen source Enterprise Resource Planning software suite,\nCopyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\nIt is licensed to you under the Common Public Attribution License\nversion 1.0, the full text of which (including xTuple-specific Exhibits)\nis available at www.xtuple.com/CPAL.  By using this software, you agree\nto be bound by its terms.</comment>\n <class>preferencesHistory</class>\n <widget class="QDialog" name="preferencesHistory">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>350</width>\n    <height>104</height>\n   </rect>\n  </property>\n  <property name="minimumSize">\n   <size>\n    <width>350</width>\n    <height>0</height>\n   </size>\n  </property>\n  <property name="windowTitle">\n   <string>History Settings</string>\n  </property>\n  <layout class="QGridLayout" name="gridLayout">\n   <item row="0" column="0">\n    <widget class="QLabel" name="_typeLit">\n     <property name="text">\n      <string>Type:</string>\n     </property>\n     <property name="alignment">\n      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n     </property>\n    </widget>\n   </item>\n   <item row="0" column="1">\n    <widget class="XComboBox" name="_type">\n     <property name="sizePolicy">\n      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n    </widget>\n   </item>\n   <item row="0" column="2" rowspan="3">\n    <widget class="QDialogButtonBox" name="buttonBox">\n     <property name="orientation">\n      <enum>Qt::Vertical</enum>\n     </property>\n     <property name="standardButtons">\n      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>\n     </property>\n    </widget>\n   </item>\n   <item row="1" column="0">\n    <widget class="QLabel" name="_groupByLit">\n     <property name="text">\n      <string>Group By:</string>\n     </property>\n     <property name="alignment">\n      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n     </property>\n    </widget>\n   </item>\n   <item row="1" column="1">\n    <widget class="XComboBox" name="_groupBy">\n     <property name="sizePolicy">\n      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n    </widget>\n   </item>\n   <item row="2" column="0">\n    <widget class="QLabel" name="_timeFramLit">\n     <property name="text">\n      <string>Time Frame:</string>\n     </property>\n     <property name="alignment">\n      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n     </property>\n    </widget>\n   </item>\n   <item row="2" column="1">\n    <widget class="XComboBox" name="_timeFrame">\n     <property name="sizePolicy">\n      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>XComboBox</class>\n   <extends>QComboBox</extends>\n   <header>xcombobox.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>accepted()</signal>\n   <receiver>preferencesHistory</receiver>\n   <slot>accept()</slot>\n   <hints>\n    <hint type="sourcelabel">\n     <x>248</x>\n     <y>254</y>\n    </hint>\n    <hint type="destinationlabel">\n     <x>157</x>\n     <y>274</y>\n    </hint>\n   </hints>\n  </connection>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>rejected()</signal>\n   <receiver>preferencesHistory</receiver>\n   <slot>reject()</slot>\n   <hints>\n    <hint type="sourcelabel">\n     <x>316</x>\n     <y>260</y>\n    </hint>\n    <hint type="destinationlabel">\n     <x>286</x>\n     <y>274</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n	
60	desktopSocial	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <class>desktopSocial</class>\n <widget class="QMainWindow" name="desktopSocial">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>996</width>\n    <height>666</height>\n   </rect>\n  </property>\n  <property name="windowTitle">\n   <string>Social</string>\n  </property>\n  <widget class="QWidget" name="centralwidget">\n   <layout class="QGridLayout" name="gridLayout_5">\n    <item row="0" column="0">\n     <layout class="QVBoxLayout" name="verticalLayout">\n      <item>\n       <layout class="QHBoxLayout" name="horizontalLayout">\n        <item>\n         <widget class="QLabel" name="desktopSociallit">\n          <property name="font">\n           <font>\n            <family>Open Sans,Helvetica,Verdana,sans-serif</family>\n            <pointsize>-1</pointsize>\n            <weight>25</weight>\n            <bold>false</bold>\n           </font>\n          </property>\n          <property name="text">\n           <string>Social</string>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <spacer name="horizontalSpacer">\n          <property name="orientation">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name="sizeHint" stdset="0">\n           <size>\n            <width>40</width>\n            <height>20</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n       </layout>\n      </item>\n      <item>\n       <widget class="QGroupBox" name="_commentConsoleGrp">\n        <property name="title">\n         <string>Comment Console</string>\n        </property>\n        <layout class="QGridLayout" name="gridLayout">\n         <item row="0" column="0">\n          <widget class="XTreeWidget" name="_commentConsole"/>\n         </item>\n         <item row="1" column="0">\n          <layout class="QHBoxLayout" name="horizontalLayout_2">\n           <item>\n            <spacer name="horizontalSpacer_2">\n             <property name="orientation">\n              <enum>Qt::Horizontal</enum>\n             </property>\n             <property name="sizeHint" stdset="0">\n              <size>\n               <width>40</width>\n               <height>20</height>\n              </size>\n             </property>\n            </spacer>\n           </item>\n           <item>\n            <widget class="QPushButton" name="_button1">\n             <property name="maximumSize">\n              <size>\n               <width>16</width>\n               <height>16</height>\n              </size>\n             </property>\n             <property name="text">\n              <string>b</string>\n             </property>\n             <property name="flat">\n              <bool>true</bool>\n             </property>\n            </widget>\n           </item>\n           <item>\n            <widget class="QPushButton" name="_button2">\n             <property name="maximumSize">\n              <size>\n               <width>16</width>\n               <height>16</height>\n              </size>\n             </property>\n             <property name="text">\n              <string>b</string>\n             </property>\n             <property name="flat">\n              <bool>true</bool>\n             </property>\n            </widget>\n           </item>\n          </layout>\n         </item>\n        </layout>\n       </widget>\n      </item>\n     </layout>\n    </item>\n   </layout>\n  </widget>\n  <widget class="QDockWidget" name="_dockSendMessage">\n   <property name="allowedAreas">\n    <set>Qt::BottomDockWidgetArea|Qt::RightDockWidgetArea|Qt::TopDockWidgetArea</set>\n   </property>\n   <property name="windowTitle">\n    <string>Send Message</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>2</number>\n   </attribute>\n   <widget class="QWidget" name="dockWidgetContents">\n    <layout class="QGridLayout" name="gridLayout_2">\n     <item row="0" column="3" rowspan="2">\n      <widget class="QPushButton" name="_send">\n       <property name="enabled">\n        <bool>false</bool>\n       </property>\n       <property name="text">\n        <string>Send</string>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="0">\n      <widget class="QLabel" name="_usrLit">\n       <property name="text">\n        <string>User:</string>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="1" rowspan="2">\n      <widget class="UsernameCluster" name="_usr">\n       <property name="descriptionVisible">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="2">\n      <spacer name="horizontalSpacer_3">\n       <property name="orientation">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name="sizeHint" stdset="0">\n        <size>\n         <width>54</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item row="3" column="0" colspan="2">\n      <widget class="QLabel" name="_messageLit">\n       <property name="text">\n        <string>Message:</string>\n       </property>\n      </widget>\n     </item>\n     <item row="4" column="0" colspan="4">\n      <widget class="QPlainTextEdit" name="_message">\n       <property name="plainText">\n        <string/>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n  <widget class="QDockWidget" name="_dockMessageHistory">\n   <property name="allowedAreas">\n    <set>Qt::BottomDockWidgetArea|Qt::RightDockWidgetArea|Qt::TopDockWidgetArea</set>\n   </property>\n   <property name="windowTitle">\n    <string>Message History</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>2</number>\n   </attribute>\n   <widget class="QWidget" name="dockWidgetContents_2">\n    <layout class="QGridLayout" name="gridLayout_4">\n     <item row="0" column="0" colspan="3">\n      <widget class="XTreeWidget" name="_messageHistory"/>\n     </item>\n     <item row="1" column="0">\n      <spacer name="horizontalSpacer_4">\n       <property name="orientation">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name="sizeHint" stdset="0">\n        <size>\n         <width>282</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item row="1" column="1">\n      <widget class="QPushButton" name="_button3">\n       <property name="maximumSize">\n        <size>\n         <width>16</width>\n         <height>16</height>\n        </size>\n       </property>\n       <property name="text">\n        <string>b</string>\n       </property>\n       <property name="flat">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="2">\n      <widget class="QPushButton" name="_button4">\n       <property name="maximumSize">\n        <size>\n         <width>16</width>\n         <height>16</height>\n        </size>\n       </property>\n       <property name="text">\n        <string>b</string>\n       </property>\n       <property name="flat">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n  <widget class="QDockWidget" name="_dockUserOnline">\n   <property name="allowedAreas">\n    <set>Qt::BottomDockWidgetArea|Qt::RightDockWidgetArea|Qt::TopDockWidgetArea</set>\n   </property>\n   <property name="windowTitle">\n    <string>Users Online</string>\n   </property>\n   <attribute name="dockWidgetArea">\n    <number>2</number>\n   </attribute>\n   <widget class="QWidget" name="dockWidgetContents_4">\n    <layout class="QGridLayout" name="gridLayout_3">\n     <item row="0" column="0">\n      <widget class="XTreeWidget" name="_userOnline">\n       <property name="populateLinear">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </widget>\n  </widget>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>UsernameCluster</class>\n   <extends>QWidget</extends>\n   <header>usernamecluster.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XTreeWidget</class>\n   <extends>QTreeWidget</extends>\n   <header>xtreewidget.h</header>\n   <container>1</container>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n	
61	preferencesComment	0	t	<?xml version="1.0" encoding="UTF-8"?>\r\n<ui version="4.0">\r\n <class>preferencesComment</class>\r\n <widget class="QDialog" name="preferencesComment">\r\n  <property name="geometry">\r\n   <rect>\r\n    <x>0</x>\r\n    <y>0</y>\r\n    <width>626</width>\r\n    <height>342</height>\r\n   </rect>\r\n  </property>\r\n  <property name="windowTitle">\r\n   <string>Comment Preference</string>\r\n  </property>\r\n  <layout class="QGridLayout" name="gridLayout_2">\r\n   <item row="0" column="0">\r\n    <layout class="QGridLayout" name="gridLayout">\r\n     <item row="0" column="0">\r\n      <layout class="QHBoxLayout" name="horizontalLayout_6">\r\n       <item>\r\n        <widget class="DateCluster" name="_dates"/>\r\n       </item>\r\n       <item>\r\n        <spacer name="horizontalSpacer_6">\r\n         <property name="orientation">\r\n          <enum>Qt::Horizontal</enum>\r\n         </property>\r\n         <property name="sizeHint" stdset="0">\r\n          <size>\r\n           <width>40</width>\r\n           <height>20</height>\r\n          </size>\r\n         </property>\r\n        </spacer>\r\n       </item>\r\n      </layout>\r\n     </item>\r\n     <item row="1" column="0">\r\n      <layout class="QHBoxLayout" name="horizontalLayout_2">\r\n       <item>\r\n        <widget class="XTreeWidget" name="_usr">\r\n         <property name="selectionMode">\r\n          <enum>QAbstractItemView::ExtendedSelection</enum>\r\n         </property>\r\n        </widget>\r\n       </item>\r\n       <item>\r\n        <widget class="XTreeWidget" name="_type">\r\n         <property name="selectionMode">\r\n          <enum>QAbstractItemView::ExtendedSelection</enum>\r\n         </property>\r\n        </widget>\r\n       </item>\r\n       <item>\r\n        <widget class="XTreeWidget" name="_source">\r\n         <property name="selectionMode">\r\n          <enum>QAbstractItemView::ExtendedSelection</enum>\r\n         </property>\r\n        </widget>\r\n       </item>\r\n       <item>\r\n        <spacer name="horizontalSpacer_5">\r\n         <property name="orientation">\r\n          <enum>Qt::Horizontal</enum>\r\n         </property>\r\n         <property name="sizeHint" stdset="0">\r\n          <size>\r\n           <width>40</width>\r\n           <height>20</height>\r\n          </size>\r\n         </property>\r\n        </spacer>\r\n       </item>\r\n      </layout>\r\n     </item>\r\n     <item row="2" column="0">\r\n      <layout class="QHBoxLayout" name="horizontalLayout">\r\n       <item>\r\n        <spacer name="horizontalSpacer">\r\n         <property name="orientation">\r\n          <enum>Qt::Horizontal</enum>\r\n         </property>\r\n         <property name="sizeHint" stdset="0">\r\n          <size>\r\n           <width>40</width>\r\n           <height>20</height>\r\n          </size>\r\n         </property>\r\n        </spacer>\r\n       </item>\r\n       <item>\r\n        <widget class="QDialogButtonBox" name="_buttonBox">\r\n         <property name="orientation">\r\n          <enum>Qt::Horizontal</enum>\r\n         </property>\r\n         <property name="standardButtons">\r\n          <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>\r\n         </property>\r\n        </widget>\r\n       </item>\r\n      </layout>\r\n     </item>\r\n    </layout>\r\n   </item>\r\n  </layout>\r\n </widget>\r\n <customwidgets>\r\n  <customwidget>\r\n   <class>DateCluster</class>\r\n   <extends>QWidget</extends>\r\n   <header>datecluster.h</header>\r\n  </customwidget>\r\n  <customwidget>\r\n   <class>XTreeWidget</class>\r\n   <extends>QTreeWidget</extends>\r\n   <header>xtreewidget.h</header>\r\n   <container>1</container>\r\n  </customwidget>\r\n </customwidgets>\r\n <resources/>\r\n <connections>\r\n  <connection>\r\n   <sender>_buttonBox</sender>\r\n   <signal>accepted()</signal>\r\n   <receiver>preferencesComment</receiver>\r\n   <slot>accept()</slot>\r\n   <hints>\r\n    <hint type="sourcelabel">\r\n     <x>248</x>\r\n     <y>254</y>\r\n    </hint>\r\n    <hint type="destinationlabel">\r\n     <x>157</x>\r\n     <y>274</y>\r\n    </hint>\r\n   </hints>\r\n  </connection>\r\n  <connection>\r\n   <sender>_buttonBox</sender>\r\n   <signal>rejected()</signal>\r\n   <receiver>preferencesComment</receiver>\r\n   <slot>reject()</slot>\r\n   <hints>\r\n    <hint type="sourcelabel">\r\n     <x>316</x>\r\n     <y>260</y>\r\n    </hint>\r\n    <hint type="destinationlabel">\r\n     <x>286</x>\r\n     <y>274</y>\r\n    </hint>\r\n   </hints>\r\n  </connection>\r\n </connections>\r\n</ui>\r\n	
62	preferencesNumber	0	t	<?xml version="1.0" encoding="UTF-8"?>\r\n<ui version="4.0">\r\n <class>preferencesNumber</class>\r\n <widget class="QDialog" name="preferencesNumber">\r\n  <property name="geometry">\r\n   <rect>\r\n    <x>0</x>\r\n    <y>0</y>\r\n    <width>257</width>\r\n    <height>72</height>\r\n   </rect>\r\n  </property>\r\n  <property name="windowTitle">\r\n   <string>Number Preferences</string>\r\n  </property>\r\n  <layout class="QGridLayout" name="gridLayout_2">\r\n   <item row="0" column="0">\r\n    <layout class="QGridLayout" name="gridLayout">\r\n     <item row="0" column="0">\r\n      <layout class="QHBoxLayout" name="horizontalLayout">\r\n       <item>\r\n        <widget class="QLabel" name="_limitLit">\r\n         <property name="text">\r\n          <string>Messages to display:</string>\r\n         </property>\r\n        </widget>\r\n       </item>\r\n       <item>\r\n        <widget class="QSpinBox" name="_limit">\r\n         <property name="value">\r\n          <number>10</number>\r\n         </property>\r\n        </widget>\r\n       </item>\r\n       <item>\r\n        <spacer name="horizontalSpacer">\r\n         <property name="orientation">\r\n          <enum>Qt::Horizontal</enum>\r\n         </property>\r\n         <property name="sizeHint" stdset="0">\r\n          <size>\r\n           <width>40</width>\r\n           <height>20</height>\r\n          </size>\r\n         </property>\r\n        </spacer>\r\n       </item>\r\n      </layout>\r\n     </item>\r\n     <item row="0" column="1">\r\n      <widget class="QDialogButtonBox" name="buttonBox">\r\n       <property name="orientation">\r\n        <enum>Qt::Vertical</enum>\r\n       </property>\r\n       <property name="standardButtons">\r\n        <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>\r\n       </property>\r\n      </widget>\r\n     </item>\r\n    </layout>\r\n   </item>\r\n  </layout>\r\n </widget>\r\n <resources/>\r\n <connections>\r\n  <connection>\r\n   <sender>buttonBox</sender>\r\n   <signal>accepted()</signal>\r\n   <receiver>preferencesNumber</receiver>\r\n   <slot>accept()</slot>\r\n   <hints>\r\n    <hint type="sourcelabel">\r\n     <x>209</x>\r\n     <y>35</y>\r\n    </hint>\r\n    <hint type="destinationlabel">\r\n     <x>128</x>\r\n     <y>35</y>\r\n    </hint>\r\n   </hints>\r\n  </connection>\r\n  <connection>\r\n   <sender>buttonBox</sender>\r\n   <signal>rejected()</signal>\r\n   <receiver>preferencesNumber</receiver>\r\n   <slot>reject()</slot>\r\n   <hints>\r\n    <hint type="sourcelabel">\r\n     <x>209</x>\r\n     <y>35</y>\r\n    </hint>\r\n    <hint type="destinationlabel">\r\n     <x>128</x>\r\n     <y>35</y>\r\n    </hint>\r\n   </hints>\r\n  </connection>\r\n </connections>\r\n</ui>\r\n	
43	preferencesSelections	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <comment>This file is part of the xtdesktop package for xTuple ERP: PostBooks Edition, a free and\nopen source Enterprise Resource Planning software suite,\nCopyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.\nIt is licensed to you under the Common Public Attribution License\nversion 1.0, the full text of which (including xTuple-specific Exhibits)\nis available at www.xtuple.com/CPAL.  By using this software, you agree\nto be bound by its terms.</comment>\n <class>preferencesSelections</class>\n <widget class="QDialog" name="preferencesSelections">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>280</width>\n    <height>259</height>\n   </rect>\n  </property>\n  <property name="windowTitle">\n   <string>Selection Preferences</string>\n  </property>\n  <layout class="QGridLayout" name="gridLayout">\n   <item row="1" column="0">\n    <widget class="XTreeWidget" name="_gl">\n     <property name="selectionMode">\n      <enum>QAbstractItemView::ExtendedSelection</enum>\n     </property>\n    </widget>\n   </item>\n   <item row="2" column="0">\n    <widget class="QDialogButtonBox" name="_buttonBox">\n     <property name="orientation">\n      <enum>Qt::Horizontal</enum>\n     </property>\n     <property name="standardButtons">\n      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>\n     </property>\n    </widget>\n   </item>\n   <item row="0" column="0">\n    <widget class="QLabel" name="label">\n     <property name="text">\n      <string>Select Accounts to monitor:</string>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>XTreeWidget</class>\n   <extends>QTreeWidget</extends>\n   <header>xtreewidget.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections>\n  <connection>\n   <sender>_buttonBox</sender>\n   <signal>accepted()</signal>\n   <receiver>preferencesSelections</receiver>\n   <slot>accept()</slot>\n   <hints>\n    <hint type="sourcelabel">\n     <x>248</x>\n     <y>254</y>\n    </hint>\n    <hint type="destinationlabel">\n     <x>157</x>\n     <y>274</y>\n    </hint>\n   </hints>\n  </connection>\n  <connection>\n   <sender>_buttonBox</sender>\n   <signal>rejected()</signal>\n   <receiver>preferencesSelections</receiver>\n   <slot>reject()</slot>\n   <hints>\n    <hint type="sourcelabel">\n     <x>316</x>\n     <y>260</y>\n    </hint>\n    <hint type="destinationlabel">\n     <x>286</x>\n     <y>274</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n	
63	sendMessageToUser	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <class>sendMessageToUser</class>\n <widget class="QDialog" name="sendMessageToUser">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>406</width>\n    <height>300</height>\n   </rect>\n  </property>\n  <property name="windowTitle">\n   <string>Send Message to User</string>\n  </property>\n  <layout class="QGridLayout" name="gridLayout">\n   <item row="0" column="0">\n    <widget class="QLabel" name="label">\n     <property name="text">\n      <string>User:</string>\n     </property>\n    </widget>\n   </item>\n   <item row="0" column="1" rowspan="2">\n    <spacer name="horizontalSpacer">\n     <property name="orientation">\n      <enum>Qt::Horizontal</enum>\n     </property>\n     <property name="sizeHint" stdset="0">\n      <size>\n       <width>158</width>\n       <height>56</height>\n      </size>\n     </property>\n    </spacer>\n   </item>\n   <item row="0" column="2" rowspan="2">\n    <layout class="QVBoxLayout" name="verticalLayout">\n     <item>\n      <widget class="QPushButton" name="_close">\n       <property name="text">\n        <string>Close</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class="QPushButton" name="_send">\n       <property name="enabled">\n        <bool>false</bool>\n       </property>\n       <property name="text">\n        <string>Send</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name="verticalSpacer">\n       <property name="orientation">\n        <enum>Qt::Vertical</enum>\n       </property>\n       <property name="sizeHint" stdset="0">\n        <size>\n         <width>38</width>\n         <height>25</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n    </layout>\n   </item>\n   <item row="1" column="0">\n    <widget class="UsernameCluster" name="_usr" native="true">\n     <property name="descriptionVisible" stdset="0">\n      <bool>false</bool>\n     </property>\n    </widget>\n   </item>\n   <item row="2" column="0">\n    <widget class="QLabel" name="label_2">\n     <property name="text">\n      <string>Message:</string>\n     </property>\n    </widget>\n   </item>\n   <item row="3" column="0" colspan="3">\n    <widget class="QPlainTextEdit" name="_message">\n     <property name="plainText">\n      <string/>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>UsernameCluster</class>\n   <extends>QWidget</extends>\n   <header>usernamecluster.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n	
\.


