DBA Data[Home] [Help]

APPS.PSP_ADJ_DRIVER dependencies on PSP_ADJUSTMENT_LINES

Line 29: -- 3. PSP_ADJUSTMENT_LINES_HISTORY (lines that have been adjusted)

25: --
26: -- 1. PSP_DISTRIUTION_LINES_HISTORY (lines taht have not been adjusted)
27: -- 2. PSP_PRE_GEN_DIST_LINES_HISTORY (pre generated lines that have
28: -- not been adjusted)
29: -- 3. PSP_ADJUSTMENT_LINES_HISTORY (lines that have been adjusted)
30: --
31: -- For each line found, a call is made to the procedure
32: -- insert_update_sumlines to summarize the line by unique
33: -- GL/POETA information for display to the user.

Line 60: and psp_adjustment_lines_history, account information

56: is found from element account, schedule line,
57: default labor schedule, or default org account tables.
58:
59: For the tables psp_pre_gen_dist_lines_history
60: and psp_adjustment_lines_history, account information
61: is taken from suspense account if present, otherwise
62: it is taken from the line. */
63:
64: --Introduced the EXISTS clause of adjust='Y' for Bug 2860013

Line 252: psp_adjustment_lines_history pal,

248: DECODE(g_dff_grouping_option, 'Y', pal.attribute8, NULL) attribute8,
249: DECODE(g_dff_grouping_option, 'Y', pal.attribute9, NULL) attribute9,
250: DECODE(g_dff_grouping_option, 'Y', pal.attribute10, NULL) attribute10
251: FROM
252: psp_adjustment_lines_history pal,
253: --psp_group_element_list pgel, --- added table for DA-ENH Modified to inline query for bug fix 3658235
254: (SELECT peg.element_group_id, pgel.element_type_id
255: FROM psp_element_groups peg, psp_group_element_list pgel
256: WHERE business_group_id = p_business_group_id

Line 1352: psp_adjustment_lines

1348: assignment_id,
1349: min(distribution_date),
1350: max(distribution_date)
1351: FROM
1352: psp_adjustment_lines
1353: WHERE
1354: batch_name = p_batch_name
1355: and business_group_id = p_business_group_id
1356: and set_of_books_id = p_set_of_books_id

Line 1583: FROM psp_adjustment_lines

1579: attribute7,
1580: attribute8,
1581: attribute9,
1582: attribute10
1583: FROM psp_adjustment_lines
1584: WHERE batch_name = p_batch_name
1585: and business_group_id = p_business_group_id
1586: and set_of_books_id = p_set_of_books_id
1587: GROUP by adj_set_number,

Line 1670: FROM psp_adjustment_lines a,

1666: a.attribute7,
1667: a.attribute8,
1668: a.attribute9,
1669: a.attribute10
1670: FROM psp_adjustment_lines a,
1671: psp_group_element_list b
1672: WHERE a.batch_name = p_batch_name
1673: and a.business_group_id = p_business_group_id
1674: and a.set_of_books_id = p_set_of_books_id

Line 1757: FROM psp_adjustment_lines

1753: attribute7,
1754: attribute8,
1755: attribute9,
1756: attribute10
1757: FROM psp_adjustment_lines
1758: WHERE batch_name = p_batch_name
1759: and business_group_id = p_business_group_id
1760: and set_of_books_id = p_set_of_books_id
1761: GROUP by adj_set_number,

Line 1826: FROM psp_adjustment_lines

1822: percent, ---- added for DA-ENH
1823: p_run_id,
1824: p_set_of_books_id,
1825: p_business_group_id
1826: FROM psp_adjustment_lines
1827: WHERE batch_name = p_batch_name
1828: and business_group_id = p_business_group_id
1829: and set_of_books_id = p_set_of_books_id
1830: GROUP by adj_set_number,

Line 1880: FROM psp_adjustment_lines a,

1876: a.percent, ---- added for DA-ENH
1877: p_run_id,
1878: p_set_of_books_id,
1879: p_business_group_id
1880: FROM psp_adjustment_lines a,
1881: psp_group_element_list b
1882: WHERE a.batch_name = p_batch_name
1883: and a.business_group_id = p_business_group_id
1884: and a.set_of_books_id = p_set_of_books_id

Line 1934: FROM psp_adjustment_lines

1930: percent, ---- added for DA-ENH
1931: p_run_id,
1932: p_set_of_books_id,
1933: p_business_group_id
1934: FROM psp_adjustment_lines
1935: WHERE batch_name = p_batch_name
1936: and business_group_id = p_business_group_id
1937: and set_of_books_id = p_set_of_books_id
1938: GROUP by adj_set_number,

Line 2006: -- The purpose is to insert lines into the table psp_adjustment_lines.

2002: ----------P R O C E D U R E: INSERT_ADJ_LINES -------------------------------
2003: --
2004: --
2005: -- Purpose: This procedure is called by procedure generate_lines described below.
2006: -- The purpose is to insert lines into the table psp_adjustment_lines.
2007: -- These lines are both the reversal and adjusted lines.
2008: --
2009: ----------------------------------------------------------------------------------
2010:

Line 2038: insert into psp_adjustment_lines(adjustment_line_id,

2034: p_business_group_id IN NUMBER,
2035: p_return_status OUT NOCOPY VARCHAR2) IS
2036: begin
2037:
2038: insert into psp_adjustment_lines(adjustment_line_id,
2039: person_id,
2040: assignment_id,
2041: element_type_id,
2042: distribution_date,

Line 2092: values(psp_adjustment_lines_s.nextval,

2088: last_updated_by,
2089: last_update_login,
2090: created_by,
2091: creation_date)
2092: values(psp_adjustment_lines_s.nextval,
2093: p_person_id,
2094: p_assignment_id,
2095: p_element_type_id,
2096: p_distribution_date,

Line 2294: -- adjusted lines for the batch. The psp_adjustment_lines table is

2290: --
2291: -- Purpose: This procedure is called by procedure generate_lines described below.
2292: -- The purpose is to insert a record into psp_payroll_controls for
2293: -- every time_period_id that exists within the time frame of the
2294: -- adjusted lines for the batch. The psp_adjustment_lines table is
2295: -- updated with the new payroll_control_id for the time_period_id.
2296: --
2297: ----------------------------------------------------------------------------------
2298:

Line 2316: from psp_adjustment_lines palh

2312:
2313:
2314: cursor time_periods_c is
2315: select distinct palh.time_period_id
2316: from psp_adjustment_lines palh
2317: where palh.batch_name = p_batch_name
2318: and palh.business_group_id = p_business_group_id
2319: and palh.set_of_books_id = p_set_of_books_id;
2320:

Line 2327: from psp_adjustment_lines

2323: For Bug 2252881 : Modifying the Cusor tot_dr_c to include tot_cr_c conitions also
2324: and to be able to select both teh DR amount and cr amount
2325: cursor tot_dr_c is
2326: select sum(distribution_amount)
2327: from psp_adjustment_lines
2328: where batch_name = p_batch_name
2329: and time_period_id = l_time_period_id
2330: and dr_cr_flag = 'D'
2331: and business_group_id = p_business_group_id

Line 2337: from psp_adjustment_lines

2333: group by batch_name, time_period_id, dr_cr_flag;
2334:
2335: cursor tot_cr_c is
2336: select sum(distribution_amount)
2337: from psp_adjustment_lines
2338: where batch_name = p_batch_name
2339: and time_period_id = l_time_period_id
2340: and dr_cr_flag = 'C'
2341: and business_group_id = p_business_group_id

Line 2349: FROM psp_adjustment_lines pal

2345: CURSOR tot_dr_c
2346: IS
2347: SELECT SUM(DECODE(pal.dr_cr_flag,'D',pal.distribution_amount,0)) l_total_dr,
2348: SUM(DECODE(pal.dr_cr_flag,'C',pal.distribution_amount,0)) l_total_cr
2349: FROM psp_adjustment_lines pal
2350: WHERE pal.batch_name = p_batch_name
2351: and pal.time_period_id = l_time_period_id;
2352:
2353: /* Bug 1677534 */

Line 2532: update psp_adjustment_lines

2528: -- Introduced for bug fix 2916848
2529: p_currency_code,
2530: null);
2531:
2532: update psp_adjustment_lines
2533: set payroll_control_id = l_payroll_control_id
2534: where time_period_id = l_time_period_id
2535: and batch_name = p_batch_name
2536: and business_group_id = p_business_group_id

Line 2583: from psp_adjustment_lines

2579:
2580:
2581: cursor adj_effort_c is
2582: select distinct person_id, distribution_date
2583: from psp_adjustment_lines
2584: where batch_name = p_batch_name
2585: and business_group_id = p_business_group_id
2586: and set_of_books_id = p_set_of_books_id
2587: and element_type_id in (select element_type_id from psp_effort_report_elements

Line 2698: psp_adjustment_lines pal

2694: AND (per.person_id, per.template_id) IN
2695: (SELECT pal.person_id, pert.template_id
2696: FROM psp_effort_report_templates pert,
2697: psp_effort_reports per2,
2698: psp_adjustment_lines pal
2699: WHERE pal.batch_name = p_batch_name
2700: AND pal.business_group_id = p_business_group_id
2701: AND pal.set_of_books_id = p_set_of_books_id
2702: AND pert.business_group_id = p_business_group_id

Line 2735: -- the lines in psp_adjustment_lines table.

2731: -- by the user in the adjusted lines block of distribution transfers
2732: -- form.
2733: -- Reversal lines are generated first, and then new adjusted lines
2734: -- are created. A call is made to insert_adj_lines to insert
2735: -- the lines in psp_adjustment_lines table.
2736: --
2737: --
2738: ----------------------------------------------------------------------------------
2739:

Line 2822: from psp_adjustment_lines

2818: l_integrity_count integer;
2819:
2820: cursor check_batch_integrity(p_batch_name varchar2) is
2821: select count(*), element_type_id
2822: from psp_adjustment_lines
2823: where batch_name = p_batch_name
2824: group by element_type_id
2825: having sum(decode(dr_cr_flag,'D',distribution_amount,-distribution_amount)) <> 0;
2826:

Line 2865: from psp_adjustment_lines

2861: -distribution_amount)) -
2862: sum(decode(dr_cr_flag, 'D',round(distribution_amount, g_precision), --|>delta amnt =
2863: -round(distribution_amount, g_precision))), g_precision), -- unrounded amnt - act amnt
2864: max(adjustment_line_id)
2865: from psp_adjustment_lines
2866: where batch_name = p_batch_name and
2867: original_line_flag = 'N'
2868: group by adj_set_number, time_period_id, element_type_id, line_number;
2869:

Line 2878: from psp_adjustment_lines

2874: sum(decode(dr_cr_flag, 'D', distribution_amount,
2875: -distribution_amount)),
2876: max(adjustment_line_id),
2877: 0 --- delta sum
2878: from psp_adjustment_lines
2879: where original_line_flag = 'N' and
2880: batch_name = p_batch_name
2881: group by adj_set_number, element_type_id, time_period_id;
2882:

Line 2927: from psp_adjustment_lines LINE,

2923: -LINE.distribution_amount)) amount,
2924: DEST.distribution_sum,
2925: LINE.adj_set_number,
2926: LINE.line_number
2927: from psp_adjustment_lines LINE,
2928: psp_temp_dest_sumlines DEST
2929: where LINE.batch_name = p_batch_name and
2930: LINE.original_line_flag = 'N' and
2931: DEST.run_id = p_run_id and

Line 2943: from psp_adjustment_lines

2939: cursor get_max_element(p_adj_set_number in integer,
2940: p_adj_line_number in integer) is
2941: select element_type_id,
2942: time_period_id
2943: from psp_adjustment_lines
2944: where batch_name = p_batch_name
2945: and original_line_flag = 'N'
2946: and adj_set_number = p_adj_set_number
2947: and line_number = p_adj_line_number

Line 2997: from psp_adjustment_lines

2993: expenditure_organization_id,
2994: expenditure_type,
2995: task_id,
2996: award_id
2997: from psp_adjustment_lines
2998: where batch_name = p_batch_name
2999: and original_line_flag <> 'Y'
3000: and set_of_books_id = p_set_of_books_id
3001: and business_group_id = p_business_group_id

Line 3022: from psp_adjustment_lines

3018: p_expenditure_type VARCHAR2)
3019: is
3020: select effective_date ,
3021: adjustment_line_id
3022: from psp_adjustment_lines
3023: where element_type_id = p_element_type_id
3024: and project_id = p_project_id
3025: and expenditure_organization_id = p_expenditure_organization_id
3026: and expenditure_type = p_expenditure_type

Line 3037: type l_effective_date is table of psp_adjustment_lines.effective_date%type INDEX BY BINARY_INTEGER;

3033: group by effective_date,
3034: adjustment_line_id;
3035:
3036:
3037: type l_effective_date is table of psp_adjustment_lines.effective_date%type INDEX BY BINARY_INTEGER;
3038: type l_adj_line_id is table of psp_adjustment_lines.adjustment_line_id%type INDEX BY BINARY_INTEGER;
3039: type effective_date_rec is record
3040: (r_effective_date l_effective_date,
3041: r_adj_line_id l_adj_line_id);

Line 3038: type l_adj_line_id is table of psp_adjustment_lines.adjustment_line_id%type INDEX BY BINARY_INTEGER;

3034: adjustment_line_id;
3035:
3036:
3037: type l_effective_date is table of psp_adjustment_lines.effective_date%type INDEX BY BINARY_INTEGER;
3038: type l_adj_line_id is table of psp_adjustment_lines.adjustment_line_id%type INDEX BY BINARY_INTEGER;
3039: type effective_date_rec is record
3040: (r_effective_date l_effective_date,
3041: r_adj_line_id l_adj_line_id);
3042:

Line 3074: FROM psp_adjustment_lines

3070:
3071: CURSOR orig_line_id_cur IS
3072: SELECT orig_line_id,
3073: orig_source_type
3074: FROM psp_adjustment_lines
3075: WHERE payroll_control_id = l_payroll_control_id;
3076:
3077: -- Bug 6634876
3078: CURSOR net_batch_sum_cur IS

Line 3080: FROM psp_adjustment_lines

3076:
3077: -- Bug 6634876
3078: CURSOR net_batch_sum_cur IS
3079: SELECT sum(decode(dr_cr_flag,'D',distribution_amount,-distribution_amount)) amount
3080: FROM psp_adjustment_lines
3081: WHERE batch_name = p_batch_name;
3082:
3083: r_net_zero_diff net_batch_sum_cur%rowtype;
3084:

Line 3148: hr_utility.trace('Inserting into PSP_ADJUSTMENT_LINES - 10');

3144: END IF;
3145:
3146: --Reversal Lines Generation
3147:
3148: hr_utility.trace('Inserting into PSP_ADJUSTMENT_LINES - 10');
3149:
3150: insert into psp_adjustment_lines(adjustment_line_id,
3151: person_id,
3152: assignment_id,

Line 3150: insert into psp_adjustment_lines(adjustment_line_id,

3146: --Reversal Lines Generation
3147:
3148: hr_utility.trace('Inserting into PSP_ADJUSTMENT_LINES - 10');
3149:
3150: insert into psp_adjustment_lines(adjustment_line_id,
3151: person_id,
3152: assignment_id,
3153: element_type_id,
3154: distribution_date,

Line 3196: select psp_adjustment_lines_s.nextval,

3192: attribute7,
3193: attribute8,
3194: attribute9,
3195: attribute10)
3196: select psp_adjustment_lines_s.nextval,
3197: p_person_id,
3198: p_assignment_id,
3199: ptol.element_type_id,
3200: ptol.orig_distribution_date,

Line 3256: hr_utility.trace('Inserted into PSP_ADJUSTMENT_LINES - 10');

3252: g_error_api_path := 'No records found in reversal lines:'||g_error_api_path;
3253: raise NO_RECORDS_FOUND;
3254: end if;
3255:
3256: hr_utility.trace('Inserted into PSP_ADJUSTMENT_LINES - 10');
3257:
3258: /***** Converted the following update statements into BULK update for R12 performance fixes (bug 4507892)
3259: UPDATE psp_distribution_lines_history
3260: SET adjustment_batch_name = p_batch_name

Line 3262: from psp_adjustment_lines

3258: /***** Converted the following update statements into BULK update for R12 performance fixes (bug 4507892)
3259: UPDATE psp_distribution_lines_history
3260: SET adjustment_batch_name = p_batch_name
3261: WHERE distribution_line_id in ( select orig_line_id
3262: from psp_adjustment_lines
3263: where payroll_control_id = l_payroll_control_id
3264: and orig_source_type = 'D');
3265:
3266: UPDATE psp_pre_gen_dist_lines_history

Line 3269: from psp_adjustment_lines

3265:
3266: UPDATE psp_pre_gen_dist_lines_history
3267: SET adjustment_batch_name = p_batch_name
3268: WHERE pre_gen_dist_line_id in ( select orig_line_id
3269: from psp_adjustment_lines
3270: where payroll_control_id = l_payroll_control_id
3271: and orig_source_type = 'P');
3272:
3273:

Line 3274: UPDATE psp_adjustment_lines_history

3270: where payroll_control_id = l_payroll_control_id
3271: and orig_source_type = 'P');
3272:
3273:
3274: UPDATE psp_adjustment_lines_history
3275: SET adjustment_batch_name = p_batch_name
3276: WHERE adjustment_line_id in ( select orig_line_id
3277: from psp_adjustment_lines
3278: where payroll_control_id = l_payroll_control_id

Line 3277: from psp_adjustment_lines

3273:
3274: UPDATE psp_adjustment_lines_history
3275: SET adjustment_batch_name = p_batch_name
3276: WHERE adjustment_line_id in ( select orig_line_id
3277: from psp_adjustment_lines
3278: where payroll_control_id = l_payroll_control_id
3279: and orig_source_type = 'A');
3280: ---end of code changes for reversal line generation DA-ENH
3281: End of comment for bug fix 4507892 *****/

Line 3305: UPDATE psp_adjustment_lines_history

3301: WHERE pre_gen_dist_line_id = r_orig_lines.orig_line_id(I)
3302: AND r_orig_lines.orig_source_type(I) = 'P';
3303:
3304: FORALL I IN 1..r_orig_lines.orig_line_id.COUNT
3305: UPDATE psp_adjustment_lines_history
3306: SET adjustment_batch_name = p_batch_name
3307: WHERE adjustment_line_id = r_orig_lines.orig_line_id(I)
3308: AND r_orig_lines.orig_source_type(I) = 'A';
3309:

Line 3317: hr_utility.trace('Inserting into PSP_ADJUSTMENT_LINES - 20');

3313:
3314: hr_utility.trace('Completed BULK updates');
3315:
3316: ----- Insert statement to generate new adj lines.
3317: hr_utility.trace('Inserting into PSP_ADJUSTMENT_LINES - 20');
3318:
3319: insert into psp_adjustment_lines
3320: (adjustment_line_id,
3321: person_id,

Line 3319: insert into psp_adjustment_lines

3315:
3316: ----- Insert statement to generate new adj lines.
3317: hr_utility.trace('Inserting into PSP_ADJUSTMENT_LINES - 20');
3318:
3319: insert into psp_adjustment_lines
3320: (adjustment_line_id,
3321: person_id,
3322: assignment_id,
3323: element_type_id,

Line 3366: select psp_adjustment_lines_s.nextval,

3362: attribute7,
3363: attribute8,
3364: attribute9,
3365: attribute10) --- new column for DA-ENH
3366: select psp_adjustment_lines_s.nextval,
3367: p_person_id,
3368: p_assignment_id,
3369: LINES.element_type_id,
3370: LINES.orig_distribution_date,

Line 3444: hr_utility.trace('Inserted into PSP_ADJUSTMENT_LINES - 20');

3440: DEST.original_line_flag = 'N';
3441: /* ORDER BY DEST.adj_set_number, DEST.line_number, LINES.time_period_id;
3442: --- order by ensures the delta amount will be posted to line of last time periods.
3443: */
3444: hr_utility.trace('Inserted into PSP_ADJUSTMENT_LINES - 20');
3445:
3446: hr_utility.trace('g_precision = '||g_precision);
3447: hr_utility.trace('Bulk Fetch SLINE_IDEAL_AMNT_MATRIX values');
3448:

Line 3462: update psp_adjustment_lines

3458: close sline_ideal_amnt_matrix;
3459:
3460: hr_utility.trace('Updating the DISTRIBUTION_AMOUNT based on g_precision');
3461:
3462: update psp_adjustment_lines
3463: set distribution_amount = round(distribution_amount, g_precision)
3464: where original_line_flag = 'N'and
3465: batch_name = p_batch_name;
3466:

Line 3468: update psp_adjustment_lines

3464: where original_line_flag = 'N'and
3465: batch_name = p_batch_name;
3466:
3467: forall I in 1..r_sline_ideal_amnt_matrix.adj_set_number.count
3468: update psp_adjustment_lines
3469: set distribution_amount = distribution_amount +
3470: decode(dr_cr_flag,'D', r_sline_ideal_amnt_matrix.delta_sum(i),
3471: -r_sline_ideal_amnt_matrix.delta_sum(i))
3472: where adjustment_line_id = r_sline_ideal_amnt_matrix.adjustment_sline_id(i);

Line 3530: update psp_adjustment_lines

3526: r_adj_matrix.element_type_id.delete;
3527: r_adj_matrix.distribution_sum.delete;
3528:
3529: forall I in 1.. r_sline_actual_amnt_matrix.adj_set_number.count
3530: update psp_adjustment_lines
3531: set distribution_amount = distribution_amount +
3532: decode(dr_cr_flag, 'D', r_sline_actual_amnt_matrix.delta_sum(I),
3533: - r_sline_actual_amnt_matrix.delta_sum(I))
3534: where adjustment_line_id = r_sline_actual_amnt_matrix.adjustment_sline_id(i);

Line 3543: -- psp_temp_dest_sumlines and psp_adjustment_lines will be zero.

3539: r_sline_actual_amnt_matrix.delta_sum.delete;
3540:
3541: --- bug fix 3470916
3542: -- The net of all differences between RHS amounts in
3543: -- psp_temp_dest_sumlines and psp_adjustment_lines will be zero.
3544: --- Logic is that for each dest sumlines, for wich it's sum doesnot equal
3545: --- the sum of dist amount in psp_adjustment_lines, adjust the difference
3546: -- to the last line in last time period of the element with max element_type_id
3547: --- there is no reason for this criteria in particular, but there should

Line 3545: --- the sum of dist amount in psp_adjustment_lines, adjust the difference

3541: --- bug fix 3470916
3542: -- The net of all differences between RHS amounts in
3543: -- psp_temp_dest_sumlines and psp_adjustment_lines will be zero.
3544: --- Logic is that for each dest sumlines, for wich it's sum doesnot equal
3545: --- the sum of dist amount in psp_adjustment_lines, adjust the difference
3546: -- to the last line in last time period of the element with max element_type_id
3547: --- there is no reason for this criteria in particular, but there should
3548: -- some convention to adjust.
3549:

Line 3571: update psp_adjustment_lines

3567: close get_max_element;
3568: l_prev_adj_set := r_dest_diff.adj_set_number; --- added for 3776353
3569: end if;
3570:
3571: update psp_adjustment_lines
3572: set distribution_amount = distribution_amount +
3573: decode(dr_cr_flag,'D',r_dest_diff.distribution_sum-r_dest_diff.amount,
3574: -r_dest_diff.distribution_sum+r_dest_diff.amount)
3575: where adjustment_line_id in

Line 3577: from psp_adjustment_lines

3573: decode(dr_cr_flag,'D',r_dest_diff.distribution_sum-r_dest_diff.amount,
3574: -r_dest_diff.distribution_sum+r_dest_diff.amount)
3575: where adjustment_line_id in
3576: (select max(adjustment_line_id)
3577: from psp_adjustment_lines
3578: where batch_name = p_batch_name and
3579: original_line_flag = 'N' and
3580: line_number = r_dest_diff.line_number and
3581: adj_set_number = r_dest_diff.adj_set_number and

Line 3589: delete psp_adjustment_lines

3585: end if;
3586: end loop;
3587:
3588: ---- moved the delete from above the loop for 3776353
3589: delete psp_adjustment_lines
3590: where distribution_amount = 0
3591: and batch_name = p_batch_name;
3592:
3593: --- added for DA-ENH

Line 3874: Update psp_adjustment_lines

3870: END LOOP; -- End of Main loop
3871:
3872:
3873: FORALL I in 1 .. final_autopop_rec.array_element_type_id.count
3874: Update psp_adjustment_lines
3875: set
3876: gl_code_combination_id = final_autopop_rec.array_glccid(i),
3877: project_id = final_autopop_rec.array_project_id(i),
3878: expenditure_organization_id = final_autopop_rec.array_exp_org_id(i),

Line 4226: l_orig_line_id psp_adjustment_lines.orig_line_id%TYPE;

4222: return_code OUT NOCOPY NUMBER)
4223: IS
4224: undo_failed_exception EXCEPTION;
4225:
4226: l_orig_line_id psp_adjustment_lines.orig_line_id%TYPE;
4227: l_orig_source_type psp_adjustment_lines.orig_source_type%TYPE;
4228: l_report_id psp_effort_reports.effort_report_id%TYPE;
4229: -- Introduced the following variables for bug fix 2724110
4230: l_person_id NUMBER(15);

Line 4227: l_orig_source_type psp_adjustment_lines.orig_source_type%TYPE;

4223: IS
4224: undo_failed_exception EXCEPTION;
4225:
4226: l_orig_line_id psp_adjustment_lines.orig_line_id%TYPE;
4227: l_orig_source_type psp_adjustment_lines.orig_source_type%TYPE;
4228: l_report_id psp_effort_reports.effort_report_id%TYPE;
4229: -- Introduced the following variables for bug fix 2724110
4230: l_person_id NUMBER(15);
4231: l_begin_date DATE;

Line 4238: FROM psp_adjustment_lines

4234:
4235: CURSOR get_line_id_csr IS
4236: SELECT orig_line_id,
4237: orig_source_type
4238: FROM psp_adjustment_lines
4239: WHERE original_line_flag = 'Y'
4240: AND batch_name = p_batch_name
4241: and business_group_id = p_business_group_id
4242: and set_of_books_id = p_set_of_books_id;

Line 4251: psp_adjustment_lines line,

4247: report.person_id,
4248: min(begin_date),
4249: max(end_date)
4250: FROM psp_effort_reports report,
4251: psp_adjustment_lines line,
4252: psp_effort_report_templates template
4253: WHERE line.batch_name = p_batch_name
4254: AND report.person_id = line.person_id
4255: AND template.template_id = report.template_id

Line 4264: FROM psp_adjustment_lines line,

4260: report.person_id;
4261:
4262: /**** Commented the following for bug fix 2724110
4263: SELECT distinct report.effort_report_id
4264: FROM psp_adjustment_lines line,
4265: psp_effort_reports report,
4266: psp_effort_report_templates template
4267: WHERE line.business_group_id = p_business_group_id
4268: and line.set_of_books_id = p_set_of_books_id

Line 4284: FROM psp_adjustment_lines pal

4280: p_batch_name VARCHAR2,
4281: p_begin_date DATE,
4282: p_end_date DATE) IS
4283: SELECT COUNT(1)
4284: FROM psp_adjustment_lines pal
4285: WHERE person_id = p_person_id
4286: AND batch_name <> p_batch_name
4287: AND distribution_date BETWEEN p_begin_date AND p_end_date
4288: AND EXISTS (SELECT 1

Line 4304: /*1. Update one of the history tables PSP_ADJUSTMENT_LINES_HISTORY or */

4300: BEGIN
4301: SAVEPOINT undo_adj_savepoint;
4302:
4303: /*---------------------------------------------------------------------*/
4304: /*1. Update one of the history tables PSP_ADJUSTMENT_LINES_HISTORY or */
4305: /* PSP_PRE_GEN_DIST_LINES_HISTORY or PSP_DISTRIBUTION_LINES_HISTORY */
4306: /* by setting the adjustment_batch_name to NULL. */
4307: /*---------------------------------------------------------------------*/
4308: OPEN get_line_id_csr;

Line 4313: UPDATE psp_adjustment_lines_history

4309: LOOP
4310: FETCH get_line_id_csr INTO l_orig_line_id, l_orig_source_type;
4311: EXIT WHEN get_line_id_csr%NOTFOUND;
4312: IF (l_orig_source_type = 'A') THEN
4313: UPDATE psp_adjustment_lines_history
4314: SET adjustment_batch_name = NULL
4315: WHERE adjustment_line_id = l_orig_line_id;
4316: ELSIF (l_orig_source_type = 'P') THEN
4317: UPDATE psp_pre_gen_dist_lines_history

Line 4388: /* PSP_ADJUSTMENT_LINES. */

4384: END IF;
4385:
4386: /*---------------------------------------------------------------------*/
4387: /*4. Delete the distribution lines of the rejected batch from table */
4388: /* PSP_ADJUSTMENT_LINES. */
4389: /*---------------------------------------------------------------------*/
4390: DELETE FROM psp_adjustment_lines
4391: WHERE batch_name = p_batch_name;
4392: IF (SQL%NOTFOUND) THEN

Line 4390: DELETE FROM psp_adjustment_lines

4386: /*---------------------------------------------------------------------*/
4387: /*4. Delete the distribution lines of the rejected batch from table */
4388: /* PSP_ADJUSTMENT_LINES. */
4389: /*---------------------------------------------------------------------*/
4390: DELETE FROM psp_adjustment_lines
4391: WHERE batch_name = p_batch_name;
4392: IF (SQL%NOTFOUND) THEN
4393: errbuf := 'Failed when update psp_adjustment_lines: no row found.';
4394: RAISE undo_failed_exception;

Line 4393: errbuf := 'Failed when update psp_adjustment_lines: no row found.';

4389: /*---------------------------------------------------------------------*/
4390: DELETE FROM psp_adjustment_lines
4391: WHERE batch_name = p_batch_name;
4392: IF (SQL%NOTFOUND) THEN
4393: errbuf := 'Failed when update psp_adjustment_lines: no row found.';
4394: RAISE undo_failed_exception;
4395: END IF;
4396:
4397: /*---------------------------------------------------------------------*/