13: --------------------------------------------------------------------- */
14: PROCEDURE zero_fill_segments(p_key_segment IN OUT NOCOPY KEY_SEGMENTS_TABLE) IS
15: BEGIN
16: JG_UTILITY_PKG.log( '> JG_CREATE_JOURNALS_PKG.Zero_Fill_Segments');
17: FOR j IN 1..JG_JOURNAL_ALLOCATIONS_PKG.G_num_of_segments LOOP
18: JG_UTILITY_PKG.debug( 'segmt posn = '||to_char(j));
19: JG_UTILITY_PKG.debug( 'ZF: segmt col name = '||JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name);
20: JG_UTILITY_PKG.debug( 'ZF: segmt zero string = '||JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).zero_string);
21: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name IS NOT NULL) THEN
15: BEGIN
16: JG_UTILITY_PKG.log( '> JG_CREATE_JOURNALS_PKG.Zero_Fill_Segments');
17: FOR j IN 1..JG_JOURNAL_ALLOCATIONS_PKG.G_num_of_segments LOOP
18: JG_UTILITY_PKG.debug( 'segmt posn = '||to_char(j));
19: JG_UTILITY_PKG.debug( 'ZF: segmt col name = '||JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name);
20: JG_UTILITY_PKG.debug( 'ZF: segmt zero string = '||JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).zero_string);
21: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name IS NOT NULL) THEN
22: p_key_segment(TO_NUMBER(SUBSTR(JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name, 8)))
23: := JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).zero_string;
16: JG_UTILITY_PKG.log( '> JG_CREATE_JOURNALS_PKG.Zero_Fill_Segments');
17: FOR j IN 1..JG_JOURNAL_ALLOCATIONS_PKG.G_num_of_segments LOOP
18: JG_UTILITY_PKG.debug( 'segmt posn = '||to_char(j));
19: JG_UTILITY_PKG.debug( 'ZF: segmt col name = '||JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name);
20: JG_UTILITY_PKG.debug( 'ZF: segmt zero string = '||JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).zero_string);
21: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name IS NOT NULL) THEN
22: p_key_segment(TO_NUMBER(SUBSTR(JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name, 8)))
23: := JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).zero_string;
24: END IF;
17: FOR j IN 1..JG_JOURNAL_ALLOCATIONS_PKG.G_num_of_segments LOOP
18: JG_UTILITY_PKG.debug( 'segmt posn = '||to_char(j));
19: JG_UTILITY_PKG.debug( 'ZF: segmt col name = '||JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name);
20: JG_UTILITY_PKG.debug( 'ZF: segmt zero string = '||JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).zero_string);
21: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name IS NOT NULL) THEN
22: p_key_segment(TO_NUMBER(SUBSTR(JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name, 8)))
23: := JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).zero_string;
24: END IF;
25: END LOOP;
18: JG_UTILITY_PKG.debug( 'segmt posn = '||to_char(j));
19: JG_UTILITY_PKG.debug( 'ZF: segmt col name = '||JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name);
20: JG_UTILITY_PKG.debug( 'ZF: segmt zero string = '||JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).zero_string);
21: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name IS NOT NULL) THEN
22: p_key_segment(TO_NUMBER(SUBSTR(JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name, 8)))
23: := JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).zero_string;
24: END IF;
25: END LOOP;
26: JG_UTILITY_PKG.log( '> JG_CREATE_JOURNALS_PKG.Zero_Fill_Segments');
19: JG_UTILITY_PKG.debug( 'ZF: segmt col name = '||JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name);
20: JG_UTILITY_PKG.debug( 'ZF: segmt zero string = '||JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).zero_string);
21: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name IS NOT NULL) THEN
22: p_key_segment(TO_NUMBER(SUBSTR(JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).segment_col_name, 8)))
23: := JG_JOURNAL_ALLOCATIONS_PKG.G_zero_fill_arr(j).zero_string;
24: END IF;
25: END LOOP;
26: JG_UTILITY_PKG.log( '> JG_CREATE_JOURNALS_PKG.Zero_Fill_Segments');
27: END zero_fill_segments;
137: JGZZ_RECON_REF,
138: PERIOD_NAME)
139: VALUES
140: ( 'NEW',
141: JG_JOURNAL_ALLOCATIONS_PKG.G_destn_set_of_books_id,
142: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_end_date,
143: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
144: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
145: 'A',
138: PERIOD_NAME)
139: VALUES
140: ( 'NEW',
141: JG_JOURNAL_ALLOCATIONS_PKG.G_destn_set_of_books_id,
142: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_end_date,
143: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
144: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
145: 'A',
146: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency),
139: VALUES
140: ( 'NEW',
141: JG_JOURNAL_ALLOCATIONS_PKG.G_destn_set_of_books_id,
142: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_end_date,
143: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
144: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
145: 'A',
146: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency),
147: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
142: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_end_date,
143: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
144: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
145: 'A',
146: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency),
147: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
148: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_type,
149: 'A',
150: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
143: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
144: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
145: 'A',
146: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency),
147: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
148: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_type,
149: 'A',
150: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
151: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
147: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
148: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_type,
149: 'A',
150: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
151: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
152: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_type,
153: JG_JOURNAL_ALLOCATIONS_PKG.G_translated_user)),
154: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
155: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_date,
149: 'A',
150: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
151: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
152: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_type,
153: JG_JOURNAL_ALLOCATIONS_PKG.G_translated_user)),
154: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
155: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_date,
156: 'A',
157: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
150: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
151: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
152: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_type,
153: JG_JOURNAL_ALLOCATIONS_PKG.G_translated_user)),
154: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
155: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_date,
156: 'A',
157: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
158: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
154: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
155: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_date,
156: 'A',
157: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
158: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
159: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_date,
160: sysdate)),
161: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
162: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_rate,
157: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
158: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
159: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_date,
160: sysdate)),
161: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
162: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_rate,
163: 'A',
164: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
165: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
161: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
162: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_rate,
163: 'A',
164: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code,
165: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
166: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_rate,
167: 1)),
168: SYSDATE,
169: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
165: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
166: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_rate,
167: 1)),
168: SYSDATE,
169: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
170: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,
171: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
172: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
173: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
166: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_conversion_rate,
167: 1)),
168: SYSDATE,
169: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
170: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,
171: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
172: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
173: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
174: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
167: 1)),
168: SYSDATE,
169: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
170: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,
171: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
172: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
173: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
174: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
175: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'B',
168: SYSDATE,
169: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
170: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,
171: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
172: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
173: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
174: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
175: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'B',
176: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
169: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
170: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,
171: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
172: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
173: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
174: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
175: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'B',
176: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
177: JG_CREATE_JOURNALS_PKG.G_key_segment( 1 ),
170: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,
171: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
172: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
173: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
174: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
175: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'B',
176: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
177: JG_CREATE_JOURNALS_PKG.G_key_segment( 1 ),
178: JG_CREATE_JOURNALS_PKG.G_key_segment( 2 ),
171: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
172: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
173: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
174: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
175: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'B',
176: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
177: JG_CREATE_JOURNALS_PKG.G_key_segment( 1 ),
178: JG_CREATE_JOURNALS_PKG.G_key_segment( 2 ),
179: JG_CREATE_JOURNALS_PKG.G_key_segment( 3 ),
172: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
173: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
174: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
175: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'B',
176: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
177: JG_CREATE_JOURNALS_PKG.G_key_segment( 1 ),
178: JG_CREATE_JOURNALS_PKG.G_key_segment( 2 ),
179: JG_CREATE_JOURNALS_PKG.G_key_segment( 3 ),
180: JG_CREATE_JOURNALS_PKG.G_key_segment( 4 ),
213: JG_CREATE_JOURNALS_PKG.G_Journal_Name, -- Reference4
214: JG_CREATE_JOURNALS_PKG.G_Journal_Description, -- Reference5
215: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.external_reference,-- Reference6
216: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_header_name ||
217: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type, 'A',
218: '/' ||JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_doc_sequence_name || '/' ||
219: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_doc_sequence_value || '/' ||
220: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_line_num, NULL), -- Reference 10
221: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_header_id,
251: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.invoice_amount,
252: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.context3,
253: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.ussgl_transaction_code,
254: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.jgzz_recon_ref,
255: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type, 'B',
256: JG_JOURNAL_ALLOCATIONS_PKG.G_destn_period_name, NULL));
257:
258: ELSE -- Inserting line for an offset group total
259:
252: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.context3,
253: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.ussgl_transaction_code,
254: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.jgzz_recon_ref,
255: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type, 'B',
256: JG_JOURNAL_ALLOCATIONS_PKG.G_destn_period_name, NULL));
257:
258: ELSE -- Inserting line for an offset group total
259:
260:
348: JGZZ_RECON_REF,
349: PERIOD_NAME)
350: VALUES
351: ( 'NEW',
352: JG_JOURNAL_ALLOCATIONS_PKG.G_destn_set_of_books_id,
353: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_end_date,
354: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
355: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
356: 'A',
349: PERIOD_NAME)
350: VALUES
351: ( 'NEW',
352: JG_JOURNAL_ALLOCATIONS_PKG.G_destn_set_of_books_id,
353: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_end_date,
354: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
355: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
356: 'A',
357: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency),
350: VALUES
351: ( 'NEW',
352: JG_JOURNAL_ALLOCATIONS_PKG.G_destn_set_of_books_id,
353: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_end_date,
354: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
355: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
356: 'A',
357: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency),
358: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
353: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_end_date,
354: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
355: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
356: 'A',
357: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency),
358: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
359: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_type,
360: 'A',
361: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
354: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
355: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
356: 'A',
357: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency),
358: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
359: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_type,
360: 'A',
361: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
362: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
358: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
359: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_type,
360: 'A',
361: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
362: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
363: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_type,
364: JG_JOURNAL_ALLOCATIONS_PKG.G_translated_user)),
365: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
366: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_date,
360: 'A',
361: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
362: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
363: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_type,
364: JG_JOURNAL_ALLOCATIONS_PKG.G_translated_user)),
365: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
366: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_date,
367: 'A',
368: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
361: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
362: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
363: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_type,
364: JG_JOURNAL_ALLOCATIONS_PKG.G_translated_user)),
365: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
366: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_date,
367: 'A',
368: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
369: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
365: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
366: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_date,
367: 'A',
368: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
369: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
370: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_date,
371: SYSDATE)),
372: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
373: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_rate,
368: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
369: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
370: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_date,
371: SYSDATE)),
372: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
373: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_rate,
374: 'A',
375: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
376: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
372: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type,'E',
373: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_rate,
374: 'A',
375: DECODE(JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code,
376: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
377: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_rate,
378: 1)),
379: SYSDATE,
380: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
376: JG_JOURNAL_ALLOCATIONS_PKG.G_functional_currency,
377: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_rate,
378: 1)),
379: SYSDATE,
380: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
381: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,
382: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
383: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
384: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
377: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_conversion_rate,
378: 1)),
379: SYSDATE,
380: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
381: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,
382: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
383: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
384: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
385: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
378: 1)),
379: SYSDATE,
380: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
381: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,
382: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
383: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
384: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
385: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
386: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'B',
379: SYSDATE,
380: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
381: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,
382: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
383: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
384: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
385: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
386: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'B',
387: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
380: JG_JOURNAL_ALLOCATIONS_PKG.G_user_id,
381: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,
382: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
383: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
384: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
385: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
386: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'B',
387: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
388: JG_CREATE_JOURNALS_PKG.G_offset_grp_key_segment( 1 ),
381: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,
382: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
383: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
384: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
385: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
386: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'B',
387: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
388: JG_CREATE_JOURNALS_PKG.G_offset_grp_key_segment( 1 ),
389: JG_CREATE_JOURNALS_PKG.G_offset_grp_key_segment( 2 ),
382: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_category_name,
383: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
384: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
385: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
386: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'B',
387: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
388: JG_CREATE_JOURNALS_PKG.G_offset_grp_key_segment( 1 ),
389: JG_CREATE_JOURNALS_PKG.G_offset_grp_key_segment( 2 ),
390: JG_CREATE_JOURNALS_PKG.G_offset_grp_key_segment( 3 ),
383: JG_JOURNAL_ALLOCATIONS_PKG.G_user_je_source_name,
384: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'E',
385: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
386: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type,'B',
387: JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type_id),
388: JG_CREATE_JOURNALS_PKG.G_offset_grp_key_segment( 1 ),
389: JG_CREATE_JOURNALS_PKG.G_offset_grp_key_segment( 2 ),
390: JG_CREATE_JOURNALS_PKG.G_offset_grp_key_segment( 3 ),
391: JG_CREATE_JOURNALS_PKG.G_offset_grp_key_segment( 4 ),
458: NULL,
459: NULL,
460: NULL,
461: NULL,
462: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type, 'B',
463: JG_JOURNAL_ALLOCATIONS_PKG.G_destn_period_name, NULL));
464:
465: END IF;
466:
459: NULL,
460: NULL,
461: NULL,
462: DECODE(JG_JOURNAL_ALLOCATIONS_PKG.G_balance_type, 'B',
463: JG_JOURNAL_ALLOCATIONS_PKG.G_destn_period_name, NULL));
464:
465: END IF;
466:
467: JG_UTILITY_PKG.log('< JG_CREATE_JOURNALS_PKG.insert_gl_interface');
497: -- Use separate array to store zeros as Zero-Fill method may not have been chosen for journal allocation.
498: --
499: JG_CREATE_JOURNALS_PKG.G_offset_grp_key_segment := JG_CREATE_JOURNALS_PKG.G_key_segment;
500: JG_CREATE_JOURNALS_PKG.zero_fill_segments(JG_CREATE_JOURNALS_PKG.G_offset_grp_key_segment);
501: JG_CREATE_JOURNALS_PKG.G_offset_grp_key_segment(JG_JOURNAL_ALLOCATIONS_PKG.G_acct_key_element) :=
502: JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.offset_account;
503: --
504: -- Calculate net totals
505: --
516: --
517: IF SIGN(l_net_total_accted_offset_amt) = '-1' THEN
518: l_net_dr_accted_offset_total := ABS(l_net_total_accted_offset_amt);
519: l_net_cr_accted_offset_total := NULL;
520: IF JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type = 'E' THEN
521: l_net_dr_entered_offset_total := ABS(l_net_total_entered_offset_amt);
522: l_net_cr_entered_offset_total := NULL;
523: ELSE
524: l_net_dr_entered_offset_total := ABS(l_net_total_accted_offset_amt);
526: END IF;
527: ELSE
528: l_net_dr_accted_offset_total := NULL;
529: l_net_cr_accted_offset_total := ABS(l_net_total_accted_offset_amt);
530: IF JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type = 'E' THEN
531: l_net_dr_entered_offset_total := NULL;
532: l_net_cr_entered_offset_total := ABS(l_net_total_entered_offset_amt);
533: ELSE
534: l_net_dr_entered_offset_total := NULL;
535: l_net_cr_entered_offset_total := ABS(l_net_total_accted_offset_amt);
536: END IF;
537: END IF;
538:
539: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_validate_only = 'N') THEN
540: --
541: -- Insert for offset account (one line that is the net of the credits and debits)
542: --
543: IF NOT JG_CREATE_JOURNALS_PKG.insert_gl_interface(l_net_dr_entered_offset_total,
544: l_net_cr_entered_offset_total,
545: l_net_dr_accted_offset_total,
546: l_net_cr_accted_offset_total,
547: TRUE) THEN
548: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name , 'JG_ZZ_GL_INTERFACE_INSERT');
549: JG_CREATE_JOURNALS_PKG.write_error_to_output;
550: RAISE APP_EXCEPTION.application_exception;
551: END IF;
552: END IF;
566: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(JG_CREATE_JOURNALS_PKG.i).code_combination_id
567: := JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.code_combination_id;
568: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(JG_CREATE_JOURNALS_PKG.i).cc_range_id
569: := JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.cc_range_id;
570: FND_MESSAGE.SET_NAME (JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name ,'JG_ZZ_JGZZTAJA_RANGE_OFFSET');
571: l_range_offset_remark := substr(FND_MESSAGE.GET,1,240);
572: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(JG_CREATE_JOURNALS_PKG.i).remarks := l_range_offset_remark;
573: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(JG_CREATE_JOURNALS_PKG.i).accounted_cr := NULL;
574: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(JG_CREATE_JOURNALS_PKG.i).accounted_dr := NULL;
612: JG_UTILITY_PKG.log( '> JG_CREATE_JOURNALS_PKG.write_error_to_output');
613: --
614: -- Construct accounting flexfield segments string
615: --
616: l_acct_segments := fnd_flex_ext.get_segs(JG_JOURNAL_ALLOCATIONS_PKG.G_GL_appln_short_name,
617: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_acct_flex_code,
618: JG_JOURNAL_ALLOCATIONS_PKG.G_chart_of_accounts_id,
619: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.code_combination_id);
620:
613: --
614: -- Construct accounting flexfield segments string
615: --
616: l_acct_segments := fnd_flex_ext.get_segs(JG_JOURNAL_ALLOCATIONS_PKG.G_GL_appln_short_name,
617: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_acct_flex_code,
618: JG_JOURNAL_ALLOCATIONS_PKG.G_chart_of_accounts_id,
619: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.code_combination_id);
620:
621: JG_UTILITY_PKG.debug('acct string = '||l_acct_segments);
614: -- Construct accounting flexfield segments string
615: --
616: l_acct_segments := fnd_flex_ext.get_segs(JG_JOURNAL_ALLOCATIONS_PKG.G_GL_appln_short_name,
617: JG_JOURNAL_ALLOCATIONS_PKG.G_GL_acct_flex_code,
618: JG_JOURNAL_ALLOCATIONS_PKG.G_chart_of_accounts_id,
619: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.code_combination_id);
620:
621: JG_UTILITY_PKG.debug('acct string = '||l_acct_segments);
622:
622:
623: --
624: -- Get the latest message from the stack for error reporting
625: --
626: IF JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL THEN -- Error Reporting
627: l_error_message := FND_MESSAGE.GET;
628: JG_JOURNAL_ALLOCATIONS_PKG.G_errbuf := l_error_message;
629: JG_UTILITY_PKG.out(
630: RPAD(SUBSTR(NVL(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_batch_name, ' '), 1, 20), 20)||' '||
624: -- Get the latest message from the stack for error reporting
625: --
626: IF JG_JOURNAL_ALLOCATIONS_PKG.G_unalloc_request_id IS NULL THEN -- Error Reporting
627: l_error_message := FND_MESSAGE.GET;
628: JG_JOURNAL_ALLOCATIONS_PKG.G_errbuf := l_error_message;
629: JG_UTILITY_PKG.out(
630: RPAD(SUBSTR(NVL(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_batch_name, ' '), 1, 20), 20)||' '||
631: RPAD(SUBSTR(NVL(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.je_header_name, ' '), 1, 19), 19)||' '||
632: RPAD(SUBSTR(NVL(l_acct_segments, ' '), 1, 35), 35)||' '||
718: IF JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.offset_account IS NOT NULL AND
719: ((JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.account_range_id <>
720: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.account_range_id) OR
721: ((JG_ALLOCATE_JOURNALS_PKG.G_last_journal_qry_rec.l_je_lines_v_rec.currency_code <>
722: JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.currency_code) AND JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type = 'E')) THEN
723: JG_UTILITY_PKG.debug( ' creating offset line for acct range ');
724: JG_CREATE_JOURNALS_PKG.create_offset_for_acct_range;
725: END IF;
726:
724: JG_CREATE_JOURNALS_PKG.create_offset_for_acct_range;
725: END IF;
726:
727:
728: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_Destn_Cost_Center_Grouping = 'Y') THEN
729: --
730: -- Set the Journal Header Name to include Cost Center Range Description; supply the cc range id if the description is null
731: --
732: l_cc_range_code := JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.cc_range_low||' - '||JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.cc_range_high;
737: JG_UTILITY_PKG.debug('Journal Header = ' || JG_CREATE_JOURNALS_PKG.G_Journal_Name);
738: END IF;
739:
740:
741: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_validate_only = 'N') THEN
742: --
743: -- Build destination account
744: --
745: JG_CREATE_JOURNALS_PKG.G_key_segment( 1 ) := JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.segment1;
775:
776: --
777: -- Zero-Fill some of the segments if Zero-Fill method was chosen
778: --
779: IF JG_JOURNAL_ALLOCATIONS_PKG.G_destn_segment_method = 'ZF' THEN
780: zero_fill_segments(JG_CREATE_JOURNALS_PKG.G_key_segment);
781: END IF;
782: END IF; -- Validate_Only check
783: --
794: -- Calculate allocated account amounts based on the parameter amount_type and the precision of the currency,
795: -- any rounding errors are dealt with later down in the code once all rule lines for the journal have been fetched.
796: --
797: l_accted_credit_amount := ROUND(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.accounted_cr *
798: (c_rule_line_rec.allocation_percent / 100), JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_precision);
799: l_accted_debit_amount := ROUND(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.accounted_dr *
800: (c_rule_line_rec.allocation_percent / 100), JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_precision);
801: --
802: -- Entered Amount Type: set to entered amounts to accounted amounts if Amount Type parameter is 'Accounted'
796: --
797: l_accted_credit_amount := ROUND(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.accounted_cr *
798: (c_rule_line_rec.allocation_percent / 100), JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_precision);
799: l_accted_debit_amount := ROUND(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.accounted_dr *
800: (c_rule_line_rec.allocation_percent / 100), JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_precision);
801: --
802: -- Entered Amount Type: set to entered amounts to accounted amounts if Amount Type parameter is 'Accounted'
803: --
804: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type = 'E') THEN
800: (c_rule_line_rec.allocation_percent / 100), JG_JOURNAL_ALLOCATIONS_PKG.G_func_currency_precision);
801: --
802: -- Entered Amount Type: set to entered amounts to accounted amounts if Amount Type parameter is 'Accounted'
803: --
804: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type = 'E') THEN
805: l_entered_credit_amount := ROUND(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.entered_cr *
806: (c_rule_line_rec.allocation_percent / 100), JG_ALLOCATE_JOURNALS_PKG.G_currency_precision);
807: l_entered_debit_amount := ROUND(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.entered_dr *
808: (c_rule_line_rec.allocation_percent / 100), JG_ALLOCATE_JOURNALS_PKG.G_currency_precision);
940: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(l_max_prc_offst_line_for_jrnal).destn_accted_cr +
941: (NVL(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.accounted_dr, 0) - NVL(l_rounded_accted_dr_sum, 0));
942: END IF;
943: END IF;
944: IF (JG_JOURNAL_ALLOCATIONS_PKG.G_amount_type = 'E') THEN
945: IF NVL(l_rounded_entered_cr_sum, 0) <>
946: NVL(JG_ALLOCATE_JOURNALS_PKG.G_journal_qry_rec.l_je_lines_v_rec.entered_cr, 0) THEN
947: IF l_max_prc_alloc_line_for_jrnal IS NOT NULL THEN
948: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(l_max_prc_alloc_line_for_jrnal).destn_entered_cr :=
995: JG_CREATE_JOURNALS_PKG.G_total_alloc_accted_dr_amt
996: := JG_CREATE_JOURNALS_PKG.G_total_alloc_accted_dr_amt + NVL(JG_CREATE_JOURNALS_PKG.alloc_lines_arr(j).destn_accted_dr, 0);
997: JG_UTILITY_PKG.debug('total_alloc_accted_cr_amt = '|| to_char(JG_CREATE_JOURNALS_PKG.G_total_alloc_accted_cr_amt));
998: JG_UTILITY_PKG.debug('total_alloc_accted_dr_amt = '|| to_char(JG_CREATE_JOURNALS_PKG.G_total_alloc_accted_dr_amt));
999: IF JG_JOURNAL_ALLOCATIONS_PKG.G_validate_only = 'N' THEN
1000: JG_UTILITY_PKG.debug( 'Inserting Allocated Journal Line number '||to_char(j));
1001: JG_CREATE_JOURNALS_PKG.G_key_segment( JG_JOURNAL_ALLOCATIONS_PKG.G_acct_key_element ) :=
1002: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(j).destn_account_number;
1003: IF NOT JG_CREATE_JOURNALS_PKG.insert_gl_interface
997: JG_UTILITY_PKG.debug('total_alloc_accted_cr_amt = '|| to_char(JG_CREATE_JOURNALS_PKG.G_total_alloc_accted_cr_amt));
998: JG_UTILITY_PKG.debug('total_alloc_accted_dr_amt = '|| to_char(JG_CREATE_JOURNALS_PKG.G_total_alloc_accted_dr_amt));
999: IF JG_JOURNAL_ALLOCATIONS_PKG.G_validate_only = 'N' THEN
1000: JG_UTILITY_PKG.debug( 'Inserting Allocated Journal Line number '||to_char(j));
1001: JG_CREATE_JOURNALS_PKG.G_key_segment( JG_JOURNAL_ALLOCATIONS_PKG.G_acct_key_element ) :=
1002: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(j).destn_account_number;
1003: IF NOT JG_CREATE_JOURNALS_PKG.insert_gl_interface
1004: (JG_CREATE_JOURNALS_PKG.alloc_lines_arr(j).destn_entered_dr,
1005: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(j).destn_entered_cr,
1005: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(j).destn_entered_cr,
1006: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(j).destn_accted_dr,
1007: JG_CREATE_JOURNALS_PKG.alloc_lines_arr(j).destn_accted_cr,
1008: FALSE) THEN
1009: FND_MESSAGE.SET_NAME(JG_JOURNAL_ALLOCATIONS_PKG.G_JG_appln_short_name , 'JG_ZZ_GL_INTERFACE_INSERT');
1010: JG_CREATE_JOURNALS_PKG.write_error_to_output;
1011: RAISE APP_EXCEPTION.application_exception;
1012: END IF;
1013: END IF; -- Validate_Only?