323: | PUBLIC PROCEDURE |
324: | refresh |
325: | |
326: | DESCRIPTION |
327: | Updates ar_periods and ar_period_types tables with latest changes in |
328: | gl_periods table. |
329: | |
330: | PARAMETERS |
331: | INPUT |
356:
357: SAVEPOINT AR_PERIODS_1;
358:
359: IF PG_DEBUG in ('Y', 'C') THEN
360: arp_standard.debug('Updating ar_period_types: ');
361: END IF;
362:
363: UPDATE ar_period_types apt
364: SET
359: IF PG_DEBUG in ('Y', 'C') THEN
360: arp_standard.debug('Updating ar_period_types: ');
361: END IF;
362:
363: UPDATE ar_period_types apt
364: SET
365: max_regular_period_length =
366: (
367: SELECT MAX(g.end_date - g.start_date) + 1
379: );
380:
381: IF PG_DEBUG in ('Y', 'C') THEN
382: arp_standard.debug('row(s) updated: ' || TO_CHAR(sql%rowcount));
383: arp_standard.debug('Inserting into ar_period_types: ');
384: END IF;
385:
386: INSERT
387: INTO ar_period_types
383: arp_standard.debug('Inserting into ar_period_types: ');
384: END IF;
385:
386: INSERT
387: INTO ar_period_types
388: ( period_type, max_regular_period_length )
389: (
390: SELECT
391: g.period_type,
396: g.adjustment_period_flag = 'N'
397: AND NOT EXISTS
398: (
399: SELECT NULL
400: FROM ar_period_types apt
401: WHERE apt.period_type = g.period_type
402: )
403: GROUP BY period_type
404: );