DBA Data[Home] [Help]

APPS.PA_FP_GEN_FCST_AMT_PUB dependencies on PA_FP_CALC_AMT_TMP1

Line 142: DELETE FROM PA_FP_CALC_AMT_TMP1;

138: ret status: '||x_return_status,
139: p_module_name => l_module_name);
140: END IF;
141:
142: DELETE FROM PA_FP_CALC_AMT_TMP1;
143: DELETE FROM PA_FP_CALC_AMT_TMP2;
144: IF p_fp_cols_rec.x_gen_incl_open_comm_flag = 'Y' THEN
145: IF p_pa_debug_mode = 'Y' THEN
146: PA_FP_GEN_AMOUNT_UTILS.FP_DEBUG(

Line 1160: FROM PA_FP_CALC_AMT_TMP1 tmp1;

1156: tmp1.target_res_asg_id,
1157: tmp1.resource_list_member_id,
1158: tmp1.cbs_element_id, --bug#16791711
1159: tmp1.etc_method_code
1160: FROM PA_FP_CALC_AMT_TMP1 tmp1;
1161:
1162: l_task_id_tab2 PA_PLSQL_DATATYPES.NumTabTyp;
1163: l_gen_etc_source_code_tab2 pa_plsql_datatypes.Char30TabTyp;
1164: l_src_ra_id_tab2 PA_PLSQL_DATATYPES.NumTabTyp;

Line 1318: -- Bug 4346172: As part of the fix, added join on pa_fp_calc_amt_tmp1

1314:
1315: l_gen_etc_src_code_tab_tmp SYSTEM.pa_varchar2_30_tbl_type:=SYSTEM.pa_varchar2_30_tbl_type();
1316: l_gen_etc_src_code_tab SYSTEM.pa_varchar2_30_tbl_type:=SYSTEM.pa_varchar2_30_tbl_type();
1317:
1318: -- Bug 4346172: As part of the fix, added join on pa_fp_calc_amt_tmp1
1319: -- to get the correct source ETC method code.
1320: -- As a result of further testing, discovered that the original fix
1321: -- introduced a duplicate resource error when Commitments are included.
1322: -- PROBLEM:

Line 1324: -- PA_FP_CALC_AMT_TMP1 table. However, when Commitments are included,

1320: -- As a result of further testing, discovered that the original fix
1321: -- introduced a duplicate resource error when Commitments are included.
1322: -- PROBLEM:
1323: -- Normally, there should be 1 record per target_res_asg_id in the
1324: -- PA_FP_CALC_AMT_TMP1 table. However, when Commitments are included,
1325: -- extra PA_FP_CALC_AMT_TMP1 records are added for commitment records.
1326: -- As a result, the query returned 2 records for target resources with
1327: -- commitments and ETC.
1328: -- SOLUTION:

Line 1325: -- extra PA_FP_CALC_AMT_TMP1 records are added for commitment records.

1321: -- introduced a duplicate resource error when Commitments are included.
1322: -- PROBLEM:
1323: -- Normally, there should be 1 record per target_res_asg_id in the
1324: -- PA_FP_CALC_AMT_TMP1 table. However, when Commitments are included,
1325: -- extra PA_FP_CALC_AMT_TMP1 records are added for commitment records.
1326: -- As a result, the query returned 2 records for target resources with
1327: -- commitments and ETC.
1328: -- SOLUTION:
1329: -- Ignore records in the PA_FP_CALC_AMT_TMP1 table with transaction

Line 1329: -- Ignore records in the PA_FP_CALC_AMT_TMP1 table with transaction

1325: -- extra PA_FP_CALC_AMT_TMP1 records are added for commitment records.
1326: -- As a result, the query returned 2 records for target resources with
1327: -- commitments and ETC.
1328: -- SOLUTION:
1329: -- Ignore records in the PA_FP_CALC_AMT_TMP1 table with transaction
1330: -- source code of 'OPEN_COMMITMENTS'. This will ensure that the query
1331: -- retrieves at most 1 record per target_res_asg_id. Note that we do
1332: -- not need to worry about the scenario when there is a commitment
1333: -- record in the temp table but no ETC record, since the purpose of

Line 1368: INDEX(tmp_ra,PA_FP_CALC_AMT_TMP1_N1) */

1364:
1365: CURSOR etc_amts_cur_wp_fp_opt_same
1366: (c_gen_etc_source_code VARCHAR2 DEFAULT NULL) IS
1367: SELECT /*+ INDEX(tmp,PA_FP_CALC_AMT_TMP2_N1)
1368: INDEX(tmp_ra,PA_FP_CALC_AMT_TMP1_N1) */
1369: tmp.RESOURCE_ASSIGNMENT_ID,
1370: tmp.TARGET_RES_ASG_ID,
1371: tmp.ETC_CURRENCY_CODE,
1372: ra.rate_based_flag,

Line 1385: FROM PA_FP_CALC_AMT_TMP1 tmp_ra,

1381: SUM(tmp.ETC_TXN_REVENUE),
1382: NVL(ta.billable_flag,'Y'), /* Added for ER 4376722 */
1383: nvl(c_gen_etc_source_code, /* Added for Bug 4369741 */
1384: nvl(tmp_ra.transaction_source_code, 'NONE'))
1385: FROM PA_FP_CALC_AMT_TMP1 tmp_ra,
1386: PA_FP_CALC_AMT_TMP2 tmp,
1387: PA_RESOURCE_ASSIGNMENTS ra,
1388: pa_tasks ta /* Added for ER 4376722 */
1389: WHERE tmp.target_res_asg_id = ra.resource_assignment_id

Line 1435: INDEX(tmp_ra,PA_FP_CALC_AMT_TMP1_N1) */

1431:
1432: CURSOR etc_amts_cur_wp_fp_opt_diff
1433: (c_gen_etc_source_code VARCHAR2 DEFAULT NULL) IS
1434: SELECT /*+ INDEX(tmp,PA_FP_CALC_AMT_TMP2_N1)
1435: INDEX(tmp_ra,PA_FP_CALC_AMT_TMP1_N1) */
1436: sum(1*null),
1437: tmp.TARGET_RES_ASG_ID,
1438: tmp.ETC_CURRENCY_CODE,
1439: ra.rate_based_flag,

Line 1452: FROM PA_FP_CALC_AMT_TMP1 tmp_ra, /* Added for Bug 4369741 */

1448: SUM(tmp.ETC_TXN_REVENUE),
1449: NVL(ta.billable_flag,'Y'), /* Added for ER 4376722 */
1450: nvl(c_gen_etc_source_code, /* Added for Bug 4369741 */
1451: nvl(tmp_ra.transaction_source_code, 'NONE'))
1452: FROM PA_FP_CALC_AMT_TMP1 tmp_ra, /* Added for Bug 4369741 */
1453: PA_FP_CALC_AMT_TMP2 tmp,
1454: PA_RESOURCE_ASSIGNMENTS ra,
1455: pa_tasks ta /* Added for ER 4376722 */
1456: WHERE tmp.target_res_asg_id = ra.resource_assignment_id

Line 1490: INDEX(tmp_ra,PA_FP_CALC_AMT_TMP1_N1) */

1486: * resources with non-Workplan source. */
1487:
1488: CURSOR etc_amts_cur_wp_opt_same IS
1489: SELECT /*+ INDEX(tmp,PA_FP_CALC_AMT_TMP2_N1)
1490: INDEX(tmp_ra,PA_FP_CALC_AMT_TMP1_N1) */
1491: tmp.RESOURCE_ASSIGNMENT_ID,
1492: tmp.TARGET_RES_ASG_ID,
1493: tmp.ETC_CURRENCY_CODE,
1494: ra.rate_based_flag,

Line 1506: FROM PA_FP_CALC_AMT_TMP1 tmp_ra,

1502: SUM(tmp.ETC_TXN_BURDENED_COST),
1503: SUM(tmp.ETC_TXN_REVENUE),
1504: NVL(ta.billable_flag,'Y'), /* Added for ER 4376722 */
1505: tmp_ra.transaction_source_code /* Added for Bug 4369741 */
1506: FROM PA_FP_CALC_AMT_TMP1 tmp_ra,
1507: PA_FP_CALC_AMT_TMP2 tmp,
1508: PA_RESOURCE_ASSIGNMENTS ra,
1509: pa_tasks ta /* Added for ER 4376722 */
1510: WHERE tmp.target_res_asg_id = ra.resource_assignment_id

Line 1532: INDEX(tmp_ra,PA_FP_CALC_AMT_TMP1_N1) */

1528: NVL(ta.billable_flag,'Y'), /* Added for ER 4376722 */
1529: tmp_ra.transaction_source_code /* Added for Bug 4369741 */
1530: UNION ALL
1531: SELECT /*+ INDEX(tmp,PA_FP_CALC_AMT_TMP2_N1)
1532: INDEX(tmp_ra,PA_FP_CALC_AMT_TMP1_N1) */
1533: sum(1*null),
1534: tmp.TARGET_RES_ASG_ID,
1535: tmp.ETC_CURRENCY_CODE,
1536: ra.rate_based_flag,

Line 1548: FROM PA_FP_CALC_AMT_TMP1 tmp_ra, /* Added for Bug 4369741 */

1544: SUM(tmp.ETC_TXN_BURDENED_COST),
1545: SUM(tmp.ETC_TXN_REVENUE),
1546: NVL(ta.billable_flag,'Y'), /* Added for ER 4376722 */
1547: tmp_ra.transaction_source_code /* Added for Bug 4369741 */
1548: FROM PA_FP_CALC_AMT_TMP1 tmp_ra, /* Added for Bug 4369741 */
1549: PA_FP_CALC_AMT_TMP2 tmp,
1550: PA_RESOURCE_ASSIGNMENTS ra,
1551: pa_tasks ta /* Added for ER 4376722 */
1552: WHERE tmp.target_res_asg_id = ra.resource_assignment_id

Line 1586: INDEX(tmp_ra,PA_FP_CALC_AMT_TMP1_N1) */

1582: * resources with non Financial Plan source. */
1583:
1584: CURSOR etc_amts_cur_fp_opt_same IS
1585: SELECT /*+ INDEX(tmp,PA_FP_CALC_AMT_TMP2_N1)
1586: INDEX(tmp_ra,PA_FP_CALC_AMT_TMP1_N1) */
1587: tmp.RESOURCE_ASSIGNMENT_ID,
1588: tmp.TARGET_RES_ASG_ID,
1589: tmp.ETC_CURRENCY_CODE,
1590: ra.rate_based_flag,

Line 1602: FROM PA_FP_CALC_AMT_TMP1 tmp_ra,

1598: SUM(tmp.ETC_TXN_BURDENED_COST),
1599: SUM(tmp.ETC_TXN_REVENUE),
1600: NVL(ta.billable_flag,'Y'), /* Added for ER 4376722 */
1601: tmp_ra.transaction_source_code /* Added for Bug 4369741 */
1602: FROM PA_FP_CALC_AMT_TMP1 tmp_ra,
1603: PA_FP_CALC_AMT_TMP2 tmp,
1604: PA_RESOURCE_ASSIGNMENTS ra,
1605: pa_tasks ta /* Added for ER 4376722 */
1606: WHERE tmp.target_res_asg_id = ra.resource_assignment_id

Line 1628: INDEX(tmp_ra,PA_FP_CALC_AMT_TMP1_N1) */

1624: NVL(ta.billable_flag,'Y'), /* Added for ER 4376722 */
1625: tmp_ra.transaction_source_code /* Added for Bug 4369741 */
1626: UNION ALL
1627: SELECT /*+ INDEX(tmp,PA_FP_CALC_AMT_TMP2_N1)
1628: INDEX(tmp_ra,PA_FP_CALC_AMT_TMP1_N1) */
1629: sum(1*null),
1630: tmp.TARGET_RES_ASG_ID,
1631: tmp.ETC_CURRENCY_CODE,
1632: ra.rate_based_flag,

Line 1644: FROM PA_FP_CALC_AMT_TMP1 tmp_ra, /* Added for Bug 4369741 */

1640: SUM(tmp.ETC_TXN_BURDENED_COST),
1641: SUM(tmp.ETC_TXN_REVENUE),
1642: NVL(ta.billable_flag,'Y'), /* Added for ER 4376722 */
1643: tmp_ra.transaction_source_code /* Added for Bug 4369741 */
1644: FROM PA_FP_CALC_AMT_TMP1 tmp_ra, /* Added for Bug 4369741 */
1645: PA_FP_CALC_AMT_TMP2 tmp,
1646: PA_RESOURCE_ASSIGNMENTS ra,
1647: pa_tasks ta /* Added for ER 4376722 */
1648: WHERE tmp.target_res_asg_id = ra.resource_assignment_id

Line 2429: FROM pa_fp_calc_amt_tmp1 tmp1

2425: IN
2426: (SELECT pt.task_id
2427: FROM pa_tasks pt
2428: WHERE pt.top_task_id IN (SELECT tmp1.task_id
2429: FROM pa_fp_calc_amt_tmp1 tmp1
2430: WHERE tmp1.budget_version_id =
2431: p_etc_fp_plan_version_id)
2432: AND pt.task_id NOT IN (SELECT tmp1.task_id
2433: FROM pa_fp_calc_amt_tmp1 tmp1

Line 2433: FROM pa_fp_calc_amt_tmp1 tmp1

2429: FROM pa_fp_calc_amt_tmp1 tmp1
2430: WHERE tmp1.budget_version_id =
2431: p_etc_fp_plan_version_id)
2432: AND pt.task_id NOT IN (SELECT tmp1.task_id
2433: FROM pa_fp_calc_amt_tmp1 tmp1
2434: WHERE tmp1.budget_version_id =
2435: p_etc_fp_plan_version_id)
2436: AND pt.project_id=p_project_id
2437: AND pt.task_id<>pt.top_task_id

Line 2564: /* select count(*) into l_test from Pa_fp_CALC_AMT_TMP1;

2560: /**From latest approved version, by calling gen_map_bv_to_target_rl
2561: *we get PA_FP_CALC_AMT_TMP3 popuated, from it, we can get the
2562: *baselined cost**/
2563:
2564: /* select count(*) into l_test from Pa_fp_CALC_AMT_TMP1;
2565: hr_utility.trace('fp calc amt tmp1 tab count '||l_test);
2566: select count(*) into l_test from Pa_fp_CALC_AMT_TMP2;
2567: hr_utility.trace('fp calc amt tmp2 tab count '||l_test); */
2568:

Line 2742: --select count(*) into l_count_tmp from PA_FP_CALC_AMT_TMP1;

2738: ELSE
2739: l_gen_etc_source_code_override := NULL;
2740: END IF;
2741:
2742: --select count(*) into l_count_tmp from PA_FP_CALC_AMT_TMP1;
2743: --dbms_output.put_line('l_count_tmp:'||l_count_tmp);
2744: --hr_utility.trace('bef cursor for etc amt calc');
2745: OPEN traverse_tasks_rlm_cur(l_gen_etc_source_code_override);
2746: FETCH traverse_tasks_rlm_cur

Line 3160: /* select count(*) into l_count_tmp from PA_FP_CALC_AMT_TMP1;

3156: *ETC amounts populated in tmp2 table, now, we need to map the amounts to the target fin
3157: *plan's resource list, summ up, call calculate to spread into pa_budget_lines if time_phase
3158: *is not null, otherwise, we need to populate into pa_budget_lines by ourselves**/
3159:
3160: /* select count(*) into l_count_tmp from PA_FP_CALC_AMT_TMP1;
3161: hr_utility.trace('tmp1 count :'|| l_count_tmp);
3162: select count(*) into l_count_tmp from PA_FP_CALC_AMT_TMP2;
3163: hr_utility.trace('tmp2 count :'|| l_count_tmp); */
3164: --delete from calc_amt_tmp11;

Line 3165: --insert into calc_amt_tmp11 select * from pa_fp_calc_amt_tmp1;

3161: hr_utility.trace('tmp1 count :'|| l_count_tmp);
3162: select count(*) into l_count_tmp from PA_FP_CALC_AMT_TMP2;
3163: hr_utility.trace('tmp2 count :'|| l_count_tmp); */
3164: --delete from calc_amt_tmp11;
3165: --insert into calc_amt_tmp11 select * from pa_fp_calc_amt_tmp1;
3166:
3167: --select count(*) into l_count_tmp from PA_FP_CALC_AMT_TMP1;
3168: --hr_utility.trace('***PA_FP_CALC_AMT_TMP1.count'||l_count_tmp);
3169: --select count(*) into l_count_tmp from PA_FP_CALC_AMT_TMP2;

Line 3167: --select count(*) into l_count_tmp from PA_FP_CALC_AMT_TMP1;

3163: hr_utility.trace('tmp2 count :'|| l_count_tmp); */
3164: --delete from calc_amt_tmp11;
3165: --insert into calc_amt_tmp11 select * from pa_fp_calc_amt_tmp1;
3166:
3167: --select count(*) into l_count_tmp from PA_FP_CALC_AMT_TMP1;
3168: --hr_utility.trace('***PA_FP_CALC_AMT_TMP1.count'||l_count_tmp);
3169: --select count(*) into l_count_tmp from PA_FP_CALC_AMT_TMP2;
3170: --hr_utility.trace('**PA_FP_CALC_AMT_TMP2.count'||l_count_tmp);
3171: --hr_utility.trace('**P_FP_COLS_REC.X_TIME_PHASED_CODE:'||P_FP_COLS_REC.X_TIME_PHASED_CODE);

Line 3168: --hr_utility.trace('***PA_FP_CALC_AMT_TMP1.count'||l_count_tmp);

3164: --delete from calc_amt_tmp11;
3165: --insert into calc_amt_tmp11 select * from pa_fp_calc_amt_tmp1;
3166:
3167: --select count(*) into l_count_tmp from PA_FP_CALC_AMT_TMP1;
3168: --hr_utility.trace('***PA_FP_CALC_AMT_TMP1.count'||l_count_tmp);
3169: --select count(*) into l_count_tmp from PA_FP_CALC_AMT_TMP2;
3170: --hr_utility.trace('**PA_FP_CALC_AMT_TMP2.count'||l_count_tmp);
3171: --hr_utility.trace('**P_FP_COLS_REC.X_TIME_PHASED_CODE:'||P_FP_COLS_REC.X_TIME_PHASED_CODE);
3172:

Line 3186: SELECT /*+ INDEX(tmp1,PA_FP_CALC_AMT_TMP1_N1)*/

3182: IF p_fp_cols_rec.x_time_phased_code IN ('P','G') THEN
3183: l_etc_start_date :=
3184: PA_FP_GEN_AMOUNT_UTILS.GET_ETC_START_DATE(p_budget_version_id);
3185:
3186: SELECT /*+ INDEX(tmp1,PA_FP_CALC_AMT_TMP1_N1)*/
3187: DISTINCT tmp1.target_res_asg_id
3188: BULK COLLECT
3189: INTO l_res_asg_uom_update_tab
3190: FROM PA_FP_CALC_AMT_TMP1 tmp1,

Line 3190: FROM PA_FP_CALC_AMT_TMP1 tmp1,

3186: SELECT /*+ INDEX(tmp1,PA_FP_CALC_AMT_TMP1_N1)*/
3187: DISTINCT tmp1.target_res_asg_id
3188: BULK COLLECT
3189: INTO l_res_asg_uom_update_tab
3190: FROM PA_FP_CALC_AMT_TMP1 tmp1,
3191: pa_resource_assignments ra
3192: WHERE ra.budget_version_id = p_budget_version_id
3193: AND ra.resource_assignment_id = tmp1.target_res_asg_id
3194: AND ( ra.transaction_source_code IS NOT NULL

Line 3208: SELECT /*+ INDEX(tmp1,PA_FP_CALC_AMT_TMP1_N1)*/

3204: WHERE tmp2.target_res_asg_id = tmp1.target_res_asg_id
3205: AND tmp2.transaction_source_code = 'ETC'
3206: AND rownum = 1 );
3207: ELSIF p_fp_cols_rec.x_time_phased_code = 'N' THEN
3208: SELECT /*+ INDEX(tmp1,PA_FP_CALC_AMT_TMP1_N1)*/
3209: DISTINCT tmp1.target_res_asg_id
3210: BULK COLLECT
3211: INTO l_res_asg_uom_update_tab
3212: FROM PA_FP_CALC_AMT_TMP1 tmp1,

Line 3212: FROM PA_FP_CALC_AMT_TMP1 tmp1,

3208: SELECT /*+ INDEX(tmp1,PA_FP_CALC_AMT_TMP1_N1)*/
3209: DISTINCT tmp1.target_res_asg_id
3210: BULK COLLECT
3211: INTO l_res_asg_uom_update_tab
3212: FROM PA_FP_CALC_AMT_TMP1 tmp1,
3213: pa_resource_assignments ra
3214: WHERE ra.budget_version_id = p_budget_version_id
3215: AND ra.resource_assignment_id = tmp1.target_res_asg_id
3216: AND ( ra.transaction_source_code IS NOT NULL

Line 4991: FROM PA_FP_CALC_AMT_TMP1

4987: CBS_ELEMENT_ID,--bug#16791711
4988: to_number(NULL),
4989: min(planning_start_date),
4990: max(planning_end_date)
4991: FROM PA_FP_CALC_AMT_TMP1
4992: GROUP BY mapped_fin_task_id,TARGET_RLM_ID,CBS_ELEMENT_ID,to_number(NULL));
4993: ELSIF P_FP_COLS_REC.X_FIN_PLAN_LEVEL_CODE = 'P' THEN
4994: -- hr_utility.trace('inside proj lvl in maintain res asg :');
4995: INSERT INTO PA_FP_PLANNING_RES_TMP1 (

Line 5008: FROM PA_FP_CALC_AMT_TMP1

5004: CBS_ELEMENT_ID,--bug#16791711
5005: to_number(NULL),
5006: min(planning_start_date),
5007: max(planning_end_date)
5008: FROM PA_FP_CALC_AMT_TMP1
5009: group by 0, TARGET_RLM_ID,CBS_ELEMENT_ID,
5010: to_number(NULL) );
5011: ELSIF P_FP_COLS_REC.X_FIN_PLAN_LEVEL_CODE = 'T' THEN
5012: -- hr_utility.trace('inside top task in maintain res asg :');

Line 5026: FROM PA_FP_CALC_AMT_TMP1 group by

5022: CBS_ELEMENT_ID,--bug#16791711
5023: to_number(NULL),
5024: min(planning_start_date),
5025: max(planning_end_date)
5026: FROM PA_FP_CALC_AMT_TMP1 group by
5027: mapped_fin_task_id,TARGET_RLM_ID,CBS_ELEMENT_ID,
5028: to_number(NULL) );
5029: END IF;
5030: -- select count(*) into l_count from PA_FP_PLANNING_RES_TMP1;