DBA Data[Home] [Help]

PACKAGE: APPS.PA_TASK_UTILS

Source


1 package PA_TASK_UTILS AUTHID CURRENT_USER as
2 -- $Header: PAXTUTLS.pls 120.7.12020000.2 2012/07/24 05:02:16 a5sharma 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 
279 /* Start of Bug 6497559 */
280 
281 --
282 --  FUNCTION
283 --              get_resource_name
284 --  PURPOSE
285 --              This functions returns the resource name for a corresponding resource_list_member_id
286 --
287 --  HISTORY
288 --   19-May-2009      rthumma  Created
289 --
290 
291 function get_resource_name (x_rlm_id  IN number) return varchar2;
292 pragma RESTRICT_REFERENCES (get_resource_name, WNDS, WNPS);
293 
294 --
295 --  FUNCTION
296 --              get_task_name
297 --  PURPOSE
298 --              This functions returns the task name for a corresponding task_id
299 --
300 --  HISTORY
301 --   19-May-2009      rthumma  Created
302 --
303 
304 function get_task_name (x_task_id  IN number) return varchar2;
305 pragma RESTRICT_REFERENCES (get_task_name, WNDS, WNPS);
306 
307 --
308 --  FUNCTION
309 --              get_task_number
310 --  PURPOSE
311 --              This functions returns the task number for a corresponding task_id
312 --
313 --  HISTORY
314 --   19-May-2009      rthumma  Created
315 --
316 
317 function get_task_number (x_task_id  IN number) return varchar2;
318 pragma RESTRICT_REFERENCES (get_task_number, WNDS, WNPS);
319 
320 --
321 --  FUNCTION
322 --              get_project_name
323 --  PURPOSE
324 --              This functions returns the project name for a corresponding project_id
325 --
326 --  HISTORY
327 --   19-May-2009      rthumma  Created
328 --
329 
330 function get_project_name (x_project_id  IN number) return varchar2;
331 pragma RESTRICT_REFERENCES (get_project_name, WNDS, WNPS);
332 --
333 --  FUNCTION
334 --              get_project_number
335 --  PURPOSE
336 --              This functions returns the project number for a corresponding project_id
337 --
338 --  HISTORY
339 --   19-May-2009      rthumma  Created
340 --
341 
342 function get_project_number (x_project_id  IN number) return varchar2;
343 pragma RESTRICT_REFERENCES (get_project_number, WNDS, WNPS);
344 
345 /* End of Bug 6497559 */
346 
347 
348 --rtarway 3908013
349 
350 PROCEDURE validate_flex_fields(
351                   p_desc_flex_name        IN     VARCHAR2
352                  ,p_attribute_category    IN     VARCHAR2 := null
353                  ,p_attribute1            IN     VARCHAR2 := null
354                  ,p_attribute2            IN     VARCHAR2 := null
355                  ,p_attribute3            IN     VARCHAR2 := null
356                  ,p_attribute4            IN     VARCHAR2 := null
357                  ,p_attribute5            IN     VARCHAR2 := null
358                  ,p_attribute6            IN     VARCHAR2 := null
359                  ,p_attribute7            IN     VARCHAR2 := null
360                  ,p_attribute8            IN     VARCHAR2 := null
361                  ,p_attribute9            IN     VARCHAR2 := null
362                  ,p_attribute10           IN     VARCHAR2 := null
363                  ,p_attribute11           IN     VARCHAR2 := null
364                  ,p_attribute12           IN     VARCHAR2 := null
365                  ,p_attribute13           IN     VARCHAR2 := null
366                  ,p_attribute14           IN     VARCHAR2 := null
367                  ,p_attribute15           IN     VARCHAR2 := null
368                  ,p_RETURN_msg            OUT NOCOPY VARCHAR2 --File.Sql.39 bug 4440895
369                  ,p_validate_status       OUT NOCOPY VARCHAR2)    ;     --File.Sql.39 bug 4440895
370 --rtarway, 3908013
371 
372 --
373 --  PROCEDURE
374 --              check_set_nonchargeable_ok
375 --  PURPOSE
376 --              This procedure checks if a specific task has PO distributions,
377 --              PO requisition distributions, AP invoice distributions
378 --              and also if it is referenced in PJM. If the task has any of
379 --              these information, then it's not ok to make the task nonchargeable
380 --              and the specific reason will be returned.
381 --		If it's ok to make the task nonchargeable, the x_err_code will be 0.
382 --
383 --  HISTORY
384 --
385 --   24-FEB-05      Derrin Joseph  Created for bug 4069938
386 --
387 procedure check_set_nonchargeable_ok ( x_task_id           IN  number
388                                      , x_err_code          IN OUT    NOCOPY number --File.Sql.39 bug 4440895
389                                      , x_err_stage         IN OUT    NOCOPY varchar2 --File.Sql.39 bug 4440895
390                                      , x_err_stack         IN OUT    NOCOPY varchar2); --File.Sql.39 bug 4440895
391 
392 --
393 --  FUNCTION
394 --              is_flex_field_defined
395 --  PURPOSE
396 --              This function checks whether the flex filed is defined for task or not and
397 --              and return Y or N accordingly.
398 --
399 --  HISTORY
400 --
401 --   23-Jul-12      Amit Sharma  Created for bug Usability Enhancement
402 function is_flex_field_defined(p_project_id         IN PA_PROJ_ELEM_VER_SCHEDULE.PROJECT_ID%TYPE
403                               ,p_element_version_id IN PA_PROJ_ELEM_VER_SCHEDULE.ELEMENT_VERSION_ID%TYPE
404 			      ,p_proj_element_id    IN PA_PROJ_ELEM_VER_SCHEDULE.PROJ_ELEMENT_ID%TYPE)
405 RETURN VARCHAR2;
406 
407 end PA_TASK_UTILS ;