[Home] [Help]
6: /* ==================================================================================
7: | PROCEDURE build_for_credit
8: |
9: | DESCRIPTION
10: | This procedure populates ar_revenue_assignments_gt (a global temporary
11: | table) with rows from ar_revenue_assignments (the view). In 11i apps,
12: | the CBO seems to have a lot of trouble with any sql containing this
13: | view. So this is an effort to offload that work to a separate
14: | sql step.
51: THEN
52:
53: arp_standard.debug('arp_revenue_assignments - using request_id');
54:
55: INSERT INTO AR_REVENUE_ASSIGNMENTS_GT
56: (SESSION_ID,
57: CUSTOMER_TRX_LINE_ID,
58: COMPLETE_FLAG,
59: ACCOUNT_CLASS,
120: THEN
121:
122: arp_standard.debug('arp_revenue_assignments - using line_id');
123:
124: INSERT INTO AR_REVENUE_ASSIGNMENTS_GT
125: (SESSION_ID,
126: CUSTOMER_TRX_LINE_ID,
127: COMPLETE_FLAG,
128: ACCOUNT_CLASS,
186: ELSE
187:
188: arp_standard.debug('arp_revenue_assignments - using trx_id');
189:
190: INSERT INTO AR_REVENUE_ASSIGNMENTS_GT
191: (SESSION_ID,
192: CUSTOMER_TRX_LINE_ID,
193: COMPLETE_FLAG,
194: ACCOUNT_CLASS,
250: and decode(rr.type, 'A',rr.rule_id, -1) = rrs.rule_id;
251:
252: END IF;
253: IF PG_DEBUG in ('Y', 'C') THEN
254: arp_standard.debug('ar_revenue_assignments_gt ***');
255: DECLARE
256: CURSOR c01 IS
257: SELECT
258: SESSION_ID,
266: RULE_DATE,
267: SET_OF_BOOKS_ID,
268: PERIOD_TYPE,
269: MAX_REGULAR_PERIOD_LENGTH
270: FROM AR_REVENUE_ASSIGNMENTS_GT
271: WHERE session_id = p_session_id
272: ORDER BY CUSTOMER_TRX_LINE_ID, RULE_date;
273: i NUMBER := 1;
274: BEGIN