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 256: psp_adjustment_lines_history pal,

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

Line 1358: psp_adjustment_lines

1354: assignment_id,
1355: min(distribution_date),
1356: max(distribution_date)
1357: FROM
1358: psp_adjustment_lines
1359: WHERE
1360: batch_name = p_batch_name
1361: and business_group_id = p_business_group_id
1362: and set_of_books_id = p_set_of_books_id

Line 1592: FROM psp_adjustment_lines

1588: attribute7,
1589: attribute8,
1590: attribute9,
1591: attribute10
1592: FROM psp_adjustment_lines
1593: WHERE batch_name = p_batch_name
1594: and business_group_id = p_business_group_id
1595: and set_of_books_id = p_set_of_books_id
1596: GROUP by adj_set_number,

Line 1679: FROM psp_adjustment_lines a,

1675: a.attribute7,
1676: a.attribute8,
1677: a.attribute9,
1678: a.attribute10
1679: FROM psp_adjustment_lines a,
1680: psp_group_element_list b
1681: WHERE a.batch_name = p_batch_name
1682: and a.business_group_id = p_business_group_id
1683: and a.set_of_books_id = p_set_of_books_id

Line 1766: FROM psp_adjustment_lines

1762: attribute7,
1763: attribute8,
1764: attribute9,
1765: attribute10
1766: FROM psp_adjustment_lines
1767: WHERE batch_name = p_batch_name
1768: and business_group_id = p_business_group_id
1769: and set_of_books_id = p_set_of_books_id
1770: GROUP by adj_set_number,

Line 1835: FROM psp_adjustment_lines

1831: percent, ---- added for DA-ENH
1832: p_run_id,
1833: p_set_of_books_id,
1834: p_business_group_id
1835: FROM psp_adjustment_lines
1836: WHERE batch_name = p_batch_name
1837: and business_group_id = p_business_group_id
1838: and set_of_books_id = p_set_of_books_id
1839: GROUP by adj_set_number,

Line 1889: FROM psp_adjustment_lines a,

1885: a.percent, ---- added for DA-ENH
1886: p_run_id,
1887: p_set_of_books_id,
1888: p_business_group_id
1889: FROM psp_adjustment_lines a,
1890: psp_group_element_list b
1891: WHERE a.batch_name = p_batch_name
1892: and a.business_group_id = p_business_group_id
1893: and a.set_of_books_id = p_set_of_books_id

Line 1943: FROM psp_adjustment_lines

1939: percent, ---- added for DA-ENH
1940: p_run_id,
1941: p_set_of_books_id,
1942: p_business_group_id
1943: FROM psp_adjustment_lines
1944: WHERE batch_name = p_batch_name
1945: and business_group_id = p_business_group_id
1946: and set_of_books_id = p_set_of_books_id
1947: GROUP by adj_set_number,

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

2011: ----------P R O C E D U R E: INSERT_ADJ_LINES -------------------------------
2012: --
2013: --
2014: -- Purpose: This procedure is called by procedure generate_lines described below.
2015: -- The purpose is to insert lines into the table psp_adjustment_lines.
2016: -- These lines are both the reversal and adjusted lines.
2017: --
2018: ----------------------------------------------------------------------------------
2019:

Line 2047: insert into psp_adjustment_lines(adjustment_line_id,

2043: p_business_group_id IN NUMBER,
2044: p_return_status OUT NOCOPY VARCHAR2) IS
2045: begin
2046:
2047: insert into psp_adjustment_lines(adjustment_line_id,
2048: person_id,
2049: assignment_id,
2050: element_type_id,
2051: distribution_date,

Line 2101: values(psp_adjustment_lines_s.nextval,

2097: last_updated_by,
2098: last_update_login,
2099: created_by,
2100: creation_date)
2101: values(psp_adjustment_lines_s.nextval,
2102: p_person_id,
2103: p_assignment_id,
2104: p_element_type_id,
2105: p_distribution_date,

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

2299: --
2300: -- Purpose: This procedure is called by procedure generate_lines described below.
2301: -- The purpose is to insert a record into psp_payroll_controls for
2302: -- every time_period_id that exists within the time frame of the
2303: -- adjusted lines for the batch. The psp_adjustment_lines table is
2304: -- updated with the new payroll_control_id for the time_period_id.
2305: --
2306: ----------------------------------------------------------------------------------
2307:

Line 2325: from psp_adjustment_lines palh

2321:
2322:
2323: cursor time_periods_c is
2324: select distinct palh.time_period_id
2325: from psp_adjustment_lines palh
2326: where palh.batch_name = p_batch_name
2327: and palh.business_group_id = p_business_group_id
2328: and palh.set_of_books_id = p_set_of_books_id;
2329:

Line 2336: from psp_adjustment_lines

2332: For Bug 2252881 : Modifying the Cusor tot_dr_c to include tot_cr_c conitions also
2333: and to be able to select both teh DR amount and cr amount
2334: cursor tot_dr_c is
2335: select sum(distribution_amount)
2336: from psp_adjustment_lines
2337: where batch_name = p_batch_name
2338: and time_period_id = l_time_period_id
2339: and dr_cr_flag = 'D'
2340: and business_group_id = p_business_group_id

Line 2346: from psp_adjustment_lines

2342: group by batch_name, time_period_id, dr_cr_flag;
2343:
2344: cursor tot_cr_c is
2345: select sum(distribution_amount)
2346: from psp_adjustment_lines
2347: where batch_name = p_batch_name
2348: and time_period_id = l_time_period_id
2349: and dr_cr_flag = 'C'
2350: and business_group_id = p_business_group_id

Line 2358: FROM psp_adjustment_lines pal

2354: CURSOR tot_dr_c
2355: IS
2356: SELECT SUM(DECODE(pal.dr_cr_flag,'D',pal.distribution_amount,0)) l_total_dr,
2357: SUM(DECODE(pal.dr_cr_flag,'C',pal.distribution_amount,0)) l_total_cr
2358: FROM psp_adjustment_lines pal
2359: WHERE pal.batch_name = p_batch_name
2360: and pal.time_period_id = l_time_period_id;
2361:
2362: /* Bug 1677534 */

Line 2541: update psp_adjustment_lines

2537: -- Introduced for bug fix 2916848
2538: p_currency_code,
2539: null);
2540:
2541: update psp_adjustment_lines
2542: set payroll_control_id = l_payroll_control_id
2543: where time_period_id = l_time_period_id
2544: and batch_name = p_batch_name
2545: and business_group_id = p_business_group_id

Line 2592: from psp_adjustment_lines

2588:
2589:
2590: cursor adj_effort_c is
2591: select distinct person_id, distribution_date
2592: from psp_adjustment_lines
2593: where batch_name = p_batch_name
2594: and business_group_id = p_business_group_id
2595: and set_of_books_id = p_set_of_books_id
2596: and element_type_id in (select element_type_id from psp_effort_report_elements

Line 2707: psp_adjustment_lines pal

2703: AND (per.person_id, per.template_id) IN
2704: (SELECT pal.person_id, pert.template_id
2705: FROM psp_effort_report_templates pert,
2706: psp_effort_reports per2,
2707: psp_adjustment_lines pal
2708: WHERE pal.batch_name = p_batch_name
2709: AND pal.business_group_id = p_business_group_id
2710: AND pal.set_of_books_id = p_set_of_books_id
2711: AND pert.business_group_id = p_business_group_id

Line 2744: -- the lines in psp_adjustment_lines table.

2740: -- by the user in the adjusted lines block of distribution transfers
2741: -- form.
2742: -- Reversal lines are generated first, and then new adjusted lines
2743: -- are created. A call is made to insert_adj_lines to insert
2744: -- the lines in psp_adjustment_lines table.
2745: --
2746: --
2747: ----------------------------------------------------------------------------------
2748:

Line 2831: from psp_adjustment_lines

2827: l_integrity_count integer;
2828:
2829: cursor check_batch_integrity(p_batch_name varchar2) is
2830: select count(*), element_type_id
2831: from psp_adjustment_lines
2832: where batch_name = p_batch_name
2833: group by element_type_id
2834: having sum(decode(dr_cr_flag,'D',distribution_amount,-distribution_amount)) <> 0;
2835:

Line 2874: from psp_adjustment_lines

2870: -distribution_amount)) -
2871: sum(decode(dr_cr_flag, 'D',round(distribution_amount, g_precision), --|>delta amnt =
2872: -round(distribution_amount, g_precision))), g_precision), -- unrounded amnt - act amnt
2873: max(adjustment_line_id)
2874: from psp_adjustment_lines
2875: where batch_name = p_batch_name and
2876: original_line_flag = 'N'
2877: group by adj_set_number, time_period_id, element_type_id, line_number;
2878:

Line 2887: from psp_adjustment_lines

2883: sum(decode(dr_cr_flag, 'D', distribution_amount,
2884: -distribution_amount)),
2885: max(adjustment_line_id),
2886: 0 --- delta sum
2887: from psp_adjustment_lines
2888: where original_line_flag = 'N' and
2889: batch_name = p_batch_name
2890: group by adj_set_number, element_type_id, time_period_id;
2891:

Line 2936: from psp_adjustment_lines LINE,

2932: -LINE.distribution_amount)) amount,
2933: DEST.distribution_sum,
2934: LINE.adj_set_number,
2935: LINE.line_number
2936: from psp_adjustment_lines LINE,
2937: psp_temp_dest_sumlines DEST
2938: where LINE.batch_name = p_batch_name and
2939: LINE.original_line_flag = 'N' and
2940: DEST.run_id = p_run_id and

Line 2952: from psp_adjustment_lines

2948: cursor get_max_element(p_adj_set_number in integer,
2949: p_adj_line_number in integer) is
2950: select element_type_id,
2951: time_period_id
2952: from psp_adjustment_lines
2953: where batch_name = p_batch_name
2954: and original_line_flag = 'N'
2955: and adj_set_number = p_adj_set_number
2956: and line_number = p_adj_line_number

Line 3006: from psp_adjustment_lines

3002: expenditure_organization_id,
3003: expenditure_type,
3004: task_id,
3005: award_id
3006: from psp_adjustment_lines
3007: where batch_name = p_batch_name
3008: and original_line_flag <> 'Y'
3009: and set_of_books_id = p_set_of_books_id
3010: and business_group_id = p_business_group_id

Line 3031: from psp_adjustment_lines

3027: p_expenditure_type VARCHAR2)
3028: is
3029: select effective_date ,
3030: adjustment_line_id
3031: from psp_adjustment_lines
3032: where element_type_id = p_element_type_id
3033: and project_id = p_project_id
3034: and expenditure_organization_id = p_expenditure_organization_id
3035: and expenditure_type = p_expenditure_type

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

3042: group by effective_date,
3043: adjustment_line_id;
3044:
3045:
3046: type l_effective_date is table of psp_adjustment_lines.effective_date%type INDEX BY BINARY_INTEGER;
3047: type l_adj_line_id is table of psp_adjustment_lines.adjustment_line_id%type INDEX BY BINARY_INTEGER;
3048: type effective_date_rec is record
3049: (r_effective_date l_effective_date,
3050: r_adj_line_id l_adj_line_id);

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

3043: adjustment_line_id;
3044:
3045:
3046: type l_effective_date is table of psp_adjustment_lines.effective_date%type INDEX BY BINARY_INTEGER;
3047: type l_adj_line_id is table of psp_adjustment_lines.adjustment_line_id%type INDEX BY BINARY_INTEGER;
3048: type effective_date_rec is record
3049: (r_effective_date l_effective_date,
3050: r_adj_line_id l_adj_line_id);
3051:

Line 3083: FROM psp_adjustment_lines

3079:
3080: CURSOR orig_line_id_cur IS
3081: SELECT orig_line_id,
3082: orig_source_type
3083: FROM psp_adjustment_lines
3084: WHERE payroll_control_id = l_payroll_control_id;
3085:
3086: -- Bug 6634876
3087: CURSOR net_batch_sum_cur IS

Line 3089: FROM psp_adjustment_lines

3085:
3086: -- Bug 6634876
3087: CURSOR net_batch_sum_cur IS
3088: SELECT sum(decode(dr_cr_flag,'D',distribution_amount,-distribution_amount)) amount
3089: FROM psp_adjustment_lines
3090: WHERE batch_name = p_batch_name;
3091:
3092: r_net_zero_diff net_batch_sum_cur%rowtype;
3093:

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

3153: END IF;
3154:
3155: --Reversal Lines Generation
3156:
3157: hr_utility.trace('Inserting into PSP_ADJUSTMENT_LINES - 10');
3158:
3159: insert into psp_adjustment_lines(adjustment_line_id,
3160: person_id,
3161: assignment_id,

Line 3159: insert into psp_adjustment_lines(adjustment_line_id,

3155: --Reversal Lines Generation
3156:
3157: hr_utility.trace('Inserting into PSP_ADJUSTMENT_LINES - 10');
3158:
3159: insert into psp_adjustment_lines(adjustment_line_id,
3160: person_id,
3161: assignment_id,
3162: element_type_id,
3163: distribution_date,

Line 3205: select psp_adjustment_lines_s.nextval,

3201: attribute7,
3202: attribute8,
3203: attribute9,
3204: attribute10)
3205: select psp_adjustment_lines_s.nextval,
3206: p_person_id,
3207: p_assignment_id,
3208: ptol.element_type_id,
3209: ptol.orig_distribution_date,

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

3261: g_error_api_path := 'No records found in reversal lines:'||g_error_api_path;
3262: raise NO_RECORDS_FOUND;
3263: end if;
3264:
3265: hr_utility.trace('Inserted into PSP_ADJUSTMENT_LINES - 10');
3266:
3267: /***** Converted the following update statements into BULK update for R12 performance fixes (bug 4507892)
3268: UPDATE psp_distribution_lines_history
3269: SET adjustment_batch_name = p_batch_name

Line 3271: from psp_adjustment_lines

3267: /***** Converted the following update statements into BULK update for R12 performance fixes (bug 4507892)
3268: UPDATE psp_distribution_lines_history
3269: SET adjustment_batch_name = p_batch_name
3270: WHERE distribution_line_id in ( select orig_line_id
3271: from psp_adjustment_lines
3272: where payroll_control_id = l_payroll_control_id
3273: and orig_source_type = 'D');
3274:
3275: UPDATE psp_pre_gen_dist_lines_history

Line 3278: from psp_adjustment_lines

3274:
3275: UPDATE psp_pre_gen_dist_lines_history
3276: SET adjustment_batch_name = p_batch_name
3277: WHERE pre_gen_dist_line_id in ( select orig_line_id
3278: from psp_adjustment_lines
3279: where payroll_control_id = l_payroll_control_id
3280: and orig_source_type = 'P');
3281:
3282:

Line 3283: UPDATE psp_adjustment_lines_history

3279: where payroll_control_id = l_payroll_control_id
3280: and orig_source_type = 'P');
3281:
3282:
3283: UPDATE psp_adjustment_lines_history
3284: SET adjustment_batch_name = p_batch_name
3285: WHERE adjustment_line_id in ( select orig_line_id
3286: from psp_adjustment_lines
3287: where payroll_control_id = l_payroll_control_id

Line 3286: from psp_adjustment_lines

3282:
3283: UPDATE psp_adjustment_lines_history
3284: SET adjustment_batch_name = p_batch_name
3285: WHERE adjustment_line_id in ( select orig_line_id
3286: from psp_adjustment_lines
3287: where payroll_control_id = l_payroll_control_id
3288: and orig_source_type = 'A');
3289: ---end of code changes for reversal line generation DA-ENH
3290: End of comment for bug fix 4507892 *****/

Line 3314: UPDATE psp_adjustment_lines_history

3310: WHERE pre_gen_dist_line_id = r_orig_lines.orig_line_id(I)
3311: AND r_orig_lines.orig_source_type(I) = 'P';
3312:
3313: FORALL I IN 1..r_orig_lines.orig_line_id.COUNT
3314: UPDATE psp_adjustment_lines_history
3315: SET adjustment_batch_name = p_batch_name
3316: WHERE adjustment_line_id = r_orig_lines.orig_line_id(I)
3317: AND r_orig_lines.orig_source_type(I) = 'A';
3318:

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

3322:
3323: hr_utility.trace('Completed BULK updates');
3324:
3325: ----- Insert statement to generate new adj lines.
3326: hr_utility.trace('Inserting into PSP_ADJUSTMENT_LINES - 20');
3327:
3328: insert into psp_adjustment_lines
3329: (adjustment_line_id,
3330: person_id,

Line 3328: insert into psp_adjustment_lines

3324:
3325: ----- Insert statement to generate new adj lines.
3326: hr_utility.trace('Inserting into PSP_ADJUSTMENT_LINES - 20');
3327:
3328: insert into psp_adjustment_lines
3329: (adjustment_line_id,
3330: person_id,
3331: assignment_id,
3332: element_type_id,

Line 3375: select psp_adjustment_lines_s.nextval,

3371: attribute7,
3372: attribute8,
3373: attribute9,
3374: attribute10) --- new column for DA-ENH
3375: select psp_adjustment_lines_s.nextval,
3376: p_person_id,
3377: p_assignment_id,
3378: LINES.element_type_id,
3379: LINES.orig_distribution_date,

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

3449: DEST.original_line_flag = 'N';
3450: /* ORDER BY DEST.adj_set_number, DEST.line_number, LINES.time_period_id;
3451: --- order by ensures the delta amount will be posted to line of last time periods.
3452: */
3453: hr_utility.trace('Inserted into PSP_ADJUSTMENT_LINES - 20');
3454:
3455: hr_utility.trace('g_precision = '||g_precision);
3456: hr_utility.trace('Bulk Fetch SLINE_IDEAL_AMNT_MATRIX values');
3457:

Line 3471: update psp_adjustment_lines

3467: close sline_ideal_amnt_matrix;
3468:
3469: hr_utility.trace('Updating the DISTRIBUTION_AMOUNT based on g_precision');
3470:
3471: update psp_adjustment_lines
3472: set distribution_amount = round(distribution_amount, g_precision)
3473: where original_line_flag = 'N'and
3474: batch_name = p_batch_name;
3475:

Line 3477: update psp_adjustment_lines

3473: where original_line_flag = 'N'and
3474: batch_name = p_batch_name;
3475:
3476: forall I in 1..r_sline_ideal_amnt_matrix.adj_set_number.count
3477: update psp_adjustment_lines
3478: set distribution_amount = distribution_amount +
3479: decode(dr_cr_flag,'D', r_sline_ideal_amnt_matrix.delta_sum(i),
3480: -r_sline_ideal_amnt_matrix.delta_sum(i))
3481: where adjustment_line_id = r_sline_ideal_amnt_matrix.adjustment_sline_id(i);

Line 3539: update psp_adjustment_lines

3535: r_adj_matrix.element_type_id.delete;
3536: r_adj_matrix.distribution_sum.delete;
3537:
3538: forall I in 1.. r_sline_actual_amnt_matrix.adj_set_number.count
3539: update psp_adjustment_lines
3540: set distribution_amount = distribution_amount +
3541: decode(dr_cr_flag, 'D', r_sline_actual_amnt_matrix.delta_sum(I),
3542: - r_sline_actual_amnt_matrix.delta_sum(I))
3543: where adjustment_line_id = r_sline_actual_amnt_matrix.adjustment_sline_id(i);

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

3548: r_sline_actual_amnt_matrix.delta_sum.delete;
3549:
3550: --- bug fix 3470916
3551: -- The net of all differences between RHS amounts in
3552: -- psp_temp_dest_sumlines and psp_adjustment_lines will be zero.
3553: --- Logic is that for each dest sumlines, for wich it's sum doesnot equal
3554: --- the sum of dist amount in psp_adjustment_lines, adjust the difference
3555: -- to the last line in last time period of the element with max element_type_id
3556: --- there is no reason for this criteria in particular, but there should

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

3550: --- bug fix 3470916
3551: -- The net of all differences between RHS amounts in
3552: -- psp_temp_dest_sumlines and psp_adjustment_lines will be zero.
3553: --- Logic is that for each dest sumlines, for wich it's sum doesnot equal
3554: --- the sum of dist amount in psp_adjustment_lines, adjust the difference
3555: -- to the last line in last time period of the element with max element_type_id
3556: --- there is no reason for this criteria in particular, but there should
3557: -- some convention to adjust.
3558:

Line 3580: update psp_adjustment_lines

3576: close get_max_element;
3577: l_prev_adj_set := r_dest_diff.adj_set_number; --- added for 3776353
3578: end if;
3579:
3580: update psp_adjustment_lines
3581: set distribution_amount = distribution_amount +
3582: decode(dr_cr_flag,'D',r_dest_diff.distribution_sum-r_dest_diff.amount,
3583: -r_dest_diff.distribution_sum+r_dest_diff.amount)
3584: where adjustment_line_id in

Line 3586: from psp_adjustment_lines

3582: decode(dr_cr_flag,'D',r_dest_diff.distribution_sum-r_dest_diff.amount,
3583: -r_dest_diff.distribution_sum+r_dest_diff.amount)
3584: where adjustment_line_id in
3585: (select max(adjustment_line_id)
3586: from psp_adjustment_lines
3587: where batch_name = p_batch_name and
3588: original_line_flag = 'N' and
3589: line_number = r_dest_diff.line_number and
3590: adj_set_number = r_dest_diff.adj_set_number and

Line 3598: delete psp_adjustment_lines

3594: end if;
3595: end loop;
3596:
3597: ---- moved the delete from above the loop for 3776353
3598: delete psp_adjustment_lines
3599: where distribution_amount = 0
3600: and batch_name = p_batch_name;
3601:
3602: --- added for DA-ENH

Line 3883: Update psp_adjustment_lines

3879: END LOOP; -- End of Main loop
3880:
3881:
3882: FORALL I in 1 .. final_autopop_rec.array_element_type_id.count
3883: Update psp_adjustment_lines
3884: set
3885: gl_code_combination_id = final_autopop_rec.array_glccid(i),
3886: project_id = final_autopop_rec.array_project_id(i),
3887: expenditure_organization_id = final_autopop_rec.array_exp_org_id(i),

Line 4235: l_orig_line_id psp_adjustment_lines.orig_line_id%TYPE;

4231: return_code OUT NOCOPY NUMBER)
4232: IS
4233: undo_failed_exception EXCEPTION;
4234:
4235: l_orig_line_id psp_adjustment_lines.orig_line_id%TYPE;
4236: l_orig_source_type psp_adjustment_lines.orig_source_type%TYPE;
4237: l_report_id psp_effort_reports.effort_report_id%TYPE;
4238: -- Introduced the following variables for bug fix 2724110
4239: l_person_id NUMBER(15);

Line 4236: l_orig_source_type psp_adjustment_lines.orig_source_type%TYPE;

4232: IS
4233: undo_failed_exception EXCEPTION;
4234:
4235: l_orig_line_id psp_adjustment_lines.orig_line_id%TYPE;
4236: l_orig_source_type psp_adjustment_lines.orig_source_type%TYPE;
4237: l_report_id psp_effort_reports.effort_report_id%TYPE;
4238: -- Introduced the following variables for bug fix 2724110
4239: l_person_id NUMBER(15);
4240: l_begin_date DATE;

Line 4247: FROM psp_adjustment_lines

4243:
4244: CURSOR get_line_id_csr IS
4245: SELECT orig_line_id,
4246: orig_source_type
4247: FROM psp_adjustment_lines
4248: WHERE original_line_flag = 'Y'
4249: AND batch_name = p_batch_name
4250: and business_group_id = p_business_group_id
4251: and set_of_books_id = p_set_of_books_id;

Line 4260: psp_adjustment_lines line,

4256: report.person_id,
4257: min(begin_date),
4258: max(end_date)
4259: FROM psp_effort_reports report,
4260: psp_adjustment_lines line,
4261: psp_effort_report_templates template
4262: WHERE line.batch_name = p_batch_name
4263: AND report.person_id = line.person_id
4264: AND template.template_id = report.template_id

Line 4273: FROM psp_adjustment_lines line,

4269: report.person_id;
4270:
4271: /**** Commented the following for bug fix 2724110
4272: SELECT distinct report.effort_report_id
4273: FROM psp_adjustment_lines line,
4274: psp_effort_reports report,
4275: psp_effort_report_templates template
4276: WHERE line.business_group_id = p_business_group_id
4277: and line.set_of_books_id = p_set_of_books_id

Line 4293: FROM psp_adjustment_lines pal

4289: p_batch_name VARCHAR2,
4290: p_begin_date DATE,
4291: p_end_date DATE) IS
4292: SELECT COUNT(1)
4293: FROM psp_adjustment_lines pal
4294: WHERE person_id = p_person_id
4295: AND batch_name <> p_batch_name
4296: AND distribution_date BETWEEN p_begin_date AND p_end_date
4297: AND EXISTS (SELECT 1

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

4309: BEGIN
4310: SAVEPOINT undo_adj_savepoint;
4311:
4312: /*---------------------------------------------------------------------*/
4313: /*1. Update one of the history tables PSP_ADJUSTMENT_LINES_HISTORY or */
4314: /* PSP_PRE_GEN_DIST_LINES_HISTORY or PSP_DISTRIBUTION_LINES_HISTORY */
4315: /* by setting the adjustment_batch_name to NULL. */
4316: /*---------------------------------------------------------------------*/
4317: OPEN get_line_id_csr;

Line 4322: UPDATE psp_adjustment_lines_history

4318: LOOP
4319: FETCH get_line_id_csr INTO l_orig_line_id, l_orig_source_type;
4320: EXIT WHEN get_line_id_csr%NOTFOUND;
4321: IF (l_orig_source_type = 'A') THEN
4322: UPDATE psp_adjustment_lines_history
4323: SET adjustment_batch_name = NULL
4324: WHERE adjustment_line_id = l_orig_line_id;
4325: ELSIF (l_orig_source_type = 'P') THEN
4326: UPDATE psp_pre_gen_dist_lines_history

Line 4397: /* PSP_ADJUSTMENT_LINES. */

4393: END IF;
4394:
4395: /*---------------------------------------------------------------------*/
4396: /*4. Delete the distribution lines of the rejected batch from table */
4397: /* PSP_ADJUSTMENT_LINES. */
4398: /*---------------------------------------------------------------------*/
4399: DELETE FROM psp_adjustment_lines
4400: WHERE batch_name = p_batch_name;
4401: IF (SQL%NOTFOUND) THEN

Line 4399: DELETE FROM psp_adjustment_lines

4395: /*---------------------------------------------------------------------*/
4396: /*4. Delete the distribution lines of the rejected batch from table */
4397: /* PSP_ADJUSTMENT_LINES. */
4398: /*---------------------------------------------------------------------*/
4399: DELETE FROM psp_adjustment_lines
4400: WHERE batch_name = p_batch_name;
4401: IF (SQL%NOTFOUND) THEN
4402: errbuf := 'Failed when update psp_adjustment_lines: no row found.';
4403: RAISE undo_failed_exception;

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

4398: /*---------------------------------------------------------------------*/
4399: DELETE FROM psp_adjustment_lines
4400: WHERE batch_name = p_batch_name;
4401: IF (SQL%NOTFOUND) THEN
4402: errbuf := 'Failed when update psp_adjustment_lines: no row found.';
4403: RAISE undo_failed_exception;
4404: END IF;
4405:
4406: /*---------------------------------------------------------------------*/