1841: ) spread_bl
1842: ---- end of third inline view 'spread_bl'...........
1843: ,
1844: (
1845: select 4 INVERT_ID from dual union all
1846: select 8 INVERT_ID from dual union all
1847: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
1848: ) invert
1849: ) collapse_bl
1842: ---- end of third inline view 'spread_bl'...........
1843: ,
1844: (
1845: select 4 INVERT_ID from dual union all
1846: select 8 INVERT_ID from dual union all
1847: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
1848: ) invert
1849: ) collapse_bl
1850: ---- End of second inline view 'collapse_bl' ..........
1843: ,
1844: (
1845: select 4 INVERT_ID from dual union all
1846: select 8 INVERT_ID from dual union all
1847: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
1848: ) invert
1849: ) collapse_bl
1850: ---- End of second inline view 'collapse_bl' ..........
1851: GROUP BY
2948: ) spread_bl
2949: ---- end of third inline view 'spread_bl'...........
2950: ,
2951: (
2952: select 1 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR1_FLAG') = 'Y' union all /* Added for bug 8708651 */
2953: select 2 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR2_FLAG') = 'Y' union all
2954: select 4 INVERT_ID from dual union all
2955: select 8 INVERT_ID from dual union all
2956: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
2949: ---- end of third inline view 'spread_bl'...........
2950: ,
2951: (
2952: select 1 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR1_FLAG') = 'Y' union all /* Added for bug 8708651 */
2953: select 2 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR2_FLAG') = 'Y' union all
2954: select 4 INVERT_ID from dual union all
2955: select 8 INVERT_ID from dual union all
2956: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
2957: ) invert
2950: ,
2951: (
2952: select 1 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR1_FLAG') = 'Y' union all /* Added for bug 8708651 */
2953: select 2 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR2_FLAG') = 'Y' union all
2954: select 4 INVERT_ID from dual union all
2955: select 8 INVERT_ID from dual union all
2956: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
2957: ) invert
2958: ) collapse_bl
2951: (
2952: select 1 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR1_FLAG') = 'Y' union all /* Added for bug 8708651 */
2953: select 2 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR2_FLAG') = 'Y' union all
2954: select 4 INVERT_ID from dual union all
2955: select 8 INVERT_ID from dual union all
2956: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
2957: ) invert
2958: ) collapse_bl
2959: ---- End of second inline view 'collapse_bl' ..........
2952: select 1 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR1_FLAG') = 'Y' union all /* Added for bug 8708651 */
2953: select 2 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR2_FLAG') = 'Y' union all
2954: select 4 INVERT_ID from dual union all
2955: select 8 INVERT_ID from dual union all
2956: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
2957: ) invert
2958: ) collapse_bl
2959: ---- End of second inline view 'collapse_bl' ..........
2960: GROUP BY
3983: ) spread_bl
3984: ---- end of third inline view 'spread_bl'...........
3985: ,
3986: (
3987: select 1 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR1_FLAG') = 'Y' union all /* Added for bug 8708651 */
3988: select 2 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR2_FLAG') = 'Y' union all
3989: select 4 INVERT_ID from dual union all
3990: select 8 INVERT_ID from dual union all
3991: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
3984: ---- end of third inline view 'spread_bl'...........
3985: ,
3986: (
3987: select 1 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR1_FLAG') = 'Y' union all /* Added for bug 8708651 */
3988: select 2 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR2_FLAG') = 'Y' union all
3989: select 4 INVERT_ID from dual union all
3990: select 8 INVERT_ID from dual union all
3991: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
3992: ) invert
3985: ,
3986: (
3987: select 1 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR1_FLAG') = 'Y' union all /* Added for bug 8708651 */
3988: select 2 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR2_FLAG') = 'Y' union all
3989: select 4 INVERT_ID from dual union all
3990: select 8 INVERT_ID from dual union all
3991: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
3992: ) invert
3993: ) collapse_bl -- WHERE wbs_element_id = 7474 -- and rbs_element_id = 10266 -- and budget_version_id = 2909
3986: (
3987: select 1 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR1_FLAG') = 'Y' union all /* Added for bug 8708651 */
3988: select 2 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR2_FLAG') = 'Y' union all
3989: select 4 INVERT_ID from dual union all
3990: select 8 INVERT_ID from dual union all
3991: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
3992: ) invert
3993: ) collapse_bl -- WHERE wbs_element_id = 7474 -- and rbs_element_id = 10266 -- and budget_version_id = 2909
3994: ---- End of second inline view 'collapse_bl' ..........
3987: select 1 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR1_FLAG') = 'Y' union all /* Added for bug 8708651 */
3988: select 2 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('GLOBAL_CURR2_FLAG') = 'Y' union all
3989: select 4 INVERT_ID from dual union all
3990: select 8 INVERT_ID from dual union all
3991: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
3992: ) invert
3993: ) collapse_bl -- WHERE wbs_element_id = 7474 -- and rbs_element_id = 10266 -- and budget_version_id = 2909
3994: ---- End of second inline view 'collapse_bl' ..........
3995: GROUP BY
4967: ) spread_bl
4968: ---- end of third inline view 'spread_bl'...........
4969: ,
4970: (
4971: select 4 INVERT_ID from dual union all
4972: select 8 INVERT_ID from dual union all
4973: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
4974: ) invert
4975: ) collapse_bl
4968: ---- end of third inline view 'spread_bl'...........
4969: ,
4970: (
4971: select 4 INVERT_ID from dual union all
4972: select 8 INVERT_ID from dual union all
4973: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
4974: ) invert
4975: ) collapse_bl
4976: ---- End of second inline view 'collapse_bl' ..........
4969: ,
4970: (
4971: select 4 INVERT_ID from dual union all
4972: select 8 INVERT_ID from dual union all
4973: select 16 INVERT_ID from dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
4974: ) invert
4975: ) collapse_bl
4976: ---- End of second inline view 'collapse_bl' ..........
4977: GROUP BY
5394: -- Todo: Remove hardcoded currency codes after making code work if one of the global currencies is null.
5395: --
5396: SELECT DECODE(g_global1_currency_code, NULL, 'USD', g_global1_currency_code)
5397: INTO g_global1_currency_code
5398: FROM DUAL;
5399:
5400: SELECT DECODE(g_global2_currency_code, NULL, 'USD', g_global2_currency_code)
5401: INTO g_global2_currency_code
5402: FROM DUAL;
5398: FROM DUAL;
5399:
5400: SELECT DECODE(g_global2_currency_code, NULL, 'USD', g_global2_currency_code)
5401: INTO g_global2_currency_code
5402: FROM DUAL;
5403:
5404: print_time(' Got global currency settings. ');
5405: print_time(' g_currency_conversion_rule ' || g_currency_conversion_rule || ' g_prorating_format ' || g_prorating_format );
5406: print_time(' g_global1_currency_code ' || g_global1_currency_code || ' g_global1_currency_code ' || g_global1_currency_code );
5883: -- , 0 prg_level
5884: , fact.plan_type_code plan_type_code -- 4471527
5885: FROM pji_fp_aggr_pjp1_t fact
5886: , pa_projects_all ppa
5887: , ( SELECT g_global1_currency_code curr_code, 0.01 mau FROM DUAL
5888: UNION
5889: SELECT g_global2_currency_code curr_code, 0.01 mau FROM DUAL
5890: ) curr
5891: , PJI_FM_AGGR_DLY_RATES_T rates
5885: FROM pji_fp_aggr_pjp1_t fact
5886: , pa_projects_all ppa
5887: , ( SELECT g_global1_currency_code curr_code, 0.01 mau FROM DUAL
5888: UNION
5889: SELECT g_global2_currency_code curr_code, 0.01 mau FROM DUAL
5890: ) curr
5891: , PJI_FM_AGGR_DLY_RATES_T rates
5892: , ( SELECT cal_period_id period_id, start_date, end_date FROM pji_time_cal_period_v
5893: UNION ALL
5995: -- , 0 prg_level
5996: , fact.plan_type_code plan_type_code -- 4471527
5997: FROM pji_fp_xbs_accum_f fact
5998: , pa_projects_all ppa
5999: , ( SELECT g_global1_currency_code curr_code, 0.01 mau FROM DUAL
6000: UNION
6001: SELECT g_global2_currency_code curr_code, 0.01 mau FROM DUAL
6002: ) curr
6003: , PJI_FM_AGGR_DLY_RATES_T rates
5997: FROM pji_fp_xbs_accum_f fact
5998: , pa_projects_all ppa
5999: , ( SELECT g_global1_currency_code curr_code, 0.01 mau FROM DUAL
6000: UNION
6001: SELECT g_global2_currency_code curr_code, 0.01 mau FROM DUAL
6002: ) curr
6003: , PJI_FM_AGGR_DLY_RATES_T rates
6004: , ( SELECT cal_period_id period_id, start_date, end_date FROM pji_time_cal_period_v
6005: UNION ALL
7285: ) spread_bl
7286: ---- end of third inline view 'spread_bl'...........
7287: ,
7288: (
7289: SELECT 4 INVERT_ID FROM dual UNION ALL
7290: SELECT 8 INVERT_ID FROM dual UNION ALL
7291: SELECT 16 INVERT_ID FROM dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
7292: ) invert
7293: ) collapse_bl
7286: ---- end of third inline view 'spread_bl'...........
7287: ,
7288: (
7289: SELECT 4 INVERT_ID FROM dual UNION ALL
7290: SELECT 8 INVERT_ID FROM dual UNION ALL
7291: SELECT 16 INVERT_ID FROM dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
7292: ) invert
7293: ) collapse_bl
7294: ---- End of second inline view 'collapse_bl' ..........
7287: ,
7288: (
7289: SELECT 4 INVERT_ID FROM dual UNION ALL
7290: SELECT 8 INVERT_ID FROM dual UNION ALL
7291: SELECT 16 INVERT_ID FROM dual where PJI_UTILS.GET_SETUP_PARAMETER('TXN_CURR_FLAG') = 'Y'
7292: ) invert
7293: ) collapse_bl
7294: ---- End of second inline view 'collapse_bl' ..........
7295: GROUP BY
9384: DECLARE
9385: BEGIN
9386: SELECT 'Y'
9387: INTO l_dangling_flag
9388: FROM DUAL
9389: WHERE EXISTS(
9390: SELECT 1
9391: FROM pji_fp_aggr_pjp1_t
9392: WHERE ( time_dangling_flag IS NOT NULL
9672: , l_last_update_date last_update_date
9673: , l_last_updated_by last_updated_by
9674: , l_created_by created_by
9675: , l_last_update_login last_update_login
9676: FROM DUAL;
9677:
9678: print_time (' INSERT_NTP_CAL_RECORD, # rows inserted is: ' || SQL%ROWCOUNT );
9679:
9680: EXCEPTION
9734: FROM pa_implementations_all imp
9735: , gl_sets_of_books sob
9736: , pa_projects_all proj
9737: , pji_fm_extr_plnver3_t ver
9738: , ( SELECT 1 cal_type FROM DUAL -- 1 GL, 2 PA.
9739: UNION ALL
9740: SELECT 2 FROM DUAL
9741: ) split_cal
9742: WHERE 1=1
9736: , pa_projects_all proj
9737: , pji_fm_extr_plnver3_t ver
9738: , ( SELECT 1 cal_type FROM DUAL -- 1 GL, 2 PA.
9739: UNION ALL
9740: SELECT 2 FROM DUAL
9741: ) split_cal
9742: WHERE 1=1
9743: AND proj.org_id=imp.org_id
9744: AND ver.project_id = proj.project_id