133: pn_report_category_comp_id pay_report_category_components.report_category_comp_id%TYPE;
134:
135: BEGIN
136:
137: fnd_file.put_line(fnd_file.log,'Starting ....');
138: lv_legislation_code := get_legislation_code(p_business_group_id);
139: fnd_file.put_line(fnd_file.log,'Business Group Id : ' || p_business_group_id);
140: fnd_file.put_line(fnd_file.log,'Legislation Code : ' || lv_legislation_code);
141:
135: BEGIN
136:
137: fnd_file.put_line(fnd_file.log,'Starting ....');
138: lv_legislation_code := get_legislation_code(p_business_group_id);
139: fnd_file.put_line(fnd_file.log,'Business Group Id : ' || p_business_group_id);
140: fnd_file.put_line(fnd_file.log,'Legislation Code : ' || lv_legislation_code);
141:
142: BEGIN
143: SELECT description INTO lv_rg_short_name
136:
137: fnd_file.put_line(fnd_file.log,'Starting ....');
138: lv_legislation_code := get_legislation_code(p_business_group_id);
139: fnd_file.put_line(fnd_file.log,'Business Group Id : ' || p_business_group_id);
140: fnd_file.put_line(fnd_file.log,'Legislation Code : ' || lv_legislation_code);
141:
142: BEGIN
143: SELECT description INTO lv_rg_short_name
144: FROM fnd_common_lookups
146: AND lookup_code = p_conc_prog
147: AND application_id = (SELECT application_id FROM fnd_application WHERE application_short_name = 'PAY')
148: AND sysdate between nvl(start_date_active,sysdate) AND nvl(end_date_active,sysdate)
149: AND enabled_flag = 'Y';
150: fnd_file.put_line(fnd_file.log,'Report Group Short Name : ' || lv_rg_short_name);
151: EXCEPTION
152: WHEN OTHERS THEN
153: fnd_file.put_line(fnd_file.log,'Report Group Not Found : Please Contact Your Support Representative');
154: END;
149: AND enabled_flag = 'Y';
150: fnd_file.put_line(fnd_file.log,'Report Group Short Name : ' || lv_rg_short_name);
151: EXCEPTION
152: WHEN OTHERS THEN
153: fnd_file.put_line(fnd_file.log,'Report Group Not Found : Please Contact Your Support Representative');
154: END;
155:
156: BEGIN
157: SELECT lookup_type_meaning INTO lv_lookup_type_meaning
156: BEGIN
157: SELECT lookup_type_meaning INTO lv_lookup_type_meaning
158: FROM fnd_common_lookup_types
159: WHERE lookup_type = p_lookup_type_name;
160: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
161: fnd_file.put_line(fnd_file.log,'New Category Name : ' || lv_lookup_type_meaning);
162: EXCEPTION
163: WHEN OTHERS THEN
164: fnd_file.put_line(fnd_file.log,'Report Category Not Found : Please Contact Your Support Representative');
157: SELECT lookup_type_meaning INTO lv_lookup_type_meaning
158: FROM fnd_common_lookup_types
159: WHERE lookup_type = p_lookup_type_name;
160: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
161: fnd_file.put_line(fnd_file.log,'New Category Name : ' || lv_lookup_type_meaning);
162: EXCEPTION
163: WHEN OTHERS THEN
164: fnd_file.put_line(fnd_file.log,'Report Category Not Found : Please Contact Your Support Representative');
165: END;
160: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
161: fnd_file.put_line(fnd_file.log,'New Category Name : ' || lv_lookup_type_meaning);
162: EXCEPTION
163: WHEN OTHERS THEN
164: fnd_file.put_line(fnd_file.log,'Report Category Not Found : Please Contact Your Support Representative');
165: END;
166:
167: SELECT pay_report_categories_s.nextval INTO ln_report_category_id_new
168: FROM DUAL;
165: END;
166:
167: SELECT pay_report_categories_s.nextval INTO ln_report_category_id_new
168: FROM DUAL;
169: fnd_file.put_line(fnd_file.log,'New Category Id : ' || ln_report_category_id_new);
170: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
171:
172: OPEN csr_get_temp_codes(p_lookup_type_name);
173: LOOP
166:
167: SELECT pay_report_categories_s.nextval INTO ln_report_category_id_new
168: FROM DUAL;
169: fnd_file.put_line(fnd_file.log,'New Category Id : ' || ln_report_category_id_new);
170: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
171:
172: OPEN csr_get_temp_codes(p_lookup_type_name);
173: LOOP
174:
173: LOOP
174:
175: FETCH csr_get_temp_codes INTO lv_lookup_code,lv_meaning;
176: EXIT WHEN csr_get_temp_codes%NOTFOUND;
177: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
178: fnd_file.put_line(fnd_file.log,'Registering Template : ' || lv_lookup_code);
179: OPEN csr_temp_code_dtls(lv_lookup_code,p_conc_prog);
180: FETCH csr_temp_code_dtls INTO lv_template_code, lv_template_name, lv_template_type_code;
181:
174:
175: FETCH csr_get_temp_codes INTO lv_lookup_code,lv_meaning;
176: EXIT WHEN csr_get_temp_codes%NOTFOUND;
177: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
178: fnd_file.put_line(fnd_file.log,'Registering Template : ' || lv_lookup_code);
179: OPEN csr_temp_code_dtls(lv_lookup_code,p_conc_prog);
180: FETCH csr_temp_code_dtls INTO lv_template_code, lv_template_name, lv_template_type_code;
181:
182: IF csr_temp_code_dtls%FOUND THEN
179: OPEN csr_temp_code_dtls(lv_lookup_code,p_conc_prog);
180: FETCH csr_temp_code_dtls INTO lv_template_code, lv_template_name, lv_template_type_code;
181:
182: IF csr_temp_code_dtls%FOUND THEN
183: fnd_file.put_line(fnd_file.log,'Template Name : ' || lv_template_name);
184: fnd_file.put_line(fnd_file.log,'Template Type : ' || lv_template_type_code);
185: OPEN csr_report_group_id(lv_rg_short_name,lv_legislation_code);
186: FETCH csr_report_group_id INTO ln_report_group_id;
187:
180: FETCH csr_temp_code_dtls INTO lv_template_code, lv_template_name, lv_template_type_code;
181:
182: IF csr_temp_code_dtls%FOUND THEN
183: fnd_file.put_line(fnd_file.log,'Template Name : ' || lv_template_name);
184: fnd_file.put_line(fnd_file.log,'Template Type : ' || lv_template_type_code);
185: OPEN csr_report_group_id(lv_rg_short_name,lv_legislation_code);
186: FETCH csr_report_group_id INTO ln_report_group_id;
187:
188: IF csr_report_group_id%FOUND THEN
185: OPEN csr_report_group_id(lv_rg_short_name,lv_legislation_code);
186: FETCH csr_report_group_id INTO ln_report_group_id;
187:
188: IF csr_report_group_id%FOUND THEN
189: fnd_file.put_line(fnd_file.log,'Report Group Id : ' || ln_report_group_id);
190: IF DEBUG_MODE THEN
191: dbms_output.put_line('Before Opening Category Cursor : csr_report_category_id');
192: dbms_output.put_line('ln_report_group_id='||ln_report_group_id);
193: dbms_output.put_line('p_lookup_type_name='||p_lookup_type_name);
211:
212: OPEN csr_report_cat_comp_id(ln_report_category_id,ln_report_definition_id,p_business_group_id);
213: FETCH csr_report_cat_comp_id INTO ln_style_sheet_id;
214: IF csr_report_cat_comp_id%FOUND THEN
215: fnd_file.put_line(fnd_file.log,'Removing Template For Definition Id : ' || ln_report_definition_id);
216: fnd_file.put_line(fnd_file.log,'Removing Template For Category Id : ' || ln_report_category_id);
217: fnd_file.put_line(fnd_file.log,'Removing Style Sheet Id : ' || ln_style_sheet_id);
218: OPEN csr_report_variable_id(ln_style_sheet_id,p_business_group_id);
219: FETCH csr_report_variable_id INTO ln_report_variable_id;
212: OPEN csr_report_cat_comp_id(ln_report_category_id,ln_report_definition_id,p_business_group_id);
213: FETCH csr_report_cat_comp_id INTO ln_style_sheet_id;
214: IF csr_report_cat_comp_id%FOUND THEN
215: fnd_file.put_line(fnd_file.log,'Removing Template For Definition Id : ' || ln_report_definition_id);
216: fnd_file.put_line(fnd_file.log,'Removing Template For Category Id : ' || ln_report_category_id);
217: fnd_file.put_line(fnd_file.log,'Removing Style Sheet Id : ' || ln_style_sheet_id);
218: OPEN csr_report_variable_id(ln_style_sheet_id,p_business_group_id);
219: FETCH csr_report_variable_id INTO ln_report_variable_id;
220: IF csr_report_variable_id%FOUND THEN
213: FETCH csr_report_cat_comp_id INTO ln_style_sheet_id;
214: IF csr_report_cat_comp_id%FOUND THEN
215: fnd_file.put_line(fnd_file.log,'Removing Template For Definition Id : ' || ln_report_definition_id);
216: fnd_file.put_line(fnd_file.log,'Removing Template For Category Id : ' || ln_report_category_id);
217: fnd_file.put_line(fnd_file.log,'Removing Style Sheet Id : ' || ln_style_sheet_id);
218: OPEN csr_report_variable_id(ln_style_sheet_id,p_business_group_id);
219: FETCH csr_report_variable_id INTO ln_report_variable_id;
220: IF csr_report_variable_id%FOUND THEN
221: fnd_file.put_line(fnd_file.log,'Removing Variable Id : ' || ln_style_sheet_id);
217: fnd_file.put_line(fnd_file.log,'Removing Style Sheet Id : ' || ln_style_sheet_id);
218: OPEN csr_report_variable_id(ln_style_sheet_id,p_business_group_id);
219: FETCH csr_report_variable_id INTO ln_report_variable_id;
220: IF csr_report_variable_id%FOUND THEN
221: fnd_file.put_line(fnd_file.log,'Removing Variable Id : ' || ln_style_sheet_id);
222: IF DEBUG_MODE THEN
223: dbms_output.put_line('DELETE FROM pay_report_variables WHERE report_variable_id = ' || ln_report_variable_id);
224: ELSE
225: DELETE FROM pay_report_variables
241: CLOSE csr_report_category_id;
242:
243: ln_definition_id := get_definition_id(ln_report_group_id,lv_template_type_code,lv_template_code);
244:
245: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
246: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_VARIABLES');
247: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
248: fnd_file.put_line(fnd_file.log,'Template Name ' || lv_template_name);
249: fnd_file.put_line(fnd_file.log,'Template Code ' || lv_template_code);
242:
243: ln_definition_id := get_definition_id(ln_report_group_id,lv_template_type_code,lv_template_code);
244:
245: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
246: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_VARIABLES');
247: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
248: fnd_file.put_line(fnd_file.log,'Template Name ' || lv_template_name);
249: fnd_file.put_line(fnd_file.log,'Template Code ' || lv_template_code);
250: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
243: ln_definition_id := get_definition_id(ln_report_group_id,lv_template_type_code,lv_template_code);
244:
245: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
246: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_VARIABLES');
247: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
248: fnd_file.put_line(fnd_file.log,'Template Name ' || lv_template_name);
249: fnd_file.put_line(fnd_file.log,'Template Code ' || lv_template_code);
250: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
251:
244:
245: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
246: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_VARIABLES');
247: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
248: fnd_file.put_line(fnd_file.log,'Template Name ' || lv_template_name);
249: fnd_file.put_line(fnd_file.log,'Template Code ' || lv_template_code);
250: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
251:
252: insert_report_variable(p_report_definition_id => ln_definition_id,
245: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
246: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_VARIABLES');
247: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
248: fnd_file.put_line(fnd_file.log,'Template Name ' || lv_template_name);
249: fnd_file.put_line(fnd_file.log,'Template Code ' || lv_template_code);
250: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
251:
252: insert_report_variable(p_report_definition_id => ln_definition_id,
253: p_definition_type => 'SS',
246: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_VARIABLES');
247: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
248: fnd_file.put_line(fnd_file.log,'Template Name ' || lv_template_name);
249: fnd_file.put_line(fnd_file.log,'Template Code ' || lv_template_code);
250: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
251:
252: insert_report_variable(p_report_definition_id => ln_definition_id,
253: p_definition_type => 'SS',
254: p_name => lv_template_name,
255: p_value => lv_template_code,
256: p_business_group_id => p_business_group_id,
257: p_report_variable_id => pn_report_variable_id);
258:
259: fnd_file.put_line(fnd_file.log,'Report Variable Id ' || pn_report_variable_id);
260:
261: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORY_COMPONENTS');
262: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
263: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
257: p_report_variable_id => pn_report_variable_id);
258:
259: fnd_file.put_line(fnd_file.log,'Report Variable Id ' || pn_report_variable_id);
260:
261: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORY_COMPONENTS');
262: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
263: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
264: fnd_file.put_line(fnd_file.log,'Style Sheet Id ' || pn_report_variable_id);
265: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
258:
259: fnd_file.put_line(fnd_file.log,'Report Variable Id ' || pn_report_variable_id);
260:
261: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORY_COMPONENTS');
262: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
263: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
264: fnd_file.put_line(fnd_file.log,'Style Sheet Id ' || pn_report_variable_id);
265: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
266:
259: fnd_file.put_line(fnd_file.log,'Report Variable Id ' || pn_report_variable_id);
260:
261: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORY_COMPONENTS');
262: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
263: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
264: fnd_file.put_line(fnd_file.log,'Style Sheet Id ' || pn_report_variable_id);
265: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
266:
267: insert_report_catg_comp(p_report_category_id => ln_report_category_id_new,
260:
261: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORY_COMPONENTS');
262: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
263: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
264: fnd_file.put_line(fnd_file.log,'Style Sheet Id ' || pn_report_variable_id);
265: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
266:
267: insert_report_catg_comp(p_report_category_id => ln_report_category_id_new,
268: p_report_definition_id => ln_definition_id,
261: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORY_COMPONENTS');
262: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
263: fnd_file.put_line(fnd_file.log,'Definition Id ' || ln_definition_id);
264: fnd_file.put_line(fnd_file.log,'Style Sheet Id ' || pn_report_variable_id);
265: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
266:
267: insert_report_catg_comp(p_report_category_id => ln_report_category_id_new,
268: p_report_definition_id => ln_definition_id,
269: p_breakout_variable_id => NULL,
271: p_style_sheet_variable_id => pn_report_variable_id,
272: p_business_group_id => p_business_group_id,
273: p_report_category_comp_id => pn_report_category_comp_id);
274:
275: fnd_file.put_line(fnd_file.log,'Category Component Id ' || pn_report_category_comp_id);
276:
277: END IF;
278: CLOSE csr_report_group_id;
279: END IF;
287: DELETE FROM pay_report_categories
288: WHERE report_category_id = ln_report_category_id;
289: END IF;
290:
291: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
292: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORIES');
293: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
294: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
295: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
288: WHERE report_category_id = ln_report_category_id;
289: END IF;
290:
291: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
292: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORIES');
293: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
294: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
295: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
296: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
289: END IF;
290:
291: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
292: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORIES');
293: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
294: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
295: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
296: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
297: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
290:
291: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
292: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORIES');
293: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
294: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
295: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
296: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
297: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
298:
291: fnd_file.put_line(fnd_file.log,'+---------------------------------------------------------------------------+');
292: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORIES');
293: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
294: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
295: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
296: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
297: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
298:
299: insert_report_category(p_report_group_id => ln_report_group_id,
292: fnd_file.put_line(fnd_file.log,'Inserting Record Into PAY_REPORT_CATEGORIES');
293: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
294: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
295: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
296: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
297: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
298:
299: insert_report_category(p_report_group_id => ln_report_group_id,
300: p_category_name => lv_lookup_type_meaning,
293: fnd_file.put_line(fnd_file.log,'Report Group Id ' || ln_report_group_id);
294: fnd_file.put_line(fnd_file.log,'Category Name ' || lv_lookup_type_meaning);
295: fnd_file.put_line(fnd_file.log,'Category Short Name ' || p_lookup_type_name);
296: fnd_file.put_line(fnd_file.log,'Business Group Id ' || p_business_group_id);
297: fnd_file.put_line(fnd_file.log,'Category Id ' || ln_report_category_id_new);
298:
299: insert_report_category(p_report_group_id => ln_report_group_id,
300: p_category_name => lv_lookup_type_meaning,
301: p_short_name => p_lookup_type_name,
302: p_legislation_code => NULL,
303: p_business_group_id => p_business_group_id,
304: p_report_category_id => ln_report_category_id_new);
305:
306: fnd_file.put_line(fnd_file.log,'Template Registered Successfully');
307:
308: END insert_custom_template;
309:
310: FUNCTION get_legislation_code(p_business_group_id NUMBER)