1 Package pay_rom_bus as
2 /* $Header: pyromrhi.pkh 120.0 2005/05/29 08:24:02 appldev noship $ */
3 --
4 -- ---------------------------------------------------------------------------
5 -- |----------------------< set_security_group_id >--------------------------|
6 -- ---------------------------------------------------------------------------
7 -- {Start Of Comments}
8 --
9 -- Description:
10 -- Sets the security_group_id in CLIENT_INFO for the appropriate business
11 -- group context.
12 -- It is only valid to call this procedure when the primary key
13 -- is within a buisiness group context.
14 --
15 -- Prerequisites:
16 -- The primary key identified by p_run_type_org_method_id
17 -- already exists.
18 --
19 -- In Arguments:
20 -- p_run_type_org_method_id
21 --
22 --
23 -- Post Success:
24 -- The security_group_id will be set in CLIENT_INFO.
25 --
26 -- Post Failure:
27 -- An error is raised if the value does not exist.
28 -- An error is also raised when the primary key data is outside
29 -- of a buisiness group context.
30 --
31 -- Access Status:
32 -- Internal Development Use Only.
33 --
34 -- {End Of Comments}
35 -- ---------------------------------------------------------------------------
36 procedure set_security_group_id
37 (p_run_type_org_method_id in number
38 );
39 --
40 --
41 -- ---------------------------------------------------------------------------
42 -- |---------------------< return_legislation_code >-------------------------|
43 -- ---------------------------------------------------------------------------
44 -- {Start Of Comments}
45 --
46 -- Description:
47 -- Return the legislation code for a specific primary key value
48 --
49 -- Prerequisites:
50 -- The primary key identified by p_run_type_org_method_id
51 -- already exists.
52 --
53 -- In Arguments:
54 -- p_run_type_org_method_id
55 --
56 --
57 -- Post Success:
58 -- The business group's legislation code will be returned.
59 --
60 -- Post Failure:
61 -- An error is raised if the value does not exist.
62 --
63 -- Access Status:
64 -- Internal Development Use Only.
65 --
66 -- {End Of Comments}
67 -- ---------------------------------------------------------------------------
68 FUNCTION return_legislation_code
69 (p_run_type_org_method_id in number
70 ) RETURN varchar2;
71 --
72 -- ---------------------------------------------------------------------------
73 -- |--------------------------< chk_run_type_id >----------------------------|
74 -- ---------------------------------------------------------------------------
75 --
76 -- Description:
77 -- Checks the validity of the run_type_id enterend by carrying out
78 -- the following:
79 -- - check that the run_type_id exists
80 -- - check that the following rules apply:
81 --
82 -- Mode Run Type Available Components Resulting method
83 -- ------ ----------- ------------------------------- ---------------
84 -- USER USER USER, STARTUP, GENERIC USER
85 -- USER STARTUP USER, STARTUP, GENERIC USER
86 -- USER GENERIC USER, STARTUP, GENERIC USER
87 -- STARTUP USER This mode cannot access USER Error
88 -- run types
89 -- STARTUP STARTUP STARTUP, GENERIC STARTUP
90 -- STARTUP GENERIC STARTUP, GENERIC STARTUP
91 -- GENERIC USER This mode cannot access USER Error
92 -- run types
93 -- GENERIC STARTUP This mode cannot access STARTUP Error
94 -- run types
95 -- GENERIC GENERIC GENERIC GENERIC
96 --
97 -- Pre-conditions:
98 -- None
99 --
100 -- In Arguments:
101 -- p_run_type_org_method_id
102 -- p_run_type_id
103 -- p_effective_date
104 -- p_business_group_id
105 -- p_legislation_code
106 --
107 -- Post Success:
108 -- If the run_type_id is valid then processing continues
109 --
110 -- Post Failure:
111 -- If any of the following cases are true then an application error will be
112 -- raised and processing is terminated:
113 --
114 -- a) run_type_id does not exist
115 --
116 -- Access Status:
117 -- Internal Row Handler Use Only.
118 --
119 -- ---------------------------------------------------------------------------
120 PROCEDURE chk_run_type_id
121 (p_run_type_org_method_id in number
122 ,p_run_type_id in number
123 ,p_effective_date in date
124 ,p_business_group_id in number
125 ,p_legislation_code in varchar2);
126 --
127 -- ---------------------------------------------------------------------------
128 -- |---------------------< chk_org_payment_method_id >-----------------------|
129 -- ---------------------------------------------------------------------------
130 --
131 -- Description:
132 -- Checks the validity of the org_payment_method_id entered by carrying out
133 -- the following:
134 -- - check that the org_payment_method_id exists
135 -- - check that the following rules apply:
136 --
137 -- Mode Org Pay. Method Available Components Resulting usage
138 -- ------ --------------- ----------------------------- ---------------
139 -- USER USER USER, STARTUP, GENERIC USER
140 -- STARTUP USER This mode cannot access USER Error
141 -- GENERIC USER This mode cannot access USER Error
142 --
143 -- NB. Only USER defined organization payment methods exist.
144 --
145 -- Pre-conditions:
146 -- None
147 --
148 -- In Arguments:
149 -- p_run_type_org_method_id
150 -- p_org_payment_method_id
151 -- p_effective_date
152 -- p_business_group_id
153 --
154 -- Post Success:
155 -- If the org_payment_method_id is valid then processing continues
156 --
157 -- Post Failure:
158 -- If any of the following cases are true then an application error will be
159 -- raised and processing is terminated:
160 --
161 -- a) org_payment_method_id does not exist
162 -- b) Either STARTUP or GENERIC mode is used.
163 --
164 -- Access Status:
165 -- Internal Row Handler Use Only.
166 --
167 -- ---------------------------------------------------------------------------
168 PROCEDURE chk_org_payment_method_id
169 (p_run_type_org_method_id in number
170 ,p_org_payment_method_id in number
171 ,p_effective_date in date
172 ,p_business_group_id in number);
173 --
174 -- ---------------------------------------------------------------------------
175 -- |---------------------------< chk_priority >----------------------------|
176 -- ---------------------------------------------------------------------------
177 --
178 -- Description:
179 -- Checks the validity of the priority enterend by carrying out the
180 -- following:
181 -- - check that the priority is unique for a particular run_type/
182 -- org_payment_method combination
183 -- - check that the priority is between 1 and 99
184 --
185 -- Pre-conditions:
186 -- None
187 --
188 -- In Arguments:
189 -- p_run_type_org_method_id
190 -- p_org_payment_method_id
191 -- p_run_type_id
192 -- p_priority
193 -- p_business_group_id
194 -- p_legislation_code
195 -- p_validation_start_date
196 -- p_validation_end_date
197 --
198 -- Post Success:
199 -- If the priority is valid then processing continues
200 --
201 -- Post Failure:
202 -- If any of the following cases are true then an application error will be
203 -- raised and processing is terminated:
204 --
205 -- a) it is not unique
206 -- b) it is not between 1 and 99
207 --
208 -- Access Status:
209 -- Internal Row Handler Use Only.
210 --
211 -- ---------------------------------------------------------------------------
212 PROCEDURE chk_priority
213 (p_run_type_org_method_id in number
214 ,p_org_payment_method_id in number
215 ,p_run_type_id in number
216 ,p_priority in number
217 ,p_business_group_id in number
218 ,p_legislation_code in varchar2
219 ,p_validation_start_date in date
220 ,p_validation_end_date in date);
221 --
222 -- ---------------------------------------------------------------------------
223 -- |-----------------------< chk_amount_percent >--------------------------|
224 -- ---------------------------------------------------------------------------
225 --
226 -- Description:
227 -- Checks the validity of the amount and percent enterend by carrying out
228 -- the following:
229 -- - check amount is >0
230 -- - check that only one of amount and percent are null
231 -- - if amount is not null check it has the correct money format
232 -- - if percent is not null check it has the correct format with 2 decimal
233 -- places
234 --
235 -- Pre-conditions:
236 -- None
237 --
238 -- In Arguments:
239 -- p_percent
240 -- p_amount
241 -- p_org_payment_method_id
242 --
243 -- Post Success:
244 -- If amount and percent are valid then processing continues
245 --
246 -- Post Failure:
247 -- If either percent or amount are invalid then an application error will be
248 -- raised and processing is terminated:
249 --
250 --
251 -- Access Status:
252 -- Internal Row Handler Use Only.
253 --
254 -- ---------------------------------------------------------------------------
255 PROCEDURE chk_percent_amount
256 (p_percent in number
257 ,p_amount in number
258 ,p_org_payment_method_id in number);
259 --
260 -- ---------------------------------------------------------------------------
261 -- |--------------------------< chk_bg_leg_code >----------------------------|
262 -- ---------------------------------------------------------------------------
263 --
264 -- Description:
265 -- Checks the validity of the business_group_id and legislation code entered
266 -- by enforcing the following:
267 --
268 -- Mode Business Group ID Legislation Code
269 -- ------------- -------------------- ------------------------------
270 -- USER NOT NULL NULL
271 -- STARTUP NULL NOT NULL
272 -- GENERIC NULL NULL
273 --
274 -- Pre-conditions:
275 -- None
276 --
277 -- In Arguments:
278 -- p_business_group_id
279 -- p_legislation_code
280 --
281 -- Post Success:
282 -- If the combination is valid then processing continues
283 --
284 -- Post Failure:
285 -- If any of the following cases are true then an application error will be
286 -- raised and processing is terminated:
287 --
288 -- a) Combination of business_group_id and legislation_code is anything other
289 -- than detailed above.
290 --
291 -- Access Status:
292 -- Internal Row Handler Use Only.
293 --
294 -- ---------------------------------------------------------------------------
295 PROCEDURE chk_bg_leg_code
296 (p_business_group_id in number
297 ,p_legislation_code in varchar2);
298 --
299 -- ----------------------------------------------------------------------------
300 -- |---------------------------< insert_validate >----------------------------|
301 -- ----------------------------------------------------------------------------
302 -- {Start Of Comments}
303 --
304 -- Description:
305 -- This procedure controls the execution of all insert business rules
306 -- validation.
307 --
308 -- Prerequisites:
309 -- This private procedure is called from ins procedure.
310 --
311 -- In Parameters:
312 -- A Pl/Sql record structre.
313 --
314 -- Post Success:
315 -- Processing continues.
316 --
317 -- Post Failure:
318 -- If a business rules fails the error will not be handled by this procedure
319 -- unless explicity coded.
320 --
321 -- Developer Implementation Notes:
322 -- For insert, your business rules should be executed from this procedure and
323 -- should ideally (unless really necessary) just be straight procedure or
324 -- function calls. Try and avoid using conditional branching logic.
325 --
326 -- Access Status:
327 -- Internal Row Handler Use Only.
328 --
329 -- {End Of Comments}
330 -- ----------------------------------------------------------------------------
331 Procedure insert_validate
332 (p_rec in pay_rom_shd.g_rec_type
333 ,p_effective_date in date
334 ,p_datetrack_mode in varchar2
335 ,p_validation_start_date in date
336 ,p_validation_end_date in date
337 );
338 --
339 -- ----------------------------------------------------------------------------
340 -- |---------------------------< update_validate >----------------------------|
341 -- ----------------------------------------------------------------------------
342 -- {Start Of Comments}
343 --
344 -- Description:
345 -- This procedure controls the execution of all update business rules
346 -- validation.
347 --
348 -- Prerequisites:
349 -- This private procedure is called from upd procedure.
350 --
351 -- In Parameters:
352 -- A Pl/Sql record structre.
353 --
354 -- Post Success:
355 -- Processing continues.
356 --
357 -- Post Failure:
358 -- If a business rules fails the error will not be handled by this procedure
359 -- unless explicity coded.
360 --
361 -- Developer Implementation Notes:
362 -- For update, your business rules should be executed from this procedure and
363 -- should ideally (unless really necessary) just be straight procedure or
364 -- function calls. Try and avoid using conditional branching logic.
365 --
366 -- Access Status:
367 -- Internal Row Handler Use Only.
368 --
369 -- {End Of Comments}
370 -- ----------------------------------------------------------------------------
371 Procedure update_validate
372 (p_rec in pay_rom_shd.g_rec_type
373 ,p_effective_date in date
374 ,p_datetrack_mode in varchar2
375 ,p_validation_start_date in date
376 ,p_validation_end_date in date
377 );
378 --
379 -- ----------------------------------------------------------------------------
380 -- |---------------------------< delete_validate >----------------------------|
381 -- ----------------------------------------------------------------------------
382 -- {Start Of Comments}
383 --
384 -- Description:
385 -- This procedure controls the execution of all delete business rules
386 -- validation.
387 --
388 -- Prerequisites:
389 -- This private procedure is called from del procedure.
390 --
391 -- In Parameters:
392 -- A Pl/Sql record structure.
393 --
394 -- Post Success:
395 -- Processing continues.
396 --
397 -- Post Failure:
398 -- If a business rules fails the error will not be handled by this procedure
399 -- unless explicity coded.
400 --
401 -- Developer Implementation Notes:
402 -- For delete, your business rules should be executed from this procedure and
403 -- should ideally (unless really necessary) just be straight procedure or
404 -- function calls. Try and avoid using conditional branching logic.
405 --
406 -- Access Status:
407 -- Internal Row Handler Use Only.
408 --
409 -- {End Of Comments}
410 -- ----------------------------------------------------------------------------
411 Procedure delete_validate
412 (p_rec in pay_rom_shd.g_rec_type
416 ,p_validation_end_date in date
413 ,p_effective_date in date
414 ,p_datetrack_mode in varchar2
415 ,p_validation_start_date in date
417 );
418 --
419 end pay_rom_bus;