[Home] [Help]
PACKAGE BODY: APPS.PA_TASKS_PKG
Source
1 PACKAGE BODY PA_TASKS_PKG as
2 /* $Header: PAXTASKB.pls 120.4 2006/05/03 04:20:33 sunkalya noship $ */
3
4 PROCEDURE Insert_Row(X_Rowid IN OUT NOCOPY VARCHAR2, --File.Sql.39 bug 4440895
5 X_Task_Id IN OUT NOCOPY NUMBER, --File.Sql.39 bug 4440895
6 X_Project_Id NUMBER,
7 X_Task_Number VARCHAR2,
8 X_Creation_Date DATE,
9 X_Created_By NUMBER,
10 X_Last_Update_Date DATE,
11 X_Last_Updated_By NUMBER,
12 X_Last_Update_Login NUMBER,
13 X_Task_Name VARCHAR2,
14 -- Long Task Name change by xxlu
15 X_Long_Task_Name VARCHAR2,
16 X_Top_Task_Id NUMBER,
17 X_Wbs_Level NUMBER,
18 X_Ready_To_Bill_Flag VARCHAR2,
19 X_Ready_To_Distribute_Flag VARCHAR2,
20 X_Parent_Task_Id NUMBER,
21 X_Description VARCHAR2,
22 X_Carrying_Out_Organization_Id NUMBER,
23 X_Service_Type_Code VARCHAR2,
24 X_Task_Manager_Person_Id NUMBER,
25 X_Chargeable_Flag VARCHAR2,
26 X_Billable_Flag VARCHAR2,
27 X_Limit_To_Txn_Controls_Flag VARCHAR2,
28 X_Start_Date DATE,
29 X_Completion_Date DATE,
30 X_Address_Id NUMBER,
31 X_Labor_Bill_Rate_Org_Id NUMBER,
32 X_Labor_Std_Bill_Rate_Schdl VARCHAR2,
33 X_Labor_Schedule_Fixed_Date DATE,
34 X_Labor_Schedule_Discount NUMBER,
35 X_Non_Labor_Bill_Rate_Org_Id NUMBER,
36 X_NL_Std_Bill_Rate_Schdl VARCHAR2,
37 X_NL_Schedule_Fixed_Date DATE,
38 X_Non_Labor_Schedule_Discount NUMBER,
39 X_Labor_Cost_Multiplier_Name VARCHAR2,
40 X_Attribute_Category VARCHAR2,
41 X_Attribute1 VARCHAR2,
42 X_Attribute2 VARCHAR2,
43 X_Attribute3 VARCHAR2,
44 X_Attribute4 VARCHAR2,
45 X_Attribute5 VARCHAR2,
46 X_Attribute6 VARCHAR2,
47 X_Attribute7 VARCHAR2,
48 X_Attribute8 VARCHAR2,
49 X_Attribute9 VARCHAR2,
50 X_Attribute10 VARCHAR2,
51 X_Cost_Ind_Rate_Sch_Id NUMBER,
52 X_Rev_Ind_Rate_Sch_Id NUMBER,
53 X_Inv_Ind_Rate_Sch_Id NUMBER,
54 X_Cost_Ind_Sch_Fixed_Date DATE,
55 X_Rev_Ind_Sch_Fixed_Date DATE,
56 X_Inv_Ind_Sch_Fixed_Date DATE,
57 X_Labor_Sch_Type VARCHAR2,
58 X_Non_Labor_Sch_Type VARCHAR2,
59 X_Allow_Cross_Charge_Flag VARCHAR2,
60 X_Project_Rate_Date DATE,
61 X_Project_Rate_Type VARCHAR2,
62 X_CC_Process_Labor_Flag VARCHAR2,
63 X_Labor_Tp_Schedule_Id NUMBER,
64 X_Labor_Tp_Fixed_Date DATE,
65 X_CC_Process_NL_Flag VARCHAR2,
66 X_Nl_Tp_Schedule_Id NUMBER,
67 X_Nl_Tp_Fixed_Date DATE,
68 X_receive_project_invoice_flag VARCHAR2,
69 X_work_type_id NUMBER,
70 -- 21-MAR-2001 anlee
71 -- added job_bill_rate_schedule_id,
72 -- emp_bill_rate_schedule_id for
73 -- PRM forecasting changes
74 X_job_bill_rate_schedule_id NUMBER,
75 X_emp_bill_rate_schedule_id NUMBER,
76 --MCA Sakthi for MultiAgreementCurreny Project
77 X_taskfunc_cost_rate_type VARCHAR2,
78 X_taskfunc_cost_rate_date DATE,
79 X_non_lab_std_bill_rt_sch_id NUMBER,
80 --MCA Sakthi for MultiAgreementCurreny Project
81 -- FP.K Setup changes by msundare
82 X_labor_disc_reason_code VARCHAR2,
83 X_non_labor_disc_reason_code VARCHAR2,
84 --PA L Dev
85 x_retirement_cost_flag VARCHAR2,
86 x_cint_eligible_flag VARCHAR2,
87 x_cint_stop_date DATE,
88 /*Added for FPM Changes */
89 x_customer_id Number default NULL,
90 x_revenue_accrual_method varchar2 default null,
91 x_invoice_method varchar2 default null,
92 x_gen_etc_src_code VARCHAR2 default NULL
93 ) IS
94 CURSOR C IS SELECT rowid FROM PA_TASKS
95 WHERE task_id = X_Task_Id;
96 CURSOR C2 IS SELECT pa_tasks_s.nextval FROM sys.dual;
97
98 -- 4537865
99 l_incoming_taskid pa_tasks.task_id%type ;
100 BEGIN
101 l_incoming_taskid := x_task_id ;
102
103 if (X_Task_Id is NULL) then
104 OPEN C2;
105 FETCH C2 INTO X_Task_Id;
106 CLOSE C2;
107 end if;
108
109 INSERT INTO PA_TASKS(
110 task_id,
111 project_id,
112 task_number,
113 creation_date,
114 created_by,
115 last_update_date,
116 last_updated_by,
117 last_update_login,
118 task_name,
119 long_task_name,
120 top_task_id,
121 wbs_level,
122 ready_to_bill_flag,
123 ready_to_distribute_flag,
124 parent_task_id,
125 description,
126 carrying_out_organization_id,
127 service_type_code,
128 task_manager_person_id,
129 chargeable_flag,
130 billable_flag,
131 limit_to_txn_controls_flag,
132 start_date,
133 completion_date,
134 address_id,
135 labor_bill_rate_org_id,
136 labor_std_bill_rate_schdl,
137 labor_schedule_fixed_date,
138 labor_schedule_discount,
139 non_labor_bill_rate_org_id,
140 non_labor_std_bill_rate_schdl,
141 non_labor_schedule_fixed_date,
142 non_labor_schedule_discount,
143 labor_cost_multiplier_name,
144 attribute_category,
145 attribute1,
146 attribute2,
147 attribute3,
148 attribute4,
149 attribute5,
150 attribute6,
151 attribute7,
152 attribute8,
153 attribute9,
154 attribute10,
155 cost_ind_rate_sch_id,
156 rev_ind_rate_sch_id,
157 inv_ind_rate_sch_id,
158 cost_ind_sch_fixed_date,
159 rev_ind_sch_fixed_date,
160 inv_ind_sch_fixed_date,
161 labor_sch_type,
162 non_labor_sch_type,
163 Allow_Cross_Charge_Flag,
164 Project_Rate_Date,
165 Project_Rate_Type,
166 CC_Process_Labor_Flag,
167 Labor_Tp_Schedule_Id,
168 Labor_Tp_Fixed_Date,
169 CC_Process_NL_Flag,
170 Nl_Tp_Schedule_Id,
171 Nl_Tp_Fixed_Date,
172 receive_project_invoice_flag,
173 work_type_id,
174 job_bill_rate_schedule_id,
175 emp_bill_rate_schedule_id,
176 taskfunc_cost_rate_type,
177 taskfunc_cost_rate_date,
178 non_lab_std_bill_rt_sch_id,
179 labor_disc_reason_code,
180 non_labor_disc_reason_code,
181 retirement_cost_flag ,
182 cint_eligible_flag ,
183 cint_stop_date ,
184 record_version_number,
185 customer_id,
186 revenue_accrual_method,
187 invoice_method,
188 GEN_ETC_SOURCE_CODE
189 ) VALUES (
190 X_Task_Id,
191 X_Project_Id,
192 SUBSTRB( X_Task_Number, 1, 25 ), --Bug 4297289
193 X_Creation_Date,
194 X_Created_By,
195 X_Last_Update_Date,
196 X_Last_Updated_By,
197 X_Last_Update_Login,
198 SUBSTRB( X_Task_Name, 1, 20 ), --Bug 4297289
199 X_Long_Task_Name,
200 nvl(X_Top_Task_Id, X_Task_id),
201 X_Wbs_Level,
202 X_Ready_To_Bill_Flag,
203 X_Ready_To_Distribute_Flag,
204 X_Parent_Task_Id,
205 X_Description,
206 X_Carrying_Out_Organization_Id,
207 X_Service_Type_Code,
208 X_Task_Manager_Person_Id,
209 X_Chargeable_Flag,
210 X_Billable_Flag,
211 X_Limit_To_Txn_Controls_Flag,
212 X_Start_Date,
213 X_Completion_Date,
214 X_Address_Id,
215 X_Labor_Bill_Rate_Org_Id,
216 X_Labor_Std_Bill_Rate_Schdl,
217 X_Labor_Schedule_Fixed_Date,
218 X_Labor_Schedule_Discount,
219 X_Non_Labor_Bill_Rate_Org_Id,
220 X_NL_Std_Bill_Rate_Schdl,
221 X_NL_Schedule_Fixed_Date,
222 X_Non_Labor_Schedule_Discount,
223 X_Labor_Cost_Multiplier_Name,
224 X_Attribute_Category,
225 X_Attribute1,
226 X_Attribute2,
227 X_Attribute3,
228 X_Attribute4,
229 X_Attribute5,
230 X_Attribute6,
231 X_Attribute7,
232 X_Attribute8,
233 X_Attribute9,
234 X_Attribute10,
235 X_Cost_Ind_Rate_Sch_Id,
236 X_Rev_Ind_Rate_Sch_Id,
237 X_Inv_Ind_Rate_Sch_Id,
238 X_Cost_Ind_Sch_Fixed_Date,
239 X_Rev_Ind_Sch_Fixed_Date,
240 X_Inv_Ind_Sch_Fixed_Date,
241 X_Labor_Sch_Type,
242 X_Non_Labor_Sch_Type,
243 X_Allow_Cross_Charge_Flag,
244 X_Project_Rate_Date,
245 X_Project_Rate_Type,
246 X_CC_Process_Labor_Flag,
247 X_Labor_Tp_Schedule_Id,
248 X_Labor_Tp_Fixed_Date,
249 X_CC_Process_NL_Flag,
250 X_Nl_Tp_Schedule_Id,
251 X_Nl_Tp_Fixed_Date,
252 X_Receive_Project_Invoice_Flag,
253 X_work_type_id,
254 X_job_bill_rate_schedule_id,
255 X_emp_bill_rate_schedule_id,
256 X_taskfunc_cost_rate_type,
257 X_taskfunc_cost_rate_date,
258 X_non_lab_std_bill_rt_sch_id,
259 X_labor_disc_reason_code,
260 X_non_labor_disc_reason_code,
261 --PA L Changes 2872708
262 x_retirement_cost_flag ,
263 x_cint_eligible_flag ,
264 x_cint_stop_date ,
265 1,
266 x_customer_id,
267 x_revenue_accrual_method,
268 x_invoice_method,
269 x_gen_etc_src_code
270 );
271
272 OPEN C;
273 FETCH C INTO X_Rowid;
274 if (C%NOTFOUND) then
275 CLOSE C;
276 Raise NO_DATA_FOUND;
277 end if;
278 CLOSE C;
279 -- 4537865
280 EXCEPTION
281 WHEN OTHERS THEN
282 -- RESET IN OUT params to their original values
283 X_Rowid := NULL ;
284 X_Task_Id := l_incoming_taskid ;
285
286 -- Populate error stack and RAISE
287 fnd_msg_pub.add_exc_msg(p_pkg_name => 'PA_TASKS_PKG',
288 p_procedure_name => 'Insert_Row',
289 p_error_text => SUBSTRB(SQLERRM,1,240));
290 RAISE;
291 END Insert_Row;
292
293
294 PROCEDURE Lock_Row(X_Rowid VARCHAR2,
295 X_Task_Id NUMBER,
296 X_Project_Id NUMBER,
297 X_Task_Number VARCHAR2,
298 X_Task_Name VARCHAR2,
299 -- Long Task Name change by xxlu
300 X_Long_Task_Name VARCHAR2,
301 X_Top_Task_Id NUMBER,
302 X_Wbs_Level NUMBER,
303 X_Ready_To_Bill_Flag VARCHAR2,
304 X_Ready_To_Distribute_Flag VARCHAR2,
305 X_Parent_Task_Id NUMBER,
306 X_Description VARCHAR2,
307 X_Carrying_Out_Organization_Id NUMBER,
308 X_Service_Type_Code VARCHAR2,
309 X_Task_Manager_Person_Id NUMBER,
310 X_Chargeable_Flag VARCHAR2,
311 X_Billable_Flag VARCHAR2,
312 X_Limit_To_Txn_Controls_Flag VARCHAR2,
313 X_Start_Date DATE,
314 X_Completion_Date DATE,
315 X_Address_Id NUMBER,
316 X_Labor_Bill_Rate_Org_Id NUMBER,
317 X_Labor_Std_Bill_Rate_Schdl VARCHAR2,
318 X_Labor_Schedule_Fixed_Date DATE,
319 X_Labor_Schedule_Discount NUMBER,
320 X_Non_Labor_Bill_Rate_Org_Id NUMBER,
321 X_NL_Std_Bill_Rate_Schdl VARCHAR2,
322 X_NL_Schedule_Fixed_Date DATE,
323 X_Non_Labor_Schedule_Discount NUMBER,
324 X_Labor_Cost_Multiplier_Name VARCHAR2,
325 X_Attribute_Category VARCHAR2,
326 X_Attribute1 VARCHAR2,
327 X_Attribute2 VARCHAR2,
328 X_Attribute3 VARCHAR2,
329 X_Attribute4 VARCHAR2,
330 X_Attribute5 VARCHAR2,
331 X_Attribute6 VARCHAR2,
332 X_Attribute7 VARCHAR2,
333 X_Attribute8 VARCHAR2,
334 X_Attribute9 VARCHAR2,
335 X_Attribute10 VARCHAR2,
336 X_Cost_Ind_Rate_Sch_Id NUMBER,
337 X_Rev_Ind_Rate_Sch_Id NUMBER,
338 X_Inv_Ind_Rate_Sch_Id NUMBER,
339 X_Cost_Ind_Sch_Fixed_Date DATE,
340 X_Rev_Ind_Sch_Fixed_Date DATE,
341 X_Inv_Ind_Sch_Fixed_Date DATE,
342 X_Labor_Sch_Type VARCHAR2,
343 X_Non_Labor_Sch_Type VARCHAR2,
344 X_Allow_Cross_Charge_Flag VARCHAR2,
345 X_Project_Rate_Date DATE,
346 X_Project_Rate_Type VARCHAR2,
347 X_CC_Process_Labor_Flag VARCHAR2,
351 X_Nl_Tp_Schedule_Id NUMBER,
348 X_Labor_Tp_Schedule_Id NUMBER,
349 X_Labor_Tp_Fixed_Date DATE,
350 X_CC_Process_NL_Flag VARCHAR2,
352 X_Nl_Tp_Fixed_Date DATE,
353 X_receive_project_invoice_flag VARCHAR2,
354 X_work_type_id NUMBER,
355 -- 21-MAR-2001 anlee
356 -- added job_bill_rate_schedule_id,
357 -- emp_bill_rate_schedule_id for
358 -- PRM forecasting changes
359 X_job_bill_rate_schedule_id NUMBER,
360 X_emp_bill_rate_schedule_id NUMBER,
361 --MCA Sakthi for MultiAgreementCurreny Project
362 X_taskfunc_cost_rate_type VARCHAR2,
363 X_taskfunc_cost_rate_date DATE,
364 X_non_lab_std_bill_rt_sch_id NUMBER,
365 --MCA Sakthi for MultiAgreementCurreny Project
366 -- FP.K Setup changes by msundare
367 X_labor_disc_reason_code VARCHAR2,
368 X_non_labor_disc_reason_code VARCHAR2,
369 --PA L Changes 2872708
370 x_retirement_cost_flag VARCHAR2,
371 x_cint_eligible_flag VARCHAR2,
372 x_cint_stop_date DATE
373 ) IS
374 CURSOR C IS
375 SELECT *
376 FROM PA_TASKS
377 WHERE rowid = X_Rowid
378 FOR UPDATE of Task_Id NOWAIT;
379 Recinfo C%ROWTYPE;
380
381 BEGIN
382 OPEN C;
383 FETCH C INTO Recinfo;
384 if (C%NOTFOUND) then
385 CLOSE C;
386 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
387 APP_EXCEPTION.Raise_Exception;
388 end if;
389 CLOSE C;
390 if (
391 (Recinfo.task_id = X_Task_Id)
392 AND (Recinfo.project_id = X_Project_Id)
393 AND (ltrim(rtrim(Recinfo.task_number)) = ltrim(rtrim(X_Task_Number)))
394 AND (rtrim(Recinfo.task_name) = rtrim(X_Task_Name))
395 AND (Recinfo.top_task_id = X_Top_Task_Id)
396 AND (Recinfo.wbs_level = X_Wbs_Level)
397 AND (Recinfo.ready_to_bill_flag = X_Ready_To_Bill_Flag)
398 AND (Recinfo.ready_to_distribute_flag = X_Ready_To_Distribute_Flag)
399 AND ( (Recinfo.parent_task_id = X_Parent_Task_Id)
400 OR ( (Recinfo.parent_task_id IS NULL)
401 AND (X_Parent_Task_Id IS NULL)))
402 AND ( (Recinfo.description = X_Description)
403 OR ( (Recinfo.description IS NULL)
404 AND (X_Description IS NULL)))
405 AND ( (Recinfo.carrying_out_organization_id =
406 X_Carrying_Out_Organization_Id)
407 OR ( (Recinfo.carrying_out_organization_id IS NULL)
408 AND (X_Carrying_Out_Organization_Id IS NULL)))
409 AND ( (Recinfo.service_type_code = X_Service_Type_Code)
410 OR ( (Recinfo.service_type_code IS NULL)
411 AND (X_Service_Type_Code IS NULL)))
412 AND ( (Recinfo.task_manager_person_id =
413 X_Task_Manager_Person_Id)
414 OR ( (Recinfo.task_manager_person_id IS NULL)
415 AND (X_Task_Manager_Person_Id IS NULL)))
416 AND ( (Recinfo.chargeable_flag = X_Chargeable_Flag)
417 OR ( (Recinfo.chargeable_flag IS NULL)
418 AND (X_Chargeable_Flag IS NULL)))
419 AND ( (Recinfo.billable_flag = X_Billable_Flag)
420 OR ( (Recinfo.billable_flag IS NULL)
421 AND (X_Billable_Flag IS NULL)))
422 AND ( (Recinfo.limit_to_txn_controls_flag =
423 X_Limit_To_Txn_Controls_Flag)
424 OR ( (Recinfo.limit_to_txn_controls_flag IS NULL)
425 AND (X_Limit_To_Txn_Controls_Flag IS NULL)))
426 AND ( (Recinfo.start_date = X_Start_Date)
427 OR ( (Recinfo.start_date IS NULL)
428 AND (X_Start_Date IS NULL)))
429 AND ( (Recinfo.completion_date = X_Completion_Date)
430 OR ( (Recinfo.completion_date IS NULL)
431 AND (X_Completion_Date IS NULL)))
432 AND ( (Recinfo.address_id = X_Address_Id)
433 OR ( (Recinfo.address_id IS NULL)
434 AND (X_Address_Id IS NULL)))
435 AND ( (Recinfo.labor_bill_rate_org_id = X_Labor_Bill_Rate_Org_Id)
436 OR ( (Recinfo.labor_bill_rate_org_id IS NULL)
437 AND (X_Labor_Bill_Rate_Org_Id IS NULL)))
438 AND ( (Recinfo.labor_std_bill_rate_schdl =
439 X_Labor_Std_Bill_Rate_Schdl)
440 OR ( (Recinfo.labor_std_bill_rate_schdl IS NULL)
441 AND (X_Labor_Std_Bill_Rate_Schdl IS NULL)))
442 AND ( (Recinfo.labor_schedule_fixed_date =
443 X_Labor_Schedule_Fixed_Date)
444 OR ( (Recinfo.labor_schedule_fixed_date IS NULL)
445 AND (X_Labor_Schedule_Fixed_Date IS NULL)))
446 AND ( (Recinfo.labor_schedule_discount =
447 X_Labor_Schedule_Discount)
448 OR ( (Recinfo.labor_schedule_discount IS NULL)
449 AND (X_Labor_Schedule_Discount IS NULL)))
450 AND ( (Recinfo.non_labor_bill_rate_org_id =
451 X_Non_Labor_Bill_Rate_Org_Id)
452 OR ( (Recinfo.non_labor_bill_rate_org_id IS NULL)
456 OR ( (Recinfo.non_labor_std_bill_rate_schdl IS NULL)
453 AND (X_Non_Labor_Bill_Rate_Org_Id IS NULL)))
454 AND ( (Recinfo.non_labor_std_bill_rate_schdl =
455 X_NL_Std_Bill_Rate_Schdl)
457 AND (X_NL_Std_Bill_Rate_Schdl IS NULL)))
458 AND ( (Recinfo.non_labor_schedule_fixed_date =
459 X_NL_Schedule_Fixed_Date)
460 OR ( (Recinfo.non_labor_schedule_fixed_date IS NULL)
461 AND (X_NL_Schedule_Fixed_Date IS NULL)))
462 AND ( (Recinfo.non_labor_schedule_discount =
463 X_Non_Labor_Schedule_Discount)
464 OR ( (Recinfo.non_labor_schedule_discount IS NULL)
465 AND (X_Non_Labor_Schedule_Discount IS NULL)))
466 AND ( (Recinfo.labor_cost_multiplier_name =
467 X_Labor_Cost_Multiplier_Name)
468 OR ( (Recinfo.labor_cost_multiplier_name IS NULL)
469 AND (X_Labor_Cost_Multiplier_Name IS NULL)))
470 AND ( (Recinfo.attribute_category = X_Attribute_Category)
471 OR ( (Recinfo.attribute_category IS NULL)
472 AND (X_Attribute_Category IS NULL)))
473 AND ( (Recinfo.attribute1 = X_Attribute1)
474 OR ( (Recinfo.attribute1 IS NULL)
475 AND (X_Attribute1 IS NULL)))
476 AND ( (Recinfo.attribute2 = X_Attribute2)
477 OR ( (Recinfo.attribute2 IS NULL)
478 AND (X_Attribute2 IS NULL)))
479 AND ( (Recinfo.attribute3 = X_Attribute3)
480 OR ( (Recinfo.attribute3 IS NULL)
481 AND (X_Attribute3 IS NULL)))
482 AND ( (Recinfo.attribute4 = X_Attribute4)
483 OR ( (Recinfo.attribute4 IS NULL)
484 AND (X_Attribute4 IS NULL)))
485 AND ( (Recinfo.attribute5 = X_Attribute5)
486 OR ( (Recinfo.attribute5 IS NULL)
487 AND (X_Attribute5 IS NULL)))
488 AND ( (Recinfo.attribute6 = X_Attribute6)
489 OR ( (Recinfo.attribute6 IS NULL)
490 AND (X_Attribute6 IS NULL)))
491 AND ( (Recinfo.attribute7 = X_Attribute7)
492 OR ( (Recinfo.attribute7 IS NULL)
493 AND (X_Attribute7 IS NULL)))
494 AND ( (Recinfo.attribute8 = X_Attribute8)
495 OR ( (Recinfo.attribute8 IS NULL)
496 AND (X_Attribute8 IS NULL)))
497 AND ( (Recinfo.attribute9 = X_Attribute9)
498 OR ( (Recinfo.attribute9 IS NULL)
499 AND (X_Attribute9 IS NULL)))
500 AND ( (Recinfo.attribute10 = X_Attribute10)
501 OR ( (Recinfo.attribute10 IS NULL)
502 AND (X_Attribute10 IS NULL)))
503 AND ( (Recinfo.cost_ind_rate_sch_id =
504 X_Cost_Ind_Rate_Sch_Id)
505 OR ( (Recinfo.cost_ind_rate_sch_id IS NULL)
506 AND (X_Cost_Ind_Rate_Sch_Id IS NULL)))
507 AND ( (Recinfo.rev_ind_rate_sch_id = X_Rev_Ind_Rate_Sch_Id)
508 OR ( (Recinfo.rev_ind_rate_sch_id IS NULL)
509 AND (X_Rev_Ind_Rate_Sch_Id IS NULL)))
510 AND ( (Recinfo.inv_ind_rate_sch_id = X_Inv_Ind_Rate_Sch_Id)
511 OR ( (Recinfo.inv_ind_rate_sch_id IS NULL)
512 AND (X_Inv_Ind_Rate_Sch_Id IS NULL)))
513 AND ( (Recinfo.cost_ind_sch_fixed_date =
514 X_Cost_Ind_Sch_Fixed_Date)
515 OR ( (Recinfo.cost_ind_sch_fixed_date IS NULL)
516 AND (X_Cost_Ind_Sch_Fixed_Date IS NULL)))
517 AND ( (Recinfo.rev_ind_sch_fixed_date =
518 X_Rev_Ind_Sch_Fixed_Date)
519 OR ( (Recinfo.rev_ind_sch_fixed_date IS NULL)
520 AND (X_Rev_Ind_Sch_Fixed_Date IS NULL)))
521 AND ( (Recinfo.inv_ind_sch_fixed_date =
522 X_Inv_Ind_Sch_Fixed_Date)
523 OR ( (Recinfo.inv_ind_sch_fixed_date IS NULL)
524 AND (X_Inv_Ind_Sch_Fixed_Date IS NULL)))
525 AND ( (Recinfo.labor_sch_type = X_Labor_Sch_Type)
526 OR ( (Recinfo.labor_sch_type IS NULL)
527 AND (X_Labor_Sch_Type IS NULL)))
528 AND ( (Recinfo.non_labor_sch_type = X_Non_Labor_Sch_Type)
529 OR ( (Recinfo.non_labor_sch_type IS NULL)
530 AND (X_Non_Labor_Sch_Type IS NULL)))
531 AND ( (Recinfo.Allow_Cross_Charge_Flag =
532 X_Allow_Cross_Charge_Flag)
533 OR ( (Recinfo.Allow_Cross_Charge_Flag IS NULL)
534 AND (X_Allow_Cross_Charge_Flag IS NULL)))
535 AND ( (Recinfo.Project_Rate_Date =
536 X_Project_Rate_Date)
537 OR ( (Recinfo.Project_Rate_Date IS NULL)
538 AND (X_Project_Rate_Date IS NULL)))
539 AND ( (Recinfo.Project_Rate_Type =
540 X_Project_Rate_Type)
541 OR ( (Recinfo.Project_Rate_Type IS NULL)
542 AND (X_Project_Rate_Type IS NULL)))
543 AND ( (Recinfo.CC_Process_Labor_Flag =
544 X_CC_Process_Labor_Flag)
545 OR ( (Recinfo.CC_Process_Labor_Flag IS NULL)
546 AND (X_CC_Process_Labor_Flag IS NULL)))
547 AND ( (Recinfo.Labor_Tp_Schedule_Id =
548 X_Labor_Tp_Schedule_Id)
549 OR ( (Recinfo.Labor_Tp_Schedule_Id IS NULL)
550 AND (X_Labor_Tp_Schedule_Id IS NULL)))
554 AND (X_Labor_Tp_Fixed_Date IS NULL)))
551 AND ( (Recinfo.Labor_Tp_Fixed_Date =
552 X_Labor_Tp_Fixed_Date)
553 OR ( (Recinfo.Labor_Tp_Fixed_Date IS NULL)
555 AND ( (Recinfo.CC_Process_NL_Flag =
556 X_CC_Process_NL_Flag)
557 OR ( (Recinfo.CC_Process_NL_Flag IS NULL)
558 AND (X_CC_Process_NL_Flag IS NULL)))
559 AND ( (Recinfo.Nl_Tp_Schedule_Id =
560 X_Nl_Tp_Schedule_Id)
561 OR ( (Recinfo.Nl_Tp_Schedule_Id IS NULL)
562 AND (X_Nl_Tp_Schedule_Id IS NULL)))
563 AND ( (Recinfo.Nl_Tp_Fixed_Date =
564 X_Nl_Tp_Fixed_Date)
565 OR ( (Recinfo.Nl_Tp_Fixed_Date IS NULL)
566 AND (X_Nl_Tp_Fixed_Date IS NULL)))
567 AND ( (Recinfo.Receive_Project_Invoice_Flag =
568 X_Receive_Project_Invoice_Flag)
569 OR ( (Recinfo.Receive_Project_Invoice_Flag IS NULL)
570 AND (X_Receive_Project_Invoice_Flag IS NULL)))
571 AND ( (Recinfo.work_type_id =
572 X_work_type_id)
573 OR ( (Recinfo.work_type_id IS NULL)
574 AND (X_work_type_id IS NULL)))
575 AND ( (Recinfo.job_bill_rate_schedule_id =
576 X_job_bill_rate_schedule_id)
577 OR ( (Recinfo.job_bill_rate_schedule_id IS NULL)
578 AND (X_job_bill_rate_schedule_id IS NULL)))
579 AND ( (Recinfo.emp_bill_rate_schedule_id =
580 X_emp_bill_rate_schedule_id)
581 OR ( (Recinfo.emp_bill_rate_schedule_id IS NULL)
582 AND (X_emp_bill_rate_schedule_id IS NULL)))
583 --MCA Sakthi for MultiAgreementCurreny Project
584 AND ( (Recinfo.taskfunc_cost_rate_type =
585 X_taskfunc_cost_rate_type)
586 OR ( (Recinfo.taskfunc_cost_rate_type IS NULL)
587 AND (X_taskfunc_cost_rate_type IS NULL)))
588 AND ( (Recinfo.taskfunc_cost_rate_date =
589 X_taskfunc_cost_rate_date)
590 OR ( (Recinfo.taskfunc_cost_rate_date IS NULL)
591 AND (X_taskfunc_cost_rate_date IS NULL)))
592 AND ( (Recinfo.non_lab_std_bill_rt_sch_id =
593 X_non_lab_std_bill_rt_sch_id)
594 OR ( (Recinfo.non_lab_std_bill_rt_sch_id IS NULL)
595 AND (X_non_lab_std_bill_rt_sch_id IS NULL)))
596 --MCA Sakthi for MultiAgreementCurreny Project
597 -- Modified for added columns in FP.K msundare
598 AND ( (Recinfo.labor_disc_reason_code =
599 X_labor_disc_reason_code)
600 OR ( (Recinfo.labor_disc_reason_code IS NULL)
601 AND (X_labor_disc_reason_code IS NULL)))
602 AND ( (Recinfo.non_labor_disc_reason_code =
603 X_non_labor_disc_reason_code)
604 OR ( (Recinfo.non_labor_disc_reason_code IS NULL)
605 AND (X_non_labor_disc_reason_code IS NULL)))
606 AND ( (Recinfo.retirement_cost_flag =
607 X_retirement_cost_flag)
608 OR ( (Recinfo.retirement_cost_flag IS NULL)
609 AND (X_retirement_cost_flag IS NULL)))
610 AND ( (Recinfo.cint_eligible_flag =
611 X_cint_eligible_flag)
612 OR ( (Recinfo.cint_eligible_flag IS NULL)
613 AND (X_cint_eligible_flag IS NULL)))
614 AND ( (Recinfo.cint_stop_date =
615 X_cint_stop_date)
616 OR ( (Recinfo.cint_stop_date IS NULL)
617 AND (X_cint_stop_date IS NULL)))
618 ) then
619 return;
620 else
621 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
622 APP_EXCEPTION.Raise_Exception;
623 end if;
624 END Lock_Row;
625
626
627 PROCEDURE Update_Row(X_Rowid VARCHAR2,
628 X_Task_Id NUMBER,
629 X_Project_Id NUMBER,
630 X_Task_Number VARCHAR2,
631 X_Last_Update_Date DATE,
632 X_Last_Updated_By NUMBER,
633 X_Last_Update_Login NUMBER,
634 X_Task_Name VARCHAR2,
635 -- Long Task Name change by xxlu
636 X_Long_Task_Name VARCHAR2,
637 X_Top_Task_Id NUMBER,
638 X_Wbs_Level NUMBER,
639 X_Ready_To_Bill_Flag VARCHAR2,
640 X_Ready_To_Distribute_Flag VARCHAR2,
641 X_Parent_Task_Id NUMBER,
642 X_Description VARCHAR2,
643 X_Carrying_Out_Organization_Id NUMBER,
644 X_Service_Type_Code VARCHAR2,
645 X_Task_Manager_Person_Id NUMBER,
646 X_Chargeable_Flag VARCHAR2,
647 X_Billable_Flag VARCHAR2,
648 X_Limit_To_Txn_Controls_Flag VARCHAR2,
649 X_Start_Date DATE,
650 X_Completion_Date DATE,
654 X_Labor_Schedule_Fixed_Date DATE,
651 X_Address_Id NUMBER,
652 X_Labor_Bill_Rate_Org_Id NUMBER,
653 X_Labor_Std_Bill_Rate_Schdl VARCHAR2,
655 X_Labor_Schedule_Discount NUMBER,
656 X_Non_Labor_Bill_Rate_Org_Id NUMBER,
657 X_NL_Std_Bill_Rate_Schdl VARCHAR2,
658 X_NL_Schedule_Fixed_Date DATE,
659 X_Non_Labor_Schedule_Discount NUMBER,
660 X_Labor_Cost_Multiplier_Name VARCHAR2,
661 X_Attribute_Category VARCHAR2,
662 X_Attribute1 VARCHAR2,
663 X_Attribute2 VARCHAR2,
664 X_Attribute3 VARCHAR2,
665 X_Attribute4 VARCHAR2,
666 X_Attribute5 VARCHAR2,
667 X_Attribute6 VARCHAR2,
668 X_Attribute7 VARCHAR2,
669 X_Attribute8 VARCHAR2,
670 X_Attribute9 VARCHAR2,
671 X_Attribute10 VARCHAR2,
672 X_Cost_Ind_Rate_Sch_Id NUMBER,
673 X_Rev_Ind_Rate_Sch_Id NUMBER,
674 X_Inv_Ind_Rate_Sch_Id NUMBER,
675 X_Cost_Ind_Sch_Fixed_Date DATE,
676 X_Rev_Ind_Sch_Fixed_Date DATE,
677 X_Inv_Ind_Sch_Fixed_Date DATE,
678 X_Labor_Sch_Type VARCHAR2,
679 X_Non_Labor_Sch_Type VARCHAR2,
680 X_Allow_Cross_Charge_Flag VARCHAR2,
681 X_Project_Rate_Date DATE,
682 X_Project_Rate_Type VARCHAR2,
683 X_CC_Process_Labor_Flag VARCHAR2,
684 X_Labor_Tp_Schedule_Id NUMBER,
685 X_Labor_Tp_Fixed_Date DATE,
686 X_CC_Process_NL_Flag VARCHAR2,
687 X_Nl_Tp_Schedule_Id NUMBER,
688 X_Nl_Tp_Fixed_Date DATE,
689 X_receive_project_invoice_flag VARCHAR2,
690 X_work_type_id NUMBER,
691 -- 21-MAR-2001 anlee
692 -- added job_bill_rate_schedule_id,
693 -- emp_bill_rate_schedule_id for
694 -- PRM forecasting changes
695 X_job_bill_rate_schedule_id NUMBER,
696 X_emp_bill_rate_schedule_id NUMBER,
697 --MCA Sakthi for MultiAgreementCurreny Project
698 X_taskfunc_cost_rate_type VARCHAR2,
699 X_taskfunc_cost_rate_date DATE,
700 X_non_lab_std_bill_rt_sch_id NUMBER,
701 --MCA Sakthi for MultiAgreementCurreny Project
702 -- FP.K Setup changes by msundare
703 X_labor_disc_reason_code VARCHAR2,
704 X_non_labor_disc_reason_code VARCHAR2,
705 --PA L Dev
706 x_retirement_cost_flag VARCHAR2,
707 x_cint_eligible_flag VARCHAR2,
708 x_cint_stop_date DATE,
709 x_gen_etc_src_code VARCHAR2
710 ) IS
711 BEGIN
712 UPDATE PA_TASKS
713 SET
714 task_id = X_Task_Id,
715 project_id = X_Project_Id,
716 task_number = SUBSTRB( X_Task_Number, 1, 25 ), -- 4537865 : Replaced SUBSTR with SUBSTRB
717 last_update_date = X_Last_Update_Date,
718 last_updated_by = X_Last_Updated_By,
719 last_update_login = X_Last_Update_Login,
720 task_name = SUBSTRB( X_Task_Name, 1, 20 ),-- 4537865 : Replaced SUBSTR with SUBSTRB
721 long_task_name = X_Long_Task_Name,
722 top_task_id = X_Top_Task_Id,
723 wbs_level = X_Wbs_Level,
724 ready_to_bill_flag = X_Ready_To_Bill_Flag,
725 ready_to_distribute_flag = X_Ready_To_Distribute_Flag,
726 parent_task_id = X_Parent_Task_Id,
727 description = X_Description,
728 carrying_out_organization_id = X_Carrying_Out_Organization_Id,
729 service_type_code = X_Service_Type_Code,
730 task_manager_person_id = X_Task_Manager_Person_Id,
731 chargeable_flag = X_Chargeable_Flag,
732 billable_flag = X_Billable_Flag,
733 limit_to_txn_controls_flag = X_Limit_To_Txn_Controls_Flag,
734 start_date = X_Start_Date,
735 completion_date = X_Completion_Date,
736 address_id = X_Address_Id,
737 labor_bill_rate_org_id = X_Labor_Bill_Rate_Org_Id,
738 labor_std_bill_rate_schdl = X_Labor_Std_Bill_Rate_Schdl,
739 labor_schedule_fixed_date = X_Labor_Schedule_Fixed_Date,
743 non_labor_schedule_fixed_date = X_NL_Schedule_Fixed_Date,
740 labor_schedule_discount = X_Labor_Schedule_Discount,
741 non_labor_bill_rate_org_id = X_Non_Labor_Bill_Rate_Org_Id,
742 non_labor_std_bill_rate_schdl = X_NL_Std_Bill_Rate_Schdl,
744 non_labor_schedule_discount = X_Non_Labor_Schedule_Discount,
745 labor_cost_multiplier_name = X_Labor_Cost_Multiplier_Name,
746 attribute_category = X_Attribute_Category,
747 attribute1 = X_Attribute1,
748 attribute2 = X_Attribute2,
749 attribute3 = X_Attribute3,
750 attribute4 = X_Attribute4,
751 attribute5 = X_Attribute5,
752 attribute6 = X_Attribute6,
753 attribute7 = X_Attribute7,
754 attribute8 = X_Attribute8,
755 attribute9 = X_Attribute9,
756 attribute10 = X_Attribute10,
757 cost_ind_rate_sch_id = X_Cost_Ind_Rate_Sch_Id,
758 rev_ind_rate_sch_id = X_Rev_Ind_Rate_Sch_Id,
759 inv_ind_rate_sch_id = X_Inv_Ind_Rate_Sch_Id,
760 cost_ind_sch_fixed_date = X_Cost_Ind_Sch_Fixed_Date,
761 rev_ind_sch_fixed_date = X_Rev_Ind_Sch_Fixed_Date,
762 inv_ind_sch_fixed_date = X_Inv_Ind_Sch_Fixed_Date,
763 labor_sch_type = X_Labor_Sch_Type,
764 non_labor_sch_type = X_Non_Labor_Sch_Type,
765 Allow_Cross_Charge_Flag = X_Allow_Cross_Charge_Flag,
766 Project_Rate_Date = X_Project_Rate_Date,
767 Project_Rate_Type = X_Project_Rate_Type,
768 CC_Process_Labor_Flag = X_CC_Process_Labor_Flag,
769 Labor_Tp_Schedule_Id = X_Labor_Tp_Schedule_Id,
770 Labor_Tp_Fixed_Date = X_Labor_Tp_Fixed_Date,
771 CC_Process_NL_Flag = X_CC_Process_NL_Flag,
772 Nl_Tp_Schedule_Id = X_Nl_Tp_Schedule_Id,
773 Nl_Tp_Fixed_Date = X_Nl_Tp_Fixed_Date,
774 Receive_Project_Invoice_Flag = X_Receive_Project_Invoice_Flag,
775 Work_Type_ID = X_Work_Type_ID,
776 job_bill_rate_schedule_id = X_job_bill_rate_schedule_id,
777 emp_bill_rate_schedule_id = X_emp_bill_rate_schedule_id,
778 --MCA Sakthi for MultiAgreementCurreny Project
779 taskfunc_cost_rate_type = X_taskfunc_cost_rate_type,
780 taskfunc_cost_rate_date = X_taskfunc_cost_rate_date,
781 non_lab_std_bill_rt_sch_id = X_non_lab_std_bill_rt_sch_id,
782 --msundare
783 labor_disc_reason_code = X_labor_disc_reason_code,
784 non_labor_disc_reason_code = X_non_labor_disc_reason_code,
785 --PA_L
786 retirement_cost_flag = x_retirement_cost_flag,
787 cint_eligible_flag = x_cint_eligible_flag,
788 cint_stop_date = x_cint_stop_date,
789 GEN_ETC_SOURCE_CODE = x_gen_etc_src_code,
790 record_version_number = nvl( record_version_number, 1 ) + 1
791 --MCA Sakthi for MultiAgreementCurreny Project
792 WHERE rowid = X_Rowid;
793
794 if (SQL%NOTFOUND) then
795 Raise NO_DATA_FOUND;
796 end if;
797 END Update_Row;
798
799 PROCEDURE Delete_Row(X_Rowid VARCHAR2) IS
800 BEGIN
801 DELETE FROM PA_TASKS
802 WHERE rowid = X_Rowid;
803
804 if (SQL%NOTFOUND) then
805 Raise NO_DATA_FOUND;
806 end if;
807 END Delete_Row;
808
809 --
810 -- Name
811 -- verify_lowest_level_task
812 --
813 -- Purpose
814 -- This procedure is used to verify if a task is a lowest level task.
815 --
816 -- History
817 -- XX-MAY-94 R. Wadera Created
818 --
819 procedure verify_lowest_level_task (x_return_status IN OUT NOCOPY number, --File.Sql.39 bug 4440895
820 x_task_id IN number)
821 is
822 x_dummy number;
823
824 begin
825
826 x_return_status := 0;
827 begin
828 select task_id
829 into x_dummy
830 from pa_tasks t1
831 where not exists
832 (select *
833 from pa_tasks t2
834 where t1.task_id = t2.parent_task_id)
835 and t1.task_id = x_task_id;
836
837 x_return_status := 0;
838 EXCEPTION
839 WHEN NO_DATA_FOUND then
840 x_return_status := 1;
841
842 WHEN OTHERS then
843 x_return_status := SQLCODE;
844 end;
845
846 end verify_lowest_level_task;
847
848 END PA_TASKS_PKG;