275: FROM jg_zz_ta_account_ranges acr,
276: jg_zz_ta_cc_ranges ccr
277: WHERE NVL(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.cost_center, ccr.cc_range_low)
278: BETWEEN ccr.cc_range_low AND ccr.cc_range_high
279: AND ccr.rule_set_id = JG_JOURNAL_ALLOCATIONS_PKG.G_rule_set_id
280: AND ccr.cc_range_id = acr.cc_range_id (+)
281: AND JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.account_number
282: BETWEEN acr.account_range_low (+) AND acr.account_range_high (+)
283: ORDER BY acr.offset_account;
318: l_output5 VARCHAR2(2000) := NULL;
319: l_output6 VARCHAR2(2000) := NULL;
320: BEGIN
321: JG_UTILITY_PKG.log( '> JG_ALLOCATE_JOURNALS_PKG.write_report_titles');
322: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL) THEN
323: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_REPORT_TITLE1');
324: FND_MESSAGE.set_token('SOB_NAME', RPAD(JG_JOURNAL_ALLOCATIONS_PKG.G_set_of_books_name, 67));
325: -- Bug 876171: The following line is too long for a row of length 180 characters
326: -- FND_MESSAGE.set_token('DATE_TIME', LPAD(fnd_date.date_to_charDT(SYSDATE), 90));
319: l_output6 VARCHAR2(2000) := NULL;
320: BEGIN
321: JG_UTILITY_PKG.log( '> JG_ALLOCATE_JOURNALS_PKG.write_report_titles');
322: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL) THEN
323: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_REPORT_TITLE1');
324: FND_MESSAGE.set_token('SOB_NAME', RPAD(JG_JOURNAL_ALLOCATIONS_PKG.G_set_of_books_name, 67));
325: -- Bug 876171: The following line is too long for a row of length 180 characters
326: -- FND_MESSAGE.set_token('DATE_TIME', LPAD(fnd_date.date_to_charDT(SYSDATE), 90));
327: FND_MESSAGE.set_token('DATE_TIME', LPAD(TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS'), 76));
320: BEGIN
321: JG_UTILITY_PKG.log( '> JG_ALLOCATE_JOURNALS_PKG.write_report_titles');
322: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL) THEN
323: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_REPORT_TITLE1');
324: FND_MESSAGE.set_token('SOB_NAME', RPAD(JG_JOURNAL_ALLOCATIONS_PKG.G_set_of_books_name, 67));
325: -- Bug 876171: The following line is too long for a row of length 180 characters
326: -- FND_MESSAGE.set_token('DATE_TIME', LPAD(fnd_date.date_to_charDT(SYSDATE), 90));
327: FND_MESSAGE.set_token('DATE_TIME', LPAD(TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS'), 76));
328: l_output1 := FND_MESSAGE.get;
325: -- Bug 876171: The following line is too long for a row of length 180 characters
326: -- FND_MESSAGE.set_token('DATE_TIME', LPAD(fnd_date.date_to_charDT(SYSDATE), 90));
327: FND_MESSAGE.set_token('DATE_TIME', LPAD(TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS'), 76));
328: l_output1 := FND_MESSAGE.get;
329: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_REPORT_TITLE2');
330: FND_MESSAGE.set_token('CONC_REQUEST_ID', TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_request_id));
331: l_output2 := FND_MESSAGE.get;
332: l_output3 := JG_JOURNAL_ALLOCATIONS_PKG.G_period_name;
333: l_output310 := JG_JOURNAL_ALLOCATIONS_PKG.G_currency_code;
326: -- FND_MESSAGE.set_token('DATE_TIME', LPAD(fnd_date.date_to_charDT(SYSDATE), 90));
327: FND_MESSAGE.set_token('DATE_TIME', LPAD(TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS'), 76));
328: l_output1 := FND_MESSAGE.get;
329: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_REPORT_TITLE2');
330: FND_MESSAGE.set_token('CONC_REQUEST_ID', TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_request_id));
331: l_output2 := FND_MESSAGE.get;
332: l_output3 := JG_JOURNAL_ALLOCATIONS_PKG.G_period_name;
333: l_output310 := JG_JOURNAL_ALLOCATIONS_PKG.G_currency_code;
334: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING2');
328: l_output1 := FND_MESSAGE.get;
329: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_REPORT_TITLE2');
330: FND_MESSAGE.set_token('CONC_REQUEST_ID', TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_request_id));
331: l_output2 := FND_MESSAGE.get;
332: l_output3 := JG_JOURNAL_ALLOCATIONS_PKG.G_period_name;
333: l_output310 := JG_JOURNAL_ALLOCATIONS_PKG.G_currency_code;
334: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING2');
335: l_output4 := FND_MESSAGE.GET;
336: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING3');
329: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_REPORT_TITLE2');
330: FND_MESSAGE.set_token('CONC_REQUEST_ID', TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_request_id));
331: l_output2 := FND_MESSAGE.get;
332: l_output3 := JG_JOURNAL_ALLOCATIONS_PKG.G_period_name;
333: l_output310 := JG_JOURNAL_ALLOCATIONS_PKG.G_currency_code;
334: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING2');
335: l_output4 := FND_MESSAGE.GET;
336: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING3');
337: l_output5 := FND_MESSAGE.GET;
330: FND_MESSAGE.set_token('CONC_REQUEST_ID', TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_request_id));
331: l_output2 := FND_MESSAGE.get;
332: l_output3 := JG_JOURNAL_ALLOCATIONS_PKG.G_period_name;
333: l_output310 := JG_JOURNAL_ALLOCATIONS_PKG.G_currency_code;
334: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING2');
335: l_output4 := FND_MESSAGE.GET;
336: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING3');
337: l_output5 := FND_MESSAGE.GET;
338: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING1');
332: l_output3 := JG_JOURNAL_ALLOCATIONS_PKG.G_period_name;
333: l_output310 := JG_JOURNAL_ALLOCATIONS_PKG.G_currency_code;
334: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING2');
335: l_output4 := FND_MESSAGE.GET;
336: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING3');
337: l_output5 := FND_MESSAGE.GET;
338: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING1');
339: l_output6 := FND_MESSAGE.GET;
340: ELSE
334: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING2');
335: l_output4 := FND_MESSAGE.GET;
336: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING3');
337: l_output5 := FND_MESSAGE.GET;
338: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING1');
339: l_output6 := FND_MESSAGE.GET;
340: ELSE
341: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_U_REPORT_TITLE1');
342: FND_MESSAGE.set_token('DATE_TIME', fnd_date.date_to_charDT(SYSDATE));
337: l_output5 := FND_MESSAGE.GET;
338: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_ERR_HEADING1');
339: l_output6 := FND_MESSAGE.GET;
340: ELSE
341: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_U_REPORT_TITLE1');
342: FND_MESSAGE.set_token('DATE_TIME', fnd_date.date_to_charDT(SYSDATE));
343: l_output1 := FND_MESSAGE.get;
344: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_REPORT_TITLE2');
345: FND_MESSAGE.set_token('CONC_REQUEST_ID', TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_request_id));
340: ELSE
341: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_U_REPORT_TITLE1');
342: FND_MESSAGE.set_token('DATE_TIME', fnd_date.date_to_charDT(SYSDATE));
343: l_output1 := FND_MESSAGE.get;
344: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_REPORT_TITLE2');
345: FND_MESSAGE.set_token('CONC_REQUEST_ID', TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_request_id));
346: l_output2 := FND_MESSAGE.get;
347: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_UNALLOC_HDING2');
348: l_output4 := FND_MESSAGE.GET;
341: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_U_REPORT_TITLE1');
342: FND_MESSAGE.set_token('DATE_TIME', fnd_date.date_to_charDT(SYSDATE));
343: l_output1 := FND_MESSAGE.get;
344: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_REPORT_TITLE2');
345: FND_MESSAGE.set_token('CONC_REQUEST_ID', TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_request_id));
346: l_output2 := FND_MESSAGE.get;
347: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_UNALLOC_HDING2');
348: l_output4 := FND_MESSAGE.GET;
349: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_UNALLOC_HDING3');
343: l_output1 := FND_MESSAGE.get;
344: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_REPORT_TITLE2');
345: FND_MESSAGE.set_token('CONC_REQUEST_ID', TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_request_id));
346: l_output2 := FND_MESSAGE.get;
347: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_UNALLOC_HDING2');
348: l_output4 := FND_MESSAGE.GET;
349: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_UNALLOC_HDING3');
350: l_output5 := FND_MESSAGE.GET;
351: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_UNALLOC_HDING1');
345: FND_MESSAGE.set_token('CONC_REQUEST_ID', TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_request_id));
346: l_output2 := FND_MESSAGE.get;
347: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_UNALLOC_HDING2');
348: l_output4 := FND_MESSAGE.GET;
349: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_UNALLOC_HDING3');
350: l_output5 := FND_MESSAGE.GET;
351: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_UNALLOC_HDING1');
352: l_output6 := FND_MESSAGE.GET;
353: END IF;
347: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_UNALLOC_HDING2');
348: l_output4 := FND_MESSAGE.GET;
349: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_UNALLOC_HDING3');
350: l_output5 := FND_MESSAGE.GET;
351: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_UNALLOC_HDING1');
352: l_output6 := FND_MESSAGE.GET;
353: END IF;
354: JG_UTILITY_PKG.out(l_output1);
355: JG_UTILITY_PKG.out(l_output2);
377: l_line_output2 VARCHAR2(2000) := NULL;
378: l_line_output3 VARCHAR2(2000) := NULL;
379: BEGIN
380: JG_UTILITY_PKG.log('> JG_ALLOCATE_JOURNALS_PKG.write_report_headings');
381: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_HEADING1');
382: l_line_output1 := FND_MESSAGE.GET;
383: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_HEADING2');
384: l_line_output2 := FND_MESSAGE.GET;
385: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_HEADING3');
379: BEGIN
380: JG_UTILITY_PKG.log('> JG_ALLOCATE_JOURNALS_PKG.write_report_headings');
381: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_HEADING1');
382: l_line_output1 := FND_MESSAGE.GET;
383: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_HEADING2');
384: l_line_output2 := FND_MESSAGE.GET;
385: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_HEADING3');
386: l_line_output3 := FND_MESSAGE.GET;
387: FND_FILE.NEW_LINE(FND_FILE.OUTPUT, 2);
381: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_HEADING1');
382: l_line_output1 := FND_MESSAGE.GET;
383: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_HEADING2');
384: l_line_output2 := FND_MESSAGE.GET;
385: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_HEADING3');
386: l_line_output3 := FND_MESSAGE.GET;
387: FND_FILE.NEW_LINE(FND_FILE.OUTPUT, 2);
388: JG_UTILITY_PKG.out(l_line_output1);
389: FND_FILE.NEW_LINE(FND_FILE.OUTPUT, 1);
425:
426: --
427: -- Retrieve the full accounting flexfield string based on original journal line
428: --
429: l_acct_seg_string := FND_FLEX_EXT.get_segs( JG_JOURNAL_ALLOCATIONS_PKG.G_GL_appln_short_name,
430: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_acct_flex_code,
431: JG_JOURNAL_ALLOCATIONS_PKG.G_chart_of_accounts_id,
432: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).code_combination_id);
433: --
426: --
427: -- Retrieve the full accounting flexfield string based on original journal line
428: --
429: l_acct_seg_string := FND_FLEX_EXT.get_segs( JG_JOURNAL_ALLOCATIONS_PKG.G_GL_appln_short_name,
430: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_acct_flex_code,
431: JG_JOURNAL_ALLOCATIONS_PKG.G_chart_of_accounts_id,
432: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).code_combination_id);
433: --
434: -- Find out NOCOPY what the segment delimiter is
427: -- Retrieve the full accounting flexfield string based on original journal line
428: --
429: l_acct_seg_string := FND_FLEX_EXT.get_segs( JG_JOURNAL_ALLOCATIONS_PKG.G_GL_appln_short_name,
430: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_acct_flex_code,
431: JG_JOURNAL_ALLOCATIONS_PKG.G_chart_of_accounts_id,
432: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).code_combination_id);
433: --
434: -- Find out NOCOPY what the segment delimiter is
435: --
432: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).code_combination_id);
433: --
434: -- Find out NOCOPY what the segment delimiter is
435: --
436: l_delimiter := FND_FLEX_EXT.get_delimiter(JG_JOURNAL_ALLOCATIONS_PKG.G_GL_appln_short_name,
437: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_acct_flex_code,
438: JG_JOURNAL_ALLOCATIONS_PKG.G_chart_of_accounts_id);
439: l_destn_acct_seg_string := l_acct_seg_string;
440:
433: --
434: -- Find out NOCOPY what the segment delimiter is
435: --
436: l_delimiter := FND_FLEX_EXT.get_delimiter(JG_JOURNAL_ALLOCATIONS_PKG.G_GL_appln_short_name,
437: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_acct_flex_code,
438: JG_JOURNAL_ALLOCATIONS_PKG.G_chart_of_accounts_id);
439: l_destn_acct_seg_string := l_acct_seg_string;
440:
441: --
434: -- Find out NOCOPY what the segment delimiter is
435: --
436: l_delimiter := FND_FLEX_EXT.get_delimiter(JG_JOURNAL_ALLOCATIONS_PKG.G_GL_appln_short_name,
437: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_acct_flex_code,
438: JG_JOURNAL_ALLOCATIONS_PKG.G_chart_of_accounts_id);
439: l_destn_acct_seg_string := l_acct_seg_string;
440:
441: --
442: -- Destination flexfield formulated differently if segment method
441: --
442: -- Destination flexfield formulated differently if segment method
443: -- is zero-filled or for offset line grouped by account range
444: --
445: IF JG_JOURNAL_ALLOCATIONS_PKG.G_destn_segment_method = 'ZF' OR
446: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_batch_name = 'OFFSET FOR ACCOUNT RANGE' THEN
447: --
448: -- For each segment
449: --
446: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_batch_name = 'OFFSET FOR ACCOUNT RANGE' THEN
447: --
448: -- For each segment
449: --
450: FOR j IN 1..JG_JOURNAL_ALLOCATIONS_PKG.G_num_of_segments LOOP
451: --
452: -- Don't zero-fill the natural account or balancing segment
453: --
454: IF j NOT IN (JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num, JG_JOURNAL_ALLOCATIONS_PKG.G_bal_segment_num) THEN
450: FOR j IN 1..JG_JOURNAL_ALLOCATIONS_PKG.G_num_of_segments LOOP
451: --
452: -- Don't zero-fill the natural account or balancing segment
453: --
454: IF j NOT IN (JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num, JG_JOURNAL_ALLOCATIONS_PKG.G_bal_segment_num) THEN
455: IF j = 1 THEN
456: l_acct_posn_start := 0;
457: ELSE
458: l_acct_posn_start := INSTR(l_destn_acct_seg_string ,l_delimiter ,1 ,j-1);
456: l_acct_posn_start := 0;
457: ELSE
458: l_acct_posn_start := INSTR(l_destn_acct_seg_string ,l_delimiter ,1 ,j-1);
459: END IF;
460: IF j = JG_JOURNAL_ALLOCATIONS_PKG.G_num_of_segments THEN
461: l_acct_posn_end := LENGTH(l_destn_acct_seg_string) + 1;
462: ELSE
463: l_acct_posn_end := INSTR(l_destn_acct_seg_string ,l_delimiter ,1 ,j);
464: END IF;
462: ELSE
463: l_acct_posn_end := INSTR(l_destn_acct_seg_string ,l_delimiter ,1 ,j);
464: END IF;
465: l_destn_acct_seg_string := SUBSTR(l_destn_acct_seg_string, 1, l_acct_posn_start)||
466: JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).zero_string||
467: SUBSTR(l_destn_acct_seg_string, l_acct_posn_end);
468: END IF;
469: END LOOP; -- each segment
470: END IF; -- Zero Fill Method
471: --
472: -- For both the Journal Account and Zero-Filled method, we are
473: -- substituting the natural account for the destination account number
474: --
475: IF JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num = 1 THEN
476: l_acct_posn_start := 0;
477: ELSE
478: l_acct_posn_start := INSTR(l_destn_acct_seg_string ,l_delimiter ,1 ,JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num - 1);
479: END IF;
474: --
475: IF JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num = 1 THEN
476: l_acct_posn_start := 0;
477: ELSE
478: l_acct_posn_start := INSTR(l_destn_acct_seg_string ,l_delimiter ,1 ,JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num - 1);
479: END IF;
480: IF JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num = JG_JOURNAL_ALLOCATIONS_PKG.G_num_of_segments THEN
481: l_acct_posn_end := LENGTH(l_destn_acct_seg_string) + 1;
482: ELSE
476: l_acct_posn_start := 0;
477: ELSE
478: l_acct_posn_start := INSTR(l_destn_acct_seg_string ,l_delimiter ,1 ,JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num - 1);
479: END IF;
480: IF JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num = JG_JOURNAL_ALLOCATIONS_PKG.G_num_of_segments THEN
481: l_acct_posn_end := LENGTH(l_destn_acct_seg_string) + 1;
482: ELSE
483: l_acct_posn_end := INSTR(l_destn_acct_seg_string ,l_delimiter ,1 ,JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num);
484: END IF;
479: END IF;
480: IF JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num = JG_JOURNAL_ALLOCATIONS_PKG.G_num_of_segments THEN
481: l_acct_posn_end := LENGTH(l_destn_acct_seg_string) + 1;
482: ELSE
483: l_acct_posn_end := INSTR(l_destn_acct_seg_string ,l_delimiter ,1 ,JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num);
484: END IF;
485: l_destn_acct_seg_string := SUBSTR(l_destn_acct_seg_string, 1, l_acct_posn_start)||
486: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_account_number||
487: SUBSTR(l_destn_acct_seg_string, l_acct_posn_end);
488:
489: -- If the next line is for a new cc range and i<>1, then insert the line separator
490: IF i <> 1 THEN
491: IF JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).cc_range_id <> JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i-1).cc_range_id THEN
492: FND_MESSAGE.set_name(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_CCRNGE_SEPRATOR');
493: l_cc_range_separator := FND_MESSAGE.get;
494: JG_UTILITY_PKG.out(RPAD(' ', 115)||l_cc_range_separator);
495: END IF;
496: END IF;
497:
498: IF JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_batch_name = 'OFFSET FOR ACCOUNT RANGE' THEN
499: JG_UTILITY_PKG.out(RPAD(' ', 115)||RPAD(SUBSTR(NVL(l_destn_acct_seg_string, ' '), 1, 34), 34)||' '||
500: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_dr,
501: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
502: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_cr,
503: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).remarks);
504: ELSIF l_previous_rec_id <> JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_batch_name||
505: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_header_name||
499: JG_UTILITY_PKG.out(RPAD(' ', 115)||RPAD(SUBSTR(NVL(l_destn_acct_seg_string, ' '), 1, 34), 34)||' '||
500: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_dr,
501: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
502: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_cr,
503: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).remarks);
504: ELSIF l_previous_rec_id <> JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_batch_name||
505: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_header_name||
506: TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_line_num) THEN
507: JG_UTILITY_PKG.out( RPAD(SUBSTR(NVL(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_batch_name, ' '), 1, 20), 20)||' '||
508: RPAD(SUBSTR(NVL(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_header_name, ' '), 1, 19), 19)||' '||
509: RPAD(SUBSTR(NVL(l_acct_seg_string, ' '), 1, 35), 35)||' '||
510: LPAD(SUBSTR(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_line_num), 1, 3), 3)||' '||
511: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).accounted_dr,
512: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
513: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).accounted_cr,
514: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
515: RPAD(SUBSTR(NVL(l_destn_acct_seg_string, ' '), 1, 34), 34)||' '||
516: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_dr,
510: LPAD(SUBSTR(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_line_num), 1, 3), 3)||' '||
511: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).accounted_dr,
512: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
513: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).accounted_cr,
514: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
515: RPAD(SUBSTR(NVL(l_destn_acct_seg_string, ' '), 1, 34), 34)||' '||
516: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_dr,
517: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
518: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_cr,
513: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).accounted_cr,
514: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
515: RPAD(SUBSTR(NVL(l_destn_acct_seg_string, ' '), 1, 34), 34)||' '||
516: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_dr,
517: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
518: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_cr,
519: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).remarks);
520: ELSE
521: JG_UTILITY_PKG.out(RPAD(' ', 115)|| RPAD(SUBSTR(NVL(l_destn_acct_seg_string, ' '), 1, 34), 34)||' '||
515: RPAD(SUBSTR(NVL(l_destn_acct_seg_string, ' '), 1, 34), 34)||' '||
516: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_dr,
517: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
518: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_cr,
519: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).remarks);
520: ELSE
521: JG_UTILITY_PKG.out(RPAD(' ', 115)|| RPAD(SUBSTR(NVL(l_destn_acct_seg_string, ' '), 1, 34), 34)||' '||
522: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_dr, JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
523: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_cr, JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).remarks);
518: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_cr,
519: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).remarks);
520: ELSE
521: JG_UTILITY_PKG.out(RPAD(' ', 115)|| RPAD(SUBSTR(NVL(l_destn_acct_seg_string, ' '), 1, 34), 34)||' '||
522: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_dr, JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
523: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_cr, JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).remarks);
524: END IF;
525:
526: l_previous_rec_id := JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_batch_name|| JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_header_name|| TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_line_num);
519: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).remarks);
520: ELSE
521: JG_UTILITY_PKG.out(RPAD(' ', 115)|| RPAD(SUBSTR(NVL(l_destn_acct_seg_string, ' '), 1, 34), 34)||' '||
522: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_dr, JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
523: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).destn_accted_cr, JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).remarks);
524: END IF;
525:
526: l_previous_rec_id := JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_batch_name|| JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_header_name|| TO_CHAR(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(i).je_line_num);
527: END LOOP; -- Each row
529: -- Output appopriate message if no rows allocated
530: IF JG_CREATE_JOURNALS_PKG.i = 0 THEN
531: -- Bug 876171: Add a new line before the no-data-found token
532: FND_FILE.NEW_LINE(FND_FILE.OUTPUT,1);
533: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_NO_DATA_FOUND');
534: -- Bug 876171: Replace the following line with new lines
535: -- JG_UTILITY_PKG.out(FND_MESSAGE.GET);
536: l_no_data_message := FND_MESSAGE.GET;
537: JG_UTILITY_PKG.out(RPAD(' ', 75)||RPAD(l_no_data_message,30)||RPAD(' ', 75));
538: ELSE
539: --
540: -- Print totals
541: --
542: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_TOTAL_SEPARATOR');
543: l_total_separator := FND_MESSAGE.GET;
544: JG_UTILITY_PKG.out(l_total_separator);
545: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_TOTAL');
546: l_total_message := FND_MESSAGE.GET;
541: --
542: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_TOTAL_SEPARATOR');
543: l_total_separator := FND_MESSAGE.GET;
544: JG_UTILITY_PKG.out(l_total_separator);
545: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_TOTAL');
546: l_total_message := FND_MESSAGE.GET;
547: JG_UTILITY_PKG.out(RPAD(' ', 41)||RPAD(l_total_message, 40)||
548: LPAD(SUBSTR(NVL(TO_CHAR(lp_total_fiscal_accted_dr_amt,
549: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
545: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_JGZZTAJA_TOTAL');
546: l_total_message := FND_MESSAGE.GET;
547: JG_UTILITY_PKG.out(RPAD(' ', 41)||RPAD(l_total_message, 40)||
548: LPAD(SUBSTR(NVL(TO_CHAR(lp_total_fiscal_accted_dr_amt,
549: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
550: LPAD(SUBSTR(NVL(TO_CHAR(lp_total_fiscal_accted_cr_amt,
551: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||
552: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.G_total_alloc_accted_dr_amt,
553: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 53)||' '||
547: JG_UTILITY_PKG.out(RPAD(' ', 41)||RPAD(l_total_message, 40)||
548: LPAD(SUBSTR(NVL(TO_CHAR(lp_total_fiscal_accted_dr_amt,
549: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
550: LPAD(SUBSTR(NVL(TO_CHAR(lp_total_fiscal_accted_cr_amt,
551: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||
552: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.G_total_alloc_accted_dr_amt,
553: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 53)||' '||
554: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.G_total_alloc_accted_cr_amt,
555: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15));
549: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||' '||
550: LPAD(SUBSTR(NVL(TO_CHAR(lp_total_fiscal_accted_cr_amt,
551: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||
552: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.G_total_alloc_accted_dr_amt,
553: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 53)||' '||
554: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.G_total_alloc_accted_cr_amt,
555: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15));
556: JG_UTILITY_PKG.log('< JG_ALLOCATE_JOURNALS_PKG.write_allocated_lines_output');
557: END IF;
551: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15)||
552: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.G_total_alloc_accted_dr_amt,
553: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 53)||' '||
554: LPAD(SUBSTR(NVL(TO_CHAR(JG_CREATE_JOURNALS_PKG.G_total_alloc_accted_cr_amt,
555: JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_format_mask), ' '), 1, 15), 15));
556: JG_UTILITY_PKG.log('< JG_ALLOCATE_JOURNALS_PKG.write_allocated_lines_output');
557: END IF;
558: END write_allocated_lines_output;
559:
589: JG_UTILITY_PKG.log( '> JG_ALLOCATE_JOURNALS_PKG.get_dynamic_select_string');
590: --
591: -- Allocation
592: --
593: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL) THEN
594: --
595: -- Set of Books ID
596: -- GC Ledger Architecture change:
597: l_sob_where := 'AND jlv.ledger_id = '||TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_set_of_books_id)||' ';
593: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL) THEN
594: --
595: -- Set of Books ID
596: -- GC Ledger Architecture change:
597: l_sob_where := 'AND jlv.ledger_id = '||TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_set_of_books_id)||' ';
598: JG_UTILITY_PKG.debug('l_sob_where = ' || l_sob_where);
599: --
600: -- Period Name
601: --
598: JG_UTILITY_PKG.debug('l_sob_where = ' || l_sob_where);
599: --
600: -- Period Name
601: --
602: IF JG_JOURNAL_ALLOCATIONS_PKG.G_period_name IS NOT NULL THEN
603: l_period_name_where := 'AND jlv.period_name = '''||JG_JOURNAL_ALLOCATIONS_PKG.G_period_name||''' ';
604: JG_UTILITY_PKG.debug('l_period_name_where = ' || l_period_name_where);
605: END IF;
606: --
599: --
600: -- Period Name
601: --
602: IF JG_JOURNAL_ALLOCATIONS_PKG.G_period_name IS NOT NULL THEN
603: l_period_name_where := 'AND jlv.period_name = '''||JG_JOURNAL_ALLOCATIONS_PKG.G_period_name||''' ';
604: JG_UTILITY_PKG.debug('l_period_name_where = ' || l_period_name_where);
605: END IF;
606: --
607: -- Currency Code
605: END IF;
606: --
607: -- Currency Code
608: --
609: IF JG_JOURNAL_ALLOCATIONS_PKG.G_currency_code IS NOT NULL THEN
610: l_currency_code_where := 'AND jlv.currency_code = '''||JG_JOURNAL_ALLOCATIONS_PKG.G_currency_code||''' ';
611: JG_UTILITY_PKG.debug('l_currency_code_where = ' ||l_currency_code_where);
612: END IF;
613: --
606: --
607: -- Currency Code
608: --
609: IF JG_JOURNAL_ALLOCATIONS_PKG.G_currency_code IS NOT NULL THEN
610: l_currency_code_where := 'AND jlv.currency_code = '''||JG_JOURNAL_ALLOCATIONS_PKG.G_currency_code||''' ';
611: JG_UTILITY_PKG.debug('l_currency_code_where = ' ||l_currency_code_where);
612: END IF;
613: --
614: -- Balancing Segment Where
612: END IF;
613: --
614: -- Balancing Segment Where
615: --
616: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_balance_segment_value IS NOT NULL) THEN
617: l_bal_seg_where := 'AND ' || JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_bal_segment_num).segment_col_name ||
618: ' = '''||JG_JOURNAL_ALLOCATIONS_PKG.G_balance_segment_value||'''';
619: JG_UTILITY_PKG.debug('l_bal_seg_where = ' ||l_bal_seg_where);
620: END IF;
613: --
614: -- Balancing Segment Where
615: --
616: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_balance_segment_value IS NOT NULL) THEN
617: l_bal_seg_where := 'AND ' || JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_bal_segment_num).segment_col_name ||
618: ' = '''||JG_JOURNAL_ALLOCATIONS_PKG.G_balance_segment_value||'''';
619: JG_UTILITY_PKG.debug('l_bal_seg_where = ' ||l_bal_seg_where);
620: END IF;
621: --
614: -- Balancing Segment Where
615: --
616: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_balance_segment_value IS NOT NULL) THEN
617: l_bal_seg_where := 'AND ' || JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_bal_segment_num).segment_col_name ||
618: ' = '''||JG_JOURNAL_ALLOCATIONS_PKG.G_balance_segment_value||'''';
619: JG_UTILITY_PKG.debug('l_bal_seg_where = ' ||l_bal_seg_where);
620: END IF;
621: --
622: -- Balance Type and budget version id OR encumbrance type id
620: END IF;
621: --
622: -- Balance Type and budget version id OR encumbrance type id
623: --
624: l_bal_type_where := ' AND jlv.actual_flag = '''||JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type||''' ';
625: JG_UTILITY_PKG.debug('l_bal_type_where = ' || l_bal_type_where);
626:
627: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type = 'B') THEN
628: l_budenc_where := ' AND jlv.budget_version_id = '|| TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id)||' ';
623: --
624: l_bal_type_where := ' AND jlv.actual_flag = '''||JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type||''' ';
625: JG_UTILITY_PKG.debug('l_bal_type_where = ' || l_bal_type_where);
626:
627: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type = 'B') THEN
628: l_budenc_where := ' AND jlv.budget_version_id = '|| TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id)||' ';
629: JG_UTILITY_PKG.debug('l_budenc_where = ' || l_budenc_where);
630: ELSIF (JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type = 'E') THEN
631: l_budenc_where := ' AND jlv.encumbrance_type_id = '||
624: l_bal_type_where := ' AND jlv.actual_flag = '''||JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type||''' ';
625: JG_UTILITY_PKG.debug('l_bal_type_where = ' || l_bal_type_where);
626:
627: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type = 'B') THEN
628: l_budenc_where := ' AND jlv.budget_version_id = '|| TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id)||' ';
629: JG_UTILITY_PKG.debug('l_budenc_where = ' || l_budenc_where);
630: ELSIF (JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type = 'E') THEN
631: l_budenc_where := ' AND jlv.encumbrance_type_id = '||
632: TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id)||' ';
626:
627: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type = 'B') THEN
628: l_budenc_where := ' AND jlv.budget_version_id = '|| TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id)||' ';
629: JG_UTILITY_PKG.debug('l_budenc_where = ' || l_budenc_where);
630: ELSIF (JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type = 'E') THEN
631: l_budenc_where := ' AND jlv.encumbrance_type_id = '||
632: TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id)||' ';
633: JG_UTILITY_PKG.debug('l_budenc_where = ' || l_budenc_where);
634: END IF;
628: l_budenc_where := ' AND jlv.budget_version_id = '|| TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id)||' ';
629: JG_UTILITY_PKG.debug('l_budenc_where = ' || l_budenc_where);
630: ELSIF (JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type = 'E') THEN
631: l_budenc_where := ' AND jlv.encumbrance_type_id = '||
632: TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id)||' ';
633: JG_UTILITY_PKG.debug('l_budenc_where = ' || l_budenc_where);
634: END IF;
635: l_allocate_where := ' AND jlv.status||'''' = ''P'' AND jlv.request_id IS NULL ';
636: JG_UTILITY_PKG.debug('l_allocate_where = '|| l_allocate_where);
645: ', acr.offset_account '||
646: 'FROM jg_zz_ta_account_ranges acr '||
647: ', jg_zz_ta_cc_ranges ccr '||
648: 'WHERE ccr.cc_range_id = acr.cc_range_id '||
649: 'AND ccr.rule_set_id = '||TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_rule_set_id)||') ranges, ';
650:
651: l_non_view_columns := ', ranges.cc_range_id '||
652: ', ranges.account_range_id '||
653: ', ranges.offset_account '||
658: ', rs.name rule_set_name ';
659:
660: l_rule_sets_clause := ' jg_zz_ta_rule_sets rs, ';
661:
662: l_rule_set_where := ' AND rs.rule_set_id = '||TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_rule_set_id)||' ' ;
663:
664: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num IS NOT NULL) THEN
665: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num).segment_vset_fmt_type <> 'N') THEN
666: l_cc_range_where := 'jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num).segment_col_name||
660: l_rule_sets_clause := ' jg_zz_ta_rule_sets rs, ';
661:
662: l_rule_set_where := ' AND rs.rule_set_id = '||TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_rule_set_id)||' ' ;
663:
664: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num IS NOT NULL) THEN
665: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num).segment_vset_fmt_type <> 'N') THEN
666: l_cc_range_where := 'jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num).segment_col_name||
667: ' BETWEEN ranges.cc_range_low (+) AND ranges.cc_range_high (+) ';
668: ELSE
661:
662: l_rule_set_where := ' AND rs.rule_set_id = '||TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_rule_set_id)||' ' ;
663:
664: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num IS NOT NULL) THEN
665: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num).segment_vset_fmt_type <> 'N') THEN
666: l_cc_range_where := 'jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num).segment_col_name||
667: ' BETWEEN ranges.cc_range_low (+) AND ranges.cc_range_high (+) ';
668: ELSE
669: l_cc_range_where := 'jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num).segment_col_name||
662: l_rule_set_where := ' AND rs.rule_set_id = '||TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_rule_set_id)||' ' ;
663:
664: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num IS NOT NULL) THEN
665: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num).segment_vset_fmt_type <> 'N') THEN
666: l_cc_range_where := 'jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num).segment_col_name||
667: ' BETWEEN ranges.cc_range_low (+) AND ranges.cc_range_high (+) ';
668: ELSE
669: l_cc_range_where := 'jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num).segment_col_name||
670: ' BETWEEN TO_NUMBER(ranges.cc_range_low) (+) AND TO_NUMBER(ranges.cc_range_high) (+) ';
665: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num).segment_vset_fmt_type <> 'N') THEN
666: l_cc_range_where := 'jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num).segment_col_name||
667: ' BETWEEN ranges.cc_range_low (+) AND ranges.cc_range_high (+) ';
668: ELSE
669: l_cc_range_where := 'jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_cc_segment_num).segment_col_name||
670: ' BETWEEN TO_NUMBER(ranges.cc_range_low) (+) AND TO_NUMBER(ranges.cc_range_high) (+) ';
671: END IF;
672: ELSE
673: l_cc_range_where := '1 = 1 ';
673: l_cc_range_where := '1 = 1 ';
674: END IF;
675: JG_UTILITY_PKG.debug('l_cc_range_where = '|| l_cc_range_where);
676:
677: IF JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num).segment_vset_fmt_type <> 'N' THEN
678: l_acct_range_where := ' AND jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num).segment_col_name||
679: ' BETWEEN ranges.account_range_low (+) AND ranges.account_range_high (+) ';
680: ELSE
681: l_acct_range_where := ' AND jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num).segment_col_name||
674: END IF;
675: JG_UTILITY_PKG.debug('l_cc_range_where = '|| l_cc_range_where);
676:
677: IF JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num).segment_vset_fmt_type <> 'N' THEN
678: l_acct_range_where := ' AND jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num).segment_col_name||
679: ' BETWEEN ranges.account_range_low (+) AND ranges.account_range_high (+) ';
680: ELSE
681: l_acct_range_where := ' AND jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num).segment_col_name||
682: ' BETWEEN TO_NUMBER(ranges.account_range_low) (+) AND TO_NUMBER(ranges.account_range_high) (+) ';
677: IF JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num).segment_vset_fmt_type <> 'N' THEN
678: l_acct_range_where := ' AND jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num).segment_col_name||
679: ' BETWEEN ranges.account_range_low (+) AND ranges.account_range_high (+) ';
680: ELSE
681: l_acct_range_where := ' AND jlv.'||JG_JOURNAL_ALLOCATIONS_PKG.G_acct_flex_segmt_arr(JG_JOURNAL_ALLOCATIONS_PKG.G_acct_segment_num).segment_col_name||
682: ' BETWEEN TO_NUMBER(ranges.account_range_low) (+) AND TO_NUMBER(ranges.account_range_high) (+) ';
683: END IF;
684:
685: l_account_type_where := ' AND NVL(rs.account_type, jlv.account_type) = jlv.account_type ';
697: ', NULL '||
698: ', NULL '||
699: ', NULL ';
700: l_hint_clause := '/*+ INDEX(jlv JG_ZZ_TA_ALLOCATED_LINES_N1) */';
701: l_allocate_where := ' AND jlv.request_id = '|| TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id) || ' ';
702: JG_UTILITY_PKG.debug('l_allocate_where = '|| l_allocate_where);
703: END IF;
704: JG_UTILITY_PKG.log( '< JG_ALLOCATE_JOURNALS_PKG.get_dynamic_select_string');
705: RETURN 'SELECT '||l_hint_clause||' jlv.je_batch_id '||
711: ', jlv.currency_conversion_date '||
712: ', jlv.currency_conversion_rate '||
713: ', jlv.encumbrance_type_id '||
714: ', jlv.budget_version_id '||
715: JG_JOURNAL_ALLOCATIONS_PKG.G_cc_seg_num_string||
716: JG_JOURNAL_ALLOCATIONS_PKG.G_acc_seg_num_string||
717: ', jlv.segment1 '||
718: ', jlv.segment2 '||
719: ', jlv.segment3 '||
712: ', jlv.currency_conversion_rate '||
713: ', jlv.encumbrance_type_id '||
714: ', jlv.budget_version_id '||
715: JG_JOURNAL_ALLOCATIONS_PKG.G_cc_seg_num_string||
716: JG_JOURNAL_ALLOCATIONS_PKG.G_acc_seg_num_string||
717: ', jlv.segment1 '||
718: ', jlv.segment2 '||
719: ', jlv.segment3 '||
720: ', jlv.segment4 '||
864: RETURN FALSE;
865: --
866: -- Allocation mode
867: --
868: ELSIF (JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL) THEN
869: --
870: -- Check that cost_center exists within a defined cost center range
871: --
872: IF JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.cc_range_id IS NULL THEN
1185:
1186: IF NOT l_is_valid_row AND l_err_msg_code IS NOT NULL THEN
1187:
1188: JG_UTILITY_PKG.debug('Invalid Journal Line found');
1189: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_Error_Handling <> 'I') THEN
1190: JG_JOURNAL_ALLOCATIONS_PKG.G_retcode := '1';
1191: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name,l_err_msg_code);
1192: JG_CREATE_JOURNALS_PKG.write_error_to_output;
1193:
1186: IF NOT l_is_valid_row AND l_err_msg_code IS NOT NULL THEN
1187:
1188: JG_UTILITY_PKG.debug('Invalid Journal Line found');
1189: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_Error_Handling <> 'I') THEN
1190: JG_JOURNAL_ALLOCATIONS_PKG.G_retcode := '1';
1191: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name,l_err_msg_code);
1192: JG_CREATE_JOURNALS_PKG.write_error_to_output;
1193:
1194: -- Bug 876171: Set up l_fail_ndf_flag for no-data-found token
1187:
1188: JG_UTILITY_PKG.debug('Invalid Journal Line found');
1189: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_Error_Handling <> 'I') THEN
1190: JG_JOURNAL_ALLOCATIONS_PKG.G_retcode := '1';
1191: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name,l_err_msg_code);
1192: JG_CREATE_JOURNALS_PKG.write_error_to_output;
1193:
1194: -- Bug 876171: Set up l_fail_ndf_flag for no-data-found token
1195: l_fail_ndf_flag :=1;
1193:
1194: -- Bug 876171: Set up l_fail_ndf_flag for no-data-found token
1195: l_fail_ndf_flag :=1;
1196:
1197: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_Error_Handling = 'E') THEN
1198: RAISE APP_EXCEPTION.application_exception;
1199: END IF;
1200: END IF;
1201:
1205:
1206: --
1207: -- Allocation Mode
1208: --
1209: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL) THEN
1210:
1211: --
1212: -- Initialize account_range_id and cc_range_id of the last journal record to the
1213: -- current record returned.
1219: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.account_range_id :=
1220: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.account_range_id;
1221: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code :=
1222: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code;
1223: JG_CREATE_JOURNALS_PKG.G_Batch_Name := TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_Request_Id)||' '||
1224: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.rule_set_name||' '||
1225: JG_JOURNAL_ALLOCATIONS_PKG.G_period_name;
1226: l_first_valid_row := FALSE;
1227: END IF;
1221: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code :=
1222: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code;
1223: JG_CREATE_JOURNALS_PKG.G_Batch_Name := TO_CHAR(JG_JOURNAL_ALLOCATIONS_PKG.G_Request_Id)||' '||
1224: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.rule_set_name||' '||
1225: JG_JOURNAL_ALLOCATIONS_PKG.G_period_name;
1226: l_first_valid_row := FALSE;
1227: END IF;
1228:
1229: --
1245:
1246: --
1247: -- Insert line to show the journal has been allocated
1248: --
1249: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_validate_only = 'N') THEN
1250: JG_ZZ_TA_ALLOCATED_LINES_PKG.insert_row(
1251: x_rowid,
1252: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_batch_id,
1253: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_header_id,
1252: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_batch_id,
1253: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_header_id,
1254: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_line_num,
1255: SYSDATE,
1256: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
1257: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
1258: SYSDATE,
1259: JG_JOURNAL_ALLOCATIONS_PKG.G_login_id,
1260: JG_JOURNAL_ALLOCATIONS_PKG.G_request_id,
1253: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_header_id,
1254: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_line_num,
1255: SYSDATE,
1256: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
1257: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
1258: SYSDATE,
1259: JG_JOURNAL_ALLOCATIONS_PKG.G_login_id,
1260: JG_JOURNAL_ALLOCATIONS_PKG.G_request_id,
1261: JG_JOURNAL_ALLOCATIONS_PKG.G_progr_appl_id,
1255: SYSDATE,
1256: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
1257: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
1258: SYSDATE,
1259: JG_JOURNAL_ALLOCATIONS_PKG.G_login_id,
1260: JG_JOURNAL_ALLOCATIONS_PKG.G_request_id,
1261: JG_JOURNAL_ALLOCATIONS_PKG.G_progr_appl_id,
1262: JG_JOURNAL_ALLOCATIONS_PKG.G_conc_progr_id,
1263: SYSDATE);
1256: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
1257: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
1258: SYSDATE,
1259: JG_JOURNAL_ALLOCATIONS_PKG.G_login_id,
1260: JG_JOURNAL_ALLOCATIONS_PKG.G_request_id,
1261: JG_JOURNAL_ALLOCATIONS_PKG.G_progr_appl_id,
1262: JG_JOURNAL_ALLOCATIONS_PKG.G_conc_progr_id,
1263: SYSDATE);
1264: END IF;
1257: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
1258: SYSDATE,
1259: JG_JOURNAL_ALLOCATIONS_PKG.G_login_id,
1260: JG_JOURNAL_ALLOCATIONS_PKG.G_request_id,
1261: JG_JOURNAL_ALLOCATIONS_PKG.G_progr_appl_id,
1262: JG_JOURNAL_ALLOCATIONS_PKG.G_conc_progr_id,
1263: SYSDATE);
1264: END IF;
1265: --
1258: SYSDATE,
1259: JG_JOURNAL_ALLOCATIONS_PKG.G_login_id,
1260: JG_JOURNAL_ALLOCATIONS_PKG.G_request_id,
1261: JG_JOURNAL_ALLOCATIONS_PKG.G_progr_appl_id,
1262: JG_JOURNAL_ALLOCATIONS_PKG.G_conc_progr_id,
1263: SYSDATE);
1264: END IF;
1265: --
1266: -- Unallocation Mode
1290:
1291: DBMS_SQL.CLOSE_CURSOR(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_c);
1292:
1293: -- Bug 876171: Add new lines to print no-data-found token
1294: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL) THEN
1295: IF l_fail_ndf_flag = 0 THEN
1296: FND_FILE.NEW_LINE(FND_FILE.OUTPUT,1);
1297: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_NO_DATA_FOUND');
1298: l_no_data_found_message := FND_MESSAGE.GET;
1293: -- Bug 876171: Add new lines to print no-data-found token
1294: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL) THEN
1295: IF l_fail_ndf_flag = 0 THEN
1296: FND_FILE.NEW_LINE(FND_FILE.OUTPUT,1);
1297: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_NO_DATA_FOUND');
1298: l_no_data_found_message := FND_MESSAGE.GET;
1299: JG_UTILITY_PKG.out(RPAD(' ',75)||RPAD(l_no_data_found_message,30)||RPAD(' ',75));
1300: END IF;
1301: ELSE
1300: END IF;
1301: ELSE
1302: IF l_unal_ndf_flag = 0 THEN
1303: FND_FILE.NEW_LINE(FND_FILE.OUTPUT,1);
1304: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_NO_DATA_FOUND');
1305: l_no_data_found_message := FND_MESSAGE.GET;
1306: JG_UTILITY_PKG.out(RPAD(' ',45)||RPAD(l_no_data_found_message,30)||RPAD(' ',105));
1307: END IF;
1308: END IF;
1306: JG_UTILITY_PKG.out(RPAD(' ',45)||RPAD(l_no_data_found_message,30)||RPAD(' ',105));
1307: END IF;
1308: END IF;
1309:
1310: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL) THEN
1311: --
1312: -- If the last row returned had an offset account at the account range level, we need
1313: -- to create its corresponding offset line.
1314: --
1326: l_total_fiscal_accted_dr_amt);
1327: END IF;
1328:
1329: -- Bug 876171: Add the following output lines for end-of-report token
1330: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL) THEN
1331: IF JG_CREATE_JOURNALS_PKG.i > 0 OR l_fail_ndf_flag > 0 THEN
1332: FND_FILE.NEW_LINE(FND_FILE.OUTPUT,1);
1333: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_END_OF_REPORT');
1334: l_eof_message := FND_MESSAGE.GET;
1329: -- Bug 876171: Add the following output lines for end-of-report token
1330: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL) THEN
1331: IF JG_CREATE_JOURNALS_PKG.i > 0 OR l_fail_ndf_flag > 0 THEN
1332: FND_FILE.NEW_LINE(FND_FILE.OUTPUT,1);
1333: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_END_OF_REPORT');
1334: l_eof_message := FND_MESSAGE.GET;
1335: JG_UTILITY_PKG.out(RPAD(' ',75)||RPAD(l_eof_message,30)||RPAD(' ', 75));
1336: END IF;
1337: ELSE
1336: END IF;
1337: ELSE
1338: IF l_unal_ndf_flag > 0 THEN
1339: FND_FILE.NEW_LINE(FND_FILE.OUTPUT,1);
1340: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name, 'JG_ZZ_END_OF_REPORT');
1341: l_eof_message := FND_MESSAGE.GET;
1342: JG_UTILITY_PKG.out(RPAD(' ',45)||RPAD(l_eof_message,30)||RPAD(' ', 105));
1343: END IF;
1344: END IF;