DBA Data[Home] [Help]

PACKAGE: APPS.AHL_PRD_WO_LOGIN_PVT

Source


1 PACKAGE AHL_PRD_WO_LOGIN_PVT AUTHID CURRENT_USER AS
2 /* $Header: AHLVLGNS.pls 120.3.12020000.2 2012/12/10 13:47:16 shnatu ship $ */
3 
4 
5 
6 TYPE WO_REC_TYPE IS RECORD
7 (
8   workorder_id      NUMBER,
9   is_login_allowed VARCHAR2(1)
10 );
11 
12 TYPE WO_TBL_TYPE IS TABLE OF WO_REC_TYPE INDEX BY BINARY_INTEGER;
13 
14 TYPE OP_RES_REC_TYPE IS RECORD
15 (
16   operation_seq_num NUMBER,
17   resource_id      NUMBER,
18   is_login_allowed VARCHAR2(1)
19 );
20 
21 TYPE OP_RES_TBL_TYPE IS TABLE OF OP_RES_REC_TYPE INDEX BY BINARY_INTEGER;
22 
23 ----------------------------------------------------------------------------------------------------
24 --Wrapper procedure used by Technician workbench, Transit Technician and Data Clerk Search Wo UIs
25 --This procedure returns whether login is allowed for all all operations of a workorder passed.
26 ----------------------------------------------------------------------------------------------------
27 
28 PROCEDURE get_wo_login_info(
29                 p_function_name         IN VARCHAR2,
30                 p_employee_id           IN NUMBER,
31                 p_x_wos                 IN OUT NOCOPY  WO_TBL_TYPE
32 );
33 
34 ----------------------------------------------------------------------------------------------------
35 --Wrapper procedure used by Technician workbench, Transit Technician and Data Clerk Search Wo UIs
36 --This procedure returns whether login is allowed for all all operations of a workorder passed.
37 ----------------------------------------------------------------------------------------------------
38 
39 PROCEDURE get_op_res_login_info(
40                 p_workorder_id          IN NUMBER,
41                 p_employee_id           IN NUMBER,
42                 p_function_name         IN VARCHAR2,
43                 p_x_op_res              IN OUT NOCOPY  OP_RES_TBL_TYPE
44 );
45 
46 ---------------------------------------------------------------------------------------------
47 
48 -- Start of Comments --
49 --  Function name : Is_Login_Allowed
50 --
51 --  Parameters  :
52 --                  p_employee_id    --  Optional Input Employee Id.
53 --                  p_wip_entity_id   --  Mandatory Workorder ID.
54 --                  p_operation_seq_num -- Mandatory Operation Seq Number
55 --                  p_resource_seq_num  -- Mandatory Resource ID.
56 --                  p_fnd_function_name  -- Mandatory fnd_function to identify user role.
57 --
58 --  Description   : This function returns the number of hours transacted by an employee
59 --                  for a particular resource requirement and an operation if the user is
60 --                  has a role of a technician or line maintenance technician. It returns the
61 --                  number of hours transacted by all employees for a resource requirement
62 --                  within an operation if the user is a data clerk.
63 --
64 
65 
66 FUNCTION Is_Login_Allowed(p_employee_id       IN NUMBER := NULL,
67                           p_workorder_id      IN NUMBER,
68                           p_operation_seq_num IN NUMBER := NULL,
69                           p_resource_seq_num  IN NUMBER := NULL,
70                           p_resource_id       IN NUMBER := NULL,
71                           p_fnd_function_name IN VARCHAR2)
72 RETURN VARCHAR2;
73 ---------------------------------------------------------------------------------------------
74 
75 -- Start of Comments --
76 --  Procedure name : Workorder_Login
77 --
78 --  Parameters  :
79 --
80 --
81 --  Description : This API logs a technician onto a workorder or operation. If the
82 --                operation sequence number passed to the API is null, then the login
83 --                is done at the workorder level; if the resource sequence or resource ID is not
84 --                passed but the workorder and operation is passed, then the login is at operation level.
85 --                If resource details are passed, then login is at the operation and resource level.
86 --
87 --
88 PROCEDURE Workorder_Login(p_api_version       IN         NUMBER,
89                           p_init_msg_list     IN         VARCHAR2 := FND_API.G_FALSE,
90                           p_commit            IN         VARCHAR2 := FND_API.G_FALSE,
91                           p_validation_level  IN         NUMBER   := FND_API.G_VALID_LEVEL_FULL,
92                           p_module_type       IN         VARCHAR2 := NULL,
93                           x_return_status     OUT NOCOPY VARCHAR2,
94                           x_msg_count         OUT NOCOPY NUMBER,
95                           x_msg_data          OUT NOCOPY VARCHAR2,
96                           p_employee_num      IN         NUMBER   := NULL,
97                           p_employee_id       IN         NUMBER   := NULL,
98                           p_workorder_name    IN         VARCHAR2 := NULL,
99                           p_workorder_id      IN         NUMBER   := NULL,
100                           p_org_code          IN         VARCHAR2 := NULL,
101                           p_operation_seq_num IN         NUMBER   := NULL,
102                           p_resource_seq_num  IN         NUMBER   := NULL,
103                           p_resource_id       IN         NUMBER   := NULL);
104 
105 ---------------------------------------------------------------------------------------------
106 
107 -- Start of Comments --
108 --  Procedure name : Workorder_Logout
109 --
110 --  Parameters  :
111 --
112 --
113 --  Description   : This API logs a technician out of a workorder or operation.
114 --                  If the operation related parameters passed to the API are null,
115 --                  then the logout is done at the workorder level. If the operation
116 --                  related parameters are not null, then the login is done at the
117 --                  operation and resource level.At least one of employee number
118 --                  or employee id should be passed to the API. If the employee id is not null
119 --                  then the employee number is ignored. Also, at least one of workorder id or
120 --                  workorder name should be passed. If the workorder id is passed, the workorder
121 --                  name is ignored. Similarly, at least one of resource sequence number or
122 --                  resource id should be passed to the API. If the resource id is passed, then
123 --                  the resource sequence number is ignored.
124 --
125 --
126 
127 
128 PROCEDURE Workorder_Logout( p_api_version        IN         NUMBER,
129                             p_init_msg_list      IN         VARCHAR2 := FND_API.G_FALSE,
130                             p_commit             IN         VARCHAR2 := FND_API.G_FALSE,
131                             p_validation_level   IN         NUMBER   := FND_API.G_VALID_LEVEL_FULL,
132                             p_module_type        IN         VARCHAR2 := NULL,
133                             x_return_status      OUT NOCOPY VARCHAR2,
134                             x_msg_count          OUT NOCOPY NUMBER,
135                             x_msg_data           OUT NOCOPY VARCHAR2,
136                             p_employee_num       IN         NUMBER   := NULL,
137                             p_employee_id        IN         NUMBER   := NULL,
138                             p_workorder_name     IN         VARCHAR2 := NULL,
139                             p_workorder_id       IN         NUMBER   := NULL,
140                             p_org_code           IN         VARCHAR2 := NULL,
141                             p_operation_seq_num  IN         NUMBER   := NULL,
142                             p_resource_seq_num   IN         NUMBER   := NULL,
143                             p_resource_id        IN         NUMBER   := NULL);
144 
145 ---------------------------------------------------------------------------------------------
146 
147 
148 -- Start of Comments --
149 --  Function name : Get_User_Role
150 --
151 --  Parameters  :
152 --                  None
153 --
154 --  Description   : This function is used to retrieve the role associated with the current
155 --                  user - it could be a Production Tech, Production Data Clerk or
156 --                  Production Transit Tech.
157 --
158 
159 
160 FUNCTION Get_User_Role
161 RETURN VARCHAR2;
162 ---------------------------------------------------------------------------------------------
163 
164 
165 -- Start of Comments --
166 --  Function name : Get_Employee_ID
167 --
168 --  Parameters  :
169 --                  p_employee_number
170 --
171 --  Description   : This function is used to retrieve the employee ID given an employee number.
172 --                  If employee number is not passed in, then the logged in user's employee ID
173 --                  is returned. This function is a helper function for other APIs.
174 --
175 --
176 
177 FUNCTION Get_Employee_ID (p_Employee_Number  IN  VARCHAR2 := NULL)
178 RETURN VARCHAR2;
179 ---------------------------------------------------------------------------------------------
180 
181 
182 -- Start of Comments --
183 --  Function name : Get_Current_Emp_Login
184 --
185 --  Parameters  :
186 --                  p_employee_id    -  Optional Input Employee Id.
187 --                  x_return_status  -- Procedure return status.
188 --                  x_workorder_id   -- Workorder ID employee is logged into.
189 --                                      only valid id Employee logged into workorder.
190 --                  x_workorder_number -- Workorder Name.
191 --                  x_operation_seq_num -- Operation Seq Number
192 --                                      -- Only valid if Employee logged into an Operation-Resource.
193 --                  x_resource_id       -- Resource sequence employee is logged into.
194 --                  x_resource_seq_num  -- Resource Sequence number.
195 --
196 --  Description   : This procedure returns the workorder or operation the input employee ID
197 --                  is currently logged into. If input employee ID is null, then the values are
198 --                  retrieved for the currently logged in employee.
199 --
200 
201 
202 PROCEDURE Get_Current_Emp_Login (x_return_status     OUT NOCOPY VARCHAR2,
203                                  x_msg_data          OUT NOCOPY VARCHAR2,
204                                  x_msg_count         OUT NOCOPY NUMBER,
205                                  p_employee_id       IN NUMBER := NULL,
206                                  x_employee_name     OUT NOCOPY VARCHAR2,
207                                  x_workorder_id      OUT NOCOPY NUMBER,
208                                  x_workorder_number  OUT NOCOPY VARCHAR2,
209                                  x_operation_seq_num OUT NOCOPY NUMBER,
210                                  x_resource_id       OUT NOCOPY NUMBER,
211                                  x_resource_seq_num  OUT NOCOPY NUMBER);
212 
213 
214 ---------------------------------------------------------------------------------------------
215 
216 --------------------------------------------------------------------------------------------------
217 
218 -- Start of Comments --
219 --  Function name : Is_Login_Enabled
220 --
221 --  Parameters  :
222 --                  p_employee_id    --  Optional Input Employee Id.
223 --                  p_wip_entity_id   --  Mandatory Workorder ID.
224 --                  p_operation_seq_num -- Operation Seq Number
225 --                  p_resource_seq_num  -- Resource ID.
226 --                  p_fnd_function_name  -- fnd_function to identify user role.
227 --
228 --  Description   : This function returns whether user is allowed to login into a
229 --                  wrokorder/operation-resource
230 --
231 
232 
233 FUNCTION Is_Login_Enabled(p_employee_id       IN NUMBER := NULL,
234                           p_workorder_id      IN NUMBER,
235                           p_operation_seq_num IN NUMBER := NULL,
236                           p_resource_seq_num  IN NUMBER := NULL,
237                           p_resource_id       IN NUMBER := NULL,
238                           p_fnd_function_name IN VARCHAR2 := NULL)
239 RETURN VARCHAR2;
240 
241 ---------------------------------------------------------------------------------------------
242 
243 -- Start of Comments --
244 --  Function name : Is_Logout_Enabled
245 --
246 --  Parameters  :
247 --                  p_employee_id    --  Optional Input Employee Id.
248 --                  p_wip_entity_id   --  Mandatory Workorder ID.
249 --                  p_operation_seq_num -- Operation Seq Number
250 --                  p_resource_seq_num  -- Resource ID.
251 --                  p_fnd_function_name  -- fnd_function to identify user role.
252 --
253 --  Description   : This function returns whether user is allowed to logout into a
254 --                  wrokorder/operation-resource
255 --
256 
257 
258 FUNCTION Is_Logout_Enabled(p_employee_id       IN NUMBER := NULL,
259                           p_workorder_id      IN NUMBER,
260                           p_operation_seq_num IN NUMBER := NULL,
261                           p_resource_seq_num  IN NUMBER := NULL,
262                           p_resource_id       IN NUMBER := NULL,
263                           p_fnd_function_name IN VARCHAR2 := NULL)
264 RETURN VARCHAR2;
265 
266 
267 END AHL_PRD_WO_LOGIN_PVT;