1 PACKAGE IBY_TRXN_DOCUMENTS_PKG AUTHID CURRENT_USER AS
2 /* $Header: ibytxdcs.pls 120.4 2005/10/30 05:51:11 appldev noship $ */
3
4
5 /* FetchDocument constant indicating doc is being accessed read-only. */
6 C_FETCH_READONLY CONSTANT INTEGER := 0;
7 /* FetchDocument constant indicating doc is being accessed read-write. */
8 C_FETCH_READWRITE CONSTANT INTEGER := 1;
9
10 /*
11 * USE: Gets trxnmid based on (transaction id,trxntype id,status)
12 *
13 * ARGS:
14 * 1. transaction id of the trxn
15 * 2. trxn type (2 for auth, 3 for authcapture) of the trxn.
16 * 3. status of the trxn
17 *
18 * OUTS:
19 * 4. the trxnmid (master id) of the given trxn
20 */
21 PROCEDURE getTrxnMID
22 (
23 transactionid_in IN iby_trxn_summaries_all.transactionid%TYPE,
24 trxntypeid_in IN iby_trxn_summaries_all.trxntypeid%TYPE,
25 status_in IN iby_trxn_summaries_all.status%TYPE DEFAULT 0,
26 trxnmid_out OUT NOCOPY iby_trxn_summaries_all.trxnmid%TYPE
27 );
28
29 /*--------------*/
30 PROCEDURE getTrxnMIDFinancing
31 (
32 transactionid_in IN iby_trxn_summaries_all.transactionid%TYPE,
33 trxntypeid_in IN iby_trxn_summaries_all.trxntypeid%TYPE,
34 trxnmid_out OUT NOCOPY iby_trxn_summaries_all.trxnmid%TYPE
35 );
36 /*--------------*/
37
38 /*
39 * USE: Add an empty document based on the master trxn id of a trxn.
40 *
41 * ARGS:
42 * 1. the trxnmid (master id) of the given trxn
43 * 2. application-defined document type of the doc to create
44 */
45 PROCEDURE CreateDocument
46 (
47 trxnmid_in IN iby_trxn_summaries_all.trxnmid%TYPE,
48 doctype_in IN iby_trxn_documents.doctype%TYPE
49 );
50
51 /*
52 * USE: Add an empty document based on the master trxn id of a trxn
53 * and get the document id back.
54 * ARGS:
55 * 1. the trxnmid (master id) of the given trxn
56 * 2. application-defined document type of the doc to create
57 *
58 * OUTS:
59 * 3. the document id (primary key to the table).
60 */
61 PROCEDURE CreateDocument
62 (
63 trxnmid_in IN iby_trxn_summaries_all.trxnmid%TYPE,
64 doctype_in IN iby_trxn_documents.doctype%TYPE,
65 docid_out OUT NOCOPY iby_trxn_documents.trxn_document_id%TYPE
66 );
67
68
69 /*
70 * USE: Add an empty document based on the master trxn id of a trxn
71 * and get the document id back. If document already exists, do
72 * not throw an error, instead return existing doc id.
73 * ARGS:
74 * 1. the trxnmid (master id) of the given trxn
75 * 2. application-defined document type of the doc to create
76 *
77 * OUTS:
78 * 3. the document id (primary key to the table).
79 */
80 PROCEDURE CreateOrUpdateDocument
81 (
82 trxnmid_in IN iby_trxn_summaries_all.trxnmid%TYPE,
83 doctype_in IN iby_trxn_documents.doctype%TYPE,
84 docid_out OUT NOCOPY iby_trxn_documents.trxn_document_id%TYPE
85 );
86
87 /*
88 * USE: Add an empty document based on (transaction id, trxntype, status).
89 *
90 * ARGS:
91 * 1. transaction id of the trxn
92 * 2. trxn type (2 for auth, 3 for authcapture) of the trxn.
93 * 3. status of the trxn
94 * 4. application-defined document type of the doc to create
95 */
96 PROCEDURE CreateDocument
97 (
98 transactionid_in IN iby_trxn_summaries_all.transactionid%TYPE,
99 trxntypeid_in IN iby_trxn_summaries_all.trxntypeid%TYPE,
100 status_in IN iby_trxn_summaries_all.status%TYPE DEFAULT 0,
101 doctype_in IN iby_trxn_documents.doctype%TYPE
102 );
103
104 /*
105 * Retro-fit IBY_TRXN_DOCUMENTS for storing R12 FD extract -
106 * doctype is 100.
107 * TRXNMID is made nullable
108 * the doc will be associated with either IBY_TRXN_SUMMARIES_ALL
109 * or IBY_PAY_INSTRUCTIONS_ALL depending on the doctype.
110 * FZ 3/14/05
111 */
112 PROCEDURE CreateDocument
113 (
114 p_payment_instruction_id IN NUMBER,
115 p_doctype IN NUMBER,
116 p_doc IN CLOB,
117 docid_out OUT NOCOPY iby_trxn_documents.trxn_document_id%TYPE
118 );
119
120 /*
121 * USE: Delete a document based on the master trxn id of a trxn.
122 *
123 * ARGS:
124 * 1. the trxnmid (master id) of the given trxn
125 * 2. application-defined document type of the doc to delete
126 */
127 PROCEDURE DeleteDocument
128 (
129 trxnmid_in IN iby_trxn_summaries_all.trxnmid%TYPE,
130 doctype_in IN iby_trxn_documents.doctype%TYPE
131 );
132
133 /*
134 * USE: Delete a document based on based on (transaction id, trxntype, status)
135 *
136 * ARGS:
137 * 1. transaction id of the trxn
138 * 2. trxn type (2 for auth, 3 for authcapture) of the trxn.
139 * 3. status of the trxn
140 * 4. application-defined document type of the doc to delete
141 */
142 PROCEDURE DeleteDocument
143 (
144 transactionid_in IN iby_trxn_summaries_all.transactionid%TYPE,
145 trxntypeid_in IN iby_trxn_summaries_all.trxntypeid%TYPE,
146 status_in IN iby_trxn_summaries_all.status%TYPE DEFAULT 0,
147 doctype_in IN iby_trxn_documents.doctype%TYPE
148 );
149
150 /*
151 * USE: Fetch a document based on (trxnmid, doctype).
152 *
153 * ARGS:
154 * 1. the trxnmid (master id) of the given trxn
155 * 2. application-defined document type of the doc to delete
156 * 3. indicates whether the fetch is readonly or not;
157 * if set to constant C_FETCH_READWRITE the document's versioning
158 * info will be updated and a SELECT FOR UPDATE statement
159 * will be used to retrieve it.
160 * OUTS:
161 * 4. the document, which can be written to/appended.
162 */
163 PROCEDURE FetchDocument
164 (
165 trxnmid_in IN iby_trxn_summaries_all.trxnmid%TYPE,
166 doctype_in IN iby_trxn_documents.doctype%TYPE,
167 read_only_in IN INTEGER DEFAULT C_FETCH_READONLY,
168 document_out OUT NOCOPY iby_trxn_documents.document%TYPE
169 );
170
171 /*
172 * USE: Over-loaded version of the above fetch method.
173 *
174 * ARGS:
175 * 1. transaction id of the trxn
176 * 2. trxn type (2 for auth, 3 for authcapture) of the trxn.
177 * 3. status of the trxn
178 * 4. application-defined document type of the doc to delete
179 * 5. indicates whether the fetch is readonly or not;
180 * if set to constant C_FETCH_READWRITE the document's versioning
181 * info will be updated and a SELECT FOR UPDATE statement
182 * will be used to retrieve it.
183 * OUTS:
184 * 6. the document, which can be written to/appended.
185 */
186 PROCEDURE FetchDocument
187 (
188 transactionid_in IN iby_trxn_summaries_all.transactionid%TYPE,
189 trxntypeid_in IN iby_trxn_summaries_all.trxntypeid%TYPE,
190 status_in IN iby_trxn_summaries_all.status%TYPE DEFAULT 0,
191 doctype_in IN iby_trxn_documents.doctype%TYPE,
192 read_only_in IN INTEGER DEFAULT C_FETCH_READONLY,
193 document_out OUT NOCOPY iby_trxn_documents.document%TYPE
194 );
195
196 /*
197 * USE: Fetch a document based on (payment_instruction_id, doctype)
198 * for R12 Disbursement payment instruction
199 * frzhang 8/17/2005
200 *
201 * ARGS:
202 * 1. the payment_instruction_id
203 * 2. application-defined document type of the doc - 100
204 * 3. indicates whether the fetch is readonly or not;
205 * if set to constant C_FETCH_READWRITE the document's versioning
206 * info will be updated and a SELECT FOR UPDATE statement
207 * will be used to retrieve it.
208 * OUTS:
209 * 4. the document, which can be written to/appended.
210 */
211 PROCEDURE FetchDisbursementDocument
212 (
213 p_payment_instruction_id IN NUMBER,
214 p_doctype IN NUMBER,
215 read_only_in IN INTEGER DEFAULT C_FETCH_READONLY,
216 document_out OUT NOCOPY iby_trxn_documents.document%TYPE
217 );
218
219 END IBY_TRXN_DOCUMENTS_PKG;
220