1 Package ota_tpc_bus1 AUTHID CURRENT_USER as
2 /* $Header: ottpcrhi.pkh 120.0 2005/05/29 07:47:09 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |----------------------<chk_tp_measurement_type_id>-------------------------|
6 -- ----------------------------------------------------------------------------
7 -- {Start Of Comments}
8 --
9 -- Description:
10 -- Validates that the tp_measurement_type_id exists in ota_tp_measurement_types
11 -- and with the business_group_id, and the measure cost_level is not 'NONE'.
12 --
13 -- Prerequisites:
14 -- Both this parameter and the business_group_id are present.
15 --
16 -- In Parameters:
17 -- p_tp_measurement_type_id
18 -- p_business_group_id
19 --
20 -- Post Success:
21 -- Processing continues if the values are legal.
22 --
23 -- Post Failure:
24 -- If an error has occurred, an error message will be raised.
25 --
26 -- Developer Implementation Notes:
27 -- None
28 --
29 -- Access Status:
30 -- Internal Row Handler Use Only.
31 --
32 -- {End Of Comments}
33 -- ----------------------------------------------------------------------------
34 Procedure chk_tp_measurement_type_id
35 (p_tp_measurement_type_id in ota_training_plan_costs.tp_measurement_type_id%TYPE
36 ,p_business_group_id in ota_training_plan_costs.business_group_id%TYPE
37 );
38 -- ----------------------------------------------------------------------------
39 -- |----------------------<chk_training_plan_id>------------------------------|
40 -- ----------------------------------------------------------------------------
41 -- {Start Of Comments}
42 --
43 -- Description:
44 -- Validates that the training_plan_id exists in ota_training_plans
45 -- and with the business_group_id.
46 --
47 -- Prerequisites:
48 -- Both this parameter and the business_group_id are present.
49 --
50 -- In Parameters:
51 -- p_training_plan_id
52 -- p_business_group_id
53 --
54 -- Post Success:
55 -- Processing continues if the values are legal.
56 --
57 -- Post Failure:
58 -- If an error has occurred, an error message will be raised.
59 --
60 -- Developer Implementation Notes:
61 -- None
62 --
63 -- Access Status:
64 -- Internal Row Handler Use Only.
65 --
66 -- {End Of Comments}
67 -- ----------------------------------------------------------------------------
68 Procedure chk_training_plan_id
69 (p_training_plan_id in ota_training_plan_costs.training_plan_id%TYPE
70 ,p_business_group_id in ota_training_plan_costs.business_group_id%TYPE
71 );
72 -- ----------------------------------------------------------------------------
73 -- |----------------------<chk_booking_id>------------------------------------|
74 -- ----------------------------------------------------------------------------
75 -- {Start Of Comments}
76 --
77 -- Description:
78 -- Validates that the booking_id exists in ota_delegate_bookings
79 -- and with the business_group_id.
80 --
81 -- Prerequisites:
82 -- Both this parameter and the business_group_id are present.
83 --
84 -- In Parameters:
85 -- p_booking_id
86 -- p_business_group_id
87 --
88 -- Post Success:
89 -- Processing continues if the values are legal.
90 --
91 -- Post Failure:
92 -- If an error has occurred, an error message will be raised.
93 --
94 -- Developer Implementation Notes:
95 -- None
96 --
97 -- Access Status:
98 -- Internal Row Handler Use Only.
99 --
100 -- {End Of Comments}
101 -- ----------------------------------------------------------------------------
102 Procedure chk_booking_id
103 (p_booking_id in ota_training_plan_costs.booking_id%TYPE
104 ,p_business_group_id in ota_training_plan_costs.business_group_id%TYPE
105 );
106 -- ----------------------------------------------------------------------------
107 -- |----------------------<chk_booking_event>----------------------------------|
108 -- ----------------------------------------------------------------------------
109 -- {Start Of Comments}
110 --
111 -- Description:
112 -- A shared function to perform the common functions of chk_booking_id
113 -- and chk_event_id.
114 -- The values will first be checked by their respective chk_procedures.
115 -- Validates that the booking_id and event_id are valid for the given
116 -- cost_level of the measurement type.
117 --
118 -- Prerequisites:
119 -- Booking_id, event_id are present
120 -- chk_booking_id and chk_event id have been called before calling this
121 --
122 -- In Parameters:
123 -- p_booking_id
124 -- p_event_id
125 --
126 -- Post Success:
127 -- Processing continues if the values are legal.
128 --
129 -- Post Failure:
130 -- If an error has occurred, an error message will be raised.
131 --
132 -- Developer Implementation Notes:
133 -- None
134 --
135 -- Access Status:
136 -- Internal Row Handler Use Only.
137 --
138 -- {End Of Comments}
139 -- ----------------------------------------------------------------------------
140 Procedure chk_booking_event
141 (p_booking_id in ota_training_plan_costs.booking_id%TYPE
142 ,p_event_id in ota_training_plan_costs.event_id%TYPE
143 ,p_business_group_id in ota_training_plan_costs.business_group_id%TYPE
144 ,p_tp_measurement_type_id in ota_training_plan_costs.tp_measurement_type_id%TYPE
145 );
146 -- ----------------------------------------------------------------------------
147 -- |----------------------<chk_event_id>--------------------------------------|
148 -- ----------------------------------------------------------------------------
149 -- {Start Of Comments}
150 --
151 -- Description:
152 -- Validates that the event_id exists in ota_events
153 -- and with the business_group_id, and that the events start_date is
154 -- is before the training plans start date.
155 --
156 -- Prerequisites:
157 -- Both this parameter and the business_group_id are present.
158 --
159 -- In Parameters:
160 -- p_event_id
161 -- p_business_group_id
162 --
163 -- Post Success:
164 -- Processing continues if the values are legal.
165 --
166 -- Post Failure:
167 -- If an error has occurred, an error message will be raised.
168 --
169 -- Developer Implementation Notes:
170 -- None
171 --
172 -- Access Status:
173 -- Internal Row Handler Use Only.
174 --
175 -- {End Of Comments}
176 -- ----------------------------------------------------------------------------
177 Procedure chk_event_id
178 (p_event_id in ota_training_plan_costs.event_id%TYPE
179 ,p_business_group_id in ota_training_plan_costs.business_group_id%TYPE
180 ,p_training_plan_id in ota_training_plans.training_plan_id%TYPE
181 );
182 -- ----------------------------------------------------------------------------
183 -- |----------------------<chk_currency_value>---------------------------------|
184 -- ----------------------------------------------------------------------------
185 -- {Start Of Comments}
186 --
187 -- Description:
188 -- Validates that the currency_code exists in fnd_currencies, if present
189 -- and that it is present if the measure type is of type 'MONEY'. It also
190 -- shares the value field validation, as this also depends on the measure
191 -- UNIT setting, and may therefore need to be validated withe courency_code
192 -- if the measurement type is 'MONEY'
193 --
194 -- Prerequisites:
195 -- Parameter is present.
196 -- chk_tp_measurement_type_id has been called first.
197 --
198 -- In Parameters:
199 -- p_currency_code
200 -- p_object_version_number
201 -- p_training_plan_cost_id
202 -- p_object_version_number
203 -- p_value
204 --
205 -- Post Success:
206 -- Processing continues if the values are legal.
207 --
208 -- Post Failure:
209 -- If an error has occurred, an error message will be raised.
210 --
211 -- Developer Implementation Notes:
212 -- None
213 --
214 -- Access Status:
215 -- Internal Row Handler Use Only.
216 --
217 -- {End Of Comments}
218 -- ----------------------------------------------------------------------------
219 Procedure chk_currency_value
220 (p_currency_code in ota_training_plan_costs.currency_code%TYPE
221 ,p_training_plan_cost_id in ota_training_plan_costs.training_plan_cost_id%TYPE
222 ,p_object_version_number in ota_training_plan_costs.object_version_number%TYPE
223 ,p_business_group_id in ota_training_plan_costs.business_group_id%TYPE
224 ,p_amount in ota_training_plan_costs.amount%TYPE
225 ,p_tp_measurement_type_id in ota_training_plan_costs.tp_measurement_type_id%TYPE
226 );
227 -- ----------------------------------------------------------------------------
228 -- |----------------------<chk_unique>----------------------------------------|
229 -- ----------------------------------------------------------------------------
230 -- {Start Of Comments}
231 --
232 -- Description:
233 -- A shared function to perform the common functions of
234 -- chk_tp_measurement_type_id
235 -- chk_booking_id
236 -- chk_event_id
237 -- chk_training_plan_id.
238 -- The values will first be checked by their respective chk_procedures.
239 -- Validates that the column combination is unique
240 --
241 -- Prerequisites:
242 -- chk_ procedures listed above have already been called
243 --
244 -- In Parameters:
245 -- p_tp_measurement_type_id
246 -- p_booking_id
247 -- p_event_id
248 -- p_training_plan_id
249 --
250 -- Post Success:
251 -- Processing continues if the values are legal.
252 --
253 -- Post Failure:
254 -- If an error has occurred, an error message will be raised.
255 --
256 -- Developer Implementation Notes:
257 -- This may be called from a form to validate that the combination is unique.
258 -- Call only on insert, as all columns are non-updateable.
259 --
260 -- Access Status:
261 -- Internal Development Use Only.
262 --
263 -- {End Of Comments}
264 -- ----------------------------------------------------------------------------
265 Procedure chk_unique
266 (p_tp_measurement_type_id in ota_training_plan_costs.tp_measurement_type_id%TYPE
267 ,p_event_id in ota_training_plan_costs.event_id%TYPE
268 ,p_booking_id in ota_training_plan_costs.booking_id%TYPE
269 ,p_training_plan_id in ota_training_plan_costs.training_plan_id%TYPE
270 );
271 end ota_tpc_bus1;