DBA Data[Home] [Help]

PACKAGE BODY: APPS.PA_RPT_UTILS

Source


1 PACKAGE BODY PA_RPT_UTILS   AS
2 /* $Header: PARPUTLB.pls 115.2 99/09/30 14:20:13 porting shi $ */
3 
4 ----------------------------
5 --  PROCEDURES AND FUNCTIONS
6 --
7 --
8 --  1. Procedure Name:	DISCOVERER_INIT
9 --  	Usage:		Populates data in tables : PA_PROJ_RPT_ATTRIBS_TEMP
10 --                      Reads the profiles for the responsibility,
11 --                      and accordingly creates records.
12 Procedure DISCOVERER_INIT
13 IS
14 BEGIN
15 NULL;
16 END Discoverer_Init;
17 
18 -----------------------------------------------------------------------
19 -- 2.  Function Name:   PROJECT_RPT_CLASS
20 --     Usage:           Returns the Class_Code assigned to the project
21 --                      for the given Class_Category.
22 Function PROJECT_RPT_CLASS ( x_Project_ID Number,
23                              x_Class_Category Varchar2 )
24 Return Varchar2
25 IS
26 x_class_code PA_Class_Codes.Class_Code%type;
27 
28 Begin
29    Select P.Class_Code
30    Into   x_class_code
31    From   PA_Project_Classes P
32    Where  P.Project_id = x_Project_ID
33    And    P.Class_Category = x_Class_Category;
34 
35    Return x_class_code;
36 Exception
37    WHEN NO_DATA_FOUND Then
38 	Return Unassigned_txt;
39 End Project_Rpt_Class;
40 
41 ------------------------------------------------------------------------
42 -- 3.  Function Name:   PROJECT_RPT_KEYMEMBER
43 --     Usage:           Returns the Key member assigned to the project
44 --                      for the given Project Role Type.
45 Function PROJECT_RPT_KEYMEMBER ( x_Project_ID Number,
46                                  x_Project_Role_Type Varchar2 )
47 Return Varchar2
48 IS
49 x_person Per_People_F.Full_Name%type;
50 
51 Begin
52    Select P.Full_Name
53    Into   x_person
54    From
55           PER_People_F P,
56           PA_Project_Players PP
57    Where
58           P.Person_ID = PP.Person_ID
59    And    PP.Project_ID = x_Project_ID
60    And    PP.Project_Role_Type = x_Project_Role_Type
61    And    PP.Start_date_active <= PA_Start_Date
62    And    nvl(PP.End_date_active,PA_End_Date) >= PA_End_Date
63    And    rownum < 2;
64 
65    Return x_person;
66 Exception
67    WHEN NO_DATA_FOUND Then
68         Return Unassigned_txt;
69 End Project_Rpt_KeyMember;
70 -------------------------------------------------------------------------
71 -- 4.  Function Name:    GET_RPT_CLASS_CATEGORY
72 --     Usage:            Returns the reporting class category attributes
73 --                       Returns the corresponding value.
74 --     Parameters:       x_number = 1,2,or 3.
75 Function GET_RPT_CLASS_CATEGORY ( x_number Number )
76 Return Varchar2
77 IS
78 Begin
79    IF x_number = 1 then
80       Return Class_category1;
81    Elsif x_number = 2 then
82       Return Class_Category2;
83    Elsif x_number = 3 then
84       Return Class_category3;
85    Else Return Null;
86    End if;
87 
88 End Get_Rpt_Class_Category;
89 
90 -------------------------------------------------------------------------
91 -- 5.  Function Name:    GET_RPT_ROLE_TYPE
92 --     Usage:            Returns the reporting project role type attributes
93 --                       Returns the corresponding value.
94 --     Parameters:       x_number = 1,2,or 3.
95 Function GET_RPT_ROLE_TYPE ( x_number Number )
96 Return Varchar2
97 IS
98 Begin
99    IF x_number = 1 then
100       Return Role_type1;
101    Elsif x_number = 2 then
102       Return Role_type2;
103    Elsif x_number = 3 then
104       Return Role_type3;
105    Else Return Null;
106    End if;
107 
108 End Get_Rpt_Role_type;
109 
110 -------------------------------------------------------------------------
111 -- 6.  Function Name:    GET_RPT_BUDGET_TYPE
112 --     Usage:            Returns the reporting budget type attributes
113 --                       Returns the corresponding value.
114 --     PARAMETERS:       x_type = C: Cost R: Revenue
115 --                       x_number = 1 or 2.
116 Function GET_RPT_BUDGET_TYPE ( x_type varchar2,
117                              x_number Number )
118 Return Varchar2
119 IS
120 Begin
121    IF x_type = 'C' then
122       IF x_number = 1 then
123          Return Cost_Budget_typeCode1;
124       Elsif x_number = 2 then
125          Return Cost_Budget_TypeCode2;
126       Else Return NULL;
127       End if;
128    Elsif x_type = 'R' then
129       IF x_number = 1 then
130          Return Revenue_Budget_typeCode1;
131       Elsif x_number = 2 then
132          Return Revenue_Budget_TypeCode2;
133       Else Return NULL;
134       End if;
135    End if;
136 End Get_RPT_Budget_Type;
137 
138 -------------------------------------------------------------------------
139 Begin
140       cost_budget_typecode1 := fnd_profile.value('PA_RPT_BUDGET_TYPE1_COST');
141       cost_budget_typecode2 := fnd_profile.value('PA_RPT_BUDGET_TYPE2_COST');
142       revenue_budget_typecode1 := fnd_profile.value('PA_RPT_BUDGET_TYPE3_REV');
143       revenue_budget_typecode2 := fnd_profile.value('PA_RPT_BUDGET_TYPE4_REV');
144       role_type1 := fnd_profile.value('PA_RPT_PROJ_ROLE_TYPE1');
145       role_type2 := fnd_profile.value('PA_RPT_PROJ_ROLE_TYPE2');
146       role_type3 := fnd_profile.value('PA_RPT_PROJ_ROLE_TYPE3');
147       class_category1 := fnd_profile.value('PA_RPT_CLASS_CATEGORY1');
148       class_category2 := fnd_profile.value('PA_RPT_CLASS_CATEGORY2');
149       class_category3 := fnd_profile.value('PA_RPT_CLASS_CATEGORY3');
150       Unassigned_txt  := fnd_message.get_string('PA',
151                                                 'PA_BIS_PAPFPJCL_UNASSIGNED');
152 
153       Select Start_date, End_date
154       Into PA_Start_Date, PA_End_Date
155       From PA_Periods
156       Where Current_pa_period_flag = 'Y';
157 
158 END PA_RPT_UTILS;