DBA Data[Home] [Help]

PACKAGE BODY: APPS.PA_PROJECTS_PKG1

Source


4   PROCEDURE Update_Row(X_Rowid                          VARCHAR2,
1 PACKAGE BODY PA_PROJECTS_PKG1 as
2 /* $Header: PAXPRO1B.pls 120.6 2011/03/21 10:53:42 pcheruvu ship $ */
3 
5                        X_Project_Id                     NUMBER,
6                        X_Name                           VARCHAR2,
7                        X_Long_Name                      VARCHAR2,
8                        X_Segment1                       VARCHAR2,
9                        X_Last_Update_Date               DATE,
10                        X_Last_Updated_By                NUMBER,
11                        X_Last_Update_Login              NUMBER,
12                        X_Project_Type                   VARCHAR2,
13                        X_Carrying_Out_Organization_Id   NUMBER,
14                        X_Public_Sector_Flag             VARCHAR2,
15 -- Commented for Bug 3605235
16                        --X_Project_Status_Code            VARCHAR2,
17                        X_Description                    VARCHAR2,
18                        X_Start_Date                     DATE,
19                        X_Completion_Date                DATE,
20                        X_Closed_Date                    DATE,
21                        X_Distribution_Rule              VARCHAR2,
22                        X_Labor_Invoice_Format_Id        NUMBER,
23                        X_NL_Invoice_Format_Id    	NUMBER,
24                        X_Retention_Invoice_Format_Id    NUMBER,
25                        X_Retention_Percentage           NUMBER,
26                        X_Billing_Offset                 NUMBER,
27                        X_Billing_Cycle_Id               NUMBER,
28                        X_Labor_Std_Bill_Rate_Schdl      VARCHAR2,
29                        X_Labor_Bill_Rate_Org_Id         NUMBER,
30                        X_Labor_Schedule_Fixed_Date      DATE,
31                        X_Labor_Schedule_Discount        NUMBER,
32                        X_NL_Std_Bill_Rate_Schdl  	VARCHAR2,
33                        X_NL_Bill_Rate_Org_Id     	NUMBER,
34                        X_NL_Schedule_Fixed_Date  	DATE,
35                        X_NL_Schedule_Discount    	NUMBER,
36                        X_Limit_To_Txn_Controls_Flag     VARCHAR2,
37                        X_Project_Level_Funding_Flag     VARCHAR2,
38                        X_Invoice_Comment                VARCHAR2,
39                        X_Unbilled_Receivable_Dr         NUMBER,
40                        X_Unearned_Revenue_Cr            NUMBER,
41                        X_Summary_Flag                   VARCHAR2,
42                        X_Enabled_Flag                   VARCHAR2,
43                        X_Segment2                       VARCHAR2,
44                        X_Segment3                       VARCHAR2,
45                        X_Segment4                       VARCHAR2,
46                        X_Segment5                       VARCHAR2,
47                        X_Segment6                       VARCHAR2,
48                        X_Segment7                       VARCHAR2,
49                        X_Segment8                       VARCHAR2,
50                        X_Segment9                       VARCHAR2,
51                        X_Segment10                      VARCHAR2,
52                        X_Attribute_Category             VARCHAR2,
53                        X_Attribute1                     VARCHAR2,
54                        X_Attribute2                     VARCHAR2,
55                        X_Attribute3                     VARCHAR2,
56                        X_Attribute4                     VARCHAR2,
57                        X_Attribute5                     VARCHAR2,
58                        X_Attribute6                     VARCHAR2,
59                        X_Attribute7                     VARCHAR2,
60                        X_Attribute8                     VARCHAR2,
61                        X_Attribute9                     VARCHAR2,
62                        X_Attribute10                    VARCHAR2,
63                        X_Cost_Ind_Rate_Sch_Id           NUMBER,
64                        X_Rev_Ind_Rate_Sch_Id            NUMBER,
65                        X_Inv_Ind_Rate_Sch_Id            NUMBER,
66                        X_Cost_Ind_Sch_Fixed_Date        DATE,
67                        X_Rev_Ind_Sch_Fixed_Date         DATE,
68                        X_Inv_Ind_Sch_Fixed_Date         DATE,
69                        X_Labor_Sch_Type                 VARCHAR2,
70                        X_Non_Labor_Sch_Type             VARCHAR2,
71                        X_Template_Flag                  VARCHAR2,
72                        X_Verification_Date              DATE,
73                        X_Created_From_Project_Id        NUMBER,
74                        X_Template_Start_Date  		     DATE,
75                        X_Template_End_Date    		     DATE,
76 --added to remove bug#594567 :ashia Bagai 6-jan-98
77 -- Commented for Bug 3605235
78               	        --X_Wf_Status_Code			        VARCHAR2,
79                        X_Project_Currency_Code          VARCHAR2,
83                        X_Output_Tax_Code                VARCHAR2,
80                        X_Allow_Cross_Charge_Flag        VARCHAR2,
81                        X_Project_Rate_Date              DATE,
82                        X_Project_Rate_Type              VARCHAR2,
84                        X_Retention_Tax_Code             VARCHAR2,
85                        X_CC_Process_Labor_Flag          VARCHAR2,
86                        X_Labor_Tp_Schedule_Id           NUMBER,
87                        X_Labor_Tp_Fixed_Date            DATE,
88                        X_CC_Process_NL_Flag             VARCHAR2,
89                        X_Nl_Tp_Schedule_Id              NUMBER,
90                        X_Nl_Tp_Fixed_Date               DATE,
91                        X_CC_Tax_Task_Id                 NUMBER,
92 --   End of addtion to remove bug#594567
93 --   17-MAY-00  kkekkar     Added the following columns for CBGA project
94 --                          bill_job_group_id, cost_job_group_id
95                        x_bill_job_group_id              NUMBER,
96                        x_cost_job_group_id              NUMBER,
97                        x_role_list_id                   NUMBER,
98                        x_work_type_id                   NUMBER,
99                        x_calendar_id                    NUMBER,
100                        x_location_id                    NUMBER,
101                        x_probability_member_id          NUMBER,
102                        x_project_value                  NUMBER,
103                        x_expected_approval_date         DATE,
104                        x_team_template_id               NUMBER,
105 -- 21-MAR-2001 anlee
106 -- added job_bill_rate_schedule_id,
107 -- emp_bill_rate_schedule_id for
108 -- PRM forecasting changes
109                        x_job_bill_rate_schedule_id      NUMBER,
110                        x_emp_bill_rate_schedule_id      NUMBER,
111 --MCA Sakthi for MultiAgreementCurreny Project
112                        x_competence_match_wt            NUMBER,
113                        x_availability_match_wt          NUMBER,
114                        x_job_level_match_wt             NUMBER,
115                        x_enable_automated_search        VARCHAR2,
116                        x_search_min_availability        NUMBER,
117                        x_search_org_hier_id             NUMBER,
118                        x_search_starting_org_id         NUMBER,
119                        x_search_country_code            VARCHAR2,
120                        x_min_cand_score_reqd_for_nom    NUMBER,
121                        x_non_lab_std_bill_rt_sch_id     NUMBER,
122                        x_invproc_currency_type          VARCHAR2,
123                        x_revproc_currency_code          VARCHAR2,
124                        x_project_bil_rate_date_code     VARCHAR2,
125                        x_project_bil_rate_type          VARCHAR2,
126                        x_project_bil_rate_date          DATE,
127                        x_project_bil_exchange_rate      NUMBER,
128                        x_projfunc_currency_code         VARCHAR2,
129                        x_projfunc_bil_rate_date_code    VARCHAR2,
130                        x_projfunc_bil_rate_type         VARCHAR2,
131                        x_projfunc_bil_rate_date         DATE,
132                        x_projfunc_bil_exchange_rate     NUMBER,
133                        x_funding_rate_date_code         VARCHAR2,
134                        x_funding_rate_type              VARCHAR2,
135                        x_funding_rate_date              DATE,
136                        x_funding_exchange_rate          NUMBER,
137                        x_baseline_funding_flag          VARCHAR2,
138                        x_projfunc_cost_rate_type         VARCHAR2,
139                        x_projfunc_cost_rate_date         DATE,
140                        x_multi_currency_billing_flag    VARCHAR2,
141                        x_inv_by_bill_trans_curr_flag    VARCHAR2,
142 --MCA Sakthi for MultiAgreementCurrency Project
143 --MCA
144                        x_assign_precedes_task       VARCHAR2,
145 --MCA
146 --Structure
147                        x_split_cost_from_wokplan_flag   VARCHAR2,
148                        x_split_cost_from_bill_flag       VARCHAR2,
149 --Structure
150 --Advertisement
151                        x_adv_action_set_id              NUMBER,
152                        x_start_adv_action_set_flag      VARCHAR2,
153 --Advertisement
154 --Project Setup
155                        x_priority_code                  VARCHAR2,
156 --Project Setup
157 --Retention
158                        x_retn_billing_inv_format_id     NUMBER,
159                        x_retn_accounting_flag           VARCHAR2,
160 --Retention
161 -- anlee
162 -- patchset K changes
163                        x_revaluate_funding_flag         VARCHAR2,
164                        x_include_gains_losses_flag    VARCHAR2,
165 -- msundare
166                        x_security_level                 NUMBER,
167                        x_labor_disc_reason_code         VARCHAR2,
168                        x_non_labor_disc_reason_code     VARCHAR2,
169 -- End of changes
170 	               x_record_version_number          NUMBER,
171 		       x_btc_cost_base_rev_code         VARCHAR2,   /* Bug#2638968 */
172                        x_revtrans_currency_type         VARCHAR2, /* R12 - Bug 4363092 */
173 --PA L
174                        x_asset_allocation_method        VARCHAR2,
175                        x_capital_event_processing       VARCHAR2,
176                        x_cint_rate_sch_id               NUMBER,
177                        x_cint_eligible_flag             VARCHAR2,
178                        x_cint_stop_date                 DATE,
179 --FP_M Changes. Tracking Bug 3279981
180                        x_en_top_task_customer_flag  VARCHAR2,
181                        x_en_top_task_inv_mth_flag   VARCHAR2,
185                        x_sys_program_flag               VARCHAR2,
182                        x_revenue_accrual_method         VARCHAR2,
183                        x_invoice_method                 VARCHAR2,
184                        x_projfunc_attr_for_ar_flag      VARCHAR2,
186                        x_allow_multi_program_rollup     VARCHAR2,
187                        x_proj_req_res_format_id         NUMBER,
188                        x_proj_asgmt_res_format_id       NUMBER,
189                        x_date_eff_funds_flag            VARCHAR2  --Bug 5511353
190                       ,x_ar_rec_notify_flag             VARCHAR2  -- 7508661 : EnC
191                       ,x_auto_release_pwp_inv           VARCHAR2  -- 7508661 : EnC
192                        /* Added for 12.2 Payroll billing ER  11847616 */
193                         ,x_bill_labor_accrual           VARCHAR2  default 'N',
194                           x_adj_inc_std_inv           VARCHAR2 default 'N'
195                            /* Added for 12.2 Payroll billing ER  11847616 */
196                  )
197 
198    IS
199 
200     l_return_status  VARCHAR2(1);
201   BEGIN
202 
203     UPDATE pa_projects
204     SET
205        project_id                      =     X_Project_Id,
206        name                            =     X_Name,
207        long_name                       =     X_Long_Name,
208        segment1                        =     X_Segment1,
209        last_update_date                =     X_Last_Update_Date,
210        last_updated_by                 =     X_Last_Updated_By,
211        last_update_login               =     X_Last_Update_Login,
212        project_type                    =     X_Project_Type,
213        carrying_out_organization_id    =     X_Carrying_Out_Organization_Id,
214        public_sector_flag              =     X_Public_Sector_Flag,
215 -- Commented for Bug 3605235
216        --project_status_code             =     X_Project_Status_Code,
217        description                     =     X_Description,
218        start_date                      =     X_Start_Date,
219        completion_date                 =     X_Completion_Date,
220        closed_date                     =     X_Closed_Date,
221        distribution_rule               =     X_Distribution_Rule,
222        labor_invoice_format_id         =     X_Labor_Invoice_Format_Id,
223        non_labor_invoice_format_id     =     X_NL_Invoice_Format_Id,
224        retention_invoice_format_id     =     X_Retention_Invoice_Format_Id,
225        retention_percentage            =     X_Retention_Percentage,
226        billing_offset                  =     X_Billing_Offset,
227        billing_cycle_id                =     X_Billing_Cycle_Id,
228        labor_std_bill_rate_schdl       =     X_Labor_Std_Bill_Rate_Schdl,
229        labor_bill_rate_org_id          =     X_Labor_Bill_Rate_Org_Id,
230        labor_schedule_fixed_date       =     X_Labor_Schedule_Fixed_Date,
231        labor_schedule_discount         =     X_Labor_Schedule_Discount,
232        non_labor_std_bill_rate_schdl   =     X_NL_Std_Bill_Rate_Schdl,
233        non_labor_bill_rate_org_id      =     X_NL_Bill_Rate_Org_Id,
234        non_labor_schedule_fixed_date   =     X_NL_Schedule_Fixed_Date,
235        non_labor_schedule_discount     =     X_NL_Schedule_Discount,
236        limit_to_txn_controls_flag      =     X_Limit_To_Txn_Controls_Flag,
237        project_level_funding_flag      =     X_Project_Level_Funding_Flag,
238        invoice_comment                 =     X_Invoice_Comment,
239        unbilled_receivable_dr          =     X_Unbilled_Receivable_Dr,
240        unearned_revenue_cr             =     X_Unearned_Revenue_Cr,
241        summary_flag                    =     X_Summary_Flag,
242        enabled_flag                    =     X_Enabled_Flag,
243        segment2                        =     X_Segment2,
244        segment3                        =     X_Segment3,
245        segment4                        =     X_Segment4,
246        segment5                        =     X_Segment5,
247        segment6                        =     X_Segment6,
248        segment7                        =     X_Segment7,
249        segment8                        =     X_Segment8,
250        segment9                        =     X_Segment9,
251        segment10                       =     X_Segment10,
252        attribute_category              =     X_Attribute_Category,
253        attribute1                      =     X_Attribute1,
254        attribute2                      =     X_Attribute2,
255        attribute3                      =     X_Attribute3,
256        attribute4                      =     X_Attribute4,
257        attribute5                      =     X_Attribute5,
258        attribute6                      =     X_Attribute6,
259        attribute7                      =     X_Attribute7,
260        attribute8                      =     X_Attribute8,
261        attribute9                      =     X_Attribute9,
262        attribute10                     =     X_Attribute10,
263        cost_ind_rate_sch_id            =     X_Cost_Ind_Rate_Sch_Id,
264        rev_ind_rate_sch_id             =     X_Rev_Ind_Rate_Sch_Id,
265        inv_ind_rate_sch_id             =     X_Inv_Ind_Rate_Sch_Id,
266        cost_ind_sch_fixed_date         =     X_Cost_Ind_Sch_Fixed_Date,
267        rev_ind_sch_fixed_date          =     X_Rev_Ind_Sch_Fixed_Date,
268        inv_ind_sch_fixed_date          =     X_Inv_Ind_Sch_Fixed_Date,
269        labor_sch_type                  =     X_Labor_Sch_Type,
270        non_labor_sch_type              =     X_Non_Labor_Sch_Type,
271        template_flag                   =     X_Template_Flag,
272        verification_date               =     X_Verification_Date,
273        created_from_project_id         =     X_Created_From_Project_Id,
274        template_start_date_active      =     X_Template_Start_Date,
275        template_end_date_active        =     X_Template_End_Date,
276 --added to remove bug#594567 :ashia Bagai 6-jan-98
280        Project_Currency_Code           =     X_Project_Currency_Code,
277 -- Commented for Bug 3605235
278        --wf_Status_Code		       =     X_Wf_Status_Code,
279 --end of addition to remove bug#594567
281        Allow_Cross_Charge_Flag         =     X_Allow_Cross_Charge_Flag,
282        Project_Rate_Date               =     X_Project_Rate_Date,
283        Project_Rate_Type               =     X_Project_Rate_Type,
284        Output_Tax_Code                 =     X_Output_Tax_Code,
285        Retention_Tax_Code              =     X_Retention_Tax_Code,
286        CC_Process_Labor_Flag           =     X_CC_Process_Labor_Flag,
287        Labor_Tp_Schedule_Id            =     X_Labor_Tp_Schedule_Id,
288        Labor_Tp_Fixed_Date             =     X_Labor_Tp_Fixed_Date,
289        CC_Process_NL_Flag              =     X_CC_Process_NL_Flag,
290        Nl_Tp_Schedule_Id               =     X_Nl_Tp_Schedule_Id,
291        Nl_Tp_Fixed_Date                =     X_Nl_Tp_Fixed_Date,
292        CC_Tax_Task_Id                  =     X_CC_Tax_Task_Id,
293        bill_job_group_id               =     X_bill_job_group_id,
294        cost_job_group_id               =     x_cost_job_group_id,
295        role_list_id                    =     x_role_list_id,
296        work_type_id                    =     x_work_type_id,
297        calendar_id                     =     x_calendar_id,
298        location_id                     =     x_location_id,
299        probability_member_id           =     x_probability_member_id,
300        project_value                   =     x_project_value,
301        expected_approval_date          =     x_expected_approval_date,
302        initial_team_template_id        =     x_team_template_id,
303        job_bill_rate_schedule_id       =     x_job_bill_rate_schedule_id,
304        emp_bill_rate_schedule_id       =     x_emp_bill_rate_schedule_id,
305 --MCA Sakthi for MultiAgreementCurreny Project
306        competence_match_wt             =     x_competence_match_wt,
307        availability_match_wt         =     x_availability_match_wt,
308        job_level_match_wt            =     x_job_level_match_wt,
309        enable_automated_search       =     x_enable_automated_search,
310        search_min_availability       =     x_search_min_availability,
311        search_org_hier_id            =     x_search_org_hier_id,
312        search_starting_org_id        =     x_search_starting_org_id,
313        search_country_code           =     x_search_country_code,
314        min_cand_score_reqd_for_nom   =     x_min_cand_score_reqd_for_nom,
315        non_lab_std_bill_rt_sch_id    =     x_non_lab_std_bill_rt_sch_id,
316        invproc_currency_type         =     x_invproc_currency_type,
317        revproc_currency_code         =     x_revproc_currency_code,
318        project_bil_rate_date_code    =     x_project_bil_rate_date_code,
319        project_bil_rate_type         =     x_project_bil_rate_type,
320        project_bil_rate_date         =     x_project_bil_rate_date,
321        project_bil_exchange_rate     =     x_project_bil_exchange_rate,
322        projfunc_currency_code        =     x_projfunc_currency_code,
323        projfunc_bil_rate_date_code   =     x_projfunc_bil_rate_date_code,
324        projfunc_bil_rate_type        =     x_projfunc_bil_rate_type,
325        projfunc_bil_rate_date        =     x_projfunc_bil_rate_date,
326        projfunc_bil_exchange_rate    =     x_projfunc_bil_exchange_rate,
327        funding_rate_date_code        =     x_funding_rate_date_code,
328        funding_rate_type             =     x_funding_rate_type,
329        funding_rate_date             =     x_funding_rate_date,
330        funding_exchange_rate         =     x_funding_exchange_rate,
331        baseline_funding_flag         =     x_baseline_funding_flag,
332        multi_currency_billing_flag   =     x_multi_currency_billing_flag,
333        inv_by_bill_trans_curr_flag   =     x_inv_by_bill_trans_curr_flag,
334        projfunc_cost_rate_type       =     x_projfunc_cost_rate_type,
335        projfunc_cost_rate_date       =     x_projfunc_cost_rate_date,
336 --MCA Sakthi for MultiAgreementCurrency Project
337 --MCA
338        assign_precedes_task      =     x_assign_precedes_task,
339 --Structure
340        split_cost_from_workplan_flag = x_split_cost_from_wokplan_flag,
341        split_cost_from_bill_flag     = x_split_cost_from_bill_flag,
342 --Structure
343 --Advertisement
344        adv_action_set_id             = x_adv_action_set_id,
345        start_adv_action_set_flag     = x_start_adv_action_set_flag,
346 --Advertisement
347 --Project Setup
348        priority_code                 = x_priority_code,
349 --Project Setup
350 --Retention
351        retn_billing_inv_format_id    = x_retn_billing_inv_format_id,
352        retn_accounting_flag          = x_retn_accounting_flag,
353 --Retention
354 -- anlee
355 -- patchset K changes
356        revaluate_funding_flag        = x_revaluate_funding_flag,
357        include_gains_losses_flag     = x_include_gains_losses_flag,
358        security_level              = x_security_level,
359        labor_disc_reason_code      = x_labor_disc_reason_code,
360        non_labor_disc_reason_code  = x_non_labor_disc_reason_code,
361 -- End of changes
362        record_version_number         = x_record_version_number,
363        btc_cost_base_rev_code      = x_btc_cost_base_rev_code,  /* Bug#2638968 */
364        revtrans_currency_type      = x_revtrans_currency_type, /* R12 - Bug 4363092 */
365 --PA L
366        asset_allocation_method     = x_asset_allocation_method,
367        capital_event_processing    = x_capital_event_processing,
368        cint_rate_sch_id            = x_cint_rate_sch_id,
369        cint_eligible_flag          = x_cint_eligible_flag,
370        cint_stop_date              = x_cint_stop_date,
371 --FP_M Changes. Tracking Bug 3279981
372        enable_top_task_customer_flag = x_en_top_task_customer_flag,
373        enable_top_task_inv_mth_flag = x_en_top_task_inv_mth_flag,
377        sys_program_flag  = x_sys_program_flag,
374        revenue_accrual_method = x_revenue_accrual_method,
375        invoice_method = x_invoice_method,
376        projfunc_attr_for_ar_flag = x_projfunc_attr_for_ar_flag,
378        allow_multi_program_rollup=x_allow_multi_program_rollup,
379        proj_req_res_format_id =x_proj_req_res_format_id,
380        proj_asgmt_res_format_id =x_proj_asgmt_res_format_id,
381        date_eff_funds_consumption = x_date_eff_funds_flag  -- Bug 5511353
382         /* Added for 12.2 Payroll billing ER  11847616 */
383       ,ar_rec_notify_flag   = x_ar_rec_notify_flag   -- 7508661 : EnC
384       ,auto_release_pwp_inv = x_auto_release_pwp_inv -- 7508661 : EnC
385        /* Added for 12.2 Payroll billing ER  11847616 */
386 
387        ,bill_labor_accrual  = x_bill_labor_accrual
388        ,  adj_on_std_inv     =   x_adj_inc_std_inv
389     WHERE rowid = X_Rowid;
390 
391     if (SQL%NOTFOUND) then
392       Raise NO_DATA_FOUND;
393     end if;
394 
395     -- anlee
396     -- Added for intermedia search
397     PA_PROJECT_CTX_SEARCH_PVT.UPDATE_ROW (
398      p_project_id           => x_project_id
399     ,p_template_flag        => x_template_flag
400     ,p_project_name         => x_name
401     ,p_project_number       => x_segment1
402     ,p_project_long_name    => x_long_name
403     ,p_project_description  => x_description
404     ,x_return_status        => l_return_status );
405     -- anlee end of changes
406 
407   END Update_Row;
408 
409   PROCEDURE Delete_Row(X_project_id NUMBER) IS
410 
411     CURSOR get_template_flag IS
412     SELECT template_flag
413     FROM PA_PROJECTS_ALL
414     WHERE project_id = x_project_id;
415 
416     l_template_flag VARCHAR2(1);
417     l_return_status VARCHAR2(1);
418   BEGIN
419 
420     -- anlee
421     -- Added for intermedia search
422     OPEN get_template_flag;
423     FETCH get_template_flag INTO l_template_flag;
424     CLOSE get_template_flag;
425 
426     PA_PROJECT_CTX_SEARCH_PVT.DELETE_ROW (
427      p_project_id           => x_project_id
428     ,p_template_flag        => l_template_flag
429     ,x_return_status        => l_return_status );
430     -- anlee end of changes
431 
432     DELETE FROM pa_projects
433     WHERE project_id = X_project_id;
434 
435     if (SQL%NOTFOUND) then
436       Raise NO_DATA_FOUND;
437     end if;
438 
439   END Delete_Row;
440 
441 
442 END PA_PROJECTS_PKG1;