Issue #23958:renumber sections for quotes
authorgaryhgohoos <gary@xtuple.com>
Fri, 20 Jun 2014 19:22:45 +0000 (15:22 -0400)
committergaryhgohoos <gary@xtuple.com>
Fri, 20 Jun 2014 19:22:45 +0000 (15:22 -0400)
foundation-database/public/tables/metasql/orderActivityByProject-detail.mql

index f211460..4d4ce29 100644 (file)
@@ -221,7 +221,7 @@ UNION ALL
 SELECT DISTINCT -1 AS id, 
        10 AS type,
        '0' AS subtype,
-       1 AS section,
+       2 AS section,
        <? value("quotes") ?> AS section_qtdisplayrole,
        <? value("quotes") ?> AS name,
        NULL::text AS status,
@@ -263,7 +263,7 @@ UNION ALL
 SELECT quhead_id AS id, 
        15 AS type,
        quhead_number AS subtype,
-       1 AS section,
+       2 AS section,
        <? value("quotes") ?> AS section_qtdisplayrole,
        quhead_number AS name,
        CASE WHEN (quhead_status = 'C') THEN 
@@ -316,7 +316,7 @@ UNION ALL
 SELECT quitem_id AS id, 
        17 AS type,
        quhead_number AS subtype,
-       1 AS section,
+       2 AS section,
        <? value("quotes") ?> AS section_qtdisplayrole,
        quitem_linenumber::text AS name, 
        CASE WHEN (quhead_status = 'C') THEN 
@@ -370,7 +370,7 @@ UNION ALL
 SELECT quhead_id AS id, 
        18 AS type,
        quhead_number AS subtype,
-       1 AS section,
+       2 AS section,
        <? value("quotes") ?> AS section_qtdisplayrole,
        <? value("total") ?> AS name,
        NULL AS status,
@@ -414,7 +414,7 @@ UNION ALL
 SELECT -1 AS id, 
        19 AS type,
        MAX(quhead_number) AS subtype,
-       1 AS section,
+       2 AS section,
        <? value("quotes") ?> AS section_qtdisplayrole,
        <? value("total") ?> || ' ' || <? value("quotes") ?> AS name,
        NULL AS status,
@@ -458,7 +458,7 @@ UNION ALL
 SELECT DISTINCT -1 AS id, 
        20 AS type,
        '0' AS subtype,
-       2 AS section,
+       3 AS section,
        <? value("sos") ?> AS section_qtdisplayrole,
        <? value("sos") ?> AS name,
        NULL::text AS status,
@@ -497,7 +497,7 @@ UNION ALL
 SELECT cohead_id AS id, 
        25 AS type,
        cohead_number::text AS subtype,
-       2 AS section,
+       3 AS section,
        <? value("sos") ?> AS section_qtdisplayrole,
        cohead_number::text AS name,
       COALESCE((SELECT 
@@ -559,7 +559,7 @@ UNION ALL
 SELECT coitem_id AS id, 
        27 AS type,
        cohead_number::text AS subtype,
-       2 AS section,
+       3 AS section,
        <? value("sos") ?> AS section_qtdisplayrole,
        coitem_linenumber::text AS name, 
        CASE WHEN (coitem_status = 'O') THEN
@@ -608,7 +608,7 @@ UNION ALL
 SELECT cohead_id AS id, 
        28 AS type,
        cohead_number::text AS subtype,
-       2 AS section,
+       3 AS section,
        <? value("sos") ?> AS section_qtdisplayrole,
        <? value("total") ?> AS name,
        NULL AS status,
@@ -649,7 +649,7 @@ UNION ALL
 SELECT -1 AS id, 
        29 AS type,
        MAX(cohead_number::text) AS subtype,
-       2 AS section,
+       3 AS section,
        <? value("sos") ?> AS section_qtdisplayrole,
        <? value("total") ?> || ' ' || <? value("sos") ?> AS name,
        NULL AS status,
@@ -690,7 +690,7 @@ UNION ALL
 SELECT DISTINCT -1 AS id, 
        30 AS type,
        '0' AS subtype,
-       3 AS section,
+       4 AS section,
        <? value("invoices") ?> AS section_qtdisplayrole,
        <? value("invoices") ?> AS name,
        NULL::text AS status,
@@ -729,7 +729,7 @@ UNION ALL
 SELECT invchead_id AS id,
        35 AS type,
        invchead_invcnumber::text AS subtype,
-       3 AS section,
+       4 AS section,
        <? value("invoices") ?> AS section_qtdisplayrole,
        invchead_invcnumber::text AS name,
        CASE WHEN (invchead_posted) THEN
@@ -775,7 +775,7 @@ UNION ALL
 SELECT invcitem_id AS id, 
        37 AS type,
        invchead_invcnumber::text AS subtype,
-       3 AS section,
+       4 AS section,
        <? value("invoices") ?> AS section_qtdisplayrole,
        invcitem_linenumber::text AS name, 
        CASE WHEN (invchead_posted) THEN
@@ -820,7 +820,7 @@ UNION ALL
 SELECT invchead_id AS id, 
        38 AS type,
        invchead_invcnumber::text AS subtype,
-       3 AS section,
+       4 AS section,
        <? value("invoices") ?> AS section_qtdisplayrole,
        <? value("total") ?> AS name,
        NULL AS status,
@@ -861,7 +861,7 @@ UNION ALL
 SELECT -1 AS id, 
        39 AS type,
        MAX(invchead_invcnumber::text) AS subtype,
-       3 AS section,
+       4 AS section,
        <? value("invoices") ?> AS section_qtdisplayrole,
        <? value("total") ?> || ' ' || <? value("invoices") ?> AS name,
        NULL AS status,
@@ -906,7 +906,7 @@ UNION ALL
 SELECT DISTINCT -1 AS id, 
        40 AS type,
        '0' AS subtype,
-       4 AS section,
+       5 AS section,
        <? value("wos") ?> AS section_qtdisplayrole,
        <? value("wos") ?> AS name,
        NULL::text AS status,
@@ -945,7 +945,7 @@ UNION ALL
 SELECT wo_id AS id, 
        45 AS type,
        formatWoNumber(wo_id) AS subtype,
-       4 AS section,
+       5 AS section,
        <? value("wos") ?> AS section_qtdisplayrole,
        formatWoNumber(wo_id) AS name,
        CASE WHEN (wo_status = 'O') THEN
@@ -997,7 +997,7 @@ UNION ALL
 SELECT -1 AS id, 
        49 AS type,
        MAX(formatWoNumber(wo_id)) AS subtype,
-       4 AS section,
+       5 AS section,
        <? value("wos") ?> AS section_qtdisplayrole,
        <? value("total") ?> || ' ' || <? value("wos") ?> AS name,
        NULL AS status,
@@ -1041,7 +1041,7 @@ SELECT -1 AS id,
 SELECT DISTINCT -1 AS id, 
        50 AS type,
        '0' AS subtype,
-       5 AS section,
+       6 AS section,
        <? value("prs") ?> AS section_qtdisplayrole,
        <? value("prs") ?> AS name,
        NULL::text AS status,
@@ -1080,7 +1080,7 @@ UNION ALL
 SELECT pr_id AS id, 
        55 AS type,
        pr_number::text || '-' || pr_subnumber::text AS subtype,
-       5 AS section,
+       6 AS section,
        <? value("prs") ?> AS section_qtdisplayrole,
        pr_number::text || '-' || pr_subnumber::text AS name,
        <? value("open") ?> AS status, 
@@ -1122,7 +1122,7 @@ UNION ALL
 SELECT -1 AS id, 
        59 AS type,
        MAX(pr_number::text || '-' || pr_subnumber::text) AS subtype,
-       5 AS section,
+       6 AS section,
        <? value("prs") ?> AS section_qtdisplayrole,
        <? value("total") ?> || ' ' || <? value("prs") ?> AS name,
        NULL AS status,
@@ -1164,7 +1164,7 @@ UNION ALL
 SELECT DISTINCT -1 AS id, 
        60 AS type,
        '0' AS subtype,
-       6 AS section,
+       7 AS section,
        <? value("pos") ?> AS section_qtdisplayrole,
        <? value("pos") ?> AS name,
        NULL::text AS status,
@@ -1203,7 +1203,7 @@ UNION ALL
 SELECT pohead_id AS id,
        65 AS type,
        pohead_number::text AS subtype,
-       6 AS section,
+       7 AS section,
        <? value("pos") ?> AS section_qtdisplayrole,
        pohead_number::text AS name,
        CASE WHEN (pohead_status = 'U') THEN
@@ -1250,7 +1250,7 @@ UNION ALL
 SELECT poitem_id AS id, 
        67 AS type,
        pohead_number::text AS subtype,
-       6 AS section,
+       7 AS section,
        <? value("pos") ?> AS section_qtdisplayrole,
        poitem_linenumber::text AS name, 
        CASE WHEN (poitem_status = 'U') THEN
@@ -1298,7 +1298,7 @@ UNION ALL
 SELECT pohead_id AS id, 
        68 AS type,
        pohead_number::text AS subtype,
-       6 AS section,
+       7 AS section,
        <? value("pos") ?> AS section_qtdisplayrole,
        <? value("total") ?> AS name,
        NULL AS status,
@@ -1339,7 +1339,7 @@ UNION ALL
 SELECT -1 AS id, 
        69 AS type,
        MAX(pohead_number::text) AS subtype,
-       6 AS section,
+       7 AS section,
        <? value("sos") ?> AS section_qtdisplayrole,
        <? value("total") ?> || ' ' || <? value("pos") ?> AS name,
        NULL AS status,