The following lines contain the word 'select', 'insert', 'update' or 'delete':
| insert_cash_receipt |
| |
| DESCRIPTION |
| Function inserts a cash receipt into the database. This entity |
| handler is called from the Receipts Gateway form and creates records |
| in the following tables: |
| AR_CASH_RECEIPTS |
| AR_CASH_RECEIPT_HISTORY |
| AR_DISTRIBUTIONS |
| AR_RECEIVABLE_APPLICATIONS |
| AR_PAYMENT_SCHEDULES |
| |
| SCOPE - PUBLIC |
| |
| EXTERNAL PROCEDURES/FUNCTIONS ACCESSED |
| |
| ARGUMENTS |
| IN: |
| OUT: |
| |
| RETURNS |
| |
| NOTES |
| |
| MODIFICATION HISTORY |
| |
| 08-SEP-95 OSTEINME created |
| 01-NOV-96 OSTEINME added parameter anticipated_clearing_date |
| for CashBook enhancement (float support) |
| Added parameters for Japan enhancements: |
| - customer_bank_branch_id |
| as well as logic to handle these properly |
| 04-NOV-96 OSTEINME changed call to get_ra_ccid to take new |
| parameters. Also changed procedure name |
| to get_ccids to better reflect purpose of |
| of procedure. |
| 30-DEC-96 OSTEINME added global flexfield parameters |
| 04-DEC-97 KLAWRANC Bug #590256. Modified calls to |
| calc_acctd_amount. Now passes NULL for the |
| currency code parameter, therefore the acctd |
| amount will be calculated based on the |
| functional currency. |
| 21-MAY-98 KTANG For all calls to calc_acctd_amount which |
| calculates header accounted amounts, if the |
| exchange_rate_type is not user, call |
| gl_currency_api.convert_amount instead. This |
| is for triangulation. |
| 29-JUL-98 K.Murphy Bug #667450. Modified calculation of the |
| accounted factor discount amount. |
| |
| 14-APR-2000 Jani Rautiainen Added parameter p_called_from. This is needed|
| inthe logic to decide whether first UNAPP row|
| is postable or not. In BR scenario when an |
| Activity Application of Short Term Debt is |
| created the UNAPP rows are not postable. |
| This is an user requirement for BR. |
| The parameter is defaulted to NULL so no |
| impact for the existing functionality. |
| Also added logic to prevent accounting |
| creation if the row is not postable. |
| 01-May-2002 Debbie Jancis Modified for Enhancement 2074220. Added |
| application_notes. |
| 05-May-2005 Debbie Jancis Added Legal Entity Id for LE R12 project |
| |
+===========================================================================*/
PROCEDURE insert_cash_receipt(
p_currency_code IN VARCHAR2,
p_amount IN NUMBER,
p_pay_from_customer IN NUMBER,
p_receipt_number IN VARCHAR2,
p_receipt_date IN DATE,
p_gl_date IN DATE,
p_maturity_date IN DATE,
p_comments IN VARCHAR2,
p_exchange_rate_type IN VARCHAR2,
p_exchange_rate IN NUMBER,
p_exchange_date IN DATE,
p_batch_id IN NUMBER,
p_attribute_category IN VARCHAR2,
p_attribute1 IN VARCHAR2,
p_attribute2 IN VARCHAR2,
p_attribute3 IN VARCHAR2,
p_attribute4 IN VARCHAR2,
p_attribute5 IN VARCHAR2,
p_attribute6 IN VARCHAR2,
p_attribute7 IN VARCHAR2,
p_attribute8 IN VARCHAR2,
p_attribute9 IN VARCHAR2,
p_attribute10 IN VARCHAR2,
p_attribute11 IN VARCHAR2,
p_attribute12 IN VARCHAR2,
p_attribute13 IN VARCHAR2,
p_attribute14 IN VARCHAR2,
p_attribute15 IN VARCHAR2,
p_override_remit_account_flag IN VARCHAR2,
p_remittance_bank_account_id IN NUMBER,
p_customer_bank_account_id IN NUMBER,
p_customer_site_use_id IN NUMBER,
p_customer_receipt_reference IN VARCHAR2,
p_factor_discount_amount IN NUMBER,
p_deposit_date IN DATE,
p_receipt_method_id IN NUMBER,
p_doc_sequence_value IN NUMBER,
p_doc_sequence_id IN NUMBER,
p_ussgl_transaction_code IN VARCHAR2,
p_vat_tax_id IN NUMBER,
p_anticipated_clearing_date IN DATE,
p_customer_bank_branch_id IN NUMBER,
-- ARTA Changes
p_postmark_date IN DATE,
--
-- ******* Global Flexfield parameters *******
--
p_global_attribute1 IN VARCHAR2,
p_global_attribute2 IN VARCHAR2,
p_global_attribute3 IN VARCHAR2,
p_global_attribute4 IN VARCHAR2,
p_global_attribute5 IN VARCHAR2,
p_global_attribute6 IN VARCHAR2,
p_global_attribute7 IN VARCHAR2,
p_global_attribute8 IN VARCHAR2,
p_global_attribute9 IN VARCHAR2,
p_global_attribute10 IN VARCHAR2,
p_global_attribute11 IN VARCHAR2,
p_global_attribute12 IN VARCHAR2,
p_global_attribute13 IN VARCHAR2,
p_global_attribute14 IN VARCHAR2,
p_global_attribute15 IN VARCHAR2,
p_global_attribute16 IN VARCHAR2,
p_global_attribute17 IN VARCHAR2,
p_global_attribute18 IN VARCHAR2,
p_global_attribute19 IN VARCHAR2,
p_global_attribute20 IN VARCHAR2,
p_global_attribute_category IN VARCHAR2,
--
-- *** Notes Receivable Additional Information
--
p_issuer_name IN VARCHAR2,
p_issue_date IN DATE,
p_issuer_bank_branch_id IN NUMBER,
--
-- *** enhancement 2074220 ***
p_application_notes IN VARCHAR2,
--
p_cr_id OUT NOCOPY NUMBER,
p_ps_id OUT NOCOPY NUMBER,
p_row_id OUT NOCOPY VARCHAR2,
--
p_form_name IN varchar2,
p_form_version IN varchar2,
p_called_from IN VARCHAR2 DEFAULT NULL, /* BR */
p_le_id IN NUMBER DEFAULT NULL, /* LE */
p_payment_trxn_extension_id IN NUMBER DEFAULT NULL, /* payment uptake */
p_automatch_set_id IN NUMBER DEFAULT NULL, /* ER Automatch Application */
p_autoapply_flag IN VARCHAR2 DEFAULT NULL
) IS
l_cr_rec ar_cash_receipts%ROWTYPE;
arp_standard.debug('arp_process_receipts.insert_cash_receipt()+');
arp_standard.debug('insert_cash_receipt: ' || 'Creation status = ' || l_creation_status);
arp_standard.debug('insert_cash_receipt: ' || 'Source Type = ' || l_source_type);
arp_standard.debug('insert_cash_receipt: ' || 'ccid = ' || l_ccid);
arp_standard.debug('insert_cash_receipt: ' || 'status = ' || l_status);
arp_standard.debug('insert_cash_receipt: ' || 'l_ra_unid_ccid = ' || l_ra_unid_ccid);
arp_standard.debug('insert_cash_receipt: ' || 'l_ra_unapp_ccid = ' || l_ra_unapp_ccid);
arp_standard.debug('insert_cash_receipt: ' || 'l_bank_charges_ccid = ' || l_bank_charges_ccid);
arp_cash_receipts_pkg.insert_p(l_cr_rec);
arp_proc_rct_util.insert_crh_rec(
l_cr_rec,
l_crh_amount,
l_crh_acctd_amount,
p_factor_discount_amount,
l_acctd_factor_discount_amount,
p_gl_date,
l_creation_status,
p_batch_id,
l_ccid,
l_bank_charges_ccid,
l_crh_rec,
p_called_from);
arp_proc_rct_util.insert_ps_rec_cash(
l_cr_rec,
p_gl_date,
nvl(p_maturity_date, p_deposit_date),
l_cr_acctd_amount,
l_ps_id);
arp_proc_rct_util.insert_ra_rec_cash(
l_cr_rec.cash_receipt_id,
l_cr_rec.amount,
l_cr_rec.receipt_date,
l_cr_rec.status,
l_cr_acctd_amount,
p_gl_date,
l_ra_ccid,
l_ps_id,
l_application_rule,
'',
l_ra_id,
p_called_from); -- jrautiai BR project
arp_proc_rct_util.insert_dist_rec(
l_crh_rec.amount,
l_crh_acctd_amount,
l_crh_rec.cash_receipt_history_id,
l_source_type,
l_ccid,
p_called_from);
arp_standard.debug('insert_cash_receipt: ' || 'Before creating distribution for bank charges:');
arp_standard.debug('insert_cash_receipt: ' || 'p_factor_discount_amount = ' ||
to_char(p_factor_discount_amount));
arp_standard.debug('insert_cash_receipt: ' || 'l_acctd_factor_discount_amount = ' ||
to_char(l_acctd_factor_discount_amount));
arp_standard.debug('insert_cash_receipt: ' || 'l_crh_rec.cash_receipt_history_id = ' ||
to_char(l_crh_rec.cash_receipt_history_id));
arp_standard.debug('insert_cash_receipt: ' || 'l_bank_charges_ccid = ' ||
to_char(l_bank_charges_ccid));
arp_proc_rct_util.insert_dist_rec(
p_factor_discount_amount,
l_acctd_factor_discount_amount,
l_crh_rec.cash_receipt_history_id,
'BANK_CHARGES',
l_bank_charges_ccid,
p_called_from);
arp_rw_batches_check_pkg.update_batch_status(
p_batch_id);
SELECT rowid
INTO p_row_id
FROM ar_cash_receipts
WHERE cash_receipt_id = l_cr_rec.cash_receipt_id;
arp_standard.debug('arp_process_receipts.insert_cash_receipt()-');
arp_standard.debug('Exception in insert_cash_receipt');
END insert_cash_receipt;
arp_cr_history_pkg.insert_p(l_new_crh_rec,l_new_crh_id );
arp_cr_history_pkg.update_p(l_crh_rec,l_prev_crh_id );
arp_proc_rct_util.insert_dist_rec(
l_new_crh_rec.amount,
l_new_crh_rec.acctd_amount,
l_new_crh_id,
'REMITTANCE',
l_remittance_ccid);
arp_proc_rct_util.insert_dist_rec(
(l_new_crh_rec.amount * -1),
(l_new_crh_rec.acctd_amount * -1),
l_new_crh_id,
'CONFIRMATION',
l_confirmation_ccid);