142: pn_report_category_comp_id pay_report_category_components.report_category_comp_id%TYPE;
143:
144: BEGIN
145:
146: fnd_file.put_line(fnd_file.log,'Starting ....');
147: lv_legislation_code := get_legislation_code(p_business_group_id);
148: fnd_file.put_line(fnd_file.log,'Business Group Id : ' || p_business_group_id);
149: fnd_file.put_line(fnd_file.log,'Legislation Code : ' || lv_legislation_code);
150:
144: BEGIN
145:
146: fnd_file.put_line(fnd_file.log,'Starting ....');
147: lv_legislation_code := get_legislation_code(p_business_group_id);
148: fnd_file.put_line(fnd_file.log,'Business Group Id : ' || p_business_group_id);
149: fnd_file.put_line(fnd_file.log,'Legislation Code : ' || lv_legislation_code);
150:
151: BEGIN
152: SELECT description INTO lv_rg_short_name
145:
146: fnd_file.put_line(fnd_file.log,'Starting ....');
147: lv_legislation_code := get_legislation_code(p_business_group_id);
148: fnd_file.put_line(fnd_file.log,'Business Group Id : ' || p_business_group_id);
149: fnd_file.put_line(fnd_file.log,'Legislation Code : ' || lv_legislation_code);
150:
151: BEGIN
152: SELECT description INTO lv_rg_short_name
153: FROM fnd_common_lookups
155: AND lookup_code = p_conc_prog
156: AND application_id IN (800, 801) /* Bug 8716056 */
157: AND SYSDATE between nvl(start_date_active,sysdate) AND nvl(end_date_active,sysdate)
158: AND enabled_flag = 'Y';
159: fnd_file.put_line(fnd_file.log,'Report Group Short Name : ' || lv_rg_short_name);
160: EXCEPTION
161: WHEN OTHERS THEN
162: fnd_file.put_line(fnd_file.log,'Report Group Not Found : Please Contact Your Support Representative');
163: END;
158: AND enabled_flag = 'Y';
159: fnd_file.put_line(fnd_file.log,'Report Group Short Name : ' || lv_rg_short_name);
160: EXCEPTION
161: WHEN OTHERS THEN
162: fnd_file.put_line(fnd_file.log,'Report Group Not Found : Please Contact Your Support Representative');
163: END;
164:
165: BEGIN
166: SELECT lookup_type_meaning INTO lv_lookup_type_meaning
165: BEGIN
166: SELECT lookup_type_meaning INTO lv_lookup_type_meaning
167: FROM fnd_common_lookup_types
168: WHERE lookup_type = p_lookup_type_name;
169: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
170: fnd_file.put_line(fnd_file.log,'New Category Name : ' || lv_lookup_type_meaning);
171: EXCEPTION
172: WHEN OTHERS THEN
173: fnd_file.put_line(fnd_file.log,'Report Category Not Found : Please Contact Your Support Representative');
166: SELECT lookup_type_meaning INTO lv_lookup_type_meaning
167: FROM fnd_common_lookup_types
168: WHERE lookup_type = p_lookup_type_name;
169: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
170: fnd_file.put_line(fnd_file.log,'New Category Name : ' || lv_lookup_type_meaning);
171: EXCEPTION
172: WHEN OTHERS THEN
173: fnd_file.put_line(fnd_file.log,'Report Category Not Found : Please Contact Your Support Representative');
174: END;
169: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
170: fnd_file.put_line(fnd_file.log,'New Category Name : ' || lv_lookup_type_meaning);
171: EXCEPTION
172: WHEN OTHERS THEN
173: fnd_file.put_line(fnd_file.log,'Report Category Not Found : Please Contact Your Support Representative');
174: END;
175:
176: SELECT pay_report_categories_s.nextval INTO ln_report_category_id_new
177: FROM DUAL;
174: END;
175:
176: SELECT pay_report_categories_s.nextval INTO ln_report_category_id_new
177: FROM DUAL;
178: fnd_file.put_line(fnd_file.log,'New Category Id : ' || ln_report_category_id_new);
179: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
180:
181: OPEN csr_get_temp_codes(p_lookup_type_name);
182: LOOP
175:
176: SELECT pay_report_categories_s.nextval INTO ln_report_category_id_new
177: FROM DUAL;
178: fnd_file.put_line(fnd_file.log,'New Category Id : ' || ln_report_category_id_new);
179: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
180:
181: OPEN csr_get_temp_codes(p_lookup_type_name);
182: LOOP
183:
182: LOOP
183:
184: FETCH csr_get_temp_codes INTO lv_lookup_code,lv_meaning;
185: EXIT WHEN csr_get_temp_codes%NOTFOUND;
186: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
187: fnd_file.put_line(fnd_file.log,'Registering Template : ' || lv_lookup_code);
188: OPEN csr_temp_code_dtls(lv_lookup_code,p_conc_prog);
189: FETCH csr_temp_code_dtls INTO lv_template_code, lv_template_name, lv_template_type_code;
190:
183:
184: FETCH csr_get_temp_codes INTO lv_lookup_code,lv_meaning;
185: EXIT WHEN csr_get_temp_codes%NOTFOUND;
186: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
187: fnd_file.put_line(fnd_file.log,'Registering Template : ' || lv_lookup_code);
188: OPEN csr_temp_code_dtls(lv_lookup_code,p_conc_prog);
189: FETCH csr_temp_code_dtls INTO lv_template_code, lv_template_name, lv_template_type_code;
190:
191: IF csr_temp_code_dtls%FOUND THEN
188: OPEN csr_temp_code_dtls(lv_lookup_code,p_conc_prog);
189: FETCH csr_temp_code_dtls INTO lv_template_code, lv_template_name, lv_template_type_code;
190:
191: IF csr_temp_code_dtls%FOUND THEN
192: fnd_file.put_line(fnd_file.log,'Template Name : ' || lv_template_name);
193: fnd_file.put_line(fnd_file.log,'Template Type : ' || lv_template_type_code);
194: OPEN csr_report_group_id(lv_rg_short_name,lv_legislation_code);
195: FETCH csr_report_group_id INTO ln_report_group_id;
196:
189: FETCH csr_temp_code_dtls INTO lv_template_code, lv_template_name, lv_template_type_code;
190:
191: IF csr_temp_code_dtls%FOUND THEN
192: fnd_file.put_line(fnd_file.log,'Template Name : ' || lv_template_name);
193: fnd_file.put_line(fnd_file.log,'Template Type : ' || lv_template_type_code);
194: OPEN csr_report_group_id(lv_rg_short_name,lv_legislation_code);
195: FETCH csr_report_group_id INTO ln_report_group_id;
196:
197: IF csr_report_group_id%FOUND THEN
194: OPEN csr_report_group_id(lv_rg_short_name,lv_legislation_code);
195: FETCH csr_report_group_id INTO ln_report_group_id;
196:
197: IF csr_report_group_id%FOUND THEN
198: fnd_file.put_line(fnd_file.log,'Report Group Id : ' || ln_report_group_id);
199: IF DEBUG_MODE THEN
200: hr_utility.trace('Before Opening Category Cursor : csr_report_category_id');
201: hr_utility.trace('ln_report_group_id='||ln_report_group_id);
202: hr_utility.trace('p_lookup_type_name='||p_lookup_type_name);
220:
221: OPEN csr_report_cat_comp_id(ln_report_category_id,ln_report_definition_id,p_business_group_id);
222: FETCH csr_report_cat_comp_id INTO ln_style_sheet_id;
223: IF csr_report_cat_comp_id%FOUND THEN
224: fnd_file.put_line(fnd_file.log,'Removing Template For Definition Id : ' || ln_report_definition_id);
225: fnd_file.put_line(fnd_file.log,'Removing Template For Category Id : ' || ln_report_category_id);
226: fnd_file.put_line(fnd_file.log,'Removing Style Sheet Id : ' || ln_style_sheet_id);
227: OPEN csr_report_variable_id(ln_style_sheet_id,p_business_group_id);
228: FETCH csr_report_variable_id INTO ln_report_variable_id;
221: OPEN csr_report_cat_comp_id(ln_report_category_id,ln_report_definition_id,p_business_group_id);
222: FETCH csr_report_cat_comp_id INTO ln_style_sheet_id;
223: IF csr_report_cat_comp_id%FOUND THEN
224: fnd_file.put_line(fnd_file.log,'Removing Template For Definition Id : ' || ln_report_definition_id);
225: fnd_file.put_line(fnd_file.log,'Removing Template For Category Id : ' || ln_report_category_id);
226: fnd_file.put_line(fnd_file.log,'Removing Style Sheet Id : ' || ln_style_sheet_id);
227: OPEN csr_report_variable_id(ln_style_sheet_id,p_business_group_id);
228: FETCH csr_report_variable_id INTO ln_report_variable_id;
229: IF csr_report_variable_id%FOUND THEN
222: FETCH csr_report_cat_comp_id INTO ln_style_sheet_id;
223: IF csr_report_cat_comp_id%FOUND THEN
224: fnd_file.put_line(fnd_file.log,'Removing Template For Definition Id : ' || ln_report_definition_id);
225: fnd_file.put_line(fnd_file.log,'Removing Template For Category Id : ' || ln_report_category_id);
226: fnd_file.put_line(fnd_file.log,'Removing Style Sheet Id : ' || ln_style_sheet_id);
227: OPEN csr_report_variable_id(ln_style_sheet_id,p_business_group_id);
228: FETCH csr_report_variable_id INTO ln_report_variable_id;
229: IF csr_report_variable_id%FOUND THEN
230: fnd_file.put_line(fnd_file.log,'Removing Variable Id : ' || ln_style_sheet_id);
226: fnd_file.put_line(fnd_file.log,'Removing Style Sheet Id : ' || ln_style_sheet_id);
227: OPEN csr_report_variable_id(ln_style_sheet_id,p_business_group_id);
228: FETCH csr_report_variable_id INTO ln_report_variable_id;
229: IF csr_report_variable_id%FOUND THEN
230: fnd_file.put_line(fnd_file.log,'Removing Variable Id : ' || ln_style_sheet_id);
231: IF DEBUG_MODE THEN
232: hr_utility.trace('DELETE FROM pay_report_variables WHERE report_variable_id = ' || ln_report_variable_id);
233: ELSE
234: DELETE FROM pay_report_variables
250: CLOSE csr_report_category_id;
251:
252: ln_definition_id := get_definition_id(ln_report_group_id,lv_template_type_code,lv_template_code);
253:
254: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
255: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_VARIABLES');
256: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
257: fnd_file.put_line(fnd_file.log,'Template Name ' || lv_template_name);
258: fnd_file.put_line(fnd_file.log,'Template Code ' || lv_template_code);
251:
252: ln_definition_id := get_definition_id(ln_report_group_id,lv_template_type_code,lv_template_code);
253:
254: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
255: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_VARIABLES');
256: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
257: fnd_file.put_line(fnd_file.log,'Template Name ' || lv_template_name);
258: fnd_file.put_line(fnd_file.log,'Template Code ' || lv_template_code);
259: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
252: ln_definition_id := get_definition_id(ln_report_group_id,lv_template_type_code,lv_template_code);
253:
254: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
255: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_VARIABLES');
256: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
257: fnd_file.put_line(fnd_file.log,'Template Name ' || lv_template_name);
258: fnd_file.put_line(fnd_file.log,'Template Code ' || lv_template_code);
259: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
260:
253:
254: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
255: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_VARIABLES');
256: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
257: fnd_file.put_line(fnd_file.log,'Template Name ' || lv_template_name);
258: fnd_file.put_line(fnd_file.log,'Template Code ' || lv_template_code);
259: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
260:
261: insert_report_variable(p_report_definition_id => ln_definition_id,
254: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
255: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_VARIABLES');
256: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
257: fnd_file.put_line(fnd_file.log,'Template Name ' || lv_template_name);
258: fnd_file.put_line(fnd_file.log,'Template Code ' || lv_template_code);
259: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
260:
261: insert_report_variable(p_report_definition_id => ln_definition_id,
262: p_definition_type => 'SS',
255: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_VARIABLES');
256: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
257: fnd_file.put_line(fnd_file.log,'Template Name ' || lv_template_name);
258: fnd_file.put_line(fnd_file.log,'Template Code ' || lv_template_code);
259: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
260:
261: insert_report_variable(p_report_definition_id => ln_definition_id,
262: p_definition_type => 'SS',
263: p_name => lv_template_name,
264: p_value => lv_template_code,
265: p_business_group_id => p_business_group_id,
266: p_report_variable_id => pn_report_variable_id);
267:
268: fnd_file.put_line(fnd_file.log,'Report Variable Id ' || pn_report_variable_id);
269:
270: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORY_COMPONENTS');
271: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
272: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
266: p_report_variable_id => pn_report_variable_id);
267:
268: fnd_file.put_line(fnd_file.log,'Report Variable Id ' || pn_report_variable_id);
269:
270: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORY_COMPONENTS');
271: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
272: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
273: fnd_file.put_line(fnd_file.log,'Style Sheet Id ' || pn_report_variable_id);
274: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
267:
268: fnd_file.put_line(fnd_file.log,'Report Variable Id ' || pn_report_variable_id);
269:
270: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORY_COMPONENTS');
271: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
272: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
273: fnd_file.put_line(fnd_file.log,'Style Sheet Id ' || pn_report_variable_id);
274: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
275:
268: fnd_file.put_line(fnd_file.log,'Report Variable Id ' || pn_report_variable_id);
269:
270: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORY_COMPONENTS');
271: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
272: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
273: fnd_file.put_line(fnd_file.log,'Style Sheet Id ' || pn_report_variable_id);
274: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
275:
276: insert_report_catg_comp(p_report_category_id => ln_report_category_id_new,
269:
270: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORY_COMPONENTS');
271: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
272: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
273: fnd_file.put_line(fnd_file.log,'Style Sheet Id ' || pn_report_variable_id);
274: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
275:
276: insert_report_catg_comp(p_report_category_id => ln_report_category_id_new,
277: p_report_definition_id => ln_definition_id,
270: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORY_COMPONENTS');
271: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
272: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
273: fnd_file.put_line(fnd_file.log,'Style Sheet Id ' || pn_report_variable_id);
274: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
275:
276: insert_report_catg_comp(p_report_category_id => ln_report_category_id_new,
277: p_report_definition_id => ln_definition_id,
278: p_breakout_variable_id => NULL,
280: p_style_sheet_variable_id => pn_report_variable_id,
281: p_business_group_id => p_business_group_id,
282: p_report_category_comp_id => pn_report_category_comp_id);
283:
284: fnd_file.put_line(fnd_file.log,'Category Component Id ' || pn_report_category_comp_id);
285:
286: END IF;
287: CLOSE csr_report_group_id;
288: END IF;
296: DELETE FROM pay_report_categories
297: WHERE report_category_id = ln_report_category_id;
298: END IF;
299:
300: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
301: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORIES');
302: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
303: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
304: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
297: WHERE report_category_id = ln_report_category_id;
298: END IF;
299:
300: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
301: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORIES');
302: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
303: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
304: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
305: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
298: END IF;
299:
300: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
301: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORIES');
302: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
303: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
304: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
305: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
306: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
299:
300: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
301: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORIES');
302: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
303: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
304: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
305: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
306: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
307:
300: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
301: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORIES');
302: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
303: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
304: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
305: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
306: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
307:
308: insert_report_category(p_report_group_id => ln_report_group_id,
301: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORIES');
302: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
303: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
304: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
305: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
306: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
307:
308: insert_report_category(p_report_group_id => ln_report_group_id,
309: p_category_name => lv_lookup_type_meaning,
302: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
303: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
304: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
305: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
306: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
307:
308: insert_report_category(p_report_group_id => ln_report_group_id,
309: p_category_name => lv_lookup_type_meaning,
310: p_short_name => p_lookup_type_name,
311: p_legislation_code => NULL,
312: p_business_group_id => p_business_group_id,
313: p_report_category_id => ln_report_category_id_new);
314:
315: fnd_file.put_line(fnd_file.log,'Template Registered Successfully');
316:
317: END insert_custom_template;
318:
319: FUNCTION get_legislation_code(p_business_group_id NUMBER)