[Home] [Help]
PACKAGE BODY: APPS.IBY_PMT_AMOUNT_PKG
Source
1 package body iby_pmt_amount_pkg as
2 /*$Header: ibypmtab.pls 115.3 2002/11/19 21:38:08 jleybovi ship $*/
3
4 procedure eval_factor(i_payeeid varchar2,
5 i_amount in number,
6 o_score out nocopy integer)
7 is
8
9 l_not_found boolean;
10 l_score varchar2(10);
11 l_cnt integer;
12 l_payeeid varchar2(80);
13
14 cursor c_getfactor_config(ci_payeeid varchar2) is
15 select lower_limit, upper_limit, score
16 from iby_irf_pmt_amount
17 where ( ( payeeid is null and ci_payeeid is null ) or
18 payeeid = ci_payeeid)
19 order by seq;
20
21 begin
22
23
24 /*
25 ** check whether this payeeid has any entry in
26 ** for Payment Amount Table.
27 ** if not the set payeeid to null.
28 */
29
30 select count(1) into l_cnt
31 from iby_irf_pmt_amount
32 where payeeid = i_payeeid;
33
34 if ( l_cnt = 0 ) then
35 l_payeeid := null;
36 else
37 l_payeeid := i_payeeid;
38 end if;
39
40 l_not_found := true;
41
42 if ( c_getfactor_config%isopen ) then
43 close c_getfactor_config;
44 end if;
45
46 <<l_range_loop>>
47 for i in c_getfactor_config(l_payeeid) loop
48 if ( ( ( i.lower_limit = -1 ) or ( i.lower_limit <= i_amount ) )
49 and ( ( i.upper_limit = -1 ) or ( i_amount < i.upper_limit ) ) )
50 then
51 l_not_found := false;
52 l_score := i.score;
53 exit l_range_loop;
54 end if;
55 end loop l_range_loop;
56
57 if ( l_not_found ) then
58 raise_application_error(-20000, 'IBY_204231#');
59 end if;
60
61 o_score := iby_risk_scores_pkg.getScore(i_payeeid, l_score);
62
63 end eval_factor;
64
65 end iby_pmt_amount_pkg;
66