1 package body iby_bill_pkg as
2 /*$Header: ibybillb.pls 120.1 2004/12/15 16:48:12 syidner ship $*/
3
4 /*
5 ** Function: createBill
6 ** Purpose: creates a tangible in iby_bill table.
7 ** billacct, corresponds to the account number of the payer
8 ** with payee, billAmount is the amount of the bill,
9 ** billDtDue due date of the bill,
10 ** billRefInfo, reference information of the bill
11 ** Memo, some kind of note. CurDef, definition of the currency,
12 ** assings the id of the tangible to io_tangibleid.
13 */
14 procedure createBill(i_billId in iby_tangible.tangibleid%type,
15 i_billAmount in iby_tangible.amount%type,
16 i_billCurDef in iby_tangible.currencyNameCode%type,
17 i_billAcct in iby_tangible.acctno%type,
18 i_billRefInfo in iby_tangible.refinfo%type,
19 i_billMemo in iby_tangible.memo%type,
20 i_billOrderMedium IN iby_tangible.Order_Medium%TYPE,
21 i_billEftAuthMethod IN iby_tangible.Eft_Auth_Method%TYPE,
22 io_mtangibleid in out nocopy iby_tangible.Mtangibleid%type)
23 is
24 cursor c_getMtangibleid is
25 select iby_tangible_s.nextval
26 from dual;
27 begin
28 /*
29 ** close the cursor if it is already open.
30 */
31 if ( c_getMtangibleid%isopen ) then
32 close c_getMtangibleid;
33 end if;
34 /*
35 ** open the cursor. Get the tangible id.
36 */
37 open c_getMtangibleid;
38 fetch c_getMtangibleid into io_mtangibleid;
39 close c_getMtangibleid;
40 /*
41 ** insert tangible information in iby_bill table.
42 */
43 insert into iby_tangible( mtangibleId, tangibleid, amount,
44 currencyNameCode, acctno, refinfo, memo,issuedate,
45 Order_Medium, Eft_Auth_Method,
46 last_update_date, last_updated_by,
47 creation_date, created_by,
48 last_update_login, object_version_number)
49 values ( io_Mtangibleid, i_billId, i_billAmount, i_billCurDef,
50 i_billAcct, i_billRefInfo, i_billMemo, sysdate,
51 i_billOrderMedium, i_billEftAuthMethod,
52 sysdate, fnd_global.user_id,
53 sysdate, fnd_global.user_id,
54 fnd_global.login_id, 1);
55
56 end createBill;
57 /*
58 ** Function: modBill
59 ** Purpose: retrieves a tangible from iby_tangible table for a given mtangibleid.
60 ** billacct, corresponds to the account number of the payer
61 ** with payee, billAmount is the amount of the bill,
62 ** billRefInfo, reference information of the bill
63 ** Memo, note from biller. CurDef, definition of the currency,
64 */
65 procedure modBill( i_mtangibleid in iby_tangible.Mtangibleid%type,
66 i_billId in iby_tangible.tangibleid%type,
67 i_billAmount in iby_tangible.amount%type,
68 i_billCurDef in iby_tangible.currencyNameCode%type,
69 i_billAcct in iby_tangible.acctno%type,
70 i_billRefInfo in iby_tangible.refinfo%type,
71 i_billMemo in iby_tangible.memo%type,
72 i_billOrderMedium IN iby_tangible.Order_Medium%TYPE,
73 i_billEftAuthMethod IN iby_tangible.Eft_Auth_Method%TYPE)
74 is
75 begin
76 update iby_tangible
77 set amount = i_billAmount,
78 currencyNameCode = i_billCurDef,
79 acctno = i_billAcct,
80 refinfo = i_billRefInfo,
81 memo = i_billMemo,
82 Order_Medium = i_billOrderMedium,
83 Eft_Auth_Method = i_billEftAuthMethod,
84 last_update_date = sysdate,
85 last_updated_by = fnd_global.user_id,
86 last_update_login = fnd_global.login_id,
87 object_version_number = 1
88 where mtangibleId = i_mtangibleid
89 and tangibleId = i_billId;
90
91 /*
92 ** if no data found then raise an exception.
93 */
94 if ( sql%notfound ) then
95 raise_application_error(-20000, 'IBY_20530#', FALSE);
96 --raise_application_error(-20530, 'Id of the Tangible has not matched or Tangible not found ' , FALSE );
97 end if;
98
99
100 end modBill;
101 end iby_bill_pkg;