7: G_PKG_NAME CONSTANT VARCHAR2(30) := 'ARI_DB_UTILITIES';
8: /*========================================================================
9: | Prototype Declarations Procedures
10: *=======================================================================*/
11: PG_DEBUG varchar2(1) := NVL(FND_PROFILE.value('AFLOG_ENABLED'), 'N');
12:
13: PROCEDURE calc_aging_buckets (
14: p_customer_id IN NUMBER,
15: p_as_of_date IN DATE,
565: --and 'CM' <> ps.class
566: and 'PMT' <> ps.class
567: and 'GUAR' <> ps.class
568: AND ps.customer_trx_id = ct.customer_trx_id
569: AND(TRUNC(ps.trx_date)) >= trunc(decode( nvl(FND_PROFILE.VALUE('ARI_FILTER_TRXDATE_OLDER'), 0), 0, ps.trx_date, (sysdate-FND_PROFILE.VALUE('ARI_FILTER_TRXDATE_OLDER'))))
570: AND ct.printing_option = decode(nvl(FND_PROFILE.VALUE('ARI_FILTER_DONOTPRINT_TRX'), 'NOT'), 'Y', 'PRI', ct.printing_option)
571: ) ;
572:
573: CURSOR c_buckets_all IS
566: and 'PMT' <> ps.class
567: and 'GUAR' <> ps.class
568: AND ps.customer_trx_id = ct.customer_trx_id
569: AND(TRUNC(ps.trx_date)) >= trunc(decode( nvl(FND_PROFILE.VALUE('ARI_FILTER_TRXDATE_OLDER'), 0), 0, ps.trx_date, (sysdate-FND_PROFILE.VALUE('ARI_FILTER_TRXDATE_OLDER'))))
570: AND ct.printing_option = decode(nvl(FND_PROFILE.VALUE('ARI_FILTER_DONOTPRINT_TRX'), 'NOT'), 'Y', 'PRI', ct.printing_option)
571: ) ;
572:
573: CURSOR c_buckets_all IS
574: SELECT SUM(amt), SUM(amt*b0),SUM(amt*b1),SUM(amt*b2),SUM(amt*b3),SUM(amt*b4),SUM(amt*b5),SUM(amt*b6)
721: and 'CM' <> ps.class
722: and 'PMT' <> ps.class
723: and 'GUAR' <> ps.class
724: AND ps.customer_trx_id = ct.customer_trx_id
725: AND(TRUNC(ps.trx_date)) >= trunc(decode( nvl(FND_PROFILE.VALUE('ARI_FILTER_TRXDATE_OLDER'), 0), 0, ps.trx_date, (sysdate-FND_PROFILE.VALUE('ARI_FILTER_TRXDATE_OLDER'))))
726: AND ct.printing_option = decode(nvl(FND_PROFILE.VALUE('ARI_FILTER_DONOTPRINT_TRX'), 'NOT'), 'Y', 'PRI', ct.printing_option)
727: );
728: BEGIN
729: --
722: and 'PMT' <> ps.class
723: and 'GUAR' <> ps.class
724: AND ps.customer_trx_id = ct.customer_trx_id
725: AND(TRUNC(ps.trx_date)) >= trunc(decode( nvl(FND_PROFILE.VALUE('ARI_FILTER_TRXDATE_OLDER'), 0), 0, ps.trx_date, (sysdate-FND_PROFILE.VALUE('ARI_FILTER_TRXDATE_OLDER'))))
726: AND ct.printing_option = decode(nvl(FND_PROFILE.VALUE('ARI_FILTER_DONOTPRINT_TRX'), 'NOT'), 'Y', 'PRI', ct.printing_option)
727: );
728: BEGIN
729: --
730: -- Get the aging buckets definition.
1075: l_template_id NUMBER(30);
1076:
1077: BEGIN
1078:
1079: l_template_id := FND_PROFILE.value('OIR_BPA_TEMPLATE_SELECTION');
1080: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
1081: fnd_log.string(fnd_log.LEVEL_STATEMENT,G_PKG_NAME, 'oir_bpa_print_invoices, l_template_id = ' || l_template_id);
1082: end if;
1083: