1 PACKAGE BODY psp_wf_adj_custom AS
2 /* $Header: PSPWFACB.pls 120.4 2006/02/09 09:32:11 vdharmap noship $ */
3
4 /*************************************************************************
5 ** Procedure select_approver_custom returns the approver_id **
6 ** for the given employee. It is called from **
7 ** PSP_WF_ADJ_PKG.SELECT_APPROVER. **
8 **************************************************************************/
9 PROCEDURE SELECT_APPROVER_CUSTOM
10 (itemtype IN VARCHAR2,
11 itemkey IN VARCHAR2,
12 actid IN VARCHAR2,
13 funcmode IN VARCHAR2,
14 p_person_id IN NUMBER,
15 p_assignment_number IN VARCHAR2,
16 p_approver_id OUT NOCOPY NUMBER) IS
17 BEGIN
18 -- Enter your code here and comment out the follwoing line.
19 p_approver_id := NULL;
20 END;
21
22 /*************************************************************************
23 ** Procedure omit_approval_custom returns 'Y' or 'N' **
24 ** It is called from PSP_WF_ADJ_PKG.OMIT_APPROVAL.
25 **************************************************************************/
26 PROCEDURE OMIT_APPROVAL_CUSTOM
27 (itemtype IN VARCHAR2,
28 itemkey IN VARCHAR2,
29 actid IN VARCHAR2,
30 funcmode IN VARCHAR2,
31 p_omit_approval OUT NOCOPY VARCHAR2) IS
32 BEGIN
33 -- Enter your code here and assign result the value in
34 -- p_omit_approval parameter. Only assign 'Y' or 'N'
35 -- to p_omit_approval.
36 p_omit_approval := 'N';
37 END;
38
39
40 /*************************************************************************
41 ** Procedure record_creator_custom returns approver id **
42 ** It is called from PSP_WF_ADJ_PKG.record_creator
43 **************************************************************************/
44 PROCEDURE RECORD_CREATOR_CUSTOM
45 (itemtype IN VARCHAR2,
46 itemkey IN VARCHAR2,
47 actid IN VARCHAR2,
48 funcmode IN VARCHAR2,
49 p_custom_approver_id OUT NOCOPY VARCHAR2) IS
50 BEGIN
51 -- Enter your code here and assign result the value in
52 -- p_custom_approver_id parameter. Please comment out the
53 -- following line and assign the proper value.
54 p_custom_approver_id := null;
55 END;
56
57 --- added 2 procedures below for 4992668
58
59 PROCEDURE PRORATE_DFF_HOOK(p_batch_name in varchar2,
60 p_business_group_id in integer,
61 p_set_of_books_id in integer) is
62 BEGIN
63
64 /*
65 update psp_adjustment_lines pal
66 set pal.attribute1 = (select round((percent /100 ) * to_number(pgh.attribute1), 2)
67 from psp_pre_gen_dist_lines_history pgh
68 where pgh.pre_gen_dist_line_id = pal.orig_line_id)
69 where pal.batch_name = p_batch_name
70 and pal.original_line_flag = 'N'
71 and pal.orig_source_type = 'P'
72 and pal.business_group_id = p_business_group_id
73 and pal.set_of_books_id = p_set_of_books_id;
74
75 update psp_adjustment_lines pal
76 set pal.attribute1 = (select pgh.attribute1 * (-1)
77 from psp_pre_gen_dist_lines_history pgh
78 where pgh.pre_gen_dist_line_id = pal.orig_line_id)
79 where pal.batch_name = p_batch_name
80 and pal.original_line_flag = 'Y'
81 and pal.orig_source_type = 'P'
82 and pal.business_group_id = p_business_group_id
83 and pal.set_of_books_id = p_set_of_books_id;
84
85 update psp_adjustment_lines pal
86 set pal.attribute1 = (select round((pal.percent /100 ) * to_number(palh.attribute1), 2)
87 from psp_adjustment_lines_history palh
88 where palh.adjustment_line_id = pal.orig_line_id)
89 where pal.batch_name = p_batch_name
90 and original_line_flag = 'N'
91 and orig_source_type = 'A'
92 and pal.business_group_id = p_business_group_id
93 and pal.set_of_books_id = p_set_of_books_id;
94
95 update psp_adjustment_lines pal
96 set pal.attribute1 = (select palh.attribute1 * (-1)
97 from psp_adjustment_lines_history palh
98 where palh.adjustment_line_id = pal.orig_line_id)
99 where pal.batch_name = p_batch_name
100 and original_line_flag = 'Y'
101 and orig_source_type = 'A'
102 and pal.business_group_id = p_business_group_id
103 and pal.set_of_books_id = p_set_of_books_id; */
104
105 /* following statement to be used only if you use non oracle payroll sub lines or Oracle payroll
106 update psp_adjustment_lines pal
107 set pal.attribute1 = (select round((percent /100 ) * pdl.attribute1
108 from psp_distribution_lines_history pdlh
109 where pdlh.distribution_line_id = pal.orig_line_id)
110 where pal.batch_name = p_batch_name
111 and orig_source_type = 'A'; */
112 NULL;
113 END;
114
115
116 procedure dff_for_approver(p_batch_name in varchar2,
117 p_run_id in integer,
118 p_business_group_id in integer,
119 p_set_of_books_id in integer) is
120 begin
121
122 /* sample code to show total sum hours in DFF approval window */
123 /* update psp_temp_Dest_sumlines ptds
124 set ptds.attribute1 = ( select sum(to_number(nvl(pal.attribute1,'0')))
125 from psp_adjustment_lines pal
126 where pal.business_group_id = p_business_group_id
127 and pal.set_of_books_id = p_set_of_books_id
128 and pal.batch_name = p_batch_name
129 and pal.adj_set_number = ptds.adj_set_number
130 and pal.line_number = ptds.line_number
131 and (ptds.element_type_id is null or
132 ptds.element_type_id = pal.element_type_id)
133 and nvl(pal.gl_code_combination_id, -999) = nvl(ptds.gl_code_combination_id, -999)
134 and nvl(pal.expenditure_organization_id, -999) = nvl(ptds.expenditure_organization_id, -999)
135 and nvl(pal.project_id, -999) = nvl(ptds.project_id, -999)
136 and nvl(pal.task_id, -999) = nvl(ptds.task_id, -999)
137 and nvl(pal.expenditure_type, '-999') = nvl(ptds.expenditure_type, '-999')
138 and pal.original_line_flag = ptds.original_line_flag)
139 where ptds.run_id = p_run_id; */
140
141 null;
142 end;
143
144
145 END psp_wf_adj_custom;
146