1 package PA_TASK_UTILS as
2 -- $Header: PAXTUTLS.pls 120.3.12010000.4 2008/10/23 05:23:10 paljain ship $
3
4 --
5 -- FUNCTION
6 -- get_wbs_level
7 -- PURPOSE
8 -- This function retrieves the wbs level of a task.
9 -- If no wbs level is found, null is returned.
10 -- If Oracle error occurs, Oracle error number is returned.
11 -- HISTORY
12 -- 20-OCT-95 R. Chiu Created
13 --
14 function get_wbs_level (x_task_id IN number) return number;
15 pragma RESTRICT_REFERENCES (get_wbs_level, WNDS, WNPS);
16
17 --
18 -- FUNCTION
19 -- get_top_task_id
20 -- PURPOSE
21 -- This function retrieves the top task id of a task.
22 -- If no top task id is found, null is returned.
23 -- If Oracle error occurs, Oracle error number is returned.
24 -- HISTORY
25 -- 20-OCT-95 R. Chiu Created
26 --
27 function get_top_task_id (x_task_id IN number) return number;
28 pragma RESTRICT_REFERENCES (get_top_task_id, WNDS, WNPS);
29
30 --
31 -- FUNCTION
32 -- get_parent_task_id
33 -- PURPOSE
34 -- This function retrieves the parent task id of a task.
35 -- If no parent task id is found, null is returned.
36 -- If Oracle error occurs, Oracle error number is returned.
37 -- HISTORY
38 -- 20-OCT-95 R. Chiu Created
39 --
40 function get_parent_task_id (x_task_id IN number) return number;
41 pragma RESTRICT_REFERENCES (get_parent_task_id, WNDS, WNPS);
42
43
44 --
45 -- FUNCTION
46 -- check_unique_task_number
47 -- PURPOSE
48 -- This function returns 1 if a task number is not already
49 -- used in PA system for a specific project id and returns 0
50 -- if number is used.
51 -- If Oracle error occurs, Oracle error number is returned.
52 -- HISTORY
53 -- 20-OCT-95 R. Chiu Created
54 --
55 function check_unique_task_number (x_project_id IN number
56 , x_task_number IN varchar2
57 , x_rowid IN varchar2 ) return number;
58 pragma RESTRICT_REFERENCES (check_unique_task_number, WNDS, WNPS);
59
60
61 --
62 -- FUNCTION
63 -- check_last_task
64 -- PURPOSE
65 -- This function returns 1 if a task is the last task
66 -- and returns 0 otherwise.
67 -- If Oracle error occurs, Oracle error number is returned.
68 --
69 -- HISTORY
70 -- 20-OCT-95 R. Chiu Created
71 --
72 function check_last_task (x_task_id IN number ) return number;
73 pragma RESTRICT_REFERENCES (check_last_task, WNDS, WNPS);
74
75 --
76 -- FUNCTION
77 -- check_last_child
78 -- PURPOSE
79 -- This function returns 1 if a task is the last child of branch
80 -- and returns 0 otherwise.
81 -- If Oracle error occurs, Oracle error number is returned.
82 --
83 -- HISTORY
84 -- 20-OCT-95 R. Chiu Created
85 --
86 function check_last_child (x_task_id IN number ) return number;
87 pragma RESTRICT_REFERENCES (check_last_child, WNDS, WNPS);
88
89
90 --
91 -- FUNCTION
92 -- check_pct_complete_exists
93 -- PURPOSE
94 -- This function returns 1 if percent complete exists for a
95 -- specific task and returns 0 if no percent complete is found
96 -- for that task.
97 --
98 -- If Oracle error occured, Oracle error code is returned.
99 --
100 -- HISTORY
101 -- 20-OCT-95 R. Chiu Created
102 --
103 function check_pct_complete_exists (x_task_id IN number ) return number;
104 pragma RESTRICT_REFERENCES (check_pct_complete_exists, WNDS, WNPS);
105
106
107 -- FUNCTION
108 -- check_labor_cost_multiplier
109 -- PURPOSE
110 -- This function returns 1 if a task has labor cost multiplier
111 -- and returns 0 otherwise.
112 --
113 -- If Oracle error occured, Oracle error code is returned.
114 --
115 -- HISTORY
116 -- 20-OCT-95 R. Chiu Created
117 --
118 function check_labor_cost_multiplier
119 (x_task_id IN number ) return number;
120 pragma RESTRICT_REFERENCES (check_labor_cost_multiplier, WNDS, WNPS);
121
122
123 --
124 -- PROCEDURE
125 -- check_create_subtask_ok
126 -- PURPOSE
127 -- This procedure checks if a specific task has any transaction
128 -- control, burden schedule override, budget, billing,
129 -- and other transaction information. If task has any of
130 -- these information, then it's not ok to create subtask for
131 -- that task. Specific reason will be returned.
132 -- If it's ok to create subtask, the x_err_code will be 0.
133 --
134 -- HISTORY
135 -- 20-OCT-95 R. Chiu Created
136 --
137 procedure check_create_subtask_ok ( x_task_id IN number
138 , x_validation_mode IN VARCHAR2 DEFAULT 'U' --bug 2947492
139 , x_err_code IN OUT NOCOPY number --File.Sql.39 bug 4440895
140 , x_err_stage IN OUT NOCOPY varchar2 --File.Sql.39 bug 4440895
141 , x_err_stack IN OUT NOCOPY varchar2); --File.Sql.39 bug 4440895
142
143
144 --
145 -- PROCEDURE
146 -- change_lowest_task_num_ok
147 -- PURPOSE
148 -- This procedure checks if a specific task has expenditure items,
149 -- Po req distributions,po distributions,ap invoices and ap
150 -- invoice distributions. If task has any of
151 -- these information, then it's not ok to change the task number
152 -- and specific reason will be returned.
153 -- If it's ok to change task number, the x_err_code will be 0.
154 --
155 -- HISTORY
156 -- 29-DEC-95 R.Krishnamurthy Created
157 --
158 procedure change_lowest_task_num_ok ( x_task_id IN number
159 , x_err_code IN OUT NOCOPY number --File.Sql.39 bug 4440895
160 , x_err_stage IN OUT NOCOPY varchar2 --File.Sql.39 bug 4440895
161 , x_err_stack IN OUT NOCOPY varchar2); --File.Sql.39 bug 4440895
162 --
163 -- PROCEDURE
164 -- change_task_org_ok
165 -- PURPOSE
166 -- This procedure checks if a specific task has CDLs,RDLs or
167 -- Draft invoices.If task has any of
168 -- these information, then it's not ok to change the task org
169 -- and specific reason will be returned.
170 -- If it's ok to change task org, the x_err_code will be 0.
171 --
172 -- HISTORY
173 -- 29-DEC-95 R.Krishnamurthy Created
174 --
175 procedure change_task_org_ok ( x_task_id IN number
176 , x_err_code IN OUT NOCOPY number --File.Sql.39 bug 4440895
177 , x_err_stage IN OUT NOCOPY varchar2 --File.Sql.39 bug 4440895
178 , x_err_stack IN OUT NOCOPY varchar2); --File.Sql.39 bug 4440895
179
180
181 -- Added the following for the fix of 6316383
182 --
183 -- PROCEDURE
184 -- change_task_org_ok1
185 -- PURPOSE
186 -- This procedure checks if a specific task has CDLs,RDLs or
187 -- Draft invoices.If task has any of these information,
188 -- the future dated expenditure items recalculation is handled.
189 --
190 -- HISTORY
191 -- 20-12-07 Pallavi Jain Created
192 --
193 procedure change_task_org_ok1 (p_task_id IN number
194 ,p_project_id IN number
195 ,p_new_org_id IN number
196 ,p_commit IN varchar2
197 ,x_err_stage IN OUT NOCOPY varchar2); --File.Sql.39 GSCC Standard
198
199 --
200 -- PROCEDURE
201 -- change_task_org_ok2
202 -- PURPOSE
203 -- This procedure receives a table of task Ids and org Ids along with other,
204 -- other parameters , then in turn calls Procedure pa_task_utils.change_task_org_ok1
205 -- for each set of task Id and org Id.
206 --
207 --
208 -- HISTORY
209 -- 26-DEC-07 Pallavi Jain Created
210
211 procedure change_task_org_ok2 ( p_task_id_tbl IN SYSTEM.PA_NUM_TBL_TYPE := NULL
212 ,p_project_id IN number
213 ,p_org_id_tbl IN SYSTEM.PA_NUM_TBL_TYPE := NULL
214 ,p_commit IN varchar2
215 ,x_err_stage IN OUT NOCOPY varchar2); --File.Sql.39 GSCC Standard
216
217
218 --Added for the fix of 7291217
219 -- FUNCTION
220 -- get_resource_list_name
221 -- PURPOSE
222 -- This function retrieves the resource list name
223 -- If no resource_list_id found, null is returned.
224 -- If Oracle error occurs, Oracle error number is returned.
225 -- HISTORY
226 -- 24-JUL-08 sugupta Created
227 --
228 function get_resource_list_name (p_resource_list_id IN number) return varchar2;
229 pragma RESTRICT_REFERENCES (get_resource_list_name, WNDS, WNPS);
230
231
232 --
233 -- PROCEDURE
234 -- check_delete_task_ok
235 -- PURPOSE
236 -- This objective of this API is to check if it is OK to delete
237 -- a task.
238 --
239 -- HISTORY
240 -- 05-JAN-96 S. Lee Created
241 --
242 procedure check_delete_task_ok (x_task_id IN number
243 , x_validation_mode IN VARCHAR2 DEFAULT 'U' --bug 2947492
244 , x_err_code IN OUT NOCOPY number --File.Sql.39 bug 4440895
245 , x_err_stage IN OUT NOCOPY varchar2 --File.Sql.39 bug 4440895
246 , x_err_stack IN OUT NOCOPY varchar2); --File.Sql.39 bug 4440895
247
248
249 --
250 -- FUNCTION
251 -- sort_order_tree_walk
252 -- PURPOSE
253 -- This function does a reverse tree walk in the pa_task table
254 -- to set up a sort order using input parent_task_id and
255 -- task_number.
256 -- If Oracle error occurs, Oracle error number is returned.
257 --
258 -- HISTORY
259 -- 12-DEC-96 Charles Fong Created
260 --
261 function sort_order_tree_walk(x_parent_id IN number, x_sort_order_col IN varchar2) return varchar2;
262 pragma RESTRICT_REFERENCES (sort_order_tree_walk, WNDS, WNPS);
263
264 --
265 -- FUNCTION
266 -- check_child_exists
267 -- PURPOSE
268 -- This function checks whether the task has any child or not and
269 -- return 1 or 0 accordingly.
270 -- If Oracle error occurs, Oracle error number is returned.
271 --
272 -- HISTORY
273 -- 12-DEC-96 Charles Fong Created
274 --
275 function check_child_exists(x_task_id IN number) return number;
276 pragma RESTRICT_REFERENCES (check_child_exists, WNDS, WNPS);
277
278 --rtarway 3908013
279
280 PROCEDURE validate_flex_fields(
281 p_desc_flex_name IN VARCHAR2
282 ,p_attribute_category IN VARCHAR2 := null
283 ,p_attribute1 IN VARCHAR2 := null
284 ,p_attribute2 IN VARCHAR2 := null
285 ,p_attribute3 IN VARCHAR2 := null
286 ,p_attribute4 IN VARCHAR2 := null
287 ,p_attribute5 IN VARCHAR2 := null
288 ,p_attribute6 IN VARCHAR2 := null
289 ,p_attribute7 IN VARCHAR2 := null
290 ,p_attribute8 IN VARCHAR2 := null
291 ,p_attribute9 IN VARCHAR2 := null
292 ,p_attribute10 IN VARCHAR2 := null
293 ,p_attribute11 IN VARCHAR2 := null
294 ,p_attribute12 IN VARCHAR2 := null
295 ,p_attribute13 IN VARCHAR2 := null
296 ,p_attribute14 IN VARCHAR2 := null
297 ,p_attribute15 IN VARCHAR2 := null
298 ,p_RETURN_msg OUT NOCOPY VARCHAR2 --File.Sql.39 bug 4440895
299 ,p_validate_status OUT NOCOPY VARCHAR2) ; --File.Sql.39 bug 4440895
300 --rtarway, 3908013
301
302 --
303 -- PROCEDURE
304 -- check_set_nonchargeable_ok
305 -- PURPOSE
306 -- This procedure checks if a specific task has PO distributions,
307 -- PO requisition distributions, AP invoice distributions
308 -- and also if it is referenced in PJM. If the task has any of
309 -- these information, then it's not ok to make the task nonchargeable
310 -- and the specific reason will be returned.
311 -- If it's ok to make the task nonchargeable, the x_err_code will be 0.
312 --
313 -- HISTORY
314 --
315 -- 24-FEB-05 Derrin Joseph Created for bug 4069938
316 --
317 procedure check_set_nonchargeable_ok ( x_task_id IN number
318 , x_err_code IN OUT NOCOPY number --File.Sql.39 bug 4440895
319 , x_err_stage IN OUT NOCOPY varchar2 --File.Sql.39 bug 4440895
320 , x_err_stack IN OUT NOCOPY varchar2); --File.Sql.39 bug 4440895
321
322 end PA_TASK_UTILS ;