The following lines contain the word 'select', 'insert', 'update' or 'delete':
| update_cash_receipt |
| |
| DESCRIPTION |
| Entity handler that updates cash transactions. |
| |
| SCOPE - PRIVATE |
| |
| EXTERNAL PROCEDURES/FUNCTIONS ACCESSED |
| |
| ARGUMENTS |
| IN: |
| OUT: |
| |
| RETURNS |
| |
| NOTES |
| |
| MODIFICATION HISTORY |
| |
| 21-AUG-95 OSTEINME created |
| 15-MAR-96 OSTEINME removed calls to procedure |
| arp_cr_util.get_creation_info as they cause |
| problems if the receipt is created as |
| approved (in this case it doesn't have |
| entries in AR_DISTRIBUTIONS yet. |
| 05-APR-96 OSTEINME added functionality (and parameters) to |
| return receipt state and status info after |
| update. |
| 30-MAY-96 OSTEINME added parameter p_status for bug 370072 |
| 19-NOV-96 OSTEINME modified update_cash_receipts procedure to |
| support changing the amount even if apps |
| exist. |
| 27-DEC-96 OSTEINME added global flexfield parameters |
| 05-MAY-97 KLAWRANC Added section to determine a valid GL and |
| Reversal GL date for receivable applications.|
| This date is then used for update and |
| creation of application records. |
| 01-JUL-97 KLAWRANC Bug fixes #511576, 511312. |
| Use valid GL date when updating and creating |
| receipt records. |
| Corrected calculation of amount due remain |
| used to update receipt payment schedule row. |
| 29-AUG-97 KLAWRANC Bug fix #462056. |
| Added update of AP Bank Uses for MICR # |
| functionality. |
| 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.
| 20-FEB-97 KLAWRANC Bugs #616531, 625124, 625132. |
| Moved the update of receipt payment |
| schedule amounts to outside the |
| posted/not posted check. |
| Corrected the calculation of |
| l_crh_fda_delta and l_crh_acctd_fda_delta. |
| This did not use nvl in calculations which |
| caused an incorrect result if the bank |
| was initially null or changed to null. |
| Created a select statement to check for |
| the existance of a bank charges row in the |
| distributions table. This is used to |
| determine if a row needs to be created or |
| we can simply update the existing one. |
| If a bank charges row already exists and |
| bank charges is set to NULL, update the row |
| with zero amounts. |
| Included select statement to sum existing |
| bank charge DR and CR entries. This is used |
| to calculate the new DR and CR amounts |
| (taking into account previously posted rows).|
| 16-APR-1998 GJWANG Bug # 635872 Added condition checking whether|
| amount_due_remaining <> 0 and update cash |
| receipt status to UNAPP and payment schedule |
| status to UNAPP and payment schedule staus to|
| 'OP' and call populate_closed_dates to |
| determine correct gl_date_closed and |
| actual_date_closed |
| 21-MAY-1998 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-1998 K.Murphy Bug #667450. Modified calculation of acctd |
| factor discount amount. |
| 28-MAY-1999 J Rautiainen Bug #894443. The status of unidentified |
| receipts cannot be changed to unapp. |
| 12-OCT-2001 R Muthuraman Bug #2024016. Rate adjustment fail when |
| rate type is changed from 'User' to another |
| rate type. |
| 25-03-2003 Ravi Sharma Bug 2855253.debit and credit mismatch when |
| the bank charges are updated. |
| 07-MAY-2003 Jon Beckett Bug 2946734 - moved claim update from |
| ARXRWRCT.pld |
| 30-JUL-2004 Jon Beckett Bug 3796142 - removed unnecessary calls to |
| gl_currency_api to convert receipt amount |
| to functional currency. Receipt rate used |
| instead of GL daily rate in all cases. |
| Currency conversion only performed if amount |
| has changed, otherwise acctd amount retrieved|
| from receipt history. |
| |
| 01-JUN-2006 Herve Yu BUG#4353362 Third Party Merge api uptake |
+===========================================================================*/
PROCEDURE update_cash_receipt(
p_cash_receipt_id IN NUMBER,
-- p_batch_id IN NUMBER,
p_status IN VARCHAR2,
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_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_confirm_date IN DATE,
p_confirm_gl_date IN DATE,
p_unconfirm_gl_date IN DATE,
p_postmark_date IN date, -- ARTA Changes
-- ******* Rate Adjustment parameters: ********
p_rate_adjust_gl_date IN DATE,
p_new_exchange_date IN DATE,
p_new_exchange_rate IN NUMBER,
p_new_exchange_rate_type IN VARCHAR2,
p_gain_loss IN NUMBER,
p_exchange_rate_attr_cat IN VARCHAR2,
p_exchange_rate_attr1 IN VARCHAR2,
p_exchange_rate_attr2 IN VARCHAR2,
p_exchange_rate_attr3 IN VARCHAR2,
p_exchange_rate_attr4 IN VARCHAR2,
p_exchange_rate_attr5 IN VARCHAR2,
p_exchange_rate_attr6 IN VARCHAR2,
p_exchange_rate_attr7 IN VARCHAR2,
p_exchange_rate_attr8 IN VARCHAR2,
p_exchange_rate_attr9 IN VARCHAR2,
p_exchange_rate_attr10 IN VARCHAR2,
p_exchange_rate_attr11 IN VARCHAR2,
p_exchange_rate_attr12 IN VARCHAR2,
p_exchange_rate_attr13 IN VARCHAR2,
p_exchange_rate_attr14 IN VARCHAR2,
p_exchange_rate_attr15 IN VARCHAR2,
--
-- ********* Reversal Info ***********
--
p_reversal_date IN DATE,
p_reversal_gl_date IN DATE,
p_reversal_category IN VARCHAR2,
p_reversal_comments IN VARCHAR2,
p_reversal_reason_code IN VARCHAR2,
p_dm_reversal_flag IN varchar2,
p_dm_cust_trx_type_id IN NUMBER,
p_dm_cust_trx_type IN VARCHAR2,
p_cc_id IN NUMBER,
p_dm_number OUT NOCOPY VARCHAR2,
p_dm_doc_sequence_value IN NUMBER,
p_dm_doc_sequence_id IN NUMBER,
p_tw_status IN OUT NOCOPY VARCHAR2,
p_anticipated_clearing_date IN DATE,
p_customer_bank_branch_id IN NUMBER,
--
-- ******* 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 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,
--
-- ******* Receipt State/Status Return information ******
--
p_new_state OUT NOCOPY VARCHAR2,
p_new_state_dsp OUT NOCOPY VARCHAR2,
p_new_status OUT NOCOPY VARCHAR2,
p_new_status_dsp OUT NOCOPY VARCHAR2,
--
--
-- ******* Form information ********
p_form_name IN VARCHAR2,
p_form_version IN VARCHAR2,
--
-- ******* Credit Card changes
p_payment_server_order_num IN VARCHAR2,
p_approval_code IN VARCHAR2,
p_legal_entity_id IN NUMBER default NULL,
p_payment_trxn_extension_id IN NUMBER default NULL /* PAYMENT_UPTAKE */
) IS
l_cr_rec ar_cash_receipts%ROWTYPE;
SELECT pay_from_customer,
customer_site_use_id
FROM ar_cash_receipts
WHERE cash_receipt_id = p_cash_receipt_id;
arp_standard.debug('arp_process_receipts.update_cash_receipt()+');
arp_standard.debug('update_cash_receipt: ' || 'l_cr_amount_changed_flag = TRUE');
arp_standard.debug('update_cash_receipt: ' || 'P_GL_DATE is:' || to_char(p_gl_date, 'DD-MM-YYYY:HH:SS'));
arp_standard.debug('update_cash_receipt: ' || 'l_valid_gl_date is:' || to_char(l_valid_gl_date, 'DD-MM-YYYY:HH:SS'));
arp_standard.debug('update_cash_receipt: ' || 'l_crh_rec_gl_date_changed = TRUE');
arp_standard.debug('update_cash_receipt: ' || 'l_crh_fda_changed_flag = TRUE');
arp_standard.debug('update_cash_receipt: ' || 'l_crh_rec_posted_flag = TRUE');
arp_standard.debug('update_cash_receipt: ' || 'l_rct_identified_flag = TRUE');
arp_standard.debug('update_cash_receipt: ' || 'l_rct_unidentified_flag = TRUE');
/* Bug 3796142 - receipt exchange rate should be used for updates, but
only if amount has actually changed */
l_cr_acctd_amount_old := (NVL(l_crh_rec.acctd_amount,0) + NVL(l_crh_rec.acctd_factor_discount_amount,0));
/* Bug 3796142 - receipt exchange rate should be used for updates, but
only if amount has actually changed */
IF (l_cr_amount_changed_flag OR l_crh_fda_changed_flag) THEN
arp_util.calc_acctd_amount( NULL,
NULL,
NULL,
l_cr_rec.exchange_rate,
'+',
l_crh_amount_new,
l_crh_acctd_amount_new,
0,
l_number_dummy,
l_number_dummy,
l_number_dummy);
arp_standard.debug('update_cash_receipt: ' || 'p_amount = '|| to_char(p_amount));
arp_standard.debug('update_cash_receipt: ' || 'l_crh_amount_new = '|| to_char(l_crh_amount_new));
arp_standard.debug('update_cash_receipt: ' || 'l_crh_acctd_amount_new = '|| to_char(l_crh_acctd_amount_new));
UPDATE ar_receivable_applications
SET reversal_gl_date = l_valid_gl_date
WHERE cash_receipt_id = p_cash_receipt_id
AND reversal_gl_date IS NULL
AND status = 'UNID';
arp_proc_rct_util.insert_ra_rec_cash(
p_cash_receipt_id,
-l_cr_rec.amount,
p_receipt_date,
'UNID',
-l_cr_acctd_amount_old,
l_valid_gl_date,
l_unidentified_ccid,
l_ps_rec.payment_schedule_id,
'60.5',
l_valid_gl_date,
l_ra_id_unid );
arp_proc_rct_util.insert_ra_rec_cash(
p_cash_receipt_id,
l_cr_rec.amount,
p_receipt_date,
'UNAPP',
l_cr_acctd_amount_old,
l_valid_gl_date,
l_unapplied_ccid,
l_ps_rec.payment_schedule_id,
'60.2',
'',
l_ra_id_unapp);
is updated later */
l_ae_doc_rec.miscel5 := p_pay_from_customer;
UPDATE ar_receivable_applications
SET reversal_gl_date = l_valid_gl_date
WHERE cash_receipt_id = p_cash_receipt_id
AND reversal_gl_date IS NULL
AND status = 'UNAPP';
arp_proc_rct_util.insert_ra_rec_cash(
p_cash_receipt_id,
-l_cr_rec.amount,
p_receipt_date,
'UNAPP',
-l_cr_acctd_amount_old,
l_valid_gl_date,
l_unapplied_ccid,
l_ps_rec.payment_schedule_id,
'60.3',
l_valid_gl_date,
l_ra_id_unapp);
arp_proc_rct_util.insert_ra_rec_cash(
p_cash_receipt_id,
l_cr_rec.amount,
p_receipt_date,
'UNID',
l_cr_acctd_amount_old,
l_valid_gl_date,
l_unidentified_ccid,
l_ps_rec.payment_schedule_id,
'60.4',
'',
l_ra_id_unid);
The cash_receipt_history record needs to be updated for APPROVED receipts */
arp_cr_history_pkg.update_p(l_crh_rec);
arp_standard.debug('update_cash_receipt: ' || 'l_ps_rec.amount_due_remaining: ' || to_char(l_ps_rec.amount_due_remaining));
arp_standard.debug('update_cash_receipt: ' || 'p_amount: ' || to_char(p_amount));
arp_standard.debug('update_cash_receipt: ' || 'l_cr_rec.amount: ' || to_char(l_cr_rec.amount));
arp_standard.debug('update_cash_receipt: ' || 'l_cr_acctd_amount_delta: ' || to_char(l_cr_acctd_amount_delta));
arp_standard.debug('update_cash_receipt: ' || 'l_ps_rec.amount_due_remaining: ' || to_char(l_ps_rec.amount_due_remaining));
arp_standard.debug('update_cash_receipt: ' || 'l_ps_rec.acctd_amount_due_remaining: ' || to_char(l_ps_rec.acctd_amount_due_remaining));
/* The distribution record can be updated only if the current CRH record has
one record in ARD corresponding to the l_source_type. Else we need to create one */
BEGIN
select 'Y'
into l_dist_row_on_current_crh
from ar_distributions dis
where dis.source_id = l_crh_rec.cash_receipt_history_id
and dis.source_table = 'CRH'
and dis.source_type = l_source_type;
arp_standard.debug('update_cash_receipt: '||'l_dist_row_on_current_crh : '||l_dist_row_on_current_crh);
arp_proc_rct_util.update_dist_rec(
l_crh_rec.cash_receipt_history_id,
l_source_type,
l_crh_amount_new - l_crh_rec.amount,
l_crh_acctd_amount_new - l_crh_rec.acctd_amount);
arp_standard.debug('update_cash_receipt: ' || 'l_crh_amount_delta : ' || to_char(l_crh_amount_delta));
arp_standard.debug('update_cash_receipt: ' || 'l_crh_acctd_amount_delta : ' || to_char(l_crh_acctd_amount_delta));
arp_standard.debug('update_cash_receipt: ' || 'cash_receipt_history_id : ' || to_char(l_crh_rec.cash_receipt_history_id));
arp_standard.debug('update_cash_receipt: ' || 'l_source_type : ' || l_source_type);
arp_standard.debug('update_cash_receipt: ' || 'l_crh_ccid : ' || l_crh_ccid);
arp_proc_rct_util.insert_dist_rec(l_crh_amount_delta,
l_crh_acctd_amount_delta,
l_crh_rec.cash_receipt_history_id,
l_source_type,
l_crh_ccid);
select 'Y'
into l_bank_charges_row_exists
from dual
where exists (select crh.cash_receipt_history_id
from ar_cash_receipt_history crh, ar_distributions dis
where crh.cash_receipt_id = l_crh_rec.cash_receipt_id
and dis.source_id = crh.cash_receipt_history_id
and dis.source_table = 'CRH'
and dis.source_type ='BANK_CHARGES');
select 'Y'
into l_bcharge_row_on_current_crh
from ar_distributions dis
where dis.source_id = l_crh_rec.cash_receipt_history_id
and dis.source_table = 'CRH'
and dis.source_type = 'BANK_CHARGES';
select nvl(sum(dis.amount_dr),0),
nvl(sum(dis.amount_cr),0),
nvl(sum(dis.acctd_amount_dr),0),
nvl(sum(dis.acctd_amount_cr),0)
into l_sum_fda_debits,
l_sum_fda_credits,
l_sum_acctd_fda_debits,
l_sum_acctd_fda_credits
from ar_distributions dis
where dis.source_id in
(select crh.cash_receipt_history_id
from ar_cash_receipt_history crh
where crh.cash_receipt_id = p_cash_receipt_id ) /* Bug2855253 removed and crh.current_record_flag ='N' */
and dis.source_table = 'CRH'
and dis.source_type = 'BANK_CHARGES';
arp_standard.debug('update_cash_receipt: ' || 'p_factor_discount_amount: ' || to_char(p_factor_discount_amount));
arp_standard.debug('update_cash_receipt: ' || 'l_sum_fda_debits : ' || to_char(l_sum_fda_debits));
arp_standard.debug('update_cash_receipt: ' || 'l_sum_fda_credits: ' || to_char(l_sum_fda_credits));
arp_standard.debug('update_cash_receipt: ' || 'l_sum_acctd_fda_debits: ' || to_char(l_sum_acctd_fda_debits));
arp_standard.debug('update_cash_receipt: ' || 'l_sum_acctd_fda_credits: ' || to_char(l_sum_acctd_fda_credits));
arp_proc_rct_util.update_dist_rec(
l_crh_rec.cash_receipt_history_id,
'BANK_CHARGES',
nvl(p_factor_discount_amount,0) - (l_sum_fda_debits - l_sum_fda_credits),
nvl(l_crh_acctd_fda_new,0) - (l_sum_acctd_fda_debits - l_sum_acctd_fda_credits) );
arp_proc_rct_util.insert_dist_rec(
nvl(p_factor_discount_amount,0) - (l_sum_fda_debits - l_sum_fda_credits),
nvl(l_crh_acctd_fda_new,0) - (l_sum_acctd_fda_debits - l_sum_acctd_fda_credits),
l_crh_rec.cash_receipt_history_id,
'BANK_CHARGES',
l_bank_charges_ccid);
arp_proc_rct_util.insert_dist_rec(
p_factor_discount_amount,
l_crh_acctd_fda_new,
l_crh_rec.cash_receipt_history_id,
'BANK_CHARGES',
l_bank_charges_ccid);
arp_cr_history_pkg.update_p(l_crh_rec);
arp_cr_history_pkg.insert_p(l_crh_rec_new, l_crh_id_new);
arp_cr_history_pkg.update_p(l_crh_rec);
arp_standard.debug('update_cash_receipt: ' || 'l_crh_amount_delta : ' || to_char(l_crh_amount_delta));
arp_standard.debug('update_cash_receipt: ' || 'l_crh_acctd_amount_delta : ' || to_char(l_crh_acctd_amount_delta));
arp_standard.debug('update_cash_receipt: ' || 'cash_receipt_history_id : ' || to_char(l_crh_rec.cash_receipt_history_id));
arp_standard.debug('update_cash_receipt: ' || 'l_source_type : ' || l_source_type);
arp_standard.debug('update_cash_receipt: ' || 'l_crh_ccid : ' || l_crh_ccid);
arp_proc_rct_util.insert_dist_rec(l_crh_amount_delta,
l_crh_acctd_amount_delta,
l_crh_rec.cash_receipt_history_id,
l_source_type,
l_crh_ccid);
arp_standard.debug('update_cash_receipt: ' || 'l_crh_fda_delta : ' || to_char(l_crh_fda_delta));
arp_standard.debug('update_cash_receipt: ' || 'l_crh_acctd_fda_delta : ' || to_char(l_crh_acctd_fda_delta));
arp_standard.debug('update_cash_receipt: ' || 'cash_receipt_history_id : ' || to_char(l_crh_rec.cash_receipt_history_id));
arp_standard.debug('update_cash_receipt: ' || 'l_crh_ccid : ' || l_bank_charges_ccid);
arp_proc_rct_util.insert_dist_rec(
l_crh_fda_delta,
l_crh_acctd_fda_delta,
l_crh_rec.cash_receipt_history_id,
'BANK_CHARGES',
l_bank_charges_ccid);
arp_proc_rct_util.insert_ra_rec_cash(
p_cash_receipt_id,
l_cr_amount_delta,
p_receipt_date,
'UNID',
l_cr_acctd_amount_delta,
l_valid_gl_date,
l_unidentified_ccid,
l_ps_rec.payment_schedule_id,
'60.4',
'',
l_ra_id_unid);
ar_mrc_engine3.update_ra_rec_cash_diff(
p_rec_app_id => l_ra_id_unid,
p_cash_receipt_id => p_cash_receipt_id,
p_diff_amount => l_cr_amount_delta,
p_old_rcpt_amount => l_cr_rec.amount,
p_payment_schedule_id =>l_ps_rec.payment_schedule_id
);
arp_proc_rct_util.insert_ra_rec_cash(
p_cash_receipt_id,
l_cr_amount_delta,
p_receipt_date,
'UNAPP',
l_cr_acctd_amount_delta,
l_valid_gl_date,
l_unapplied_ccid,
l_ps_rec.payment_schedule_id,
'60.2',
'',
l_ra_id_unapp);
is updated later */
l_ae_doc_rec.miscel5 := p_pay_from_customer;
arp_standard.debug('Before Inserting CR/CRH record in update_cash_receipt.');
arp_acct_event_pkg.update_cr_dist
( p_ledger_id => arp_global.set_of_books_id
,p_source_id_int_1 => p_cash_receipt_id
,p_third_party_merge_date => l_valid_gl_date
,p_original_third_party_id => l_current_customer_id
,p_original_site_id => l_current_csu_id
,p_new_third_party_id => p_pay_from_customer
,p_new_site_id => p_customer_site_use_id
,p_create_update => 'U'
,p_entity_code => 'RECEIPTS'
,p_type_of_third_party_merge => 'PARTIAL'
,p_mapping_flag => 'N'
,p_execution_mode => 'SYNC'
,p_accounting_mode => 'F'
,p_transfer_to_gl_flag => 'Y'
,p_post_in_gl_flag => 'Y'
,p_third_party_type => 'C'
,x_errbuf => x_errbuf
,x_retcode => x_retcode
,x_event_ids => x_event_ids
,x_request_id => x_request_id);
arp_cash_receipts_pkg.update_p(l_cr_rec);
arp_cr_history_pkg.update_p(l_crh_rec);
arp_ps_pkg.update_p(l_ps_rec);
AR_BUS_EVENT_COVER.p_insert_trx_sum_hist(l_trx_sum_hist_rec,
l_history_id,
'PMT',
'MODIFY_PMT');
arp_standard.debug('update_cash_receipt: ' || 'Receipt needs to be reversed.');
arp_standard.debug('update_cash_receipt: ' || 'Debit memo reversal required');
AR_BUS_EVENT_COVER.p_insert_trx_sum_hist(l_trx_sum_hist_rec,
l_history_id,
'PMT',
'DM_REVERSE_PMT');
arp_standard.debug('update_cash_receipt: ' || 'Regular reversal required');
arp_standard.debug('update_cash_receipt: ' || 'before creating the history rec for BusinessEvent');
AR_BUS_EVENT_COVER.p_insert_trx_sum_hist(l_trx_sum_hist_rec,
l_history_id,
'PMT',
'REVERSE_PMT');
arp_standard.debug('update_cash_receipt: ' || 'before raising the new business event');
arp_standard.debug('arp_process_receipts.update_cash_receipt()+');
SELECT cr.status,
l_cr_status.meaning,
crh_current.status ,
l_crh_status.meaning
INTO p_new_status,
p_new_status_dsp,
p_new_state,
p_new_state_dsp
FROM
ar_cash_receipt_history crh_current,
ar_cash_receipts cr,
ar_lookups l_cr_status,
ar_lookups l_crh_status
WHERE
cr.cash_receipt_id = p_cash_receipt_id
AND l_cr_status.lookup_type = 'CHECK_STATUS'
AND l_cr_status.lookup_code = cr.status
AND l_crh_status.lookup_type = 'RECEIPT_CREATION_STATUS'
AND l_crh_status.lookup_code = crh_current.status
AND crh_current.cash_receipt_id = cr.cash_receipt_id
AND crh_current.current_record_flag = 'Y';
arp_standard.debug('Exception in arp_process_receipts.update_cash_receipts');
arp_standard.debug('update_cash_receipt: ' || 'p_cash_receipt_id = '|| to_char(p_cash_receipt_id));
arp_standard.debug('update_cash_receipt: ' || 'p_amount = '|| to_char(p_amount));
arp_standard.debug('update_cash_receipt: ' || 'p_factor_discount_amount = '|| to_char(p_factor_discount_amount));
arp_standard.debug('arp_process_rct_util.update_cash_receipts()-');
END update_cash_receipt;