1 PACKAGE AHL_VWP_TIMES_PVT AS
2 /* $Header: AHLVTMSS.pls 120.2 2007/12/31 10:34:28 rnahata ship $ */
3
4 -------------------------------------------------------------------
5 -- Procedure name : Calculate_Task_Times
6 -- Type : Private
7 -- Function : Derive the start and end times/hours of tasks
8 -- and the end_date_time of the visit
9 -- Parameters :
10 --
11 -- Standard OUT Parameters :
12 -- x_return_status OUT VARCHAR2 Required
13 -- x_msg_count OUT NUMBER Required
14 -- x_msg_data OUT VARCHAR2 Required
15 --
16 -- Derive_Visit_Task_Times Parameters:
17 -- p_visit_id IN NUMBER Required
18 -- The id of the visit whose associated tasks' start and end times or hours
19 -- need to be derived
20 -- Version :
21 -- Initial Version 1.0
22 --
23 -------------------------------------------------------------------
24 PROCEDURE Calculate_Task_Times
25 (
26 p_api_version IN NUMBER,
27 p_init_msg_list IN VARCHAR2 := Fnd_Api.G_FALSE,
28 p_commit IN VARCHAR2 := Fnd_Api.G_FALSE,
29 p_validation_level IN NUMBER := Fnd_Api.G_VALID_LEVEL_FULL,
30 x_return_status OUT NOCOPY VARCHAR2,
31 x_msg_count OUT NOCOPY NUMBER,
32 x_msg_data OUT NOCOPY VARCHAR2,
33 p_visit_id IN NUMBER);
34
35 -------------------------------------------------------------------
36 -- Procedure name : Calculate_Task_Times_For_Dept
37 -- Type : Private
38 -- Function : Recalculate all Visits for Dept for Task Times
39 -- Parameters :
40 --
41 -- Standard OUT Parameters :
42 -- x_return_status OUT VARCHAR2 Required
43 -- x_msg_count OUT NUMBER Required
44 -- x_msg_data OUT VARCHAR2 Required
45 --
46 -- Derive_Visit_Task_Times Parameters:
47 -- p_dept_id IN NUMBER Required
48 -- The dept id which need to have all its visits recalculated.
49 -- Need to be called from concurrent program due to performance issues.
50 --
51 -------------------------------------------------------------------
52 PROCEDURE Calculate_Task_Times_For_Dept
53 (
54 p_api_version IN NUMBER,
55 p_init_msg_list IN VARCHAR2 := Fnd_Api.G_FALSE,
56 p_commit IN VARCHAR2 := Fnd_Api.G_FALSE,
57 p_validation_level IN NUMBER := Fnd_Api.G_VALID_LEVEL_FULL,
58 x_return_status OUT NOCOPY VARCHAR2,
59 x_msg_count OUT NOCOPY NUMBER,
60 x_msg_data OUT NOCOPY VARCHAR2,
61 p_dept_id IN NUMBER);
62
63 --------------------------------------------------------------------
64 -- Procedure name : Adjust_task_times
65 -- Type : Private
66 -- Purpose : Adjusts tasks times and all dependent task times
67 -- Parameters :
68 --
69 -- Standard OUT Parameters :
70 -- x_return_status OUT VARCHAR2 Required,
71 --
72 -- Validate_bef_Times_Derive IN Parameters :
73 -- p_task_id IN NUMBER Required
74 --
75 -- Version :
76 -- Initial Version 1.0
77 --
78 --------------------------------------------------------------------
79 PROCEDURE Adjust_Task_Times
80 (
81 p_api_version IN NUMBER,
82 p_init_msg_list IN VARCHAR2 := Fnd_Api.G_FALSE,
83 p_commit IN VARCHAR2 := Fnd_Api.G_FALSE,
84 p_validation_level IN NUMBER := Fnd_Api.G_VALID_LEVEL_FULL,
85 x_return_status OUT NOCOPY VARCHAR2,
86 x_msg_count OUT NOCOPY NUMBER,
87 x_msg_data OUT NOCOPY VARCHAR2,
88 p_task_id IN NUMBER,
89 p_reset_sysdate_flag IN VARCHAR2 := FND_API.G_FALSE);
90
91 --------------------------------------------------------------------
92 -- Function name : Get_Visit_Start_Time
93 -- Type : Public
94 -- Purpose : Fetches Master Work Order Actual Start Date if the
95 -- Visit is Closed, else returns the Visit Start Date.
96 -- Parameters :
97 -- p_visit_id Visit ID to fetch the data
98 --
99 --------------------------------------------------------------------
100 function Get_Visit_Start_Time(
101 p_visit_id IN NUMBER
102 )
103 RETURN DATE;
104
105 --------------------------------------------------------------------
106 -- Function name : Get_Visit_End_Time
107 -- Type : Public
108 -- Purpose : To RETURN the End Date for the visit.
109 -- For Unit Affectivity API it returns
110 -- Master Work Order Actual End Date when visit is Closed
111 -- and NVL(Visit Close Date,Max(Task End Times))
112 -- For VWP it returns
113 -- Max(Task End Times) when Visit is in Planning
114 -- Max(Max(WO Released Job Completion Date),Max(Task End Times))
115
116 -- Parameters :
117 -- p_visit_id Visit ID to fetch the data
118 -- p_use_actual This is a boolean value equal to FND_API.G_TRUE or FND_API.G_FALSE
119 --
120 --------------------------------------------------------------------
121 function Get_Visit_End_Time(
122 p_visit_id IN NUMBER,
123 p_use_actuals IN VARCHAR2 := FND_API.G_TRUE
124 )
125 RETURN DATE;
126
127 -----------------------------------------------------------
128 --Convert date+duration and department into end date/time
129 ---------------------------------------------------------
130 FUNCTION Compute_Date(
131 p_start_date date,
132 p_dept_id number,
133 p_duration number := 0)
134 RETURN DATE;
135
136 --------------------------------------------------------------------
137 -- Function name : Get_task_duration
138 -- Type : Public
139 -- Purpose : To return the total duration of the task
140 -- based on the resource requirements.
141 -- Parameters :
142 -- p_vst_task_qty : Visit task quantity
143 -- p_route_id : Route id
144 --
145 -- 06/Jul/2007 Initial Version Sowmya B6182718
146 --
147 -- For Internal use only. The function is used in visit task time
148 -- calculation.
149 --------------------------------------------------------------------
150
151 Function Get_task_duration(
152 p_vst_task_qty IN NUMBER,
153 p_route_id IN NUMBER
154 )
155 RETURN NUMBER;
156
157 END AHL_VWP_TIMES_PVT;