[Home] [Help]
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.
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
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
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
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:
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;
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