1 PACKAGE AR_PREPAYMENTS_PUB AUTHID CURRENT_USER AS
2 /* $Header: ARPPAYAS.pls 120.6 2006/06/27 08:37:30 shveeram noship $ */
3 /*#
4 * The Prepayments API enables the creation of a receipt in advance of
5 * the invoicing event. It provides a mechanism for matching a
6 * prepayment receipt to a prepaid invoice. The Prepayments API lets
7 * you model down payments, deposits, or prepayments as receipts
8 * created in Oracle Receivables in advance of the invoice creation event.
9 * @rep:scope public
10 * @rep:metalink 236938.1 See OracleMetaLink note 236938.1
11 * @rep:product AR
12 * @rep:lifecycle active
13 * @rep:displayname Prepayment
14 * @rep:category BUSINESS_ENTITY AR_RECEIPT
15 */
16
17 /*=======================================================================+
18 | Declare PUBLIC Data Types and Variables
19 +=======================================================================*/
20
21 TYPE installment_rec_type IS RECORD (
22 installment_number NUMBER(15) DEFAULT NULL ,
23 installment_amount NUMBER DEFAULT NULL);
24
25 TYPE installment_tbl IS TABLE of installment_rec_type
26 INDEX BY BINARY_INTEGER;
27
28 /*=======================================================================+
29 | Declare PUBLIC Exceptions
30 +=======================================================================*/
31 temp_exception EXCEPTION;
32
33
34 /*========================================================================
35 | PUBLIC Procedure create_prepayment
36 |
37 | DESCRIPTION
38 | Create prepayment receipt and put it on prepayment
39 | ----------------------------------------
40 |
41 | PSEUDO CODE/LOGIC
42 |
43 | PARAMETERS
44 |
45 |
46 | RETURNS
47 | nothing
48 |
49 | KNOWN ISSUES
50 |
51 |
52 |
53 | NOTES
54 |
55 |
56 |
57 | MODIFICATION HISTORY
58 | Date Author Description of Changes
59 | 10-SEP-2001 S Nambiar Created
60 | 08-AUG-2003 J Pandey Bug: 3063445 Moved the logic from
61 | AR_PREPAYMENTS to this public API
62 | 11-DEC-2003 J Pandey Bug 3220078 Change the parameter to TRUE
63 *=======================================================================*/
64 /*#
65 * Use this procedure to creates a prepayment receipt.
66 * @rep:scope public
67 * @rep:lifecycle active
68 * @rep:displayname Create Prepayment
69 */
70
71 PROCEDURE Create_Prepayment(
72 -- Standard API parameters.
73 p_api_version IN NUMBER,
74 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
75 p_commit IN VARCHAR2 := FND_API.G_FALSE,
76 p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
77 x_return_status OUT NOCOPY VARCHAR2,
78 x_msg_count OUT NOCOPY NUMBER,
79 x_msg_data OUT NOCOPY VARCHAR2,
80 -- Receipt info. parameters
81 p_usr_currency_code IN VARCHAR2 DEFAULT NULL, --the translated currency code
82 p_currency_code IN ar_cash_receipts.currency_code%TYPE DEFAULT NULL,
83 p_usr_exchange_rate_type IN VARCHAR2 DEFAULT NULL,
84 p_exchange_rate_type IN ar_cash_receipts.exchange_rate_type%TYPE DEFAULT NULL,
85 p_exchange_rate IN ar_cash_receipts.exchange_rate%TYPE DEFAULT NULL,
86 p_exchange_rate_date IN ar_cash_receipts.exchange_date%TYPE DEFAULT NULL,
87 p_amount IN ar_cash_receipts.amount%TYPE,
88 p_factor_discount_amount IN ar_cash_receipts.factor_discount_amount%TYPE DEFAULT NULL,
89
90 -----Multiple prepayments project: receipt number should be IN OUT
91 p_receipt_number IN OUT NOCOPY ar_cash_receipts.receipt_number%TYPE,
92
93 p_receipt_date IN ar_cash_receipts.receipt_date%TYPE DEFAULT NULL,
94 p_gl_date IN ar_cash_receipt_history.gl_date%TYPE DEFAULT NULL,
95 p_maturity_date IN DATE DEFAULT NULL,
96 p_postmark_date IN DATE DEFAULT NULL,
97 p_customer_id IN ar_cash_receipts.pay_from_customer%TYPE DEFAULT NULL,
98 p_customer_name IN hz_parties.party_name%TYPE DEFAULT NULL,
99 p_customer_number IN hz_cust_accounts.account_number%TYPE DEFAULT NULL,
100 p_customer_bank_account_id IN ar_cash_receipts.customer_bank_account_id%TYPE DEFAULT NULL,
101 p_customer_bank_account_num IN ap_bank_accounts.bank_account_num%TYPE DEFAULT NULL,
102 p_customer_bank_account_name IN ap_bank_accounts.bank_account_name%TYPE DEFAULT NULL,
103 p_location IN hz_cust_site_uses.location%TYPE DEFAULT NULL,
104 p_customer_site_use_id IN hz_cust_site_uses.site_use_id%TYPE DEFAULT NULL,
105 p_customer_receipt_reference IN ar_cash_receipts.customer_receipt_reference%TYPE DEFAULT NULL,
106 p_override_remit_account_flag IN ar_cash_receipts.override_remit_account_flag%TYPE DEFAULT NULL,
107 p_remittance_bank_account_id IN ar_cash_receipts.remit_bank_acct_use_id%type DEFAULT NULL,
108 p_remittance_bank_account_num IN ce_bank_accounts.bank_account_num%TYPE DEFAULT NULL,
109 p_remittance_bank_account_name IN ce_bank_accounts.bank_account_name%TYPE DEFAULT NULL,
110 p_deposit_date IN ar_cash_receipts.deposit_date%TYPE DEFAULT NULL,
111 p_receipt_method_id IN ar_cash_receipts.receipt_method_id%TYPE DEFAULT NULL,
112 p_receipt_method_name IN ar_receipt_methods.name%TYPE DEFAULT NULL,
113 p_doc_sequence_value IN NUMBER DEFAULT NULL,
114 p_ussgl_transaction_code IN ar_cash_receipts.ussgl_transaction_code%TYPE DEFAULT NULL,
115 p_anticipated_clearing_date IN ar_cash_receipts.anticipated_clearing_date%TYPE DEFAULT NULL,
116 p_called_from IN VARCHAR2 DEFAULT NULL,
117 p_attribute_rec IN ar_receipt_api_pub.attribute_rec_type
118 DEFAULT ar_receipt_api_pub.attribute_rec_const,
119 -- ******* Global Flexfield parameters *******
120 p_global_attribute_rec IN ar_receipt_api_pub.global_attribute_rec_type
121 DEFAULT ar_receipt_api_pub.global_attribute_rec_const,
122 p_receipt_comments IN VARCHAR2 DEFAULT NULL,
123 -- *** Notes Receivable Additional Information ***
124 p_issuer_name IN ar_cash_receipts.issuer_name%TYPE DEFAULT NULL,
125 p_issue_date IN ar_cash_receipts.issue_date%TYPE DEFAULT NULL,
126 p_issuer_bank_branch_id IN ar_cash_receipts.issuer_bank_branch_id%TYPE DEFAULT NULL,
127 -- ** OUT NOCOPY variables for Creating receipt
128 p_cr_id OUT NOCOPY ar_cash_receipts.cash_receipt_id%TYPE,
129 -- Receipt application parameters
130 p_applied_payment_schedule_id IN ar_payment_schedules.payment_schedule_id%TYPE DEFAULT NULL,
131 p_amount_applied IN ar_receivable_applications.amount_applied%TYPE DEFAULT NULL,
132 p_application_ref_type IN VARCHAR2 DEFAULT NULL,
133 p_application_ref_id IN OUT NOCOPY NUMBER ,
134 p_application_ref_num IN OUT NOCOPY VARCHAR2 ,
135 p_secondary_application_ref_id IN OUT NOCOPY NUMBER ,
136 p_receivable_trx_id IN ar_receivable_applications.receivables_trx_id%TYPE DEFAULT NULL,
137 p_amount_applied_from IN ar_receivable_applications.amount_applied_from%TYPE DEFAULT NULL,
138 p_apply_date IN ar_receivable_applications.apply_date%TYPE DEFAULT NULL,
139 p_apply_gl_date IN ar_receivable_applications.gl_date%TYPE DEFAULT NULL,
140 app_ussgl_transaction_code IN ar_receivable_applications.ussgl_transaction_code%TYPE DEFAULT NULL,
141 p_show_closed_invoices IN VARCHAR2 DEFAULT 'FALSE',
142 p_move_deferred_tax IN VARCHAR2 DEFAULT 'Y',
143 app_attribute_rec IN ar_receipt_api_pub.attribute_rec_type
144 DEFAULT ar_receipt_api_pub.attribute_rec_const,
145 -- ******* Global Flexfield parameters *******
146 app_global_attribute_rec IN ar_receipt_api_pub.global_attribute_rec_type
147 DEFAULT ar_receipt_api_pub.global_attribute_rec_const,
148 app_comments IN ar_receivable_applications.comments%TYPE DEFAULT NULL,
149 -- processor such as iPayments
150 p_payment_server_order_num IN OUT NOCOPY ar_cash_receipts.payment_server_order_num%TYPE,
151 p_approval_code IN OUT NOCOPY ar_cash_receipts.approval_code%TYPE,
152
153 ---Bug 3220078 Change the parameter to TRUE
154 p_call_payment_processor IN VARCHAR2 DEFAULT FND_API.G_TRUE,
155
156 p_payment_response_error_code OUT NOCOPY VARCHAR2,
157 -- OUT NOCOPY parameter for the Application
158 p_receivable_application_id OUT NOCOPY ar_receivable_applications.receivable_application_id%TYPE,
159 p_payment_set_id IN OUT NOCOPY NUMBER,
160 p_org_id IN NUMBER DEFAULT NULL,
161 -- bug 4491278 payment uptake project
162 p_payment_trxn_extension_id IN ar_cash_receipts.payment_trxn_extension_id%TYPE DEFAULT NULL
163 );
164 /*#
165 * Use this procedure to calculate the amount of all the installments of
166 * a given payment term.
167 * @rep:scope public
168 * @rep:lifecycle active
169 * @rep:displayname Calculate Installment Amount
170 */
171
172 PROCEDURE get_installment(
173 p_term_id IN NUMBER,
174 p_amount IN NUMBER,
175 p_currency_code IN VARCHAR2,
176 p_org_id IN NUMBER DEFAULT NULL,
177 p_installment_tbl OUT NOCOPY ar_prepayments_pub.installment_tbl,
178 x_return_status OUT NOCOPY VARCHAR2,
179 x_msg_count OUT NOCOPY NUMBER,
180 x_msg_data OUT NOCOPY VARCHAR2);
181
182
183
184 END AR_PREPAYMENTS_PUB;