DBA Data[Home] [Help]

PACKAGE BODY: APPS.PA_PROJECTS_PKG

Source


1 PACKAGE BODY PA_PROJECTS_PKG as
2 /* $Header: PAXPROJB.pls 120.7 2011/03/18 12:14:56 pcheruvu ship $ */
3 
4   PROCEDURE Insert_Row(X_Rowid                   IN OUT NOCOPY VARCHAR2, -- 4537865
5                        X_Project_Id                     IN OUT NOCOPY NUMBER, -- 4537865
6                        x_org_id                         NUMBER, --R12: Bug 4363092
7                        X_Name                           VARCHAR2,
8                        X_Long_Name                      VARCHAR2,
9                        X_Segment1                       VARCHAR2,
10                        X_Last_Update_Date               DATE,
11                        X_Last_Updated_By                NUMBER,
12                        X_Creation_Date                  DATE,
13                        X_Created_By                     NUMBER,
14                        X_Last_Update_Login              NUMBER,
15                        X_Project_Type                   VARCHAR2,
16                        X_Carrying_Out_Organization_Id   NUMBER,
17                        X_Public_Sector_Flag             VARCHAR2,
18                        X_Project_Status_Code            VARCHAR2,
19                        X_Description                    VARCHAR2,
20                        X_Start_Date                     DATE,
21                        X_Completion_Date                DATE,
22                        X_Closed_Date                    DATE,
23                        X_Distribution_Rule              VARCHAR2,
24                        X_Labor_Invoice_Format_Id        NUMBER,
25                        X_NL_Invoice_Format_Id	        NUMBER,
26                        X_Retention_Invoice_Format_Id    NUMBER,
27                        X_Retention_Percentage           NUMBER,
28                        X_Billing_Offset                 NUMBER,
29                        X_Billing_Cycle_Id               NUMBER,
30                        X_Labor_Std_Bill_Rate_Schdl      VARCHAR2,
31                        X_Labor_Bill_Rate_Org_Id         NUMBER,
32                        X_Labor_Schedule_Fixed_Date      DATE,
33                        X_Labor_Schedule_Discount        NUMBER,
34                        X_NL_Std_Bill_Rate_Schdl   	VARCHAR2,
35                        X_NL_Bill_Rate_Org_Id     	NUMBER,
36                        X_NL_Schedule_Fixed_Date  	DATE,
37                        X_NL_Schedule_Discount    	NUMBER,
38                        X_Limit_To_Txn_Controls_Flag     VARCHAR2,
39                        X_Project_Level_Funding_Flag     VARCHAR2,
40                        X_Invoice_Comment                VARCHAR2,
41                        X_Unbilled_Receivable_Dr         NUMBER,
42                        X_Unearned_Revenue_Cr            NUMBER,
43                        X_Summary_Flag                   VARCHAR2,
44                        X_Enabled_Flag                   VARCHAR2,
45                        X_Segment2                       VARCHAR2,
46                        X_Segment3                       VARCHAR2,
47                        X_Segment4                       VARCHAR2,
48                        X_Segment5                       VARCHAR2,
49                        X_Segment6                       VARCHAR2,
50                        X_Segment7                       VARCHAR2,
51                        X_Segment8                       VARCHAR2,
52                        X_Segment9                       VARCHAR2,
53                        X_Segment10                      VARCHAR2,
54                        X_Attribute_Category             VARCHAR2,
55                        X_Attribute1                     VARCHAR2,
56                        X_Attribute2                     VARCHAR2,
57                        X_Attribute3                     VARCHAR2,
58                        X_Attribute4                     VARCHAR2,
59                        X_Attribute5                     VARCHAR2,
60                        X_Attribute6                     VARCHAR2,
61                        X_Attribute7                     VARCHAR2,
62                        X_Attribute8                     VARCHAR2,
63                        X_Attribute9                     VARCHAR2,
64                        X_Attribute10                    VARCHAR2,
65                        X_Cost_Ind_Rate_Sch_Id           NUMBER,
66                        X_Rev_Ind_Rate_Sch_Id            NUMBER,
67                        X_Inv_Ind_Rate_Sch_Id            NUMBER,
68                        X_Cost_Ind_Sch_Fixed_Date        DATE,
69                        X_Rev_Ind_Sch_Fixed_Date         DATE,
70                        X_Inv_Ind_Sch_Fixed_Date         DATE,
71                        X_Labor_Sch_Type                 VARCHAR2,
72                        X_Non_Labor_Sch_Type             VARCHAR2,
73                        X_Template_Flag                  VARCHAR2,
77                        X_Template_End_Date    		DATE,
74                        X_Verification_Date              DATE,
75                        X_Created_From_Project_Id        NUMBER,
76                        X_Template_Start_Date		DATE,
78                        X_Project_Currency_Code          VARCHAR2,
79                        X_Allow_Cross_Charge_Flag        VARCHAR2,
80                        X_Project_Rate_Date              DATE,
81                        X_Project_Rate_Type              VARCHAR2,
82                        X_Output_Tax_Code                VARCHAR2,
83                        X_Retention_Tax_Code             VARCHAR2,
84                        X_CC_Process_Labor_Flag          VARCHAR2,
85                        X_Labor_Tp_Schedule_Id           NUMBER,
86                        X_Labor_Tp_Fixed_Date            DATE,
87                        X_CC_Process_NL_Flag             VARCHAR2,
88                        X_Nl_Tp_Schedule_Id              NUMBER,
89                        X_Nl_Tp_Fixed_Date               DATE,
90                        X_CC_Tax_Task_Id                 NUMBER,
91 --   17-MAY-00  kkekkar     Added the following columns for CBGA project
92 --                          bill_job_group_id, cost_job_group_id
93                        x_bill_job_group_id              NUMBER,
94                        x_cost_job_group_id              NUMBER,
95                        x_role_list_id                   NUMBER,
96                        x_work_type_id                   NUMBER,
97                        x_calendar_id                    NUMBER,
98                        x_location_id                    NUMBER,
99                        x_probability_member_id          NUMBER,
100                        x_project_value                  NUMBER,
101                        x_expected_approval_date         DATE,
102                        x_team_template_id               NUMBER,
103 -- 21-MAR-2001 anlee
104 -- added job_bill_rate_schedule_id,
105 -- emp_bill_rate_schedule_id for
106 -- PRM forecasting changes
107                        x_job_bill_rate_schedule_id      NUMBER,
108                        x_emp_bill_rate_schedule_id      NUMBER,
109 --MCA Sakthi for MultiAgreementCurreny Project
110                        x_competence_match_wt            NUMBER,
111                        x_availability_match_wt          NUMBER,
112                        x_job_level_match_wt             NUMBER,
113                        x_enable_automated_search        VARCHAR2,
114                        x_search_min_availability        NUMBER,
115                        x_search_org_hier_id             NUMBER,
116                        x_search_starting_org_id         NUMBER,
117                        x_search_country_code            VARCHAR2,
118                        x_min_cand_score_reqd_for_nom    NUMBER,
119                        x_non_lab_std_bill_rt_sch_id     NUMBER,
120                        x_invproc_currency_type          VARCHAR2,
121                        x_revproc_currency_code          VARCHAR2,
122                        x_project_bil_rate_date_code     VARCHAR2,
123                        x_project_bil_rate_type          VARCHAR2,
124                        x_project_bil_rate_date          DATE,
125                        x_project_bil_exchange_rate      NUMBER,
126                        x_projfunc_currency_code         VARCHAR2,
127                        x_projfunc_bil_rate_date_code    VARCHAR2,
128                        x_projfunc_bil_rate_type         VARCHAR2,
129                        x_projfunc_bil_rate_date         DATE,
130                        x_projfunc_bil_exchange_rate     NUMBER,
131                        x_funding_rate_date_code         VARCHAR2,
132                        x_funding_rate_type              VARCHAR2,
133                        x_funding_rate_date              DATE,
134                        x_funding_exchange_rate          NUMBER,
135                        x_baseline_funding_flag          VARCHAR2,
136                        x_projfunc_cost_rate_type         VARCHAR2,
137                        x_projfunc_cost_rate_date         DATE,
138                        x_multi_currency_billing_flag    VARCHAR2,
139                        x_inv_by_bill_trans_curr_flag    VARCHAR2,
140 --MCA Sakthi for MultiAgreementCurrency Project
141 --MCA
142                        x_assign_precedes_task       VARCHAR2,
143 --Structure
144                        x_split_cost_from_wokplan_flag   VARCHAR2,
145                        x_split_cost_from_bill_flag       VARCHAR2,
146 --Structure
147 --Advertisement
148                        x_adv_action_set_id              NUMBER,
149                        x_start_adv_action_set_flag      VARCHAR2,
150 --Advertisement
151 --Project Setup
152                        x_priority_code                  VARCHAR2,
153 --Project Setup
154 --Retention
155                        x_retn_billing_inv_format_id     NUMBER,
156                        x_retn_accounting_flag           VARCHAR2,
157 --Retention
158 -- anlee
159 -- patchset K changes
160                        x_revaluate_funding_flag         VARCHAR2,
161                        x_include_gains_losses_flag    VARCHAR2,
162 -- msundare
163                        x_security_level                 NUMBER,
164                        x_labor_disc_reason_code         VARCHAR2,
165                        x_non_labor_disc_reason_code     VARCHAR2,
166 -- End of changes
167                        x_record_version_number          NUMBER,
168                        x_btc_cost_base_rev_code         VARCHAR2,  /* Bug#2638968 */
169                        x_revtrans_currency_type         VARCHAR2,  /* R12 - Bug 4363092 */
170 --PA L
171                        x_asset_allocation_method        VARCHAR2,
172                        x_capital_event_processing       VARCHAR2,
173                        x_cint_rate_sch_id               NUMBER,
174                        x_cint_eligible_flag             VARCHAR2,
178                        x_en_top_task_inv_mth_flag   VARCHAR2,
175                        x_cint_stop_date                 DATE,
176 --FP_M Changes. Tracking Bug 3279981
177                        x_en_top_task_customer_flag  VARCHAR2,
179                        x_revenue_accrual_method         VARCHAR2,
180                        x_invoice_method                 VARCHAR2,
181                        x_projfunc_attr_for_ar_flag      VARCHAR2,
182                        x_sys_program_flag               VARCHAR2,
183                        x_allow_multi_program_rollup     VARCHAR2,
184                        x_proj_req_res_format_id         NUMBER,
185                        x_proj_asgmt_res_format_id       NUMBER,
186 		       --sunkalya:federal Bug#5511353
187 		       x_date_eff_funds_flag        VARCHAR2
188 		       --sunkalya:federal Bug#5511353
189                       ,x_ar_rec_notify_flag             VARCHAR2  -- 7508661 : EnC
190                       ,x_auto_release_pwp_inv           VARCHAR2  -- 7508661 : EnC
191                         /* Added for 12.2 Payroll billing ER  11847616 */
192                          ,x_bill_labor_accrual            VARCHAR2  default 'N',
193                         x_adj_on_std_inv           VARCHAR2   default 'N'
194                           /* Added for 12.2 Payroll billing ER  11847616 */
195   ) IS
196 
197     CURSOR C IS SELECT rowid FROM pa_projects
198                  WHERE project_id = X_Project_Id;
199       CURSOR C2 IS SELECT pa_projects_s.nextval FROM sys.dual;
200 
201     l_return_status VARCHAR2(1);
202    BEGIN
203       if (X_Project_Id is NULL) then
204         OPEN C2;
205         FETCH C2 INTO X_Project_Id;
206         CLOSE C2;
207       end if;
208 
209        INSERT INTO pa_projects(
210               project_id,
211               org_id, --R12: Bug 4363092
212               name,
213               long_name,
214               segment1,
215               last_update_date,
216               last_updated_by,
217               creation_date,
218               created_by,
219               last_update_login,
220               project_type,
221               carrying_out_organization_id,
222               public_sector_flag,
223               project_status_code,
224               description,
225               start_date,
226               completion_date,
227               closed_date,
228               distribution_rule,
229               labor_invoice_format_id,
230               non_labor_invoice_format_id,
231               retention_invoice_format_id,
232               retention_percentage,
233               billing_offset,
234               billing_cycle_id,
235               labor_std_bill_rate_schdl,
236               labor_bill_rate_org_id,
237               labor_schedule_fixed_date,
238               labor_schedule_discount,
239               non_labor_std_bill_rate_schdl,
240               non_labor_bill_rate_org_id,
241               non_labor_schedule_fixed_date,
242               non_labor_schedule_discount,
243               limit_to_txn_controls_flag,
244               project_level_funding_flag,
245               invoice_comment,
246               unbilled_receivable_dr,
247               unearned_revenue_cr,
248               summary_flag,
249               enabled_flag,
250               segment2,
251               segment3,
252               segment4,
253               segment5,
254               segment6,
255               segment7,
256               segment8,
257               segment9,
258               segment10,
259               attribute_category,
260               attribute1,
261               attribute2,
262               attribute3,
263               attribute4,
264               attribute5,
265               attribute6,
266               attribute7,
267               attribute8,
268               attribute9,
269               attribute10,
270               cost_ind_rate_sch_id,
271               rev_ind_rate_sch_id,
272               inv_ind_rate_sch_id,
273               cost_ind_sch_fixed_date,
274               rev_ind_sch_fixed_date,
275               inv_ind_sch_fixed_date,
276               labor_sch_type,
277               non_labor_sch_type,
278               template_flag,
279               verification_date,
280               created_from_project_id,
281               template_start_date_active,
282               template_end_date_active,
283               Project_Currency_Code,
284               Allow_Cross_Charge_Flag,
285               Project_Rate_Date,
286               Project_Rate_Type,
287               Output_Tax_Code,
288               Retention_Tax_Code,
289 				  CC_Process_Labor_Flag,
290 				  Labor_Tp_Schedule_Id,
291 				  Labor_Tp_Fixed_Date,
292 				  CC_Process_NL_Flag,
293 				  Nl_Tp_Schedule_Id,
294 				  Nl_Tp_Fixed_Date,
295 				  CC_Tax_Task_Id,
296               bill_job_group_id,
297               cost_job_group_id,
298               role_list_id,
299               work_type_id,
300               calendar_id,
301               location_id,
302               probability_member_id,
303               project_value,
304               expected_approval_date,
305               initial_team_template_id,
306               job_bill_rate_schedule_id,
307               emp_bill_rate_schedule_id,
308 --MCA Sakthi for MultiAgreementCurreny Project
309                  competence_match_wt,
310                  availability_match_wt,
311                  job_level_match_wt,
312                  enable_automated_search,
313                  search_min_availability,
317                  min_cand_score_reqd_for_nom,
314                  search_org_hier_id,
315                  search_starting_org_id,
316                  search_country_code,
318                  non_lab_std_bill_rt_sch_id,
319                  invproc_currency_type,
320                  revproc_currency_code,
321                  project_bil_rate_date_code,
322                  project_bil_rate_type,
323                  project_bil_rate_date,
324                  project_bil_exchange_rate,
325                  projfunc_currency_code,
326                  projfunc_bil_rate_date_code,
327                  projfunc_bil_rate_type,
328                  projfunc_bil_rate_date,
329                  projfunc_bil_exchange_rate,
330                  funding_rate_date_code,
331                  funding_rate_type,
332                  funding_rate_date,
333                  funding_exchange_rate,
334                  baseline_funding_flag,
335                  projfunc_cost_rate_type,
336                  projfunc_cost_rate_date,
337                  multi_currency_billing_flag,
338                  inv_by_bill_trans_curr_flag,
339 --MCA Sakthi for MultiAgreementCurreny Project
340                  assign_precedes_task,
341 --Structure
342                  split_cost_From_workplan_flag,
343                  split_cost_from_bill_flag,
344 --Structure
345 --Advertisement
346                  adv_action_set_id        ,
347                  start_adv_action_set_flag,
348 --Advertisement
349 --Project Setup
350                  priority_code,
351 --Project Setup
352 --Retention
353                  retn_billing_inv_format_id,
354                  retn_accounting_flag ,
355 --Retention
356 -- anlee
357 -- patchset K changes
358                  revaluate_funding_flag,
359                  include_gains_losses_flag,
360 -- msundare
361                  security_level                 ,
362                  labor_disc_reason_code         ,
363                  non_labor_disc_reason_code     ,
364 -- End of changes
365               record_version_number,
366 	      btc_cost_base_rev_code , /* Bug#2638968 */
367               revtrans_currency_type, /* R12 - Bug 4363092 */
368 --PA L
369               asset_allocation_method ,
370               capital_event_processing,
371               cint_rate_sch_id ,
372               cint_eligible_flag,
373               cint_stop_date,
374 --FP_M Changes. Tracking Bug 3279981
375               enable_top_task_customer_flag,
376               enable_top_task_inv_mth_flag,
377               revenue_accrual_method,
378               invoice_method,
379               projfunc_attr_for_ar_flag,
380               sys_program_flag,
381               allow_multi_program_rollup,
382               proj_req_res_format_id,
383               proj_asgmt_res_format_id,
384 	      --sunkalya:federal Bug#5511353
385 	      date_eff_funds_consumption
386 	      --sunkalya:federal Bug#5511353
387              ,ar_rec_notify_flag      -- 7508661 : EnC
388              ,auto_release_pwp_inv    -- 7508661 : EnC
389                /* Added for 12.2 Payroll billing ER  11847616 */
390               ,bill_labor_accrual
391              , adj_on_std_inv
392                /* Added for 12.2 Payroll billing ER  11847616 */
393              )
394 
395 	     VALUES (
396               X_Project_Id,
397               X_Org_id, --R12: Bug 4363092
398               X_Name,
399               X_Long_Name,
400               X_Segment1,
401               X_Last_Update_Date,
402               X_Last_Updated_By,
403               X_Creation_Date,
404               X_Created_By,
405               X_Last_Update_Login,
406               X_Project_Type,
407               X_Carrying_Out_Organization_Id,
408               X_Public_Sector_Flag,
409               X_Project_Status_Code,
410               X_Description,
411               X_Start_Date,
412               X_Completion_Date,
413               X_Closed_Date,
414               X_Distribution_Rule,
415               X_Labor_Invoice_Format_Id,
416               X_NL_Invoice_Format_Id,
417               X_Retention_Invoice_Format_Id,
418               X_Retention_Percentage,
419               X_Billing_Offset,
420               X_Billing_Cycle_Id,
421               X_Labor_Std_Bill_Rate_Schdl,
422               X_Labor_Bill_Rate_Org_Id,
423               X_Labor_Schedule_Fixed_Date,
424               X_Labor_Schedule_Discount,
425               X_NL_Std_Bill_Rate_Schdl,
426               X_NL_Bill_Rate_Org_Id,
427               X_NL_Schedule_Fixed_Date,
428               X_NL_Schedule_Discount,
429               X_Limit_To_Txn_Controls_Flag,
430               X_Project_Level_Funding_Flag,
431               X_Invoice_Comment,
432               X_Unbilled_Receivable_Dr,
433               X_Unearned_Revenue_Cr,
434               X_Summary_Flag,
435               X_Enabled_Flag,
436               X_Segment2,
437               X_Segment3,
438               X_Segment4,
439               X_Segment5,
440               X_Segment6,
441               X_Segment7,
442               X_Segment8,
443               X_Segment9,
444               X_Segment10,
445               X_Attribute_Category,
446               X_Attribute1,
447               X_Attribute2,
448               X_Attribute3,
449               X_Attribute4,
450               X_Attribute5,
451               X_Attribute6,
452               X_Attribute7,
453               X_Attribute8,
454               X_Attribute9,
455               X_Attribute10,
459               X_Cost_Ind_Sch_Fixed_Date,
456               X_Cost_Ind_Rate_Sch_Id,
457               X_Rev_Ind_Rate_Sch_Id,
458               X_Inv_Ind_Rate_Sch_Id,
460               X_Rev_Ind_Sch_Fixed_Date,
461               X_Inv_Ind_Sch_Fixed_Date,
462               X_Labor_Sch_Type,
463               X_Non_Labor_Sch_Type,
464               X_Template_Flag,
465               X_Verification_Date,
466               X_Created_From_Project_Id,
467               X_Template_Start_Date,
468               X_Template_End_Date,
469               X_Project_Currency_Code,
470               X_Allow_Cross_Charge_Flag,
471               X_Project_Rate_Date,
472               X_Project_Rate_Type,
473               X_Output_Tax_Code,
474               X_Retention_Tax_Code,
475 				  X_CC_Process_Labor_Flag,
476 				  X_Labor_Tp_Schedule_Id,
477 				  X_Labor_Tp_Fixed_Date,
478 				  X_CC_Process_NL_Flag,
479 				  X_Nl_Tp_Schedule_Id,
480 				  X_Nl_Tp_Fixed_Date,
481 				  X_CC_Tax_Task_Id,
482               x_bill_job_group_id,
483               x_cost_job_group_id,
484               x_role_list_id,
485               x_work_type_id,
486               x_calendar_id,
487               x_location_id,
488               x_probability_member_id,
489               x_project_value,
490               x_expected_approval_date,
491               x_team_template_id,
492               x_job_bill_rate_schedule_id,
493               x_emp_bill_rate_schedule_id,
494 --MCA Sakthi for MultiAgreementCurreny Project
495               x_competence_match_wt,
496               x_availability_match_wt,
497               x_job_level_match_wt,
498               x_enable_automated_search,
499               x_search_min_availability,
500               x_search_org_hier_id,
501               x_search_starting_org_id,
502               x_search_country_code,
503               x_min_cand_score_reqd_for_nom,
504               x_non_lab_std_bill_rt_sch_id,
505               x_invproc_currency_type,
506               x_revproc_currency_code,
507               x_project_bil_rate_date_code,
508               x_project_bil_rate_type,
509               x_project_bil_rate_date,
510               x_project_bil_exchange_rate,
511               x_projfunc_currency_code,
512               x_projfunc_bil_rate_date_code,
513               x_projfunc_bil_rate_type,
514               x_projfunc_bil_rate_date,
515               x_projfunc_bil_exchange_rate,
516               x_funding_rate_date_code,
517               x_funding_rate_type,
518               x_funding_rate_date,
519               x_funding_exchange_rate,
520               x_baseline_funding_flag,
521               x_projfunc_cost_rate_type,
522               x_projfunc_cost_rate_date,
523               x_multi_currency_billing_flag,
524               x_inv_by_bill_trans_curr_flag,
525 --MCA Sakthi for MultiAgreementCurreny Project
526               x_assign_precedes_task,
527 --Structure
528               x_split_cost_from_wokplan_flag,
529               x_split_cost_from_bill_flag,
530 --Structure
531 --Advertisement
532               x_adv_action_set_id        ,
533               x_start_adv_action_set_flag,
534 --Advertisement
535 --Project Setup
536               x_priority_code,
537 --Project Setup
538 --Retention
539               x_retn_billing_inv_format_id  ,
540               x_retn_accounting_flag        ,
541 --Retention
542 -- anlee
543 -- patchset K changes
544                  x_revaluate_funding_flag,
545                  x_include_gains_losses_flag,
546 -- msundare
547                  x_security_level                 ,
548                  x_labor_disc_reason_code         ,
549                  x_non_labor_disc_reason_code     ,
550 -- End of changes
551               x_record_version_number,
552 	      x_btc_cost_base_rev_code,   /* Bug#2638968 */
553               x_revtrans_currency_type, /* R12 - Bug 4363092 */
554 --PA L
555               x_asset_allocation_method ,
556               x_capital_event_processing,
557               x_cint_rate_sch_id ,
558               x_cint_eligible_flag,
559               x_cint_stop_date,
560 --FP_M Changes. Tracking Bug 3279981
561                        x_en_top_task_customer_flag,
562                        x_en_top_task_inv_mth_flag,
563                        x_revenue_accrual_method,
564                        x_invoice_method,
565                        x_projfunc_attr_for_ar_flag,
566                        x_sys_program_flag,
567                        x_allow_multi_program_rollup,
568                        x_proj_req_res_format_id,
569                        x_proj_asgmt_res_format_id,
570 		       --sunkalya:federal Bug#5511353
571 		       x_date_eff_funds_flag
572 		       --sunkalya:federal Bug#5511353
573                       ,x_ar_rec_notify_flag     -- 7508661 : EnC
574                       ,x_auto_release_pwp_inv   -- 7508661 : EnC
575                         /* Added for 12.2 Payroll billing ER  11847616 */
576                           , x_bill_labor_accrual
577                       ,  x_adj_on_std_inv
578                         /* Added for 12.2 Payroll billing ER  11847616 */
579              );
580 
581 
582     OPEN C;
583     FETCH C INTO X_Rowid;
584     if (C%NOTFOUND) then
585       CLOSE C;
586       Raise NO_DATA_FOUND;
587     end if;
588     CLOSE C;
589 
590     -- anlee
591     -- Added for intermedia search
592     PA_PROJECT_CTX_SEARCH_PVT.INSERT_ROW (
593      p_project_id           => x_project_id
597     ,p_project_long_name    => x_long_name
594     ,p_template_flag        => x_template_flag
595     ,p_project_name         => x_name
596     ,p_project_number       => x_segment1
598     ,p_project_description  => x_description
599     ,x_return_status        => l_return_status );
600     -- anlee end of changes
601 
602   EXCEPTION -- 4537865 Included Exception Block
603   WHEN OTHERS THEN
604 	X_Rowid := NULL ;
605 	X_Project_Id := NULL;
606 	Fnd_Msg_Pub.add_exc_msg(p_pkg_name        => 'PA_PROJECTS_PKG'
607 				,p_procedure_name => 'Insert_Row'
608 				,p_error_text     => SUBSTRB(SQLERRM,1,240));
609 	RAISE;
610   END Insert_Row;
611 
612 
613   PROCEDURE Lock_Row(X_Rowid                            VARCHAR2,
614                      X_Project_Id                       NUMBER,
615                      X_Name                             VARCHAR2,
616                      X_Long_Name                        VARCHAR2,
617                      X_Segment1                         VARCHAR2,
618                      X_Project_Type                     VARCHAR2,
619                      X_Carrying_Out_Organization_Id     NUMBER,
620                      X_Public_Sector_Flag               VARCHAR2,
621                      X_Project_Status_Code              VARCHAR2,
622                      X_Description                      VARCHAR2,
623                      X_Start_Date                       DATE,
624                      X_Completion_Date                  DATE,
625                      X_Closed_Date                      DATE,
626                      X_Distribution_Rule                VARCHAR2,
627                      X_Labor_Invoice_Format_Id          NUMBER,
628                      X_NL_Invoice_Format_Id	        NUMBER,
629                      X_Retention_Invoice_Format_Id      NUMBER,
630                      X_Retention_Percentage             NUMBER,
631                      X_Billing_Offset                   NUMBER,
632                      X_Billing_Cycle_Id                 NUMBER,
633                      X_Labor_Std_Bill_Rate_Schdl        VARCHAR2,
634                      X_Labor_Bill_Rate_Org_Id           NUMBER,
635                      X_Labor_Schedule_Fixed_Date        DATE,
636                      X_Labor_Schedule_Discount          NUMBER,
637                      X_NL_Std_Bill_Rate_Schdl		VARCHAR2,
638                      X_NL_Bill_Rate_Org_Id      	NUMBER,
639                      X_NL_Schedule_Fixed_Date    	DATE,
640                      X_NL_Schedule_Discount      	NUMBER,
641                      X_Limit_To_Txn_Controls_Flag       VARCHAR2,
642                      X_Project_Level_Funding_Flag       VARCHAR2,
643                      X_Invoice_Comment                  VARCHAR2,
644                      X_Unbilled_Receivable_Dr           NUMBER,
645                      X_Unearned_Revenue_Cr              NUMBER,
646                      X_Summary_Flag                     VARCHAR2,
647                      X_Enabled_Flag                     VARCHAR2,
648                      X_Segment2                         VARCHAR2,
649                      X_Segment3                         VARCHAR2,
650                      X_Segment4                         VARCHAR2,
651                      X_Segment5                         VARCHAR2,
652                      X_Segment6                         VARCHAR2,
653                      X_Segment7                         VARCHAR2,
654                      X_Segment8                         VARCHAR2,
655                      X_Segment9                         VARCHAR2,
656                      X_Segment10                        VARCHAR2,
657                      X_Attribute_Category               VARCHAR2,
658                      X_Attribute1                       VARCHAR2,
659                      X_Attribute2                       VARCHAR2,
660                      X_Attribute3                       VARCHAR2,
661                      X_Attribute4                       VARCHAR2,
662                      X_Attribute5                       VARCHAR2,
663                      X_Attribute6                       VARCHAR2,
664                      X_Attribute7                       VARCHAR2,
665                      X_Attribute8                       VARCHAR2,
666                      X_Attribute9                       VARCHAR2,
667                      X_Attribute10                      VARCHAR2,
668                      X_Cost_Ind_Rate_Sch_Id             NUMBER,
669                      X_Rev_Ind_Rate_Sch_Id              NUMBER,
670                      X_Inv_Ind_Rate_Sch_Id              NUMBER,
671                      X_Cost_Ind_Sch_Fixed_Date          DATE,
672                      X_Rev_Ind_Sch_Fixed_Date           DATE,
673                      X_Inv_Ind_Sch_Fixed_Date           DATE,
674                      X_Labor_Sch_Type                   VARCHAR2,
675                      X_Non_Labor_Sch_Type               VARCHAR2,
676                      X_Template_Flag                    VARCHAR2,
677                      X_Verification_Date                DATE,
678                      X_Created_From_Project_Id          NUMBER,
679                      X_Template_Start_Date    		DATE,
680                      X_Template_End_Date      		DATE,
681                      X_Project_Currency_Code         VARCHAR2,
682                      X_Allow_Cross_Charge_Flag        VARCHAR2,
683                      X_Project_Rate_Date              DATE,
684                      X_Project_Rate_Type              VARCHAR2,
685                      X_Output_Tax_Code                VARCHAR2,
686                      X_Retention_Tax_Code             VARCHAR2,
687                      X_CC_Process_Labor_Flag          VARCHAR2,
688                      X_Labor_Tp_Schedule_Id           NUMBER,
692                      X_Nl_Tp_Fixed_Date               DATE,
689                      X_Labor_Tp_Fixed_Date            DATE,
690                      X_CC_Process_NL_Flag             VARCHAR2,
691                      X_Nl_Tp_Schedule_Id              NUMBER,
693                      X_CC_Tax_Task_Id                 NUMBER,
694 --   17-MAY-00  kkekkar     Added the following columns for CBGA project
695 --                            bill_job_group_id, cost_job_group_id
696                      x_bill_job_group_id              NUMBER   ,
697                      x_cost_job_group_id              NUMBER   ,
698                      x_role_list_id                   NUMBER,
699                      x_work_type_id                   NUMBER,
700                      x_calendar_id                    NUMBER,
701                      x_location_id                    NUMBER,
702                      x_probability_member_id          NUMBER,
703                      x_project_value              NUMBER,
704                      x_expected_approval_date         DATE,
705                      x_team_template_id               NUMBER,
706 -- 21-MAR-2001 anlee
707 -- added job_bill_rate_schedule_id,
708 -- emp_bill_rate_schedule_id for
709 -- PRM forecasting changes
710                      x_job_bill_rate_schedule_id      NUMBER,
711                      x_emp_bill_rate_schedule_id      NUMBER,
712 --MCA Sakthi for MultiAgreementCurreny Project
713                        x_competence_match_wt            NUMBER,
714                        x_availability_match_wt          NUMBER,
715                        x_job_level_match_wt             NUMBER,
716                        x_enable_automated_search        VARCHAR2,
717                        x_search_min_availability        NUMBER,
718                        x_search_org_hier_id             NUMBER,
719                        x_search_starting_org_id         NUMBER,
720                        x_search_country_code            VARCHAR2,
721                        x_min_cand_score_reqd_for_nom    NUMBER,
722                        x_non_lab_std_bill_rt_sch_id     NUMBER,
723                        x_invproc_currency_type          VARCHAR2,
724                        x_revproc_currency_code          VARCHAR2,
725                        x_project_bil_rate_date_code     VARCHAR2,
726                        x_project_bil_rate_type          VARCHAR2,
727                        x_project_bil_rate_date          DATE,
728                        x_project_bil_exchange_rate      NUMBER,
729                        x_projfunc_currency_code         VARCHAR2,
730                        x_projfunc_bil_rate_date_code    VARCHAR2,
731                        x_projfunc_bil_rate_type         VARCHAR2,
732                        x_projfunc_bil_rate_date         DATE,
733                        x_projfunc_bil_exchange_rate     NUMBER,
734                        x_funding_rate_date_code         VARCHAR2,
735                        x_funding_rate_type              VARCHAR2,
736                        x_funding_rate_date              DATE,
737                        x_funding_exchange_rate          NUMBER,
738                        x_baseline_funding_flag          VARCHAR2,
739                        x_projfunc_cost_rate_type         VARCHAR2,
740                        x_projfunc_cost_rate_date         DATE,
741                        x_multi_currency_billing_flag    VARCHAR2,
742                        x_inv_by_bill_trans_curr_flag    VARCHAR2,
743 --MCA Sakthi for MultiAgreementCurrency Project
744                        x_assign_precedes_task       VARCHAR2,
745 --Structure
746                        x_split_cost_from_wokplan_flag   VARCHAR2,
747                        x_split_cost_from_bill_flag       VARCHAR2,
748 --Structure
749 --Advertisement
750                        x_adv_action_set_id              NUMBER,
751                        x_start_adv_action_set_flag      VARCHAR2,
752 --Advertisement
753 --Project Setup
754                        x_priority_code                  VARCHAR2,
755 --Project Setup
756 --Retention
757                        x_retn_billing_inv_format_id     NUMBER,
758                        x_retn_accounting_flag           VARCHAR2,
759 --Retention
760 -- anlee
761 -- patchset K changes
762                        x_revaluate_funding_flag         VARCHAR2,
763                        x_include_gains_losses_flag    VARCHAR2,
764 -- msundare
765                        x_security_level                 NUMBER,
766                        x_labor_disc_reason_code         VARCHAR2,
767                        x_non_labor_disc_reason_code     VARCHAR2,
768 -- End of changes
769 		     x_record_version_number          NUMBER,
770 		     x_btc_cost_base_rev_code         VARCHAR2,
771                      x_revtrans_currency_type         VARCHAR2,     /* R12 - Bug 4363092 */
772 --PA L
773                        x_asset_allocation_method        VARCHAR2,
774                        x_capital_event_processing       VARCHAR2,
775                        x_cint_rate_sch_id               NUMBER,
776                        x_cint_eligible_flag             VARCHAR2,
777                        x_cint_stop_date                 DATE,
778 --FP_M Changes. Tracking Bug 3279981
779                        x_en_top_task_customer_flag  VARCHAR2,
780                        x_en_top_task_inv_mth_flag   VARCHAR2,
781                        x_revenue_accrual_method         VARCHAR2,
782                        x_invoice_method                 VARCHAR2,
783                        x_projfunc_attr_for_ar_flag      VARCHAR2,
784 		        --sunkalya:federal Bug#5511353
785 		       x_date_eff_funds_flag        VARCHAR2
786 		       --sunkalya:federal Bug#5511353
787                       ,x_ar_rec_notify_flag             VARCHAR2  -- 7508661 : EnC
788                       ,x_auto_release_pwp_inv           VARCHAR2  -- 7508661 : EnC
789                         /* Added for 12.2 Payroll billing ER  11847616 */
793   ) IS
790                          ,x_bill_labor_accrual           VARCHAR2
791                           ,x_adj_on_std_inv           VARCHAR2
792                             /* Added for 12.2 Payroll billing ER  11847616 */
794 
795     CURSOR C IS
796         SELECT *
797         FROM   pa_projects
798         WHERE  rowid = X_Rowid
799         FOR UPDATE of Project_Id NOWAIT;
800     Recinfo C%ROWTYPE;
801 
802 
803   BEGIN
804     OPEN C;
805     FETCH C INTO Recinfo;
806     if (C%NOTFOUND) then
807       CLOSE C;
808       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
809       APP_EXCEPTION.Raise_Exception;
810     end if;
811     CLOSE C;
812     if Recinfo.record_version_number <> x_record_version_number
813     then
814       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
815       APP_EXCEPTION.Raise_Exception;
816     end if;
817 
818     if (
819                (Recinfo.project_id =  X_Project_Id)
820            AND (Recinfo.name =  X_Name)
821            AND (Recinfo.long_name =  X_Long_Name)
822            AND (Recinfo.segment1 =  X_Segment1)
823            AND (Recinfo.project_type =  X_Project_Type)
824            AND (Recinfo.carrying_out_organization_id =
825 			 X_Carrying_Out_Organization_Id)
826            AND (Recinfo.public_sector_flag =  X_Public_Sector_Flag)
827            AND (Recinfo.project_status_code =  X_Project_Status_Code)
828            AND (   (Recinfo.description =  X_Description)
829                 OR (    (Recinfo.description IS NULL)
830                     AND (X_Description IS NULL)))
831            AND (   (Recinfo.start_date =  X_Start_Date)
832                 OR (    (Recinfo.start_date IS NULL)
833                     AND (X_Start_Date IS NULL)))
834            AND (   (Recinfo.completion_date =  X_Completion_Date)
835                 OR (    (Recinfo.completion_date IS NULL)
836                     AND (X_Completion_Date IS NULL)))
837 --changed to remove bug# 609287 by Ashia Bagai on 27-jan-98
838            AND (   (TRUNC(Recinfo.closed_date) =  TRUNC(X_Closed_Date))
839 --           AND (   (Recinfo.closed_date =  X_Closed_Date)
840 --end of change to remove bug# 609287
841                 OR (    (Recinfo.closed_date IS NULL)
842                     AND (X_Closed_Date IS NULL)))
843            AND (   (Recinfo.distribution_rule =  X_Distribution_Rule)
844                 OR (    (Recinfo.distribution_rule IS NULL)
845                     AND (X_Distribution_Rule IS NULL)))
846            AND (   (Recinfo.labor_invoice_format_id =
847 			X_Labor_Invoice_Format_Id)
848                 OR (    (Recinfo.labor_invoice_format_id IS NULL)
849                     AND (X_Labor_Invoice_Format_Id IS NULL)))
850            AND (   (Recinfo.non_labor_invoice_format_id =
851 			X_NL_Invoice_Format_Id)
852                 OR (    (Recinfo.non_labor_invoice_format_id IS NULL)
853                     AND (X_NL_Invoice_Format_Id IS NULL)))
854            AND (   (Recinfo.retention_invoice_format_id =
855 			 X_Retention_Invoice_Format_Id)
856                 OR (    (Recinfo.retention_invoice_format_id IS NULL)
857                     AND (X_Retention_Invoice_Format_Id IS NULL)))
858            AND (   (Recinfo.retention_percentage =  X_Retention_Percentage)
859                 OR (    (Recinfo.retention_percentage IS NULL)
860                     AND (X_Retention_Percentage IS NULL)))
861            AND (   (Recinfo.billing_offset =  X_Billing_Offset)
862                 OR (    (Recinfo.billing_offset IS NULL)
863                     AND (X_Billing_Offset IS NULL)))
864            AND (   (Recinfo.billing_cycle_id =  X_Billing_Cycle_Id)
865                 OR (    (Recinfo.billing_cycle_id IS NULL)
866                     AND (X_Billing_Cycle_Id IS NULL)))
867            AND (   (Recinfo.labor_std_bill_rate_schdl =
868 			 X_Labor_Std_Bill_Rate_Schdl)
869                 OR (    (Recinfo.labor_std_bill_rate_schdl IS NULL)
870                     AND (X_Labor_Std_Bill_Rate_Schdl IS NULL)))
871            AND (   (Recinfo.labor_bill_rate_org_id =  X_Labor_Bill_Rate_Org_Id)
872                 OR (    (Recinfo.labor_bill_rate_org_id IS NULL)
873                     AND (X_Labor_Bill_Rate_Org_Id IS NULL)))
874            AND (   (Recinfo.labor_schedule_fixed_date =
875 			 X_Labor_Schedule_Fixed_Date)
876                 OR (    (Recinfo.labor_schedule_fixed_date IS NULL)
877                     AND (X_Labor_Schedule_Fixed_Date IS NULL)))
878            AND (   (Recinfo.labor_schedule_discount =
879 			X_Labor_Schedule_Discount)
880                 OR (    (Recinfo.labor_schedule_discount IS NULL)
881                     AND (X_Labor_Schedule_Discount IS NULL)))
882            AND (   (Recinfo.non_labor_std_bill_rate_schdl =
883 			 X_NL_Std_Bill_Rate_Schdl)
884                 OR (    (Recinfo.non_labor_std_bill_rate_schdl IS NULL)
885                     AND (X_NL_Std_Bill_Rate_Schdl IS NULL)))
886            AND (   (Recinfo.non_labor_bill_rate_org_id =
887 			 X_NL_Bill_Rate_Org_Id)
888                 OR (    (Recinfo.non_labor_bill_rate_org_id IS NULL)
889                     AND (X_NL_Bill_Rate_Org_Id IS NULL)))
890            AND (   (Recinfo.non_labor_schedule_fixed_date =
891 		    	 X_NL_Schedule_Fixed_Date)
892                 OR (    (Recinfo.non_labor_schedule_fixed_date IS NULL)
893                     AND (X_NL_Schedule_Fixed_Date IS NULL)))
894            AND (   (Recinfo.non_labor_schedule_discount =
895 			 X_NL_Schedule_Discount)
896                 OR (    (Recinfo.non_labor_schedule_discount IS NULL)
897                     AND (X_NL_Schedule_Discount IS NULL)))
898            AND (   (Recinfo.limit_to_txn_controls_flag =
899 			 X_Limit_To_Txn_Controls_Flag)
900                 OR (    (Recinfo.limit_to_txn_controls_flag IS NULL)
901                     AND (X_Limit_To_Txn_Controls_Flag IS NULL)))
905                     AND (X_Project_Level_Funding_Flag IS NULL)))
902            AND (   (Recinfo.project_level_funding_flag =
903 			 X_Project_Level_Funding_Flag)
904                 OR (    (Recinfo.project_level_funding_flag IS NULL)
906            AND (   (Recinfo.invoice_comment =  X_Invoice_Comment)
907                 OR (    (Recinfo.invoice_comment IS NULL)
908                     AND (X_Invoice_Comment IS NULL)))
909            AND (   (Recinfo.unbilled_receivable_dr =  X_Unbilled_Receivable_Dr)
910                 OR (    (Recinfo.unbilled_receivable_dr IS NULL)
911                     AND (X_Unbilled_Receivable_Dr IS NULL)))
912            AND (   (Recinfo.unearned_revenue_cr =  X_Unearned_Revenue_Cr)
913                 OR (    (Recinfo.unearned_revenue_cr IS NULL)
914                     AND (X_Unearned_Revenue_Cr IS NULL)))
915            AND (Recinfo.summary_flag =  X_Summary_Flag)
916            AND (Recinfo.enabled_flag =  X_Enabled_Flag)
917            AND (   (Recinfo.segment2 =  X_Segment2)
918                 OR (    (Recinfo.segment2 IS NULL)
919                     AND (X_Segment2 IS NULL)))
920            AND (   (Recinfo.segment3 =  X_Segment3)
921                 OR (    (Recinfo.segment3 IS NULL)
922                     AND (X_Segment3 IS NULL)))
923            AND (   (Recinfo.segment4 =  X_Segment4)
924                 OR (    (Recinfo.segment4 IS NULL)
925                     AND (X_Segment4 IS NULL)))
926            AND (   (Recinfo.segment5 =  X_Segment5)
927                 OR (    (Recinfo.segment5 IS NULL)
928                     AND (X_Segment5 IS NULL)))
929            AND (   (Recinfo.segment6 =  X_Segment6)
930                 OR (    (Recinfo.segment6 IS NULL)
931                     AND (X_Segment6 IS NULL)))
932            AND (   (Recinfo.segment7 =  X_Segment7)
933                 OR (    (Recinfo.segment7 IS NULL)
934                     AND (X_Segment7 IS NULL)))
935            AND (   (Recinfo.segment8 =  X_Segment8)
936                 OR (    (Recinfo.segment8 IS NULL)
937                     AND (X_Segment8 IS NULL)))
938            AND (   (Recinfo.segment9 =  X_Segment9)
939                 OR (    (Recinfo.segment9 IS NULL)
940                     AND (X_Segment9 IS NULL)))
941            AND (   (Recinfo.segment10 =  X_Segment10)
942                 OR (    (Recinfo.segment10 IS NULL)
943                     AND (X_Segment10 IS NULL)))
944            AND (   (Recinfo.attribute_category =  X_Attribute_Category)
945                 OR (    (Recinfo.attribute_category IS NULL)
946                     AND (X_Attribute_Category IS NULL)))
947            AND (   (Recinfo.attribute1 =  X_Attribute1)
948                 OR (    (Recinfo.attribute1 IS NULL)
949                     AND (X_Attribute1 IS NULL)))
950            AND (   (Recinfo.attribute2 =  X_Attribute2)
951                 OR (    (Recinfo.attribute2 IS NULL)
952                     AND (X_Attribute2 IS NULL)))
953            AND (   (Recinfo.attribute3 =  X_Attribute3)
954                 OR (    (Recinfo.attribute3 IS NULL)
955                     AND (X_Attribute3 IS NULL)))
956            AND (   (Recinfo.attribute4 =  X_Attribute4)
957                 OR (    (Recinfo.attribute4 IS NULL)
958                     AND (X_Attribute4 IS NULL)))
959            AND (   (Recinfo.attribute5 =  X_Attribute5)
960                 OR (    (Recinfo.attribute5 IS NULL)
961                     AND (X_Attribute5 IS NULL)))
962            AND (   (Recinfo.attribute6 =  X_Attribute6)
963                 OR (    (Recinfo.attribute6 IS NULL)
964                     AND (X_Attribute6 IS NULL)))
965            AND (   (Recinfo.attribute7 =  X_Attribute7)
966                 OR (    (Recinfo.attribute7 IS NULL)
967                     AND (X_Attribute7 IS NULL)))
968            AND (   (Recinfo.attribute8 =  X_Attribute8)
969                 OR (    (Recinfo.attribute8 IS NULL)
970                     AND (X_Attribute8 IS NULL)))
971            AND (   (Recinfo.attribute9 =  X_Attribute9)
972                 OR (    (Recinfo.attribute9 IS NULL)
973                     AND (X_Attribute9 IS NULL)))
974            AND (   (Recinfo.attribute10 =  X_Attribute10)
975                 OR (    (Recinfo.attribute10 IS NULL)
976                     AND (X_Attribute10 IS NULL)))
977            AND (   (Recinfo.cost_ind_rate_sch_id =  X_Cost_Ind_Rate_Sch_Id)
978                 OR (    (Recinfo.cost_ind_rate_sch_id IS NULL)
979                     AND (X_Cost_Ind_Rate_Sch_Id IS NULL)))
980            AND (   (Recinfo.rev_ind_rate_sch_id =  X_Rev_Ind_Rate_Sch_Id)
981                 OR (    (Recinfo.rev_ind_rate_sch_id IS NULL)
982                     AND (X_Rev_Ind_Rate_Sch_Id IS NULL)))
983            AND (   (Recinfo.inv_ind_rate_sch_id =  X_Inv_Ind_Rate_Sch_Id)
984                 OR (    (Recinfo.inv_ind_rate_sch_id IS NULL)
985                     AND (X_Inv_Ind_Rate_Sch_Id IS NULL)))
986            AND (   (Recinfo.cost_ind_sch_fixed_date =
987 			X_Cost_Ind_Sch_Fixed_Date)
988                 OR (    (Recinfo.cost_ind_sch_fixed_date IS NULL)
989                     AND (X_Cost_Ind_Sch_Fixed_Date IS NULL)))
990            AND (   (Recinfo.rev_ind_sch_fixed_date =  X_Rev_Ind_Sch_Fixed_Date)
991                 OR (    (Recinfo.rev_ind_sch_fixed_date IS NULL)
992                     AND (X_Rev_Ind_Sch_Fixed_Date IS NULL)))
993            AND (   (Recinfo.inv_ind_sch_fixed_date =  X_Inv_Ind_Sch_Fixed_Date)
994                 OR (    (Recinfo.inv_ind_sch_fixed_date IS NULL)
995                     AND (X_Inv_Ind_Sch_Fixed_Date IS NULL)))
996            AND (   (Recinfo.labor_sch_type =  X_Labor_Sch_Type)
997                 OR (    (Recinfo.labor_sch_type IS NULL)
998                     AND (X_Labor_Sch_Type IS NULL)))
999 	)
1000     then
1001 	   if ((   (Recinfo.non_labor_sch_type =  X_Non_Labor_Sch_Type)
1002                 OR (    (Recinfo.non_labor_sch_type IS NULL)
1006                     AND (X_Template_Flag IS NULL)))
1003                     AND (X_Non_Labor_Sch_Type IS NULL)))
1004               AND (   (Recinfo.template_flag =  X_Template_Flag)
1005                 OR (    (Recinfo.template_flag IS NULL)
1007               AND (   (Recinfo.verification_date =  X_Verification_Date)
1008                 OR (    (Recinfo.verification_date IS NULL)
1009                     AND (X_Verification_Date IS NULL)))
1010               AND (   (Recinfo.created_from_project_id =
1011 			 X_Created_From_Project_Id)
1012                 OR (    (Recinfo.created_from_project_id IS NULL)
1013                     AND (X_Created_From_Project_Id IS NULL)))
1014               AND (   (Recinfo.template_start_date_active =
1015 			 X_Template_Start_Date)
1016                 OR (    (Recinfo.template_start_date_active IS NULL)
1017                     AND (X_Template_Start_Date IS NULL)))
1018               AND (   (Recinfo.template_end_date_active =
1019 			X_Template_End_Date)
1020                 OR (    (Recinfo.template_end_date_active IS NULL)
1021                     AND (X_Template_End_Date IS NULL)))
1022               AND (   (Recinfo.Project_Currency_Code =
1023          X_Project_Currency_Code)
1024                 OR (    (Recinfo.Project_Currency_Code IS NULL)
1025                     AND (X_Project_Currency_Code IS NULL)))
1026               AND (   (Recinfo.Allow_Cross_Charge_Flag =
1027          X_Allow_Cross_Charge_Flag)
1028                 OR (    (Recinfo.Allow_Cross_Charge_Flag IS NULL)
1029                     AND (X_Allow_Cross_Charge_Flag IS NULL)))
1030               AND (   (Recinfo.Project_Rate_Date =
1031          X_Project_Rate_Date)
1032                 OR (    (Recinfo.Project_Rate_Date IS NULL)
1033                     AND (X_Project_Rate_Date IS NULL)))
1034               AND (   (Recinfo.Project_Rate_Type =
1035          X_Project_Rate_Type)
1036                 OR (    (Recinfo.Project_Rate_Type IS NULL)
1037                     AND (X_Project_Rate_Type IS NULL)))
1038              AND (   (Recinfo.Output_Tax_Code =
1039          X_Output_Tax_Code)
1040                 OR (    (Recinfo.Output_Tax_Code IS NULL)
1041                     AND (X_Output_Tax_Code IS NULL)))
1042              AND (   (Recinfo.Retention_Tax_Code =
1043          X_Retention_Tax_Code)
1044                 OR (    (Recinfo.Retention_Tax_Code IS NULL)
1045                     AND (X_Retention_Tax_Code IS NULL)))
1046              AND (   (Recinfo.CC_Process_Labor_Flag =
1047          X_CC_Process_Labor_Flag)
1048                 OR (    (Recinfo.CC_Process_Labor_Flag IS NULL)
1049                     AND (X_CC_Process_Labor_Flag IS NULL)))
1050              AND (   (Recinfo.Labor_Tp_Schedule_Id =
1051          X_Labor_Tp_Schedule_Id)
1052                 OR (    (Recinfo.Labor_Tp_Schedule_Id IS NULL)
1053                     AND (X_Labor_Tp_Schedule_Id IS NULL)))
1054              AND (   (Recinfo.Labor_Tp_Fixed_Date =
1055          X_Labor_Tp_Fixed_Date)
1056                 OR (    (Recinfo.Labor_Tp_Fixed_Date IS NULL)
1057                     AND (X_Labor_Tp_Fixed_Date IS NULL)))
1058              AND (   (Recinfo.CC_Process_NL_Flag =
1059          X_CC_Process_NL_Flag)
1060                 OR (    (Recinfo.CC_Process_NL_Flag IS NULL)
1061                     AND (X_CC_Process_NL_Flag IS NULL)))
1062              AND (   (Recinfo.Nl_Tp_Schedule_Id =
1063          X_Nl_Tp_Schedule_Id)
1064                 OR (    (Recinfo.Nl_Tp_Schedule_Id IS NULL)
1065                     AND (X_Nl_Tp_Schedule_Id IS NULL)))
1066              AND (   (Recinfo.Nl_Tp_Fixed_Date =
1067          X_Nl_Tp_Fixed_Date)
1068                 OR (    (Recinfo.Nl_Tp_Fixed_Date IS NULL)
1069                     AND (X_Nl_Tp_Fixed_Date IS NULL)))
1070              AND (   (Recinfo.CC_Tax_Task_Id =
1071          X_CC_Tax_Task_Id)
1072                 OR (    (Recinfo.CC_Tax_Task_Id IS NULL)
1073                     AND (X_CC_Tax_Task_Id IS NULL)))
1074              AND (   (Recinfo.bill_job_group_id =
1075          X_bill_job_group_id )
1076                 OR (    (Recinfo.bill_job_group_id IS NULL )
1077                     AND (X_bill_job_group_id IS NULL )))
1078             AND (    (Recinfo.cost_job_group_id =
1079          X_cost_job_group_id )
1080                 OR (    (Recinfo.cost_job_group_id IS NULL )
1081                    AND ( X_cost_job_group_id IS NULL )))
1082             AND (    (Recinfo.role_list_id =
1083          X_role_list_id )
1084                 OR (    (Recinfo.role_list_id IS NULL )
1085                    AND ( X_role_list_id IS NULL )))
1086             AND (    (Recinfo.work_type_id =
1087          X_work_type_id )
1088                 OR (    (Recinfo.work_type_id IS NULL )
1089                    AND ( X_work_type_id IS NULL )))
1090             AND (    (Recinfo.calendar_id =
1091          X_calendar_id )
1092                 OR (    (Recinfo.calendar_id IS NULL )
1093                    AND ( X_calendar_id IS NULL )))
1094             AND (    (Recinfo.location_id =
1095          X_location_id )
1096                 OR (    (Recinfo.location_id IS NULL )
1097                    AND ( X_location_id IS NULL )))
1098             AND (    (Recinfo.probability_member_id =
1099          X_probability_member_id )
1100                 OR (    (Recinfo.probability_member_id IS NULL )
1101                    AND ( X_probability_member_id IS NULL )))
1102             AND (    (Recinfo.project_value =
1103          X_project_value )
1104                 OR (    (Recinfo.project_value IS NULL )
1105                    AND ( X_project_value IS NULL )))
1106             AND (    (Recinfo.expected_approval_date =
1107          X_expected_approval_date )
1108                 OR (    (Recinfo.expected_approval_date IS NULL )
1109                    AND ( X_expected_approval_date IS NULL )))
1113                    AND ( x_team_template_id IS NULL )))
1110             AND (    (Recinfo.initial_team_template_id =
1111          x_team_template_id )
1112                 OR (    (Recinfo.initial_team_template_id IS NULL )
1114             AND (    (Recinfo.job_bill_rate_schedule_id =
1115          x_job_bill_rate_schedule_id )
1116                 OR (    (Recinfo.job_bill_rate_schedule_id IS NULL )
1117                    AND ( x_job_bill_rate_schedule_id IS NULL )))
1118             AND (    (Recinfo.emp_bill_rate_schedule_id =
1119          x_emp_bill_rate_schedule_id )
1120                 OR (    (Recinfo.emp_bill_rate_schedule_id IS NULL )
1121                    AND ( x_emp_bill_rate_schedule_id IS NULL )))
1122 --MCA Sakthi for MultiAgreementCurreny Project
1123             AND (    (Recinfo.competence_match_wt =
1124          x_competence_match_wt )
1125                 OR (    (Recinfo.competence_match_wt IS NULL )
1126                    AND ( x_competence_match_wt IS NULL )))
1127             AND (    (Recinfo.availability_match_wt =
1128          x_availability_match_wt )
1129                 OR (    (Recinfo.availability_match_wt IS NULL )
1130                    AND ( x_availability_match_wt IS NULL )))
1131             AND (    (Recinfo.job_level_match_wt =
1132          x_job_level_match_wt )
1133                 OR (    (Recinfo.job_level_match_wt IS NULL )
1134                    AND ( x_job_level_match_wt IS NULL )))
1135             AND (    (Recinfo.enable_automated_search =
1136          x_enable_automated_search )
1137                 OR (    (Recinfo.enable_automated_search IS NULL )
1138                    AND ( x_enable_automated_search IS NULL )))
1139             AND (    (Recinfo.search_min_availability =
1140          x_search_min_availability )
1141                 OR (    (Recinfo.search_min_availability IS NULL )
1142                    AND ( x_search_min_availability IS NULL )))
1143             AND (    (Recinfo.search_org_hier_id =
1144          x_search_org_hier_id )
1145                 OR (    (Recinfo.search_org_hier_id IS NULL )
1146                    AND ( x_search_org_hier_id IS NULL )))
1147             AND (    (Recinfo.search_starting_org_id =
1148          x_search_starting_org_id )
1149                 OR (    (Recinfo.search_starting_org_id IS NULL )
1150                    AND ( x_search_starting_org_id IS NULL )))
1151             AND (    (Recinfo.search_country_code =
1152          x_search_country_code )
1153                 OR (    (Recinfo.search_country_code IS NULL )
1154                    AND ( x_search_country_code IS NULL )))
1155             AND (    (Recinfo.min_cand_score_reqd_for_nom =
1156          x_min_cand_score_reqd_for_nom )
1157                 OR (    (Recinfo.min_cand_score_reqd_for_nom IS NULL )
1158                    AND ( x_min_cand_score_reqd_for_nom IS NULL )))
1159             AND (    (Recinfo.non_lab_std_bill_rt_sch_id =
1160          x_non_lab_std_bill_rt_sch_id )
1161                 OR (    (Recinfo.non_lab_std_bill_rt_sch_id IS NULL )
1162                    AND ( x_non_lab_std_bill_rt_sch_id IS NULL )))
1163             AND (    (Recinfo.invproc_currency_type =
1164          x_invproc_currency_type )
1165                 OR (    (Recinfo.invproc_currency_type IS NULL )
1166                    AND ( x_invproc_currency_type IS NULL )))
1167             AND (    (Recinfo.revproc_currency_code =
1168          x_revproc_currency_code )
1169                 OR (    (Recinfo.revproc_currency_code IS NULL )
1170                    AND ( x_revproc_currency_code IS NULL )))
1171             AND (    (Recinfo.project_bil_rate_date_code =
1172          x_project_bil_rate_date_code )
1173                 OR (    (Recinfo.project_bil_rate_date_code IS NULL )
1174                    AND ( x_project_bil_rate_date_code IS NULL )))
1175             AND (    (Recinfo.project_bil_rate_type =
1176          x_project_bil_rate_type )
1177                 OR (    (Recinfo.project_bil_rate_type IS NULL )
1178                    AND ( x_project_bil_rate_type IS NULL )))
1179             AND (    (Recinfo.project_bil_rate_date =
1180          x_project_bil_rate_date )
1181                 OR (    (Recinfo.project_bil_rate_date IS NULL )
1182                    AND ( x_project_bil_rate_date IS NULL )))
1183             AND (    (Recinfo.project_bil_exchange_rate =
1184          x_project_bil_exchange_rate )
1185                 OR (    (Recinfo.project_bil_exchange_rate IS NULL )
1186                    AND ( x_project_bil_exchange_rate IS NULL )))
1187             AND (    (Recinfo.projfunc_currency_code =
1188          x_projfunc_currency_code )
1189                 OR (    (Recinfo.projfunc_currency_code IS NULL )
1190                    AND ( x_projfunc_currency_code IS NULL )))
1191             AND (    (Recinfo.projfunc_bil_rate_date_code =
1192          x_projfunc_bil_rate_date_code )
1193                 OR (    (Recinfo.projfunc_bil_rate_date_code IS NULL )
1194                    AND ( x_projfunc_bil_rate_date_code IS NULL )))
1195             AND (    (Recinfo.projfunc_bil_rate_type =
1196          x_projfunc_bil_rate_type )
1197                 OR (    (Recinfo.projfunc_bil_rate_type IS NULL )
1198                    AND ( x_projfunc_bil_rate_type IS NULL )))
1199             AND (    (Recinfo.projfunc_bil_rate_date =
1200          x_projfunc_bil_rate_date )
1201                 OR (    (Recinfo.projfunc_bil_rate_date IS NULL )
1202                    AND ( x_projfunc_bil_rate_date IS NULL )))
1203             AND (    (Recinfo.projfunc_bil_exchange_rate =
1204          x_projfunc_bil_exchange_rate )
1205                 OR (    (Recinfo.projfunc_bil_exchange_rate IS NULL )
1206                    AND ( x_projfunc_bil_exchange_rate IS NULL )))
1207             AND (    (Recinfo.funding_rate_date_code =
1208          x_funding_rate_date_code )
1209                 OR (    (Recinfo.funding_rate_date_code IS NULL )
1210                    AND ( x_funding_rate_date_code IS NULL )))
1211             AND (    (Recinfo.funding_rate_type =
1215             AND (    (Recinfo.funding_rate_date =
1212          x_funding_rate_type )
1213                 OR (    (Recinfo.funding_rate_type IS NULL )
1214                    AND ( x_funding_rate_type IS NULL )))
1216          x_funding_rate_date )
1217                 OR (    (Recinfo.funding_rate_date IS NULL )
1218                    AND ( x_funding_rate_date IS NULL )))
1219             AND (    (Recinfo.funding_exchange_rate =
1220          x_funding_exchange_rate )
1221                 OR (    (Recinfo.funding_exchange_rate IS NULL )
1222                    AND ( x_funding_exchange_rate IS NULL )))
1223             AND (    (Recinfo.baseline_funding_flag =
1224          x_baseline_funding_flag )
1225                 OR (    (Recinfo.baseline_funding_flag IS NULL )
1226                    AND ( x_baseline_funding_flag IS NULL )))
1227             AND (    (Recinfo.projfunc_cost_rate_type =
1228          x_projfunc_cost_rate_type )
1229                 OR (    (Recinfo.projfunc_cost_rate_type IS NULL )
1230                    AND ( x_projfunc_cost_rate_type IS NULL )))
1231             AND (    (Recinfo.projfunc_cost_rate_date =
1232          x_projfunc_cost_rate_date )
1233                 OR (    (Recinfo.projfunc_cost_rate_date IS NULL )
1234                    AND ( x_projfunc_cost_rate_date IS NULL )))
1235             AND (    (Recinfo.multi_currency_billing_flag =
1236          x_multi_currency_billing_flag )
1237                 OR (    (Recinfo.multi_currency_billing_flag IS NULL )
1238                    AND ( x_multi_currency_billing_flag IS NULL )))
1239             AND (    (Recinfo.btc_cost_base_rev_code =
1240          x_btc_cost_base_rev_code )
1241                 OR (    (Recinfo.btc_cost_base_rev_code IS NULL )
1242                    AND ( x_btc_cost_base_rev_code IS NULL )))
1243 -- R12 - Bug 4363092
1244             AND (    (Recinfo.revtrans_currency_type =
1245          x_revtrans_currency_type )
1246                 OR (    (Recinfo.revtrans_currency_type IS NULL )
1247                    AND ( x_revtrans_currency_type IS NULL )))
1248 -- R12 - Bug 4363092
1249             AND (    (Recinfo.inv_by_bill_trans_curr_flag =
1250          x_inv_by_bill_trans_curr_flag )
1251                 OR (    (Recinfo.inv_by_bill_trans_curr_flag IS NULL )
1252                    AND ( x_inv_by_bill_trans_curr_flag IS NULL )))
1253 --MCA Sakthi for MultiAgreementCurrency Project
1254             AND (    (Recinfo.assign_precedes_task =
1255          x_assign_precedes_task )
1256                 OR (    (Recinfo.assign_precedes_task IS NULL )
1257                    AND ( x_assign_precedes_task IS NULL )))
1258 --Structure
1259             AND (    (Recinfo.split_cost_from_workplan_flag  =
1260          x_split_cost_from_wokplan_flag )
1261                 OR (    (Recinfo.split_cost_from_workplan_flag IS NULL )
1262                    AND ( x_split_cost_from_wokplan_flag IS NULL )))
1263 
1264             AND (    (Recinfo.split_cost_from_bill_flag =
1265          x_split_cost_from_bill_flag )
1266                 OR (    (Recinfo.split_cost_from_bill_flag IS NULL )
1267                    AND ( x_split_cost_from_bill_flag IS NULL )))
1268 --Structure
1269 --Advertisement
1270             AND (    (Recinfo.adv_action_set_id  =
1271          x_adv_action_set_id )
1272                 OR (    (Recinfo.adv_action_set_id IS NULL )
1273                    AND ( x_adv_action_set_id IS NULL )))
1274 
1275             AND (    (Recinfo.start_adv_action_set_flag =
1276          x_start_adv_action_set_flag )
1277                 OR (    (Recinfo.start_adv_action_set_flag IS NULL )
1278                    AND ( x_start_adv_action_set_flag IS NULL )))
1279 --Advertisement
1280 --Project Setup
1281             AND (    (Recinfo.Priority_code =
1282          x_Priority_code )
1283                 OR (    (Recinfo.Priority_code IS NULL )
1284                    AND ( x_Priority_code IS NULL )))
1285 --Project Setup
1286 --Retention
1287             AND (    (Recinfo.retn_billing_inv_format_id =
1288          x_retn_billing_inv_format_id )
1289                 OR (    (Recinfo.retn_billing_inv_format_id IS NULL )
1290                    AND ( x_retn_billing_inv_format_id IS NULL )))
1291 
1292             AND (    (Recinfo.retn_accounting_flag =
1293          x_retn_accounting_flag )
1294                 OR (    (Recinfo.retn_accounting_flag IS NULL )
1295                    AND ( x_retn_accounting_flag IS NULL )))
1296 --Retention
1297 -- anlee
1298 -- patchset K changes
1299             AND (    (Recinfo.revaluate_funding_flag =
1300          x_revaluate_funding_flag )
1301                 OR (    (Recinfo.revaluate_funding_flag IS NULL )
1302                    AND ( x_revaluate_funding_flag IS NULL )))
1303 
1304             AND (    (Recinfo.include_gains_losses_flag =
1305          x_include_gains_losses_flag )
1306                 OR (    (Recinfo.include_gains_losses_flag IS NULL )
1307                    AND ( x_include_gains_losses_flag IS NULL )))
1308 -- msundare
1309             AND (    (Recinfo.security_level = x_security_level )
1310                 OR (    (Recinfo.security_level IS NULL )
1311                    AND ( x_security_level IS NULL )))
1312 
1313             AND (    (Recinfo.labor_disc_reason_code = x_labor_disc_reason_code )
1314                 OR (    (Recinfo.labor_disc_reason_code IS NULL )
1315                    AND ( x_labor_disc_reason_code IS NULL )))
1316 
1317             AND (    (Recinfo.non_labor_disc_reason_code = x_non_labor_disc_reason_code )
1318                 OR (    (Recinfo.non_labor_disc_reason_code IS NULL )
1319                    AND ( x_non_labor_disc_reason_code IS NULL )))
1320 -- End of changes
1321 --PA L changes
1322             AND (    (Recinfo.asset_allocation_method = x_asset_allocation_method )
1323                 OR (    (Recinfo.asset_allocation_method IS NULL )
1324                    AND ( x_asset_allocation_method IS NULL )))
1325 
1326             AND (    (Recinfo.capital_event_processing = x_capital_event_processing )
1327                 OR (    (Recinfo.capital_event_processing IS NULL )
1328                    AND ( x_capital_event_processing IS NULL )))
1329 
1330             AND (    (Recinfo.cint_rate_sch_id = x_cint_rate_sch_id )
1331                 OR (    (Recinfo.cint_rate_sch_id IS NULL )
1332                    AND ( x_cint_rate_sch_id IS NULL )))
1333 
1334             AND (    (Recinfo.cint_eligible_flag = x_cint_eligible_flag )
1335                 OR (    (Recinfo.cint_eligible_flag IS NULL )
1336                    AND ( x_cint_eligible_flag IS NULL )))
1337 
1338             AND (    (Recinfo.cint_stop_date = x_cint_stop_date )
1339                 OR (    (Recinfo.cint_stop_date IS NULL )
1340                    AND ( x_cint_stop_date IS NULL )))
1341 
1342 --FP_M Changes. Tracking Bug 3279981
1343             AND (    (Recinfo.enable_top_task_customer_flag = x_en_top_task_customer_flag )
1344                 OR (    (Recinfo.enable_top_task_customer_flag IS NULL )
1345                    AND ( x_en_top_task_customer_flag IS NULL )))
1346 
1347             AND (    (Recinfo.enable_top_task_inv_mth_flag = x_en_top_task_inv_mth_flag )
1348                 OR (    (Recinfo.enable_top_task_inv_mth_flag IS NULL )
1349                    AND ( x_en_top_task_inv_mth_flag IS NULL )))
1350 
1351             AND (    (Recinfo.revenue_accrual_method = x_revenue_accrual_method )
1352                 OR (    (Recinfo.revenue_accrual_method IS NULL )
1353                    AND ( x_revenue_accrual_method IS NULL )))
1354 
1355             AND (    (Recinfo.invoice_method = x_invoice_method )
1356                 OR (    (Recinfo.invoice_method IS NULL )
1357                    AND ( x_invoice_method IS NULL )))
1358 
1359             AND (    (Recinfo.projfunc_attr_for_ar_flag = x_projfunc_attr_for_ar_flag )
1360                 OR (    (Recinfo.projfunc_attr_for_ar_flag IS NULL )
1361                    AND ( x_projfunc_attr_for_ar_flag IS NULL )))
1362 
1363 --sunkalya:federal changes Bug#5511353
1364 	    AND (    (Recinfo.date_eff_funds_consumption = x_date_eff_funds_flag )
1365                 OR (    (Recinfo.date_eff_funds_consumption IS NULL )
1366                    AND ( x_date_eff_funds_flag IS NULL )))
1367 --sunkalya:federal changes	Bug#5511353
1368 
1369         /* 7508661 : EnC : Start */
1370         AND (    (Recinfo.ar_rec_notify_flag = x_ar_rec_notify_flag )
1371                 OR (    (Recinfo.ar_rec_notify_flag IS NULL )
1372                    AND ( x_ar_rec_notify_flag IS NULL )))
1373         AND (    (Recinfo.auto_release_pwp_inv = x_auto_release_pwp_inv )
1374                 OR (    (Recinfo.auto_release_pwp_inv IS NULL )
1375                    AND ( x_auto_release_pwp_inv IS NULL )))
1376                                                          /* 7508661 : EnC : End */
1377                                      /* Added for 12.2 Payroll billing ER  11847616 */
1378                     AND (    (Recinfo.bill_labor_accrual = x_bill_labor_accrual )
1379                 OR (    (Recinfo.bill_labor_accrual IS NULL )
1380                    AND ( x_bill_labor_accrual IS NULL )))
1381 
1382                     AND (    (Recinfo.adj_on_std_inv = x_adj_on_std_inv )
1383                 OR (    (Recinfo.adj_on_std_inv IS NULL )
1384                    AND ( x_adj_on_std_inv IS NULL )))
1385 
1386           /* Added for 12.2 Payroll billing ER  11847616 */
1387 
1388        )
1389 	    then
1390 		      return;
1391 	    else
1392 		      FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
1393 		      APP_EXCEPTION.Raise_Exception;
1394 	    end if;
1395     else
1399   END Lock_Row;
1396       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
1397       APP_EXCEPTION.Raise_Exception;
1398     end if;
1400 
1401 
1402 END PA_PROJECTS_PKG;