1: package body iby_accppmtmthd_pkg as
2: /*$Header: ibyacpmb.pls 115.7 2002/11/15 23:45:00 jleybovi ship $*/
3:
4: /*
5: ** Procedure: getMPayeeId
23: /*
24: ** Function: pmtMthdExists.
25: ** Purpose: Check if the specified payeeid and pmtmethod exists or not.
26: */
27: function pmtMthdExists(i_ecappid in iby_accppmtmthd.ecappid%type,
28: i_payeeid in iby_accppmtmthd.payeeid%type,
29: i_instrtype in iby_accttype.instrtype%type,
30: i_accttype in iby_accttype.accttype%type,
31: o_status out nocopy iby_accppmtmthd.status%type)
24: ** Function: pmtMthdExists.
25: ** Purpose: Check if the specified payeeid and pmtmethod exists or not.
26: */
27: function pmtMthdExists(i_ecappid in iby_accppmtmthd.ecappid%type,
28: i_payeeid in iby_accppmtmthd.payeeid%type,
29: i_instrtype in iby_accttype.instrtype%type,
30: i_accttype in iby_accttype.accttype%type,
31: o_status out nocopy iby_accppmtmthd.status%type)
32: return boolean
27: function pmtMthdExists(i_ecappid in iby_accppmtmthd.ecappid%type,
28: i_payeeid in iby_accppmtmthd.payeeid%type,
29: i_instrtype in iby_accttype.instrtype%type,
30: i_accttype in iby_accttype.accttype%type,
31: o_status out nocopy iby_accppmtmthd.status%type)
32: return boolean
33: is
34: l_flag boolean := false;
35: cursor c_pmtmthd (ci_ecappid in iby_accppmtmthd.ecappid%type,
31: o_status out nocopy iby_accppmtmthd.status%type)
32: return boolean
33: is
34: l_flag boolean := false;
35: cursor c_pmtmthd (ci_ecappid in iby_accppmtmthd.ecappid%type,
36: ci_payeeid in iby_accppmtmthd.payeeid%type,
37: ci_instrtype iby_accttype.instrtype%type,
38: ci_accttype iby_accttype.accttype%type)
39: is
32: return boolean
33: is
34: l_flag boolean := false;
35: cursor c_pmtmthd (ci_ecappid in iby_accppmtmthd.ecappid%type,
36: ci_payeeid in iby_accppmtmthd.payeeid%type,
37: ci_instrtype iby_accttype.instrtype%type,
38: ci_accttype iby_accttype.accttype%type)
39: is
40: SELECT status
37: ci_instrtype iby_accttype.instrtype%type,
38: ci_accttype iby_accttype.accttype%type)
39: is
40: SELECT status
41: FROM iby_accppmtmthd accp, iby_accttype acct
42: WHERE accp.payeeid = ci_payeeid
43: AND accp.ecappid = ci_ecappid
44: AND accp.accttypeid = acct.accttypeid
45: AND acct.instrtype = ci_instrtype
73: ** i_payeeid : id of the payee.
74: ** i_instrtype : type of the instrument. Ex, BANKACCT, CREDITCARD etc.
75: ** i_accttype : Type of the account. Example, Checking, SAVINGS, VISA, MATERCARD.
76: */
77: procedure createAccpPmtMthd(i_ecappid in iby_accppmtmthd.ecappid%type,
78: i_payeeid in iby_accppmtmthd.payeeid%type,
79: i_instrtype in iby_accttype.instrtype%type,
80: i_accttype in iby_accttype.accttype%type )
81: is
74: ** i_instrtype : type of the instrument. Ex, BANKACCT, CREDITCARD etc.
75: ** i_accttype : Type of the account. Example, Checking, SAVINGS, VISA, MATERCARD.
76: */
77: procedure createAccpPmtMthd(i_ecappid in iby_accppmtmthd.ecappid%type,
78: i_payeeid in iby_accppmtmthd.payeeid%type,
79: i_instrtype in iby_accttype.instrtype%type,
80: i_accttype in iby_accttype.accttype%type )
81: is
82:
80: i_accttype in iby_accttype.accttype%type )
81: is
82:
83: l_accttypeid iby_accttype.accttypeid%type;
84: l_mpayeeid iby_accppmtmthd.mpayeeid%type;
85: l_status iby_accppmtmthd.status%type;
86:
87: begin
88:
81: is
82:
83: l_accttypeid iby_accttype.accttypeid%type;
84: l_mpayeeid iby_accppmtmthd.mpayeeid%type;
85: l_status iby_accppmtmthd.status%type;
86:
87: begin
88:
89: -- check to make sure input ecappid is valid
103: -- already added
104: raise_application_error(-20000, 'IBY_20500#', FALSE);
105: --raise_application_error(-20500, 'Accepted Pmt Mthd Already Exists.', FALSE);
106: else
107: UPDATE iby_accppmtmthd
108: SET status = 1,
109: last_update_date = sysdate,
110: last_updated_by = fnd_global.user_id,
111: last_update_login = fnd_global.login_id
122: -- brand new, add it in
123: -- create an acct type as needed
124: iby_accttype_pkg.createAccttype(i_accttype, i_instrtype,
125: l_accttypeid);
126: INSERT INTO iby_accppmtmthd ( ecappid, mpayeeid, payeeid,
127: accttypeid, status,
128: last_update_date, last_updated_by,
129: creation_date, created_by,
130: last_update_login, object_version_number)
146: ** i_payeeid : id of the payee.
147: ** i_instrtype : type of the instrument. Ex, BANKACCT, CREDITCARD etc.
148: ** i_accttype : Type of the account. Example, Checking, SAVINGS, VISA, MATERCARD.
149: */
150: procedure deleteAccpPmtMthd(i_ecappid iby_accppmtmthd.ecappid%type,
151: i_payeeid iby_accppmtmthd.payeeid%type,
152: i_instrtype iby_accttype.instrtype%type,
153: i_accttype iby_accttype.accttype%type)
154: is
147: ** i_instrtype : type of the instrument. Ex, BANKACCT, CREDITCARD etc.
148: ** i_accttype : Type of the account. Example, Checking, SAVINGS, VISA, MATERCARD.
149: */
150: procedure deleteAccpPmtMthd(i_ecappid iby_accppmtmthd.ecappid%type,
151: i_payeeid iby_accppmtmthd.payeeid%type,
152: i_instrtype iby_accttype.instrtype%type,
153: i_accttype iby_accttype.accttype%type)
154: is
155: begin
153: i_accttype iby_accttype.accttype%type)
154: is
155: begin
156: /*
157: ** Update the iby_accppmtmthd table to mark the row as inactive.
158: ** If there are no rows present, then raise an exception.
159: */
160: UPDATE iby_accppmtmthd
161: SET status = 0,
156: /*
157: ** Update the iby_accppmtmthd table to mark the row as inactive.
158: ** If there are no rows present, then raise an exception.
159: */
160: UPDATE iby_accppmtmthd
161: SET status = 0,
162: last_update_date = sysdate,
163: last_updated_by = fnd_global.user_id,
164: last_update_login = fnd_global.login_id
179:
180: end if;
181: commit;
182: end;
183: end iby_accppmtmthd_pkg;