DBA Data[Home] [Help]

APPS.PA_ALLOC_RUN dependencies on PA_ALLOC_RUNS

Line 160: SELECT pa_alloc_runs_s.nextval

156: pa_debug.G_err_stage := 'GETTING NEW RUN ID';
157: IF P_DEBUG_MODE = 'Y' THEN
158: pa_debug.write_file('allocation_run: ' || 'LOG', pa_debug.G_err_stage);
159: END IF;
160: SELECT pa_alloc_runs_s.nextval
161: INTO v_run_id
162: FROM dual;
163: G_alloc_run_id := v_run_id;
164: x_run_id := v_run_id;

Line 527: UPDATE pa_alloc_runs

523: alloc_errors( p_rule_id, x_run_id,'R','W','PA_AL_ALL_TASKS_RECD_ZERO_AMT', FALSE) ;
524: END IF ;
525:
526: if x_errbuf is null then /* added if clause for 6243121 */
527: UPDATE pa_alloc_runs
528: SET run_status = DECODE( v_mode, 'RELEASE', 'RS', 'DS'),
529: release_request_id = decode(v_mode, 'RELEASE',v_request_id, NULL),
530: release_request_date = decode(v_mode, 'RELEASE',sysdate, NULL)
531: WHERE run_id = x_run_id;

Line 541: UPDATE pa_alloc_runs

537: END IF;
538:
539: /* added for 6243121 */
540: else -- if any error/exception is encountered while releasing
541: UPDATE pa_alloc_runs
542: SET run_status = DECODE( v_mode, 'RELEASE', 'RF', 'DF'),
543: release_request_id = decode(v_mode, 'RELEASE',v_request_id, NULL),
544: release_request_date = decode(v_mode, 'RELEASE',sysdate, NULL)
545: WHERE run_id = x_run_id;

Line 576: UPDATE pa_alloc_runs

572: pa_debug.G_err_stage := 'UPDATING RUN STATUS AS FAILURE';
573: IF P_DEBUG_MODE = 'Y' THEN
574: pa_debug.write_file('allocation_run: ' || 'LOG', pa_debug.G_err_stage);
575: END IF;
576: UPDATE pa_alloc_runs
577: SET run_status = DECODE( v_mode, 'RELEASE', 'RF',
578: 'DRAFT', 'DF',
579: run_status ),
580: release_request_id = decode(v_mode, 'RELEASE',v_request_id, NULL),

Line 600: FROM pa_alloc_runs

596: , x_run_id IN OUT NOCOPY NUMBER
597: , x_mode OUT NOCOPY VARCHAR2 ) IS
598: CURSOR C_run_id IS
599: SELECT max(run_id)
600: FROM pa_alloc_runs
601: WHERE rule_id = p_rule_id
602: AND run_id <> x_run_id;
603: CURSOR C_prev_run( p_prev_run_id IN NUMBER) IS
604: SELECT run_status

Line 605: FROM pa_alloc_runs

601: WHERE rule_id = p_rule_id
602: AND run_id <> x_run_id;
603: CURSOR C_prev_run( p_prev_run_id IN NUMBER) IS
604: SELECT run_status
605: FROM pa_alloc_runs
606: WHERE run_id = p_prev_run_id ;
607: v_run_status VARCHAR2(5) := NULL;
608: v_prev_run_id NUMBER;
609: BEGIN

Line 2632: FROM pa_alloc_runs

2628: AND actual_flag = 'A'
2629: AND translated_flag IS NULL;
2630: CURSOR get_pool_percent IS
2631: SELECT nvl(pool_percent,100) pool_percent
2632: FROM pa_alloc_runs
2633: WHERE run_id = p_run_id;
2634: v_sob_id NUMBER;
2635: v_currency_code VARCHAR2(10);
2636: v_period_type VARCHAR2(10);

Line 2801: pa_alloc_runs ar

2797: , a.project_id project_id
2798: , a.task_id task_id
2799: , nvl(a.eligible_amount,0) eligible_amount
2800: FROM pa_alloc_run_source_det a,
2801: pa_alloc_runs ar
2802: WHERE a.run_id = ar.run_id
2803: AND a.rule_id = p_rule_id
2804: AND ar.fiscal_year = NVL(p_fscl_year, ar.fiscal_year)
2805: AND ar.quarter = NVL(p_qrtr_num, ar.quarter)

Line 2816: pa_alloc_runs c_ar -- added this table to exclude reversed runs.

2812: AND b.rule_id = p_rule_id
2813: AND b.run_id = p_run_id )
2814: AND a.run_id =( SELECT max(c.run_id)
2815: FROM pa_alloc_run_source_det c,
2816: pa_alloc_runs c_ar -- added this table to exclude reversed runs.
2817: WHERE c.project_id = a.project_id
2818: AND c.task_id = a.task_id
2819: AND c.run_id = c_ar.run_id
2820: AND c_ar.rule_id = p_rule_id

Line 2838: -- the PA_ALLOC_RUNS (single) record for the largest Run_Id

2834: NVL ( A.Eligible_Amount, 0 ) Eligible_Amount
2835: FROM PA_ALLOC_RUN_SOURCE_DET A ,
2836: ( --
2837: -- The purpose of this in-line view is to return
2838: -- the PA_ALLOC_RUNS (single) record for the largest Run_Id
2839: -- less than the input p_Run_Id
2840: --
2841: SELECT MAX ( AR.Run_Id ) AS Run_Id
2842: FROM PA_ALLOC_RUNS AR

Line 2842: FROM PA_ALLOC_RUNS AR

2838: -- the PA_ALLOC_RUNS (single) record for the largest Run_Id
2839: -- less than the input p_Run_Id
2840: --
2841: SELECT MAX ( AR.Run_Id ) AS Run_Id
2842: FROM PA_ALLOC_RUNS AR
2843: WHERE AR.Fiscal_Year = NVL ( p_Fscl_Year , AR.Fiscal_Year )
2844: AND AR.Quarter = NVL ( p_Qrtr_Num , AR.Quarter )
2845: AND AR.Period_Num = NVL ( p_Prd_Num , AR.Period_Num )
2846: AND AR.Run_Id < p_Run_Id

Line 2871: pa_alloc_runs ar

2867: , a.project_id project_id
2868: , a.task_id task_id
2869: , nvl(a.Total_allocation,0) Total_allocation
2870: FROM pa_alloc_txn_details a,
2871: pa_alloc_runs ar
2872: WHERE a.run_id = ar.run_id
2873: AND a.rule_id = p_rule_id
2874: AND ar.fiscal_year = NVL(p_fscl_year, ar.fiscal_year)
2875: AND ar.quarter = NVL(p_qrtr_num, ar.quarter)

Line 2887: pa_alloc_runs c_ar -- added this table to exclude reversed runs.

2883: AND b.exclude_flag = 'N'
2884: AND b.run_id = p_run_id )
2885: AND a.run_id =( SELECT max(c.run_id)
2886: FROM pa_alloc_txn_details c,
2887: pa_alloc_runs c_ar -- added this table to exclude reversed runs.
2888: WHERE c.project_id = a.project_id
2889: AND c.task_id = a.task_id
2890: AND c.transaction_type = 'T'
2891: AND c.run_id = c_ar.run_id

Line 2999: pa_alloc_runs b

2995: , p_fscl_year IN NUMBER
2996: , p_prd_num IN NUMBER ) IS
2997: SELECT nvl(sum(nvl(a.current_allocation,0)),0)
2998: FROM pa_alloc_txn_details a,
2999: pa_alloc_runs b
3000: WHERE b.rule_id = p_rule_id
3001: AND b.run_id < p_run_id
3002: AND b.quarter = nvl(p_qrtr_num, b.quarter)
3003: AND b.fiscal_year = nvl(p_fscl_year, b.fiscal_year)

Line 3324: from pa_alloc_runs par1

3320: v_fiscal_year NUMBER;
3321: v_period_num NUMBER;
3322: cursor c_sum_of_allocated_amts is
3323: select NVL(sum ( nvl(par1.allocated_amount,0)),0)
3324: from pa_alloc_runs par1
3325: where par1.run_id < p_run_id
3326: and par1.rule_id = p_rule_id
3327: and par1.fiscal_year = nvl(v_fiscal_year, par1.fiscal_year)
3328: and par1.quarter = nvl(v_quarter_num, par1.quarter)

Line 3583: UPDATE pa_alloc_runs

3579: pa_debug.write_file('create_target_txns: ' || 'LOG', 'v_src_sunk_cost:'||to_char(v_src_sunk_cost) );
3580: pa_debug.write_file('create_target_txns: ' || 'LOG', 'v_tgt_sunk_cost:'||to_char(v_tgt_sunk_cost) );
3581: END IF;
3582: x_curr_alloc_amount := nvl(v_net_alloc_amount,0)+nvl(v_remnant_amount,0) ;
3583: UPDATE pa_alloc_runs
3584: SET total_pool_amount = nvl(p_pool_amount,0)
3585: , allocated_amount = nvl(v_net_alloc_amount,0)+nvl(v_remnant_amount,0)
3586: , Missing_source_proj_amt = v_src_sunk_cost
3587: , Missing_target_proj_amt = v_tgt_sunk_cost

Line 3637: ,pa_alloc_runs par

3633: CURSOR C_prev_offset_task_CE (v_project_id IN NUMBER
3634: , v_task_id IN NUMBER) is
3635: SELECT nvl(sum(nvl(current_allocation,0)),0)
3636: from pa_alloc_txn_details pat
3637: ,pa_alloc_runs par
3638: where pat.run_id = par.run_id
3639: and par.fiscal_year = nvl(p_fiscal_year, par.fiscal_year)
3640: and par.quarter = nvl(p_quarter_num,par.quarter)
3641: and par.period_num = nvl(p_period_num , par.period_num)

Line 3656: pa_alloc_runs ar

3652: , a.project_id project_id
3653: , a.task_id task_id
3654: , nvl(a.Total_allocation,0) Total_allocation
3655: FROM pa_alloc_txn_details a,
3656: pa_alloc_runs ar
3657: WHERE a.run_id = ar.run_id
3658: AND a.rule_id = p_rule_id
3659: AND ar.fiscal_year = NVL(p_fscl_year, ar.fiscal_year)
3660: AND ar.quarter = NVL(p_qrtr_num, ar.quarter)

Line 3672: pa_alloc_runs c_ar -- added this table to exclude reversed runs.

3668: AND b.transaction_type = 'O'
3669: AND b.run_id = p_run_id )
3670: AND a.run_id =( SELECT max(c.run_id)
3671: FROM pa_alloc_txn_details c,
3672: pa_alloc_runs c_ar -- added this table to exclude reversed runs.
3673: WHERE c.project_id = a.project_id
3674: AND c.task_id = a.task_id
3675: AND c.transaction_type = 'O'
3676: AND c.run_id = c_ar.run_id

Line 4153: update pa_alloc_runs

4149: IF P_DEBUG_MODE = 'Y' THEN
4150: pa_debug.write_file('create_offset_txns: ' || 'LOG','v_off_sunk_cost =' ||to_char(v_off_sunk_cost) );
4151: END IF;
4152: END IF ;
4153: update pa_alloc_runs
4154: set Missing_offset_proj_amt = nvl(v_off_sunk_cost,0) ,
4155: TOTAL_OFFSETTED_AMOUNT = v_sum_tot_offsets
4156: where run_id = p_run_id ;
4157: pa_debug.reset_err_stack;

Line 4285: Select pa_alloc_runs_s.nextval

4281: ) IS
4282: BEGIN
4283: pa_debug.set_err_stack('insert_alloc_runs');
4284: If x_run_id is NULL then
4285: Select pa_alloc_runs_s.nextval
4286: Into x_run_id
4287: From dual;
4288: End If;
4289: INSERT INTO pa_alloc_runs_all (

Line 4289: INSERT INTO pa_alloc_runs_all (

4285: Select pa_alloc_runs_s.nextval
4286: Into x_run_id
4287: From dual;
4288: End If;
4289: INSERT INTO pa_alloc_runs_all (
4290: RUN_ID
4291: , RULE_ID
4292: , RUN_PERIOD
4293: , EXPND_ITEM_DATE

Line 9289: from pa_alloc_runs

9285: , target_exp_type
9286: , offset_exp_type
9287: , trunc(expnd_item_date) expnd_item_date
9288: , offset_method
9289: from pa_alloc_runs
9290: where run_id = p_run_id ;
9291: cursor C_org_id is
9292: select org_id
9293: from pa_implementations ;

Line 9637: update pa_alloc_runs

9633: Delete from pa_expenditure_groups
9634: where expenditure_group in ( v_tgt_exp_group, v_off_exp_group) ;
9635: else
9636: --Modifed this for capital project changes.
9637: update pa_alloc_runs
9638: set target_exp_group = v_tgt_exp_group ,
9639: offset_exp_group = decode(p_rule_id,
9640: -1,null,
9641: decode(run_rec.offset_method,'N',NULL,v_off_exp_group) )

Line 9675: from pa_alloc_runs

9671: IS
9672: Cursor C_run is
9673: Select target_exp_group
9674: , offset_exp_group
9675: from pa_alloc_runs
9676: where run_id = p_run_id ;
9677: run_rec C_run%ROWTYPE ;
9678: v_num_reversed NUMBER ;
9679: v_num_rejected NUMBER ;

Line 9757: update pa_alloc_runs

9753: End if;
9754: End If;
9755: -- Update the alloc runs table with the reversal info --
9756: If nvl(v_return_code,'0') = '0' then
9757: update pa_alloc_runs
9758: set run_status = 'RV'
9759: ,reversal_date = trunc(sysdate)
9760: ,rev_target_exp_group = p_tgt_exp_group
9761: ,rev_offset_exp_group = p_off_exp_group

Line 9877: -- Delete Transactions from pa_alloc_runs

9873: where run_id = p_run_id ;
9874: -- Delete Transactions from pa_alloc_exceptions
9875: Delete from pa_alloc_exceptions
9876: where run_id = p_run_id ;
9877: -- Delete Transactions from pa_alloc_runs
9878: Delete from pa_alloc_runs
9879: where run_id = p_run_id ;
9880: ---- Release Lock on the rule_name ---------------------
9881: unlock_rule(p_rule_id , p_run_id) ;

Line 9878: Delete from pa_alloc_runs

9874: -- Delete Transactions from pa_alloc_exceptions
9875: Delete from pa_alloc_exceptions
9876: where run_id = p_run_id ;
9877: -- Delete Transactions from pa_alloc_runs
9878: Delete from pa_alloc_runs
9879: where run_id = p_run_id ;
9880: ---- Release Lock on the rule_name ---------------------
9881: unlock_rule(p_rule_id , p_run_id) ;
9882: pa_debug.reset_err_stack ;

Line 9898: select run_id from pa_alloc_runs_all

9894: )
9895: IS
9896: CURSOR get_run_id
9897: IS
9898: select run_id from pa_alloc_runs_all
9899: where rule_id = p_rule_id
9900: and run_status = 'DL';
9901: l_run_id NUMBER;
9902: v_debug_mode VARCHAR2(2);

Line 10027: -- Delete Transactions from pa_alloc_runs

10023: where run_id = l_run_id ;
10024: -- Delete Transactions from pa_alloc_exceptions
10025: Delete from pa_alloc_exceptions
10026: where run_id = l_run_id ;
10027: -- Delete Transactions from pa_alloc_runs
10028: Delete from pa_alloc_runs
10029: where run_id = l_run_id ;
10030: ---- Release Lock on the rule_name ---------------------
10031: --unlock_rule(p_rule_id , l_run_id) ;

Line 10028: Delete from pa_alloc_runs

10024: -- Delete Transactions from pa_alloc_exceptions
10025: Delete from pa_alloc_exceptions
10026: where run_id = l_run_id ;
10027: -- Delete Transactions from pa_alloc_runs
10028: Delete from pa_alloc_runs
10029: where run_id = l_run_id ;
10030: ---- Release Lock on the rule_name ---------------------
10031: --unlock_rule(p_rule_id , l_run_id) ;
10032: END LOOP;

Line 10232: ( p_run_id IN pa_alloc_runs_all.run_id%TYPE

10228: --This procedure is called from PA_CAP_INT_PVT. Generate_cap_interest when release button is pressed on the
10229: --Allocation form(when form is accessed in the context of capitalized interest) or when auto release flag is
10230: --passed Y
10231: PROCEDURE release_capint_txns
10232: ( p_run_id IN pa_alloc_runs_all.run_id%TYPE
10233: ,x_return_status OUT NOCOPY VARCHAR2
10234: ,x_msg_count OUT NOCOPY NUMBER
10235: ,x_msg_data OUT NOCOPY VARCHAR2
10236: )

Line 10287: UPDATE pa_alloc_runs

10283: /* bug fix: 3123539 based on the return status update the run staus and avoid
10284: * setting the concurrent process to raise error
10285: */
10286: IF x_return_status = 'S' Then
10287: UPDATE pa_alloc_runs
10288: SET run_status = 'RS'
10289: ,release_request_id = l_rel_request_id
10290: ,release_request_date =sysdate
10291: WHERE run_id = p_run_id;

Line 10294: UPDATE pa_alloc_runs

10290: ,release_request_date =sysdate
10291: WHERE run_id = p_run_id;
10292: Else
10293: -- Update the status to release failure
10294: UPDATE pa_alloc_runs
10295: SET run_status = 'RF'
10296: ,release_request_id = null
10297: ,release_request_date =sysdate
10298: WHERE run_id = p_run_id;

Line 10323: UPDATE pa_alloc_runs

10319: pa_debug.G_err_stage := 'UPDATING RUN STATUS AS FAILURE';
10320: pa_debug.write_file('cap_int: ' || 'LOG', pa_debug.G_err_stage);
10321: END IF;
10322: -- Update the status to release failure
10323: UPDATE pa_alloc_runs
10324: SET run_status = 'RF'
10325: ,release_request_id = l_rel_request_id
10326: ,release_request_date =sysdate
10327: WHERE run_id = p_run_id;

Line 10339: ( p_run_id IN pa_alloc_runs_all.run_id%TYPE

10335: --This procedure deletes the source details for each capital interest transaction. This procedure will
10336: --be called from delete_alloc_run api when the DELETE button is pressed to delete a capital interest
10337: --batch
10338: PROCEDURE delete_cint_source_dets
10339: ( p_run_id IN pa_alloc_runs_all.run_id%TYPE
10340: ,x_return_status OUT NOCOPY VARCHAR2
10341: ,x_msg_count OUT NOCOPY NUMBER
10342: ,x_msg_data OUT NOCOPY VARCHAR2
10343: )