DBA Data[Home] [Help]

PACKAGE: APPS.IBY_DISBURSE_SINGLE_PMT_PKG

Source


1 PACKAGE IBY_DISBURSE_SINGLE_PMT_PKG AS
2 /*$Header: ibysings.pls 120.12.12010000.1 2008/07/28 05:42:43 appldev ship $*/
3 
4  TYPE payreq_tbl_type IS TABLE of iby_pay_service_requests.
5                                       payment_service_request_id%TYPE
6     INDEX BY BINARY_INTEGER;
7 
8  --
9  -- These two records store the distinct payment
10  -- functions, and orgs that are present in a
11  -- payment request.
12  --
13  -- The disbursement UI uses the data in this table to
14  -- restrict access to the user (depending upon the
15  -- users' payment function and organization).
16  --
17  TYPE distinctPmtFxAccessType IS RECORD (
18      object_id
19          IBY_PROCESS_FUNCTIONS.object_id%TYPE,
20      object_type
21          IBY_PROCESS_FUNCTIONS.object_type%TYPE,
22      payment_function
23          IBY_PROCESS_FUNCTIONS.payment_function%TYPE
24  );
25 
26  TYPE distinctOrgAccessType IS RECORD (
27      object_id
28          IBY_PROCESS_ORGS.object_id%TYPE,
29      object_type
30          IBY_PROCESS_ORGS.object_type%TYPE,
31      org_type
32          IBY_PROCESS_ORGS.org_type%TYPE,
33      org_id
34          IBY_PROCESS_ORGS.org_id%TYPE
35  );
36 
37  --
38  -- Table of distinct access types.
39  --
40  TYPE distinctPmtFxAccessTab IS TABLE OF distinctPmtFxAccessType
41      INDEX BY BINARY_INTEGER;
42 
43  TYPE distinctOrgAccessTab IS TABLE OF distinctOrgAccessType
44      INDEX BY BINARY_INTEGER;
45 
46  --
47  -- Record to store the default payment processing
48  -- attributes derived from the payment process profile.
49  --
50  -- TYPE profileProcessAttribs IS RECORD (
51  --     processing_type
52  --        IBY_PAYMENT_PROFILES.processing_type%TYPE
53  -- );
54 
55  /*
56   * Record to store transaction error id from
57   * IBY_TRANSACTION_ERRORS table.
58   */
59  TYPE trxnErrorIdRecType IS RECORD (
60      trxn_error_id
61          IBY_TRANSACTION_ERRORS.transaction_error_id%TYPE
62  );
63 
64  /*
65   * Table of transaction error ids.
66   */
67  TYPE trxnErrorIdsTab IS TABLE OF trxnErrorIdRecType
68      INDEX BY BINARY_INTEGER;
69 
70 /*--------------------------------------------------------------------
71  | NAME:
72  |     submit_single_payment
73  |
74  | PURPOSE:
75  |     Entry point for the single payment API; This procedure will return
76  |     a success/failure response back to the caller synchronously.
77  |
78  |     It is the callers responsibility to perform a COMMIT in case of
79  |     success (rollback in case of failure). This API will not perform
80  |     a commit.
81  |
82  |     Functional blocks of this API include -
83  |       - validate the provided document payable
84  |       - create a payment
85  |       - validate the payment
86  |       - create a payment instruction
87  |       - validate the payment instruction
88  |       - invoke extract/format for the created instruction
89  |       - mark the payment complete
90  |
91  |     Single payments are automatically marked complete by this API.
92  |     That is the understanding with the calling application as well.
93  |
94  |     For this reason, single payments should not be again marked complete
95  |     by the user (this is handled in the iPayment UI).
96  |
97  |     Note 1: it is the calling applications responsibility to ensure
98  |     that all the hardcoded grouping rules are applied on the documents
99  |     payable *before* the single payment API is invoked. This is to
100  |     ensure that the single payment API does not generate multiple
101  |     payments after grouping the provided documents payable.
102  |
103  |     If such a situation arises, the single payment API will fail the
104  |     request.
105  |
106  |     Note 2: Only one payment will be created by the single payment API
107  |     regardless of the number of provided documents payable (this is
108  |     ensured because of Note 1).
109  |
110  |     Since only one payment is created, it also follows that the single
111  |     payment API will only create a single payment instruction with this
112  |     payment.
113  |
114  | PARAMETERS:
115  |    IN
116  |
117  |    p_api_version
118  |
119  |    p_init_msg_list
120  |
121  |    p_calling_app_id
122  |        The 3-character product code of the calling application. Example,
123  |        '200' for Oracle Payables.
124  |
125  |    p_calling_app_payreq_cd
126  |        Id of the payment service request from the calling app's
127  |        point of view. For a given calling app, this id should be
128  |        unique.
129  |
130  |    p_is_manual_payment_flag
131  |        Specifies whether this payment is a manual payment or
132  |        a quick payment. Manual payments are payments made outside
133  |        of Oracle Payments that need to be recorded. Manual
134  |        payments do not undergo any validation, the given payment is
135  |        simply inserted into IBY tables.
136  |
137  |    p_payment_function
138  |        Payment function. Used in setting the payee context.
139  |
140  |    p_internal_bank_account_id
141  |        The internal bank account to pay from.
142  |
143  |    p_pay_process_profile_id
144  |        Payment process profile. The payment profile drives how this
145  |        payment is processed in IBY.
146  |
147  |    p_payment_method_cd
148  |        The payment method.
149  |
150  |    p_legal_entity_id
151  |        Legal entity.
152  |
153  |    p_organization_id
154  |        Org id. Used in setting the payee context.
155  |
156  |    p_organization_type
157  |        Org type. Used in setting the payee context.
158  |
159  |    p_payment_date
160  |        The payment date.
161  |        Currently not used.
162  |
163  |    p_payment_amount
164  |        The payment amount.
165  |
166  |    p_payment_currency
167  |        The payment currency.
168  |
169  |    p_payee_party_id
170  |        Payee party id. Used in setting the payee context.
171  |
172  |    p_payee_party_site_id
173  |        Payee party site id. Used in setting the payee context.
174  |
175  |    p_supplier_site_id
176  |        Supplier site id. Used in setting the payee context.
177  |
178  |    p_payee_bank_account_id
179  |        Payee bank account id. Only relevant for electronic single payments.
180  |        Currently not used.
181  |
182  |    p_override_pmt_complete_pt
183  |        Override completion point flag. If this flag is set to 'Y', IBY
184  |        will immediately mark the single payment as completed without
185  |        waiting for the pre-set completion event.
186  |
187  |    p_bill_payable_flag
188  |        Indicates whether this payment is a future-dated payment.
189  |        Currently not used.
190  |
191  |    p_anticipated_value_date
192  |        Anticipated value date.
193  |        Currently not used.
194  |
195  |    p_maturity_date
196  |        Payment maturity date/
197  |        Required parameter if the payment is a future-dated payment.
198  |        Currently not used.
199  |
200  |    p_payment_document_id
201  |        The paper document (check stock) to be used for numbering and
202  |        printing of the payment. Only relevant for printed payments.
203  |        If not provided, this value will be derived from the payment
204  |        process profile.
205  |
206  |    p_paper_document_number
207  |        The number of the paper document (check number). Only relevant
208  |        for printed single payments. If this value is not provided
209  |        the next available paper document number will be used.
210  |
211  |    p_printer_name
212  |        Printer name is required if the payment needs to be printed
213  |        immediately.
214  |
215  |    p_print_immediate_flag
216  |        Whether to print the payment immediately. If set to N, user
217  |        will have to initiate printing from the IBY UI.
218  |
219  |
220  |    p_transmit_immediate_flag
221  |       Flag indicating whether this payment needs to be transmitted
222  |       to the bank immediately upon formatting. Only relevant for
223  |       electronic payments. If this param is set to N, user will have
224  |       to initiate transmission from the IBY UI.
225  |
226  |    p_payee_address_line1 .. p_payee_address_line4
227  |        Payee address lines.  If payee address information is
228  |        provided as API params, then these would be used to create
229  |        the payment. If not provided, the payment would be stamped
230  |        with the address information derived from payee party site id.
231  |
232  |    p_payee_address_city
233  |        Payee city.
234  |
235  |    p_payee_address_county
236  |        Payee county.
237  |
238  |    p_payee_address_state
239  |        Payee state.
240  |
241  |    p_payee_address_zip
242  |        Payee postal code.
243  |
244  |    p_payee_address_country
245  |        Payee country.
246  |
247  |    p_attribute_category
248  |        Descriptive flex fields category.
249  |        Currently not used.
250  |
251  |    p_attribute1 .. p_attribute15
252  |        Descriptive flex field attributes.
253  |        Currently not used.
254  |
255  | OUT
256  |
257  |    x_num_printed_docs
258  |        Total number of printed documents generated after numbering.
259  |        This will include the actual single payment [1 document] plus
260  |        any setup and overflow documents.
261  |
262  |    x_payment_id
263  |        Payment id of the actual single payment. This value maps to
264  |        IBY_PAYMENTS_ALL.payment_id.
265  |
266  |    x_paper_doc_num
267  |        Paper document number of the actual single payment. This could be
268  |        a check number, for example.
269  |
270  |    x_pmt_ref_num
271  |        Payment reference number stamped by IBY on the actual single
272  |        payment. Use this payment reference number when interacting with
273  |        third parties e.g., banks.
274  |
275  |    x_return_status
276  |        Return status of the API.
277  |
278  |        S - Success
279  |        E - Error / failure
280  |        U - Unexpected / system error
281  |
282  |    x_error_ids_tab
283  |        List of validation error ids that map to
284  |        IBY_TRANSACTION_ERRORS.transaction_error_id. Use these
285  |        error ids to look up this table for list of validation errors.
286  |
287  |        This parameter is only relevant when the return status is E.
288  |
289  |    x_msg_count
290  |        Generated FND messages count.
291  |
292  |    x_msg_data
293  |        Generated FND messages. This param is only relevant in case
294  |        the return status is U. Unwind the message stack to see list
295  |        of exceptions / system errors.
296  |
297  | RETURNS:
298  |
299  |
300  | NOTES:
301  |
302  *---------------------------------------------------------------------*/
303  PROCEDURE submit_single_payment(
304      p_api_version                IN         NUMBER,
305      p_init_msg_list              IN         VARCHAR2,
306      p_calling_app_id             IN         NUMBER,
307      p_calling_app_payreq_cd      IN         VARCHAR2,
308      p_is_manual_payment_flag     IN         VARCHAR2,
309      p_payment_function           IN         VARCHAR2,
310      p_internal_bank_account_id   IN         NUMBER,
311      p_pay_process_profile_id     IN         NUMBER,
312      p_payment_method_cd          IN         VARCHAR2,
313      p_legal_entity_id            IN         NUMBER,
314      p_organization_id            IN         NUMBER,
315      p_organization_type          IN         VARCHAR2,
316      p_payment_date               IN         DATE,
317      p_payment_amount             IN         NUMBER,
318      p_payment_currency           IN         VARCHAR2,
319      p_payee_party_id             IN         NUMBER,
320      p_payee_party_site_id        IN         NUMBER   DEFAULT NULL,
321      p_supplier_site_id           IN         NUMBER   DEFAULT NULL,
322      p_payee_bank_account_id      IN         NUMBER,
323      p_override_pmt_complete_pt   IN         VARCHAR2,
324      p_bill_payable_flag          IN         VARCHAR2,
325      p_anticipated_value_date     IN         DATE     DEFAULT NULL,
326      p_maturity_date              IN         DATE,
327      p_payment_document_id        IN         NUMBER,
328      p_paper_document_number      IN         NUMBER,
329      p_printer_name               IN         VARCHAR2,
330      p_print_immediate_flag       IN         VARCHAR2,
331      p_transmit_immediate_flag    IN         VARCHAR2,
332      p_payee_address_line1        IN         VARCHAR2 DEFAULT NULL,
333      p_payee_address_line2        IN         VARCHAR2 DEFAULT NULL,
334      p_payee_address_line3        IN         VARCHAR2 DEFAULT NULL,
335      p_payee_address_line4        IN         VARCHAR2 DEFAULT NULL,
336      p_payee_address_city         IN         VARCHAR2 DEFAULT NULL,
337      p_payee_address_county       IN         VARCHAR2 DEFAULT NULL,
338      p_payee_address_state        IN         VARCHAR2 DEFAULT NULL,
339      p_payee_address_zip          IN         VARCHAR2 DEFAULT NULL,
340      p_payee_address_country      IN         VARCHAR2 DEFAULT NULL,
341      p_attribute_category         IN         VARCHAR2 DEFAULT NULL,
342      p_attribute1                 IN         VARCHAR2 DEFAULT NULL,
343      p_attribute2                 IN         VARCHAR2 DEFAULT NULL,
344      p_attribute3                 IN         VARCHAR2 DEFAULT NULL,
345      p_attribute4                 IN         VARCHAR2 DEFAULT NULL,
346      p_attribute5                 IN         VARCHAR2 DEFAULT NULL,
347      p_attribute6                 IN         VARCHAR2 DEFAULT NULL,
348      p_attribute7                 IN         VARCHAR2 DEFAULT NULL,
349      p_attribute8                 IN         VARCHAR2 DEFAULT NULL,
350      p_attribute9                 IN         VARCHAR2 DEFAULT NULL,
351      p_attribute10                IN         VARCHAR2 DEFAULT NULL,
352      p_attribute11                IN         VARCHAR2 DEFAULT NULL,
353      p_attribute12                IN         VARCHAR2 DEFAULT NULL,
354      p_attribute13                IN         VARCHAR2 DEFAULT NULL,
355      p_attribute14                IN         VARCHAR2 DEFAULT NULL,
359      x_paper_doc_num              OUT NOCOPY NUMBER,
356      p_attribute15                IN         VARCHAR2 DEFAULT NULL,
357      x_num_printed_docs           OUT NOCOPY NUMBER,
358      x_payment_id                 OUT NOCOPY NUMBER,
360      x_pmt_ref_num                OUT NOCOPY NUMBER,
361      x_return_status              OUT NOCOPY VARCHAR2,
362      x_error_ids_tab              OUT NOCOPY trxnErrorIdsTab,
363      x_msg_count                  OUT NOCOPY NUMBER,
364      x_msg_data                   OUT NOCOPY VARCHAR2
365      );
366 
367 /*--------------------------------------------------------------------
368  | NAME:
369  |     insert_payreq
370  |
371  |
372  | PURPOSE:
373  |
374  |
375  | PARAMETERS:
376  |     IN
377  |
378  |
379  |     OUT
380  |
381  |
382  | RETURNS:
383  |
384  | NOTES:
385  |
386  *---------------------------------------------------------------------*/
387  FUNCTION insert_payreq (
388      p_calling_app_id         IN IBY_PAY_SERVICE_REQUESTS.calling_app_id%TYPE,
389      p_calling_app_payreq_cd  IN IBY_PAY_SERVICE_REQUESTS.
390                                     call_app_pay_service_req_code%TYPE,
391      p_internal_bank_account_id
392                               IN IBY_PAY_SERVICE_REQUESTS.
393                                      internal_bank_account_id%TYPE,
394      p_pay_process_profile_id
395                               IN IBY_PAY_SERVICE_REQUESTS.
396                                      payment_profile_id%TYPE,
397      p_is_manual_payment_flag IN VARCHAR2
398      )
399      RETURN NUMBER;
400 
401 /*--------------------------------------------------------------------
402  | NAME:
403  |     populateOutParams
404  |
405  | PURPOSE:
406  |
407  |
408  | PARAMETERS:
409  |     IN
410  |
411  |
412  |     OUT
413  |
414  |
415  | RETURNS:
416  |
417  | NOTES:
418  |
419  *---------------------------------------------------------------------*/
420  PROCEDURE populateOutParams(
421      p_payreq_id          IN IBY_PAY_SERVICE_REQUESTS.
422                                  payment_service_request_id%TYPE,
423      p_processing_type    IN IBY_PAYMENT_PROFILES.processing_type%TYPE,
424      x_num_printed_docs   OUT NOCOPY NUMBER,
425      x_payment_id         OUT NOCOPY IBY_PAYMENTS_ALL.
426                                  payment_id%TYPE,
427      x_paper_doc_num      OUT NOCOPY IBY_PAYMENTS_ALL.
428                                  paper_document_number%TYPE,
429      x_pmt_ref_num        OUT NOCOPY IBY_PAYMENTS_ALL.
430                                  payment_reference_number%TYPE
431      );
432 
433 /*--------------------------------------------------------------------
434  | NAME:
435  |     retrieve_transaction_errors
436  |
437  |
438  | PURPOSE:
439  |
440  |
441  | PARAMETERS:
442  |     IN
443  |
444  |
445  |     OUT
446  |
447  |
448  | RETURNS:
449  |
450  | NOTES:
451  |
452  *---------------------------------------------------------------------*/
453  PROCEDURE retrieve_transaction_errors(
454      p_payreq_id        IN IBY_PAY_SERVICE_REQUESTS.
455                             payment_service_request_id%TYPE,
456      x_trxnErrorIdsTab  IN OUT NOCOPY trxnErrorIdsTab
457      );
458 
459 /*--------------------------------------------------------------------
460  | NAME:
461  |     provide_pmt_reference_num
462  |
463  |
464  | PURPOSE:
465  |
466  |
467  | PARAMETERS:
468  |     IN
469  |
470  |
471  |     OUT
472  |
473  |
474  | RETURNS:
475  |
476  | NOTES:
477  |
478  *---------------------------------------------------------------------*/
479  FUNCTION provide_pmt_reference_num
480      RETURN NUMBER;
481 
482 
483 /*--------------------------------------------------------------------
484  | NAME:
485  |     print_debuginfo
486  |
487  | PURPOSE:
488  |
489  |
490  | PARAMETERS:
491  |     IN
492  |
493  |
494  |     OUT
495  |
496  |
497  | RETURNS:
498  |
499  | NOTES:
500  |
501  *---------------------------------------------------------------------*/
502  PROCEDURE print_debuginfo(p_module IN VARCHAR2,
503      p_debug_text IN VARCHAR2);
504 
505 END IBY_DISBURSE_SINGLE_PMT_PKG;