DBA Data[Home] [Help]

APPS.FV_RECEIVABLES_ACTIVITY_PKG SQL Statements

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

Line: 107

  SELECT MIN(start_date) , MAX(end_date)
  INTO   vl_fy_begin_date , vl_fy_end_date
  FROM   gl_period_statuses
  WHERE  period_year = p_fiscal_year
  AND    set_of_books_id = P_SET_OF_BOOKS_ID
  AND    application_id = '101';
Line: 127

   SELECT MAX (end_date)
   INTO  vg_end_date
   FROM  gl_period_statuses
   WHERE period_year = P_FISCAL_YEAR
   AND   set_of_books_id = vp_sob_id
   AND   application_id = '101'
   AND   quarter_num = P_QUARTER;
Line: 160

 DELETE FROM fv_receivables_activity_temp;
Line: 239

SELECT 	rct.customer_trx_id,
       	rct.related_customer_trx_id,
		rct.trx_date,
		aps.amount_due_original,
        aps.amount_due_remaining,
       	aps.actual_date_closed,
	    aps.due_date,
      	aps.class,
	    aps.payment_schedule_id,
		interface_header_attribute3 created_from,
      	hzp1.category_code customer_category_code
		--fvis.status
FROM   	RA_CUSTOMER_TRX_ALL rct,
		RA_CUST_TRX_LINE_GL_DIST_ALL rctlgd,
		AR_PAYMENT_SCHEDULES_ALL aps,
		--RA_CUSTOMERS  rc, Bug#4476059 Quick Change
		hz_cust_accounts hzca1,
		hz_parties hzp1,
		FV_RECEIVABLE_TYPES_ALL frt,
 		FV_REC_CUST_TRX_TYPES_ALL fctt,
		GL_CODE_COMBINATIONS glc
		--FV_INVOICE_STATUSES_ALL fvis
WHERE  	rct.customer_trx_id = rctlgd.customer_trx_id
AND    	rct.trx_date <= vg_end_date
AND 	rctlgd.account_class = 'REC'
AND 	rctlgd.set_of_books_id = vp_sob_id
AND 	aps.customer_trx_id = rct.customer_trx_id
AND 	rct.bill_to_customer_id = hzca1.cust_account_id
AND	hzca1.party_id = hzp1.party_id
AND 	rctlgd.code_combination_id = glc.code_combination_id
AND 	hzca1.customer_class_code  = vp_nonfed_customer_class
AND 	aps.class = 'INV'
AND 	frt.receivable_type_id = fctt.receivable_type_id
AND 	frt.receivable_type = vp_type_of_receivable
AND 	fctt.cust_trx_type_id = rct.cust_trx_type_id
AND	frt.SET_OF_BOOKS_ID = vp_sob_id	-- Bug 4655467
--AND	frt.org_id = vp_org_id		-- Bug 4655467
AND	rct.SET_OF_BOOKS_ID = vp_sob_id	-- Bug 4655467
--AND	rct.org_id = vp_org_id		-- Bug 4655467
--added to main query for delinquent debt 180 days or less
--AND 	aps.customer_trx_id = fvis.customer_trx_id (+)
---AND 	vg_end_date BETWEEN NVL(fvis.start_date, vg_end_date)
--added to main query for delinquent debt 180 daysorless
--AND NVL(fvis.end_date, vg_end_date)
UNION
SELECT	rct2.customer_trx_id,
        rct2.related_customer_trx_id,
		rct2.trx_date,
		aps2.amount_due_original,
        aps2.amount_due_remaining,
        aps2.actual_date_closed,
        aps2.due_date,
        aps2.class,
        aps2.payment_schedule_id,
		rct2.interface_header_attribute3 created_from,
        hzp2.category_code customer_category_code
--		fvis.status
FROM   	RA_CUSTOMER_TRX_ALL rct2,
		AR_PAYMENT_SCHEDULES_ALL aps2,
        --RA_CUSTOMERS rc2           Bug#4476059 Quick Change
		hz_cust_accounts hzca2,
		hz_parties hzp2
--		FV_INVOICE_STATUSES_ALL fvis
where aps2.class in ('DM','CM')
and hzca2.cust_account_id = rct2.bill_to_customer_id
and hzca2.party_id = hzp2.party_id
and rct2.customer_trx_id = aps2.customer_trx_id
and rct2.SET_OF_BOOKS_ID = vp_sob_id	-- Bug 4655467
--and rct2.org_id = vp_org_id		-- Bug 4655467
--added to main query for delinquent debt 180 days or less
--and aps2.customer_trx_id = fvis.customer_trx_id (+)
and rct2.related_customer_trx_id in
	(Select rct3.customer_trx_id
     from   RA_CUSTOMER_TRX_ALL rct3,
            RA_CUST_TRX_LINE_GL_DIST_ALL rctlgd3,
 			--RA_CUSTOMERS  rc3,-- Bug#4476059 Quick Change
			hz_cust_accounts hzca3,
			hz_parties hzp3,
			AR_PAYMENT_SCHEDULES_ALL aps3,
			FV_RECEIVABLE_TYPES_ALL frt3,
			FV_REC_CUST_TRX_TYPES_ALL fctt3,
		--	FV_FUND_PARAMETERS fp3,		-- Bug 4655467
		--	FV_TREASURY_SYMBOLS  fts3,	-- Bug 4655467
			GL_CODE_COMBINATIONS glc3
  where  rct3.customer_trx_id = rctlgd3.customer_trx_id
  and      rct3.trx_date <= vg_end_date
  and rctlgd3.account_class ='REC'
  and rctlgd3.set_of_books_id = vp_sob_id
  and frt3.SET_OF_BOOKS_ID = vp_sob_id	-- Bug 4655467
--  and frt3.org_id = vp_org_id		-- Bug 4655467
  and rct3.SET_OF_BOOKS_ID = vp_sob_id	-- Bug 4655467
--  and rct3.org_id = vp_org_id		-- Bug 4655467
  and aps3.customer_trx_id = rct3.customer_trx_id
  and rct3.bill_to_customer_id = hzca3.cust_account_id
  and hzca3.party_id = hzp3.party_id
  and rctlgd3.code_combination_id = glc3.code_combination_id
  and hzca3.customer_class_code  =  vp_nonfed_customer_class
  and aps3.class = 'INV'
  and frt3.receivable_type = vp_type_of_receivable
  and frt3.receivable_type_id = fctt3.receivable_type_id
  and fctt3.cust_trx_type_id = rct3.cust_trx_type_id);
Line: 345

  SELECT status
  FROM   ra_customer_trx_all rct , fv_invoice_statuses_all fvis
  WHERE  rct.customer_trx_id = P_customer_trx_id
  AND    fvis.customer_trx_id = rct.customer_trx_id
  AND    vg_end_date  BETWEEN NVL(fvis.start_date,vg_end_date)
                AND NVL(fvis.end_date,vg_end_date);
Line: 540

  SELECT nvl(min(due_date),recs.due_date)
  INTO   l_dm_due_date
  FROM   ar_payment_schedules_all a
  WHERE  a.customer_trx_id = recs.related_customer_trx_id
  AND    amount_due_remaining > 0;
Line: 546

  SELECT MIN(payment_schedule_id)
  INTO   l_pay_schedule_id
  FROM   ar_payment_schedules_all a
  WHERE  a.customer_trx_id = recs.customer_trx_id;
Line: 622

   SELECT  related_customer_trx_id
    INTO   l_customer_trx_id
    FROM   ra_customer_trx_all rct
    WHERE  rct.customer_trx_id = recs.customer_trx_id
    AND    rct.SET_OF_BOOKS_ID = vp_sob_id;		-- Bug 4655467
Line: 642

     SELECT  count(*)
	 INTO l_count
	 FROM  fv_invoice_statuses_all fvis
     WHERE fvis.customer_trx_id = recs.customer_trx_id
     AND   fvis.status = 'CROSS';
Line: 658

SELECT min(payment_schedule_id)
INTO   l_pay_schedule_id
FROM   ar_payment_schedules_all
WHERE  customer_trx_id = recs.customer_trx_id
AND    amount_due_remaining > 0;
Line: 867

insert_row('1B01',  'Section B' ,NULL ,NULL) ;
Line: 868

insert_row('1B02',  'Delinquent Debt by Age' ,NULL ,NULL) ;
Line: 869

insert_row('1B03','LINE' ,NULL ,NULL) ;
Line: 870

insert_row('1B1',   '(1) Total Delinquencies',NULL ,NULL);
Line: 871

insert_row('1B1A',  '  (A) 1-90 Days',    num_delinq_1A , amt_delinq_1A);
Line: 872

insert_row('1B1B',  '  (B) 91-180 Days',  num_delinq_1B , amt_delinq_1B);
Line: 873

insert_row('1B1C',  '  (C) 181-365 Days', num_delinq_1C , amt_delinq_1C);
Line: 874

insert_row('1B1D',  '  (D) 1-2 Years',    num_delinq_1D , amt_delinq_1D);
Line: 875

insert_row('1B1E',  '  (E) 2-6 Years',    num_delinq_1E , amt_delinq_1E);
Line: 876

insert_row('1B1F',  '  (F) 6-10 Years',   num_delinq_1F , amt_delinq_1F);
Line: 877

insert_row('1B1G',  '  (G) Over 10 Years',num_delinq_1G , amt_delinq_1G);
Line: 878

insert_row('1B2',   '(2) Commercial',   num_delinq_commercial,
	           			amt_delinq_commercial);
Line: 880

insert_row('1B3',   '(3) Consumer',     num_delinq_consumer,
					amt_delinq_consumer);
Line: 882

insert_row('1B4',   '(4) Foreign/Sovereign Debt' ,   num_delinq_forgn_sovrn ,
  						     amt_delinq_forgn_sovrn);
Line: 885

insert_row('1B411',  '' ,NULL ,NULL);
Line: 886

insert_row('1B412',  '' ,NULL ,NULL);
Line: 887

insert_row('1B413',  '' ,NULL ,NULL);
Line: 888

insert_row('1B414',  '' ,NULL ,NULL);
Line: 889

insert_row('1B415',  '' ,NULL ,NULL);
Line: 890

insert_row('1B416',  '' ,NULL ,NULL);
Line: 891

insert_row('1B417',  '' ,NULL ,NULL);
Line: 892

insert_row('1B418',  '' ,NULL ,NULL);
Line: 893

insert_row('1B419',  '' ,NULL ,NULL);
Line: 894

insert_row('1B420',  '' ,NULL ,NULL);
Line: 895

insert_row('1B421',  '' ,NULL ,NULL);
Line: 899

insert_row('2011','LINE' ,NULL ,NULL) ;
Line: 900

insert_row('2012','Part II - Debt Management Tool and Technique',NULL,NULL);
Line: 901

insert_row('2013','          Performance Data ' ,NULL ,NULL) ;
Line: 902

insert_row('2014','LINE' ,NULL ,NULL) ;
Line: 903

insert_row('2A01','Section A' ,NULL ,NULL) ;
Line: 904

insert_row('2A02','Delinquent Debt 180 Days or Less',NULL ,NULL);
Line: 906

insert_row('2A03','LINE' ,NULL ,NULL) ;
Line: 907

insert_row('2A1', '(1) Total Delinquencies 1 - 180 Days',num_delinq_2A_tot ,
                        amt_delinq_2A_tot ) ;
Line: 909

insert_row('2A1A','  (A) In Bankruptcy',  num_tot_delinq_bankruptcy ,
                                          amt_tot_delinq_bankruptcy);
Line: 911

insert_row('2A1B','  (B) In Forbearance or In Formal Appeals Process',
num_tot_delinq_forbearance ,amt_tot_delinq_forbearance);
Line: 913

insert_row('2A1C','  (C) In Foreclosure',
num_tot_delinq_foreclosure ,amt_tot_delinq_foreclosure);
Line: 915

insert_row('2A1D','  (D) At Private Collection Agencies',
num_tot_delinq_collection ,amt_tot_delinq_collection);
Line: 917

insert_row('2A1E','  (E) In Litigation',
num_tot_delinq_litigation ,amt_tot_delinq_litigation);
Line: 919

insert_row('2A1F','  (F) Eligible for Internal Offset',
num_tot_delinq_internal_offset ,amt_tot_delinq_internal_offset);
Line: 921

insert_row('2A1G','  (G) In Wage Garnishment',
num_tot_delinq_garnishment ,amt_tot_delinq_garnishment);
Line: 923

insert_row('2A1H','  (H) At Treasury for Cross Servicing',
num_tot_delinq_cross ,amt_tot_delinq_cross);
Line: 925

insert_row('2A1I','  (I) At Treasury for Offset',
num_tot_delinq_treasury_offset ,amt_tot_delinq_treasury_offset);
Line: 927

insert_row('2A1J','  (J) At Agency',
num_tot_delinq_agency ,amt_tot_delinq_agency);
Line: 929

insert_row('2A1K','  (K) Other - must footnote',
num_tot_delinq_other ,amt_tot_delinq_other);
Line: 935

insert_row('2B01','LINE' ,NULL ,NULL) ;
Line: 936

insert_row('2B02','Section B' ,NULL ,NULL) ;
Line: 937

insert_row('2B03','Debt Eligible for Referral to Treasury for' ,NULL ,NULL) ;
Line: 938

insert_row('2B04','Offset and Cross-Servicing' ,NULL ,NULL) ;
Line: 939

insert_row('2B05','LINE' ,NULL ,NULL) ;
Line: 940

insert_row('2B11', '(1) Debt Eligible for Referral to Treasury' ,NULL ,NULL) ;
Line: 941

insert_row('2B12', '    for Offset' ,NULL ,NULL) ;
Line: 942

insert_row('2B1A', '  (A) Delinquent Debt Over 180 Days to 10 Years' ,
num_debt_eligible_180_10 ,amt_debt_eligible_180_10) ;
Line: 944

insert_row('2B1B', '  (B) In Bankruptcy (-)' ,
num_debt_eligible_bankruptcy ,amt_debt_eligible_bankruptcy) ;
Line: 946

insert_row('2B1C', '  (C) Foreign/Sovereign Debt (-)' ,
num_debt_eligible_foreign ,amt_debt_eligible_foreign) ;
Line: 948

insert_row('2B1D', '  (D) In Forbearance or Formal Appeals Process(-)' ,
num_debt_eligible_forbearance ,amt_debt_eligible_forbearance) ;
Line: 950

insert_row('2B1E', '  (E) In Foreclosure (-)' ,
num_debt_eligible_foreclosure ,amt_debt_eligible_foreclosure) ;
Line: 952

insert_row('2B1F', '  (F) Other - must footnote (+ or -)' ,
num_debt_eligible_other ,amt_debt_eligible_other) ;
Line: 954

insert_row('2B1G1','  (G) Debt Eligible for Referral to Treasury' ,
num_debt_eligible_offset ,amt_debt_eligible_offset) ;
Line: 956

insert_row('2B1G2','      for Offset' ,NULL, NULL) ;
Line: 957

insert_row('2B21', '(2) Debt Eligible for Referral to Treasury or a ' ,
NULL ,NULL) ;
Line: 959

insert_row('2B22', '    Designated Debt Collection Center for' ,NULL ,NULL) ;
Line: 960

insert_row('2B23', '    Cross-Servicing' ,NULL ,NULL) ;
Line: 961

insert_row('2B2A1','  (A) Debt Eligible for Referral to Treasury' ,
num_debt_eligible_offset ,amt_debt_eligible_offset) ;
Line: 963

insert_row('2B2A2','      for Offset' ,NULL,NULL) ;
Line: 964

insert_row('2B2B', '  (B) At PCAs (-)' ,num_debt_eligible_collection ,
                                        amt_debt_eligible_collection) ;
Line: 966

insert_row('2B2C', '  (C) In Litigation(-)' ,num_debt_eligible_litigation ,
                                             amt_debt_eligible_litigation) ;
Line: 968

insert_row('2B2D', '  (D) Eligible for Internal Offset (-)' ,
num_debt_eligible_int_offset ,amt_debt_eligible_int_offset) ;
Line: 970

insert_row('2B2E', '  (E) Other - must footnote (+ or -)' ,
num_debt_eligible_other ,amt_debt_eligible_other) ;
Line: 972

insert_row('2B2F1','  (F) Debt Eligible for Referral to Treasury or a ' ,
num_debt_eligible_X_servicing ,amt_debt_eligible_X_servicing) ;
Line: 974

insert_row('2B2F2','      Designated Debt Collection Center for' ,NULL ,NULL) ;
Line: 975

insert_row('2B2F3','      Cross-Servicing' ,NULL ,NULL) ;
Line: 1002

SELECT 	rct.customer_trx_id,
            rct.related_customer_trx_id,
		rct.trx_date,
		aps.amount_due_original,
        aps.amount_due_remaining,
        aps.actual_date_closed,
        aps.due_date,
        aps.class,
        aps.payment_schedule_id,
		rct.interface_header_attribute3 created_from,
        hzp1.category_code customer_category_code
FROM	RA_CUSTOMER_TRX_ALL rct,
		RA_CUST_TRX_LINE_GL_DIST_ALL rctlgd,
		AR_PAYMENT_SCHEDULES_ALL aps,
		--RA_CUSTOMERS  rc, --Bug#4476059 Quick Change
		hz_cust_accounts hzca1,
		hz_parties hzp1,
		FV_RECEIVABLE_TYPES_ALL frt,
        FV_REC_CUST_TRX_TYPES_ALL fctt,
	--	FV_FUND_PARAMETERS fp,		-- Bug 4655467
		GL_CODE_COMBINATIONS glc
	--	FV_TREASURY_SYMBOLS fts		-- Bug 4655467
WHERE 	rct.customer_trx_id = rctlgd.customer_trx_id
AND    	rct.trx_date <= vg_end_date
AND     rctlgd.account_class ='REC'
AND 	rctlgd.set_of_books_id = vp_sob_id
AND     aps.customer_trx_id = rct.customer_trx_id
AND     rct.bill_to_customer_id = hzca1.cust_account_id
AND	hzca1.party_id = hzp1.party_id
AND     rctlgd.code_combination_id = glc.code_combination_id
AND	 	hzca1.customer_class_code  = vp_nonfed_customer_class
AND   	aps.class = 'INV'
AND	    frt.receivable_type_id = fctt.receivable_type_id
AND 	frt.receivable_type = vp_type_of_receivable
AND		fctt.cust_trx_type_id = rct.cust_trx_type_id
AND	frt.SET_OF_BOOKS_ID = vp_sob_id	-- Bug 4655467
--AND	frt.org_id = vp_org_id		-- Bug 4655467
AND	rct.SET_OF_BOOKS_ID = vp_sob_id	-- Bug 4655467
--AND	rct.org_id = vp_org_id		-- Bug 4655467
UNION
SELECT 	rct2.customer_trx_id,
		rct2.related_customer_trx_id,
		rct2.trx_date,
		aps2.amount_due_original,
      	aps2.amount_due_remaining,
	      aps2.actual_date_closed,
      	aps2.due_date,
	      aps2.class,
      	aps2.payment_schedule_id,
		rct2.interface_header_attribute3 created_from,
	      hzp2.category_code customer_category_code
from   	RA_CUSTOMER_TRX_ALL rct2,
		ar_payment_schedules_all aps2,
      	--ra_customers rc2 --Bug#4476059 Quick Change
		hz_cust_accounts hzca2,
		hz_parties hzp2
where aps2.class in ('DM','CM')
	  	and hzca2.cust_account_id = rct2.bill_to_customer_id
		AND	hzca2.party_id = hzp2.party_id
		and rct2.customer_trx_id = aps2.customer_trx_id
		and rct2.SET_OF_BOOKS_ID = vp_sob_id	-- Bug 4655467
--		and rct2.org_id = vp_org_id		-- Bug 4655467
		and rct2.related_customer_trx_id

IN
	(Select rct3.customer_trx_id
from  RA_CUSTOMER_TRX_ALL rct3,
	RA_CUST_TRX_LINE_GL_DIST_ALL rctlgd3,
	--RA_CUSTOMERS  rc3, --Bug#4476059 Quick Change
		hz_cust_accounts hzca3,
		hz_parties hzp3,
      AR_PAYMENT_SCHEDULES_ALL aps3,
	FV_RECEIVABLE_TYPES_ALL frt3,
      FV_REC_CUST_TRX_TYPES_ALL fctt3,
--	FV_FUND_PARAMETERS fp3,		-- Bug 4655467
--	FV_TREASURY_SYMBOLS  fts3,	-- Bug 4655467
	GL_CODE_COMBINATIONS glc3
  where  rct3.customer_trx_id = rctlgd3.customer_trx_id
  and      rct3.trx_date <= vg_end_date
  and rctlgd3.account_class ='REC'
  and rctlgd3.set_of_books_id = vp_sob_id
  and frt3.SET_OF_BOOKS_ID = vp_sob_id	-- Bug 4655467
--  and frt3.org_id = vp_org_id		-- Bug 4655467
  and rct3.SET_OF_BOOKS_ID = vp_sob_id	-- Bug 4655467
--  and rct3.org_id = vp_org_id		-- Bug 4655467
  and aps3.customer_trx_id = rct3.customer_trx_id
  and rct3.bill_to_customer_id = hzca3.cust_account_id
  and hzca3.party_id = hzp3.party_id
  and rctlgd3.code_combination_id = glc3.code_combination_id
  and hzca3.customer_class_code  =  vp_nonfed_customer_class
  and aps3.class = 'INV'
  and frt3.receivable_type = vp_type_of_receivable
  and frt3.receivable_type_id = fctt3.receivable_type_id
  and fctt3.cust_trx_type_id = rct3.cust_trx_type_id);
Line: 1099

SELECT decode(fvs.factsi_customer_attribute, 'ATTRIBUTE1', ara.attribute1,
             'ATTRIBUTE2', ara.attribute2, 'ATTRIBUTE3', ara.attribute3,
             'ATTRIBUTE4', ara.attribute4, 'ATTRIBUTE5', ara.attribute5,
             'ATTRIBUTE6', ara.attribute6, 'ATTRIBUTE7', ara.attribute7,
             'ATTRIBUTE8', ara.attribute8, 'ATTRIBUTE8', ara.attribute8,
             'ATTRIBUTE9', ara.attribute9, 'ATTRIBUTE10', ara.attribute10,
             'ATTRIBUTE11', ara.attribute11, 'ATTRIBUTE12', ara.attribute12,
             'ATTRIBUTE13', ara.attribute13, 'ATTRIBUTE14', ara.attribute14,
             'ATTRIBUTE15', ara.attribute15) attribute15,
           ara.amount,
           ara.receivables_trx_id,
           ara.payment_schedule_id,
           rct.interface_header_attribute3 created_from,
           ara.customer_trx_id,
           hzp1.category_code customer_category_code,
           ara.type,
           rctt.type  trx_type
FROM       ar_adjustments_all ara,
           ra_customer_trx_all rct,
           --ra_customers rc, --Bug#4476059 Quick Change
	   hz_cust_accounts hzca1,
	   hz_parties hzp1,
           ra_cust_trx_types_all rctt,
           fv_system_parameters fvs
WHERE  rct.customer_trx_id = ara.customer_trx_id
AND    hzca1.cust_account_id   = rct.bill_to_customer_id
AND	hzca1.party_id = hzp1.party_id
AND    rct.cust_trx_type_id = rctt.cust_trx_type_id
AND    ara.apply_date >= vl_fy_begin_date
AND    ara.apply_date <  vg_end_date+1
AND    ara.gl_date    >= vl_fy_begin_date
AND    ara.gl_date    <  vg_end_date+1
AND    ara.payment_schedule_id = p_payment_schedule_id
AND    ara.customer_trx_id = p_customer_trx_id
AND    rct.SET_OF_BOOKS_ID = vp_sob_id;	-- Bug 4655467
Line: 1139

SELECT  ara.amount_applied,
        ara.APPLIED_CUSTOMER_TRX_ID ,
        ara.receivables_trx_id,
        hzp1.category_code customer_category_code,
        ara.applied_payment_schedule_id,
        acr.receipt_number,
        acr.cash_receipt_id,
	acr.amount
from    ar_receivable_applications_all ara,
        ar_cash_receipts_all acr,
        --ra_customers rc, ----Bug#4476059 Quick Change
	   hz_cust_accounts hzca1,
	   hz_parties hzp1,
        ra_customer_trx_all rct
where   ara.cash_receipt_id = acr.cash_receipt_id
and     ara.status = 'APP'
and     ara.apply_date between vl_fy_begin_date and vg_end_date+1
and     rct.customer_trx_id = p_customer_trx_id
and     hzca1.cust_account_id = rct.bill_to_customer_id
AND	hzca1.party_id = hzp1.party_id
AND     ara.APPLIED_CUSTOMER_TRX_ID = p_customer_trx_id
AND 	ara.applied_payment_schedule_id = p_payment_schedule_id ;
Line: 1165

SELECT receipt_desc_type ,NVL(ficr.amount,0) amount
FROM   fv_interim_cash_receipts_all ficr,
	 ar_cash_receipts_all acr,
	 ar_cash_receipt_history_all acrh
WHERE ficr.receipt_number = p_receipt_number
AND   ficr.customer_trx_id = p_customer_trx_id
AND   ficr.set_of_books_id  = vp_sob_id
AND   ficr.batch_id = acrh.batch_id
AND   acrh.cash_receipt_id = acr.cash_receipt_id
AND   acrh.current_record_flag = 'Y'
AND   acr.cash_receipt_id = p_cash_receipt_id ;
Line: 1180

select ara.amount_applied,
       ara.applied_customer_trx_id,
       ara.applied_payment_schedule_id,
       acr.receipt_number,
       ara.cash_receipt_id,
       aps.class
from   ar_receivable_applications_all ara,
       ar_cash_receipts_all acr,
       ar_payment_schedules_all aps
where  ara.cash_receipt_id = acr.cash_receipt_id
and    acr.set_of_books_id = vp_sob_id
and    nvl(ara.days_late,0) >=  0
and    trunc(ara.apply_date) > trunc(aps.due_date)
and    aps.customer_trx_id = ara.applied_customer_trx_id
and    aps.payment_schedule_id = ara.applied_payment_schedule_id
and    ara.applied_customer_trx_id = p_customer_trx_id
and    ara.applied_payment_schedule_id = p_payment_schedule_id ;
Line: 1334

	select nvl(sum(amount),0)
   	into l_adj_amount
   	from ar_adjustments_all
   	where customer_trx_id = recs.customer_trx_id
	and apply_date < vl_fy_begin_date + 1;
Line: 1340

   	select nvl(sum(amount_applied),0) * -1
   	into l_appld_amount
   	from ar_receivable_applications_all
   	where applied_customer_trx_id = recs.customer_trx_id
	and apply_date < vl_fy_begin_date + 1;
Line: 1352

SELECT MIN(payment_schedule_id)
INTO   l_pay_schedule_id
FROM   ar_payment_schedules_all a
WHERE  a.customer_trx_id = recs.customer_trx_id
AND    actual_date_closed > vl_fy_begin_date;
Line: 1365

SELECT min(payment_schedule_id)
INTO   l_pay_schedule_id
FROM   ar_payment_schedules_all a
WHERE  a.customer_trx_id = recs.customer_trx_id;
Line: 1382

   SELECT DISTINCT 'x' INTO dummy
   FROM   fv_finance_charge_controls_all
   WHERE  set_of_books_id = vp_sob_id
   AND    charge_type = recs.created_from  ;
Line: 1397

   SELECT DISTINCT 'x' INTO dummy
   FROM   fv_finance_charge_controls_all
   WHERE  set_of_books_id = vp_sob_id
   AND    charge_type = recs.created_from
   AND category<> 'A';
Line: 1418

    SELECT distinct 'Y' into fc_flag
    from   fv_finance_charge_controls_all
    where  charge_type = adj_recs.created_from;
Line: 1451

	SELECT status_trx
	INTO l_status
	FROM ra_customer_trx_all
	WHERE customer_trx_id = adj_recs.customer_trx_id;
Line: 1468

  select distinct 'Y' into fc_flag
  from   fv_finance_charge_controls_all
  where  set_of_books_id = vp_sob_id
  AND    charge_type = recs.created_from
  AND category <> 'A';
Line: 1556

select  min(applied_payment_schedule_id)
into schedule_id
FROM ar_receivable_applications_all
where applied_customer_trx_id =IIC_col_recs.applied_customer_trx_id
and   cash_receipt_id     =    IIC_col_recs.cash_receipt_id;
Line: 1636

insert_row('101', 'LINE' ,NULL ,NULL) ;
Line: 1637

insert_row('102', 'Part I - Status of Receivables' ,NULL ,NULL) ;
Line: 1638

insert_row('103', 'LINE' ,NULL ,NULL) ;
Line: 1639

insert_row('1A01','Section A' ,NULL ,NULL) ;
Line: 1640

insert_row('1A02','Receivables and Collections' ,NULL ,NULL) ;
Line: 1641

insert_row('1A03','LINE' ,NULL ,NULL) ;
Line: 1642

insert_row('1A1', '(1) Beginning FY Balance',
num_fy_begin_bal ,amt_fy_begin_bal ) ;
Line: 1644

insert_row('1A2', '(2) New Receivables (+)',
num_fy_new_rec   ,amt_fy_new_rec   ) ;
Line: 1646

insert_row('1A3', '(3) Accruals (+)', '', amt_adj_accrual + amt_accruals) ;
Line: 1647

insert_row('1A4', '(4) Collections on Receivables (-)', '' ,
						 amt_col_at_agency +
						 amt_col_third_party +
						 amt_col_asset_sales +
						 amt_col_others ) ;
Line: 1652

insert_row('1A4A','  (A) At Agency', '' ,amt_col_at_agency ) ;
Line: 1653

insert_row('1A4B','  (B) At Third Party', '' ,amt_col_third_party ) ;
Line: 1654

insert_row('1A4C','  (C) Asset Sales', '' ,amt_col_asset_sales ) ;
Line: 1655

insert_row('1A4D','  (D) Other - must footnote', '' ,amt_col_others ) ;
Line: 1656

insert_row('1A5', '(5) Adjustments',
num_adj ,amt_adj_reclassified + amt_adj_sales_assets + amt_adj_consolidation) ;
Line: 1658

insert_row('1A5A','  (A) Reclassified/Adjusted Amounts (+ or -)',
'', amt_adj_reclassified) ;
Line: 1660

insert_row('1A5B','  (B) Adjustments Due to Sale of Assets (+ or -)',
'', amt_adj_sales_assets) ;
Line: 1662

insert_row('1A5C','  (C) Consolidations (+ or -)',
'', amt_adj_consolidation) ;
Line: 1664

insert_row('1A6', '(6) Amounts Written-Off (-)',
num_write_off_A + num_write_off_B , amt_write_off_A + amt_write_off_B ) ;
Line: 1666

insert_row('1A6A','  (A) Currently Not Collectible',
num_write_off_A , amt_write_off_A ) ;
Line: 1668

insert_row('1A6B','  (B) Written-Off and Closed Out',
num_write_off_B , amt_write_off_B ) ;
Line: 1670

insert_row('1A70', '(7) Ending Balance',
num_fy_begin_bal + num_fy_new_rec - num_write_off_A - num_write_off_B,
amt_fy_begin_bal + amt_fy_new_rec + amt_accruals
+amt_col_at_agency + amt_col_third_party + amt_col_asset_sales + amt_col_others
+ amt_adj_reclassified + amt_adj_sales_assets + amt_adj_consolidation
+ amt_write_off_A + amt_write_off_A ) ;
Line: 1676

insert_row('1A71','LINE' ,NULL ,NULL) ;
Line: 1677

insert_row('1A7A','  (A) Foreign/Sovereign', '' , '' ) ;
Line: 1678

insert_row('1A7B','  (B) State and Local Government', '' , '' ) ;
Line: 1679

insert_row('1A7C','LINE' ,NULL ,NULL) ;
Line: 1680

insert_row('1A8', '(8) Rescheduled Debt','' ,'' ) ;
Line: 1681

insert_row('1A8A','  (A) Delinquent','' ,'') ;
Line: 1682

insert_row('1A8B','  (B) Non-Delinquent','' ,'') ;
Line: 1683

insert_row('1A91', '(9) Interest' || ' & ' || 'Late Charges',
'',    amt_fin_accruals_int + amt_fin_adj_accruals_int  ) ;
Line: 1685

insert_row('1A92','LINE' ,NULL ,NULL) ;
Line: 1689

insert_row('2C01', 'LINE' ,NULL ,NULL) ;
Line: 1690

insert_row('2C02', 'Section C' ,NULL ,NULL) ;
Line: 1691

insert_row('2C03', 'Collections' ,NULL ,NULL) ;
Line: 1692

insert_row('2C04', 'LINE' ,NULL ,NULL) ;
Line: 1693

insert_row('2C1',  '(1) Collections on Delinquent Debt',
num_SECC_1A + num_SECC_1B + num_SECC_1C + num_SECC_1D +
num_SECC_1E + num_SECC_1F + num_SECC_1G + num_SECC_1H +
num_SECC_1I + num_SECC_1J  ,
amt_SECC_1A + amt_SECC_1B + amt_SECC_1C + amt_SECC_1D +
amt_SECC_1E + amt_SECC_1F + amt_SECC_1G + amt_SECC_1H +
amt_SECC_1I + amt_SECC_1J ) ;
Line: 1700

insert_row('2C1A', '  (A) By Private Collection Agencies',
 num_SECC_1A   ,amt_SECC_1A  ) ;
Line: 1702

insert_row('2C1B', '  (B) By Litigation',
 num_SECC_1B   ,amt_SECC_1B ) ;
Line: 1704

insert_row('2C1C', '  (C) By Internal Offset',
 num_SECC_1C  , amt_SECC_1C) ;
Line: 1706

insert_row('2C1D', '  (D) By Third Party',
 num_SECC_1D ,amt_SECC_1D ) ;
Line: 1708

insert_row('2C1E', '  (E) By Asset Sales',
 num_SECC_1E ,amt_SECC_1E ) ;
Line: 1710

insert_row('2C1F', '  (F) By Wage Garnishment',
 num_SECC_1F  ,amt_SECC_1F);
Line: 1712

insert_row('2C1G1','  (G) By Treasury or a Designated Debt Collection',
 num_SECC_1G ,amt_SECC_1G  ) ;
Line: 1714

insert_row('2C1G2','      Center Cross Servicing', NULL ,NULL  ) ;
Line: 1715

insert_row('2C1H', '  (H) By Treasury Offset',
 num_SECC_1H , amt_SECC_1H);
Line: 1717

insert_row('2C1I', '  (I) By Agency',
 num_SECC_1I , amt_SECC_1I);
Line: 1719

insert_row('2C1J', '  (J) Other - must footnote',
num_SECC_1J  ,amt_SECC_1J);
Line: 1724

insert_row('2D01','LINE' ,NULL ,NULL) ;
Line: 1725

insert_row('2D02','Section D' ,NULL ,NULL) ;
Line: 1726

insert_row('2D03','Debt Disposition' ,NULL ,NULL) ;
Line: 1727

insert_row('2D04','LINE' ,NULL ,NULL) ;
Line: 1728

insert_row('2D1',  '(1) Written Off and Not Closed Out' ,NULL ,NULL) ;
Line: 1729

insert_row('2D1A', '  (A) At Private Collection Agencies' ,NULL ,NULL) ;
Line: 1730

insert_row('2D1B1','  (B) At Treasury or a Designated Debt Collection' ,
NULL ,NULL) ;
Line: 1732

insert_row('2D1B2','      Center for Cross Servicing' ,NULL ,NULL) ;
Line: 1733

insert_row('2D1C', '  (C) At Treasury for Offset' ,NULL ,NULL) ;
Line: 1734

insert_row('2D1D4','  (D) Other - must footnote' ,NULL ,NULL) ;
Line: 1735

insert_row('2D2', '(2) Reported to IRS on Form 1099-C' ,NULL ,NULL) ;
Line: 1736

insert_row('2D21','LINE' ,NULL ,NULL) ;
Line: 1755

PROCEDURE insert_row
            ( p_line_num VARCHAR2,
			  p_descpription VARCHAR2,
			  p_count NUMBER,
			  p_amount NUMBER
            ) IS
l_module_name VARCHAR2(200);
Line: 1764

l_module_name := g_module_name || 'Insert_Row.';
Line: 1766

     INSERT INTO fv_receivables_activity_temp  (
		LINE_NUM,
		DESCRIPTION,
		COUNT ,
		AMOUNT)
     VALUES  (
	 	p_line_num,
		p_descpription,
		p_count,
		p_amount );
Line: 1781

      'Error in Insert_Row procedure while inserting value for line:' ||
      p_line_num ;
Line: 1786

END insert_row;
Line: 1824

SELECT COUNT(*)
INTO vl_count
FROM fv_receivables_activity_temp ;