DBA Data[Home] [Help]

PACKAGE: APPS.IBY_BUILD_UTILS_PKG

Source


1 PACKAGE IBY_BUILD_UTILS_PKG AS
2 /*$Header: ibybluts.pls 120.12.12010000.1 2008/07/28 05:39:40 appldev ship $*/
3 
4  --
5  -- Payment profile record
6  --
7  TYPE pmtProfRecType IS RECORD (
8      profile_id   IBY_DOCS_PAYABLE_ALL.payment_profile_id%TYPE
9      );
10 
11  --
12  -- Payment profiles table
13  --
14  TYPE pmtProfTabType IS TABLE OF pmtProfRecType
15      INDEX BY BINARY_INTEGER;
16 
17  --
18  -- Utility record to map a payment profile id on a payment instruction
19  -- to a payment profile code on instr creation rules record.
20  --
21  -- Multiple payment profile ids can be mapped to the same payment
22  -- profile code.
23  --
24  TYPE profileIdToCodeMap IS RECORD (
25      pmt_profile_id     IBY_PAYMENT_PROFILES.payment_profile_id%TYPE,
26      pmt_profile_cd     IBY_PAYMENT_PROFILES.system_profile_code%TYPE
27      );
28 
29  --
30  -- Table of payment profile code maps.
31  --
32  TYPE profileIdToCodeMapTabType IS TABLE OF profileIdToCodeMap
33      INDEX BY BINARY_INTEGER;
34 
35 
36 /*--------------------------------------------------------------------
37  | NAME:
38  |     print_debuginfo
39  |
40  | PURPOSE:
41  |
42  |
43  | PARAMETERS:
44  |     IN
45  |
46  |
47  |     OUT
48  |
49  |
50  | RETURNS:
51  |
52  | NOTES:
53  |
54  *---------------------------------------------------------------------*/
55  PROCEDURE print_debuginfo(p_module IN VARCHAR2,
56      p_debug_text  IN VARCHAR2,
57      p_debug_level IN VARCHAR2  DEFAULT FND_LOG.LEVEL_STATEMENT
58      );
59 
60 /*--------------------------------------------------------------------
61  | NAME:
62  |     printXMLClob
63  |
64  | PURPOSE:
65  |     Prints out the XML data contained within the given clob; to be
66  |     used for testing purposes.
67  |
68  |
69  | PARAMETERS:
70  |     IN
71  |
72  |     OUT
73  |
74  |
75  | RETURNS:
76  |
77  | NOTES:
78  |
79  *---------------------------------------------------------------------*/
80  PROCEDURE printXMLClob(
81      p_xml_clob IN CLOB);
82 
83 /*--------------------------------------------------------------------
84  | NAME:
85  |     checkForInvalidChars
86  |
87  | PURPOSE:
88  |     Given an input string and a string of invalid characters, this
89  |     procedure checks if any of the invalid characters are present
90  |     in the given input string.
91  |
92  |     If any of the invalid characters are found, an error message is
93  |     inserted into the error table identifying the invalid character.
94  |
95  |     If no invalid characters are found in the input string, this
96  |     procedure simply returns.
97  |
98  | PARAMETERS:
99  |     IN
100  |     p_fieldName  - The name  of the input field (used for logging)
101  |     p_fieldValue - The value of the input field
102  |     p_isComposite - Indidicates that the field is a composite
103  |                     field created by appending multiple individual
104  |                     fields. For composite fields, the field value
105  |                     will not be printed in the error message.
106  |     p_invalid_chars_list - List of invalid characters that
107  |                    should not be present in the field value
108  |     OUT
109  |     x_docErrorRec - Error message record. This should contain the
110  |                     document id when coming into this method.
111  |     x_docErrorTab - Error messages table. An error message will be
112  |                     added to this table if the input field value
113  |                     contains an invalid char.
114  |
115  | RETURNS:
116  |
117  | NOTES:
118  |
119  *---------------------------------------------------------------------*/
120  PROCEDURE checkForInvalidChars(
121          p_fieldName          IN VARCHAR2,
122          p_fieldValue         IN VARCHAR2,
123          p_isComposite        IN BOOLEAN,
124          p_validCharsList     IN VARCHAR2,
125          p_invalidCharsList   IN VARCHAR2,
126          x_docErrorRec        IN OUT NOCOPY IBY_TRANSACTION_ERRORS%ROWTYPE,
127          x_docErrorTab        IN OUT NOCOPY IBY_VALIDATIONSETS_PUB.
128                                                 docErrorTabType
129          );
130 
131 /*--------------------------------------------------------------------
132  | NAME:
133  |     getChar
134  |
135  | PURPOSE:
136  |     Returns the character at a given position of a given string.
137  |     Similar to ChatAt(index) in Java.
138  |
139  |     Note that in PLSQL indexes are 1 based i.e., the very first
140  |     character in the string has index 1 (as opposed to 0 based
141  |     indexes in C and Java).
142  |
143  |     Therefore, if the given string is 'I am the walrus', then
144  |     getChar(str, 10) will return 'w'.
145  |
146  |     NULL will be returned if the index is out-of-bounds.
147  |
148  | PARAMETERS:
149  |     IN
150  |     p_string - The name  of the input field (used for logging)
151  |     p_index - The value of the input field
152  |
153  |     OUT
154  |
155  | RETURNS:
156  |
157  |     VARCHAR2(1) - the character at the given index on the given string
158  |
159  | NOTES:
160  |
161  *---------------------------------------------------------------------*/
162  FUNCTION getChar(
163          p_string      IN VARCHAR2,
164          p_index       IN VARCHAR2
165          )
166          RETURN VARCHAR2;
167 
168 /*--------------------------------------------------------------------
169  | NAME:
170  |     diffStrings
171  |
172  | PURPOSE:
173  |     Given two strings, this method performs a diff on them
174  |     and returns their differences.
175  |
176  |     The two args are not expected to be completely arbitary;
177  |     instead arg2 is expected to be similar to arg1 with some
178  |     differences. For this reason, both strings are expected to
179  |     be of the same length.
180  |
181  |     Whenever there are differences, the value from arg1 is added
182  |     to the diff list. The value from arg2 is ignored.
183  |
184  | PARAMETERS:
185  |     IN
186  |     p_originalString - The original string
187  |     p_compareString  - The changed string
188  |
189  |     OUT
190  |
191  | RETURNS:
192  |
193  |     VARCHAR2 - the difference between the two strings
194  |     NULL will be returned if both strings are the same
195  |
196  | NOTES:
197  |     Comparison between the two strings will only take place uptil the
198  |     length of the original string.
199  |
200  *---------------------------------------------------------------------*/
201  FUNCTION diffStrings(
202          p_originalString      IN VARCHAR2,
203          p_compareString       IN VARCHAR2
204          )
205          RETURN VARCHAR2;
206 
207 /*--------------------------------------------------------------------
208  | NAME:
209  |     createErrorRecord
210  |
211  | PURPOSE:
212  |
213  | PARAMETERS:
214  |     IN
215  |
216  |     OUT
217  |
218  |
219  | RETURNS:
220  |
221  | NOTES:
222  |
223  *---------------------------------------------------------------------*/
224  PROCEDURE createErrorRecord(
225      p_trxn_type    IN IBY_TRANSACTION_ERRORS.transaction_type%TYPE,
226      p_doc_id       IN IBY_DOCS_PAYABLE_ALL.document_payable_id%TYPE,
227      p_doc_status   IN IBY_DOCS_PAYABLE_ALL.document_status%TYPE,
228      p_ca_id        IN IBY_DOCS_PAYABLE_ALL.calling_app_id%TYPE,
229      p_ca_doc_id1    IN IBY_DOCS_PAYABLE_ALL.
230                            calling_app_doc_unique_ref1%TYPE,
231      p_ca_doc_id2    IN IBY_DOCS_PAYABLE_ALL.
232                            calling_app_doc_unique_ref2%TYPE,
233      p_ca_doc_id3    IN IBY_DOCS_PAYABLE_ALL.
234                            calling_app_doc_unique_ref3%TYPE,
235      p_ca_doc_id4    IN IBY_DOCS_PAYABLE_ALL.
236                            calling_app_doc_unique_ref4%TYPE,
237      p_ca_doc_id5    IN IBY_DOCS_PAYABLE_ALL.
238                            calling_app_doc_unique_ref5%TYPE,
239      p_pp_tt_cd     IN IBY_DOCS_PAYABLE_ALL.pay_proc_trxn_type_code%TYPE,
240      x_docErrorRec  IN OUT NOCOPY IBY_TRANSACTION_ERRORS%ROWTYPE,
241      x_docTokenTab  IN OUT NOCOPY IBY_VALIDATIONSETS_PUB.trxnErrTokenTabType,
242      p_rel_doc_id   IN IBY_DOCS_PAYABLE_ALL.document_payable_id%TYPE
243                            DEFAULT NULL,
244      p_error_code   IN VARCHAR2 DEFAULT NULL
245      );
246 
247 /*--------------------------------------------------------------------
248  | NAME:
249  |     createPmtErrorRecord
250  |
251  | PURPOSE:
252  |
253  | PARAMETERS:
254  |     IN
255  |
256  |     OUT
257  |
258  |
259  | RETURNS:
260  |
261  | NOTES:
262  |
263  *---------------------------------------------------------------------*/
264  PROCEDURE createPmtErrorRecord(
265      p_pmt_id        IN IBY_PAYMENTS_ALL.payment_id%TYPE,
266      p_pmt_status    IN IBY_PAYMENTS_ALL.
267                             payment_status%TYPE,
268      p_error_code    IN IBY_TRANSACTION_ERRORS.error_code%TYPE
269                            DEFAULT NULL,
270      p_error_msg     IN IBY_TRANSACTION_ERRORS.error_message%TYPE
271                            DEFAULT NULL,
272      x_docErrorRec   IN OUT NOCOPY IBY_TRANSACTION_ERRORS%ROWTYPE
273      );
274 
275 /*--------------------------------------------------------------------
276  | NAME:
277  |     getProfListFromProfileDrivers
278  |
279  | PURPOSE:
280  |     Derives the payment profile for the given (payment method,
281  |     payment format, org, payment currency, internal bank acct)
282  |     combination.
283  |
284  | PARAMETERS:
285  |     IN
286  |
287  |     OUT
288  |
289  |
290  | RETURNS:
291  |
292  |
293  | NOTES:
294  |
295  *---------------------------------------------------------------------*/
296  PROCEDURE getProfListFromProfileDrivers(
297      p_pmt_method_cd     IN IBY_DOCS_PAYABLE_ALL.payment_method_code%TYPE,
298      p_org_id            IN IBY_DOCS_PAYABLE_ALL.org_id%TYPE,
299      p_org_type          IN IBY_DOCS_PAYABLE_ALL.org_type%TYPE,
300      p_pmt_currency      IN IBY_DOCS_PAYABLE_ALL.payment_currency_code%TYPE,
301      p_int_bank_acct_id  IN IBY_DOCS_PAYABLE_ALL.internal_bank_account_id%TYPE,
302      x_profilesTab       IN OUT NOCOPY pmtProfTabType
303      );
304 
305 /*--------------------------------------------------------------------
306  | NAME:
307  |     getProfileMap
308  |
309  | PURPOSE:
310  |
311  | PARAMETERS:
312  |     IN
313  |
314  |
315  |     OUT
316  |
317  |
318  | RETURNS:
319  |
320  | NOTES:
321  |
322  *---------------------------------------------------------------------*/
323  PROCEDURE getProfileMap(
324      x_profileMap     IN OUT NOCOPY profileIdToCodeMapTabType
325      );
326 
327 /*--------------------------------------------------------------------
328  | NAME:
329  |     getProfileCodeFromId
330  |
331  | PURPOSE:
332  |
333  | PARAMETERS:
334  |     IN
335  |
336  |
337  |     OUT
338  |
339  |
340  | RETURNS:
341  |
342  | NOTES:
343  |
344  *---------------------------------------------------------------------*/
345  FUNCTION getProfileCodeFromId(
346      p_profile_id     IN IBY_PAY_INSTRUCTIONS_ALL.payment_profile_id%TYPE,
347      p_profileMap     IN profileIdToCodeMapTabType
348      ) RETURN VARCHAR2;
349 
350 /*--------------------------------------------------------------------
351  | NAME:
352  |     printWrappedString
353  |
354  | PURPOSE:
355  |
356  | PARAMETERS:
357  |     IN
358  |
359  |
360  |     OUT
361  |
362  |
363  | RETURNS:
364  |
365  | NOTES:
366  |
367  *---------------------------------------------------------------------*/
368  PROCEDURE printWrappedString(
369      p_string     IN VARCHAR2
370      );
371 
372 /*--------------------------------------------------------------------
373  | NAME:
374  |     inactivateOldErrors
375  |
376  | PURPOSE:
377  |
378  | PARAMETERS:
379  |     IN
380  |
381  |
382  |     OUT
383  |
384  |
385  | RETURNS:
386  |
387  | NOTES:
388  |
389  *---------------------------------------------------------------------*/
390  PROCEDURE inactivateOldErrors(
391      p_trxn_id    IN IBY_TRANSACTION_ERRORS.transaction_id%TYPE,
392      p_trxn_type  IN IBY_TRANSACTION_ERRORS.transaction_type%TYPE
393      );
394 
395 END IBY_BUILD_UTILS_PKG;