[Home] [Help]
6077: g_state := 'Truncating table FII_AR_RECEIPTS_F';
6078: TRUNCATE_TABLE('FII_AR_RECEIPTS_F');
6079: */
6080:
6081: g_state := 'Populating FII_AR_RECAPP_MERGE_GT';
6082: if g_debug_flag = 'Y' then
6083: FII_UTIL.put_line(g_state);
6084: FII_UTIL.start_timer;
6085: FII_UTIL.put_line('');
6084: FII_UTIL.start_timer;
6085: FII_UTIL.put_line('');
6086: end if;
6087:
6088: insert into FII_AR_RECAPP_MERGE_GT
6089: (
6090: receivable_application_id,
6091: time_id,
6092: cash_receipt_id,
6378: */
6379: ;
6380:
6381: if g_debug_flag = 'Y' then
6382: FII_UTIL.put_line('Inserted ' ||SQL%ROWCOUNT|| ' records into FII_AR_RECAPP_MERGE_GT');
6383: FII_UTIL.stop_timer;
6384: FII_UTIL.print_timer('Duration');
6385: FII_UTIL.put_line('');
6386: end if;
6394:
6395: delete from fii_ar_receipts_f
6396: where RECEIVABLE_APPLICATION_ID in (
6397: select RECEIVABLE_APPLICATION_ID
6398: from FII_AR_RECAPP_MERGE_GT
6399: where (case when applied_payment_schedule_id is null
6400: or applied_payment_schedule_id < 0
6401: then case when --receipt_date >= g_global_start_date
6402: decode(g_collection_criteria,
6479: CREATED_BY,
6480: LAST_UPDATE_DATE,
6481: LAST_UPDATED_BY,
6482: LAST_UPDATE_LOGIN
6483: from FII_AR_RECAPP_MERGE_GT
6484: /* where (case when applied_payment_schedule_id is null
6485: or applied_payment_schedule_id < 0
6486: then case when --receipt_date >= g_global_start_date
6487: decode(g_collection_criteria,
8251: gt.receivable_application_id,
8252: gt.amount_applied_rct_func bucket_amount_func,
8253: gt.amount_applied_rct_prim bucket_amount_prim,
8254: gt.amount_applied_rct_sec bucket_amount_sec
8255: from FII_AR_RECAPP_MERGE_GT gt
8256: where gt.application_status in ('UNAPP','UNID')
8257: and gt.header_status not in ('REV', 'NSF', 'STOP')
8258: and nvl(gt.applied_payment_schedule_id,1) > 0 --exclude all special applications
8259: and gt.application_type = 'CASH'
9015: -- Purpose
9016: -- This procedure detects new unapplied receipts.
9017: -- It also detects records in fii_ar_aging_receipts that have not been
9018: -- completely aged.
9019: -- Corresponding cash_receipt_id(s) are populated in FII_AR_RECAPP_MERGE_GT
9020: ------------------------------------------------------------------
9021: PROCEDURE POPULATE_INCREMENTAL_RCT_IDS IS
9022:
9023: BEGIN
9027: FII_UTIL.put_line(g_state);
9028: end if;
9029:
9030: --trx_ids that have new applications
9031: --These are already in FII_AR_RECAPP_MERGE_GT
9032:
9033: g_state := 'Populating FII_AR_RECAPP_MERGE_GT from fii_ar_aging_receipts';
9034: if g_debug_flag = 'Y' then
9035: FII_UTIL.put_line(g_state);
9029:
9030: --trx_ids that have new applications
9031: --These are already in FII_AR_RECAPP_MERGE_GT
9032:
9033: g_state := 'Populating FII_AR_RECAPP_MERGE_GT from fii_ar_aging_receipts';
9034: if g_debug_flag = 'Y' then
9035: FII_UTIL.put_line(g_state);
9036: end if;
9037:
9035: FII_UTIL.put_line(g_state);
9036: end if;
9037:
9038: --Insert rct ids that are already in aging table but not yet aged completely
9039: INSERT INTO FII_AR_RECAPP_MERGE_GT
9040: ( receivable_application_id,
9041: time_id,
9042: cash_receipt_id,
9043: application_status,
9148: where ag.next_aging_date > G_LAST_UPDATE_DATE --'15-APR-2005'
9149: and ag.next_aging_date <= g_sysdate --'20-MAY-2005'
9150: and not exists
9151: (select 1
9152: from FII_AR_RECAPP_MERGE_GT t
9153: where t.cash_receipt_id = ag.cash_receipt_id
9154: and t.application_status in ('UNAPP','UNID')
9155: and t.header_status not in ('REV', 'NSF', 'STOP')
9156: and nvl(t.applied_payment_schedule_id,1) > 0 --exclude all special applications
9163: and rct.application_type = 'CASH'
9164: and rct.amount_applied_rct_func <> 0);
9165:
9166: if g_debug_flag = 'Y' then
9167: FII_UTIL.put_line('Inserted ' ||SQL%ROWCOUNT|| ' additional records into FII_AR_RECAPP_MERGE_GT.');
9168: FII_UTIL.stop_timer;
9169: FII_UTIL.print_timer('Duration');
9170: FII_UTIL.put_line('');
9171: end if;