DBA Data[Home] [Help]

APPS.ARP_PROC_RECEIPTS1 SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 20

 |    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 */
	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;
Line: 387

SELECT pay_from_customer,
       customer_site_use_id
  FROM ar_cash_receipts
 WHERE cash_receipt_id = p_cash_receipt_id;
Line: 401

     arp_standard.debug('arp_process_receipts.update_cash_receipt()+');
Line: 485

         arp_standard.debug('update_cash_receipt: ' || 'l_cr_amount_changed_flag = TRUE');
Line: 492

     arp_standard.debug('update_cash_receipt: ' || 'P_GL_DATE is:' || to_char(p_gl_date, 'DD-MM-YYYY:HH:SS'));
Line: 493

     arp_standard.debug('update_cash_receipt: ' || 'l_valid_gl_date is:' || to_char(l_valid_gl_date, 'DD-MM-YYYY:HH:SS'));
Line: 500

         arp_standard.debug('update_cash_receipt: ' || 'l_crh_rec_gl_date_changed = TRUE');
Line: 512

         arp_standard.debug('update_cash_receipt: ' || 'l_crh_fda_changed_flag = TRUE');
Line: 523

         arp_standard.debug('update_cash_receipt: ' || 'l_crh_rec_posted_flag = TRUE');
Line: 534

         arp_standard.debug('update_cash_receipt: ' || 'l_rct_identified_flag = TRUE');
Line: 545

         arp_standard.debug('update_cash_receipt: ' || 'l_rct_unidentified_flag = TRUE');
Line: 587

  /* 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));
Line: 610

  /* 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);
Line: 676

     arp_standard.debug('update_cash_receipt: ' || 'p_amount = 		'|| to_char(p_amount));
Line: 677

     arp_standard.debug('update_cash_receipt: ' || 'l_crh_amount_new =	'|| to_char(l_crh_amount_new));
Line: 678

     arp_standard.debug('update_cash_receipt: ' || 'l_crh_acctd_amount_new =  '|| to_char(l_crh_acctd_amount_new));
Line: 697

    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';
Line: 705

    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     );
Line: 733

    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);
Line: 747

    update ar_receivable_applications
      set include_in_accumulation ='N'
    where cash_receipt_id = p_cash_receipt_id
    and   status = 'UNAPP';
Line: 766

     is updated later */
    l_ae_doc_rec.miscel5                   := p_pay_from_customer;
Line: 785

    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';
Line: 793

    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);
Line: 808

    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);
Line: 822

    update ar_receivable_applications
      set include_in_accumulation ='N'
    where cash_receipt_id = p_cash_receipt_id
    and   status = 'UNAPP';
Line: 895

       The cash_receipt_history record needs to be updated for APPROVED receipts */
    arp_cr_history_pkg.update_p(l_crh_rec);
Line: 916

         arp_standard.debug('update_cash_receipt: ' || 'l_ps_rec.amount_due_remaining: ' || to_char(l_ps_rec.amount_due_remaining));
Line: 917

         arp_standard.debug('update_cash_receipt: ' || 'p_amount: ' || to_char(p_amount));
Line: 918

         arp_standard.debug('update_cash_receipt: ' || 'l_cr_rec.amount: ' || to_char(l_cr_rec.amount));
Line: 919

         arp_standard.debug('update_cash_receipt: ' || 'l_cr_acctd_amount_delta: ' || to_char(l_cr_acctd_amount_delta));
Line: 931

         arp_standard.debug('update_cash_receipt: ' || 'l_ps_rec.amount_due_remaining: ' || to_char(l_ps_rec.amount_due_remaining));
Line: 932

         arp_standard.debug('update_cash_receipt: ' || 'l_ps_rec.acctd_amount_due_remaining: ' || to_char(l_ps_rec.acctd_amount_due_remaining));
Line: 970

          /* 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;
Line: 984

             arp_standard.debug('update_cash_receipt: '||'l_dist_row_on_current_crh : '||l_dist_row_on_current_crh);
Line: 987

            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);
Line: 994

              arp_standard.debug('update_cash_receipt: ' || 'l_crh_amount_delta : ' || to_char(l_crh_amount_delta));
Line: 995

              arp_standard.debug('update_cash_receipt: ' || 'l_crh_acctd_amount_delta : ' || to_char(l_crh_acctd_amount_delta));
Line: 996

              arp_standard.debug('update_cash_receipt: ' || 'cash_receipt_history_id : ' || to_char(l_crh_rec.cash_receipt_history_id));
Line: 997

              arp_standard.debug('update_cash_receipt: ' || 'l_source_type : ' || l_source_type);
Line: 998

              arp_standard.debug('update_cash_receipt: ' || 'l_crh_ccid : ' || l_crh_ccid);
Line: 1001

            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);
Line: 1025

             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');
Line: 1044

            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';
Line: 1086

             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';
Line: 1104

                arp_standard.debug('update_cash_receipt: ' || 'p_factor_discount_amount: ' || to_char(p_factor_discount_amount));
Line: 1105

                arp_standard.debug('update_cash_receipt: ' || 'l_sum_fda_debits : ' || to_char(l_sum_fda_debits));
Line: 1106

                arp_standard.debug('update_cash_receipt: ' || 'l_sum_fda_credits: ' || to_char(l_sum_fda_credits));
Line: 1107

                arp_standard.debug('update_cash_receipt: ' || 'l_sum_acctd_fda_debits: ' || to_char(l_sum_acctd_fda_debits));
Line: 1108

                arp_standard.debug('update_cash_receipt: ' || 'l_sum_acctd_fda_credits: ' || to_char(l_sum_acctd_fda_credits));
Line: 1115

               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) );
Line: 1121

                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);
Line: 1135

             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);
Line: 1161

        arp_cr_history_pkg.update_p(l_crh_rec);
Line: 1187

        arp_cr_history_pkg.insert_p(l_crh_rec_new, l_crh_id_new);
Line: 1199

	arp_cr_history_pkg.update_p(l_crh_rec);
Line: 1213

             arp_standard.debug('update_cash_receipt: ' || 'l_crh_amount_delta : ' || to_char(l_crh_amount_delta));
Line: 1214

             arp_standard.debug('update_cash_receipt: ' || 'l_crh_acctd_amount_delta : ' || to_char(l_crh_acctd_amount_delta));
Line: 1215

             arp_standard.debug('update_cash_receipt: ' || 'cash_receipt_history_id : ' || to_char(l_crh_rec.cash_receipt_history_id));
Line: 1216

             arp_standard.debug('update_cash_receipt: ' || 'l_source_type : ' || l_source_type);
Line: 1217

             arp_standard.debug('update_cash_receipt: ' || 'l_crh_ccid : ' || l_crh_ccid);
Line: 1220

  	  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);
Line: 1235

            arp_standard.debug('update_cash_receipt: ' || 'l_crh_fda_delta : ' || to_char(l_crh_fda_delta));
Line: 1236

	    arp_standard.debug('update_cash_receipt: ' || 'l_crh_acctd_fda_delta : ' || to_char(l_crh_acctd_fda_delta));
Line: 1237

            arp_standard.debug('update_cash_receipt: ' || 'cash_receipt_history_id : ' || to_char(l_crh_rec.cash_receipt_history_id));
Line: 1238

             arp_standard.debug('update_cash_receipt: ' || 'l_crh_ccid : ' || l_bank_charges_ccid);
Line: 1241

          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);
Line: 1259

	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);
Line: 1273

           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
                        );
Line: 1299

	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);
Line: 1313

     update ar_receivable_applications
      set include_in_accumulation ='N'
     where cash_receipt_id = p_cash_receipt_id
     and   status = 'UNAPP';
Line: 1332

     is updated later */
       l_ae_doc_rec.miscel5                   := p_pay_from_customer;
Line: 1446

     arp_standard.debug('Before Inserting CR/CRH record in update_cash_receipt.');
Line: 1453

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);
Line: 1481

  arp_cash_receipts_pkg.update_p(l_cr_rec);
Line: 1488

  arp_cr_history_pkg.update_p(l_crh_rec);
Line: 1494

  arp_ps_pkg.update_p(l_ps_rec);
Line: 1507

   AR_BUS_EVENT_COVER.p_insert_trx_sum_hist(l_trx_sum_hist_rec,
                                            l_history_id,
                                            'PMT',
                                            'MODIFY_PMT');
Line: 1545

       arp_standard.debug('update_cash_receipt: ' || 'Receipt needs to be reversed.');
Line: 1549

         arp_standard.debug('update_cash_receipt: ' || 'Debit memo reversal required');
Line: 1577

       AR_BUS_EVENT_COVER.p_insert_trx_sum_hist(l_trx_sum_hist_rec,
                                                l_history_id,
                                                'PMT',
                                                'DM_REVERSE_PMT');
Line: 1589

         arp_standard.debug('update_cash_receipt: ' || 'Regular reversal required');
Line: 1635

      arp_standard.debug('update_cash_receipt: ' || 'before creating the history rec for BusinessEvent');
Line: 1637

   AR_BUS_EVENT_COVER.p_insert_trx_sum_hist(l_trx_sum_hist_rec,
                                            l_history_id,
                                            'PMT',
                                            'REVERSE_PMT');
Line: 1644

      arp_standard.debug('update_cash_receipt: ' || 'before raising the new business event');
Line: 1684

     arp_standard.debug('arp_process_receipts.update_cash_receipt()+');
Line: 1699

        SELECT PARTY_ID INTO l_party_id
        FROM   HZ_CUST_ACCOUNTS
        WHERE  CUST_ACCOUNT_ID = p_pay_from_customer;
Line: 1703

        SELECT COUNT(*) INTO l_no_of_accounts
        FROM   IBY_FNDCPT_PAYER_ASSGN_INSTR_V
        WHERE  CUST_ACCOUNT_ID    =    p_pay_from_customer
        AND    INSTRUMENT_ID      =    p_customer_bank_account_id;
Line: 1716

	    SELECT COUNT(*) INTO l_no_of_other_accounts
            FROM   IBY_FNDCPT_PAYER_ASSGN_INSTR_V
            WHERE  NVL(CUST_ACCOUNT_ID, -99) <> p_pay_from_customer
            AND    INSTRUMENT_ID      =    p_customer_bank_account_id;
Line: 1728

	        SELECT COUNT(*) INTO l_no_of_other_party_accounts
                FROM   IBY_FNDCPT_PAYER_ASSGN_INSTR_V
		WHERE  PARTY_ID           <>   l_party_id
                AND    INSTRUMENT_ID      =    p_customer_bank_account_id;
Line: 1741

		    UPDATE AR_CASH_RECEIPTS SET
                        CUSTOMER_BANK_ACCOUNT_ID = NULL,
			APPLICATION_NOTES = (SELECT DISTINCT 'Removed Bank Account: '||BANK_NAME||'-'||ACCOUNT_NUMBER||
                                                             ' from this receipt.'
                                             FROM IBY_FNDCPT_PAYER_ASSGN_INSTR_V
					     WHERE INSTRUMENT_ID = p_customer_bank_account_id)
		    WHERE CASH_RECEIPT_ID = p_cash_receipt_id;
Line: 1786

	    ARP_EXT_BANK_PKG.INSERT_ACCT_INSTR_ASSIGNMENT(
		p_party_id        =>  l_party_id,
		p_customer_id     =>  p_pay_from_customer,
		p_instr_id        =>  p_customer_bank_account_id,
		p_assignment_start_date => p_receipt_date, --Add for bug 13801721
		x_instr_assign_id =>  l_instr_assign_id,
		x_return_status   =>  l_iby_return_status );
Line: 1810

  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';
Line: 1835

         arp_standard.debug('Exception in arp_process_receipts.update_cash_receipts');
Line: 1836

         arp_standard.debug('update_cash_receipt: ' || 'p_cash_receipt_id =		'|| to_char(p_cash_receipt_id));
Line: 1837

         arp_standard.debug('update_cash_receipt: ' || 'p_amount =			'|| to_char(p_amount));
Line: 1838

         arp_standard.debug('update_cash_receipt: ' || 'p_factor_discount_amount =	'|| to_char(p_factor_discount_amount));
Line: 1843

     arp_standard.debug('arp_process_rct_util.update_cash_receipts()-');
Line: 1846

END update_cash_receipt;