1 PACKAGE BODY PAROUTINGX AS
2 /* $Header: PAXTRTEB.pls 120.1 2005/08/17 12:57:26 ramurthy noship $ */
3
4 PROCEDURE route_to_extension (
5 X_expenditure_id IN NUMBER
6 , X_incurred_by_person_id IN NUMBER
7 , X_expenditure_end_date IN DATE
8 , X_exp_class_code IN VARCHAR2
9 , X_previous_approver_person_id IN NUMBER DEFAULT NULL
10 , P_Timecard_Table IN Pa_Otc_Api.Timecard_Table DEFAULT PAROUTINGX.G_dummy
11 , P_Module IN VARCHAR2 DEFAULT NULL
12 , X_route_to_person_id OUT NOCOPY NUMBER )
13 IS
14
15 dummy NUMBER;
16
17 BEGIN
18
19 -- Initialize return variable
20 X_route_to_person_id := NULL;
21
22
23 -- The following is the default processing for determining the
24 -- route to person ID for online expenditures imported into PA
25 -- from PTE.
26
27 SELECT
28 a.supervisor_id
29 INTO
30 X_route_to_person_id
31 FROM
32 per_all_assignments_f a -- Bug 4525947
33 WHERE
34 a.person_id = nvl(X_previous_approver_person_id, X_incurred_by_person_id)
35 AND a.assignment_type IN ('E','C')
36 AND a.primary_flag = 'Y'
37 AND trunc(SYSDATE) BETWEEN a.effective_start_date /* Added trunc on sysdate for Bug2886344 */
38 AND a.effective_end_date;
39
40 /*Code changes for bug 1838001 */
41
42 IF X_Route_to_person_id IS NOT NULL THEN
43 SELECT 1 INTO dummy
44 FROM per_all_assignments_f b -- Bug 4525947
45 WHERE b.person_id= X_Route_to_person_id
46 AND b.assignment_type IN ('E','C')
47 AND b.primary_flag = 'Y'
48 AND trunc(SYSDATE) BETWEEN b.effective_start_date /* Added trunc on sysdate for Bug2886344 */
49 AND b.effective_end_date;
50 END IF;
51
52 /*Code changes ends for bug 1838001 */
53
54 EXCEPTION
55 -- Add your exception handling logic here
56 WHEN OTHERS THEN
57 NULL;
58
59 END route_to_extension;
60
61 END PAROUTINGX;