34: );
35:
36: PROCEDURE copy_burden_pct
37: (
38: pi_legal_entity_id_from IN gmf_burden_percentages.legal_entity_id%TYPE,
39: pi_calendar_code_from IN cm_cldr_hdr.calendar_code%TYPE,
40: pi_period_code_from IN cm_cldr_dtl.period_code%TYPE,
41: pi_cost_type_id_from IN cm_mthd_mst.cost_type_id%TYPE,
42: pi_legal_entity_id_to IN gmf_burden_percentages.legal_entity_id%TYPE,
38: pi_legal_entity_id_from IN gmf_burden_percentages.legal_entity_id%TYPE,
39: pi_calendar_code_from IN cm_cldr_hdr.calendar_code%TYPE,
40: pi_period_code_from IN cm_cldr_dtl.period_code%TYPE,
41: pi_cost_type_id_from IN cm_mthd_mst.cost_type_id%TYPE,
42: pi_legal_entity_id_to IN gmf_burden_percentages.legal_entity_id%TYPE,
43: pi_calendar_code_to IN cm_cldr_hdr.calendar_code%TYPE,
44: pi_period_code_to IN cm_cldr_dtl.period_code%TYPE,
45: pi_cost_type_id_to IN cm_mthd_mst.cost_type_id%TYPE,
46: pi_from_range IN gmf_burden_codes.burden_code%TYPE,
51: );
52:
53: PROCEDURE delete_burden_pct
54: (
55: pi_legal_entity_id IN gmf_burden_percentages.legal_entity_id%TYPE,
56: pi_period_id IN gmf_burden_percentages.period_id%TYPE,
57: pi_cost_type_id IN cm_mthd_mst.cost_type_id%TYPE,
58: pi_from_range IN gmf_burden_codes.burden_code%TYPE,
59: pi_to_range IN gmf_burden_codes.burden_code%TYPE
52:
53: PROCEDURE delete_burden_pct
54: (
55: pi_legal_entity_id IN gmf_burden_percentages.legal_entity_id%TYPE,
56: pi_period_id IN gmf_burden_percentages.period_id%TYPE,
57: pi_cost_type_id IN cm_mthd_mst.cost_type_id%TYPE,
58: pi_from_range IN gmf_burden_codes.burden_code%TYPE,
59: pi_to_range IN gmf_burden_codes.burden_code%TYPE
60: );
60: );
61:
62: FUNCTION do_pct_exist
63: (
64: pi_legal_entity_id IN gmf_burden_percentages.legal_entity_id%TYPE,
65: pi_period_id IN gmf_burden_percentages.period_id%TYPE,
66: pi_cost_type_id IN cm_mthd_mst.cost_type_id%TYPE,
67: pi_burden_code_from IN gmf_burden_codes.burden_code%TYPE,
68: pi_burden_code_to IN gmf_burden_codes.burden_code%TYPE
61:
62: FUNCTION do_pct_exist
63: (
64: pi_legal_entity_id IN gmf_burden_percentages.legal_entity_id%TYPE,
65: pi_period_id IN gmf_burden_percentages.period_id%TYPE,
66: pi_cost_type_id IN cm_mthd_mst.cost_type_id%TYPE,
67: pi_burden_code_from IN gmf_burden_codes.burden_code%TYPE,
68: pi_burden_code_to IN gmf_burden_codes.burden_code%TYPE
69: )
102: PROCEDURE copy_percentage_burden
103: (
104: po_errbuf OUT NOCOPY VARCHAR2,
105: po_retcode OUT NOCOPY VARCHAR2,
106: pi_legal_entity_id_from IN gmf_burden_percentages.legal_entity_id%TYPE,
107: pi_calendar_code_from IN cm_cldr_hdr.calendar_code%TYPE,
108: pi_period_code_from IN cm_cldr_dtl.period_code%TYPE,
109: pi_cost_type_id_from IN cm_mthd_mst.cost_type_id%TYPE,
110: pi_legal_entity_id_to IN gmf_burden_percentages.legal_entity_id%TYPE,
106: pi_legal_entity_id_from IN gmf_burden_percentages.legal_entity_id%TYPE,
107: pi_calendar_code_from IN cm_cldr_hdr.calendar_code%TYPE,
108: pi_period_code_from IN cm_cldr_dtl.period_code%TYPE,
109: pi_cost_type_id_from IN cm_mthd_mst.cost_type_id%TYPE,
110: pi_legal_entity_id_to IN gmf_burden_percentages.legal_entity_id%TYPE,
111: pi_calendar_code_to IN cm_cldr_hdr.calendar_code%TYPE,
112: pi_period_code_to IN cm_cldr_dtl.period_code%TYPE,
113: pi_cost_type_id_to IN cm_mthd_mst.cost_type_id%TYPE,
114: pi_burden_code_from IN gmf_burden_codes.burden_code%TYPE,
126: l_from_range gmf_burden_codes.burden_code%TYPE;
127: l_to_range gmf_burden_codes.burden_code%TYPE;
128: l_rem_repl NUMBER;
129: l_num_src_rows NUMBER; -- num rows in source period
130: l_period_id_from gmf_burden_percentages.period_id%TYPE;
131:
132: /*************
133: * Exceptions *
134: *************/
331: ****************************************************************************************/
332:
333: PROCEDURE copy_burden_pct
334: (
335: pi_legal_entity_id_from IN gmf_burden_percentages.legal_entity_id%TYPE,
336: pi_calendar_code_from IN cm_cldr_hdr.calendar_code%TYPE,
337: pi_period_code_from IN cm_cldr_dtl.period_code%TYPE,
338: pi_cost_type_id_from IN cm_mthd_mst.cost_type_id%TYPE,
339: pi_legal_entity_id_to IN gmf_burden_percentages.legal_entity_id%TYPE,
335: pi_legal_entity_id_from IN gmf_burden_percentages.legal_entity_id%TYPE,
336: pi_calendar_code_from IN cm_cldr_hdr.calendar_code%TYPE,
337: pi_period_code_from IN cm_cldr_dtl.period_code%TYPE,
338: pi_cost_type_id_from IN cm_mthd_mst.cost_type_id%TYPE,
339: pi_legal_entity_id_to IN gmf_burden_percentages.legal_entity_id%TYPE,
340: pi_calendar_code_to IN cm_cldr_hdr.calendar_code%TYPE,
341: pi_period_code_to IN cm_cldr_dtl.period_code%TYPE,
342: pi_cost_type_id_to IN cm_mthd_mst.cost_type_id%TYPE,
343: pi_from_range IN gmf_burden_codes.burden_code%TYPE,
353: ***************************/
354:
355: TYPE rectype_brdn_pct IS RECORD
356: (
357: legal_entity_id gmf_burden_percentages.legal_entity_id%TYPE,
358: period_id gmf_burden_percentages.period_id%TYPE,
359: cost_type_id cm_mthd_mst.cost_type_id%TYPE,
360: burden_id gmf_burden_codes.burden_id%TYPE,
361: burden_code gmf_burden_codes.burden_code%TYPE,
354:
355: TYPE rectype_brdn_pct IS RECORD
356: (
357: legal_entity_id gmf_burden_percentages.legal_entity_id%TYPE,
358: period_id gmf_burden_percentages.period_id%TYPE,
359: cost_type_id cm_mthd_mst.cost_type_id%TYPE,
360: burden_id gmf_burden_codes.burden_id%TYPE,
361: burden_code gmf_burden_codes.burden_code%TYPE,
362: organization_id gmf_burden_percentages.organization_id%TYPE,
358: period_id gmf_burden_percentages.period_id%TYPE,
359: cost_type_id cm_mthd_mst.cost_type_id%TYPE,
360: burden_id gmf_burden_codes.burden_id%TYPE,
361: burden_code gmf_burden_codes.burden_code%TYPE,
362: organization_id gmf_burden_percentages.organization_id%TYPE,
363: master_organization_id gmf_burden_percentages.master_organization_id%TYPE,
364: inventory_item_id gmf_burden_percentages.inventory_item_id%TYPE,
365: gl_category_id gmf_burden_percentages.gl_category_id%TYPE,
366: cost_category_id gmf_burden_percentages.cost_category_id%TYPE,
359: cost_type_id cm_mthd_mst.cost_type_id%TYPE,
360: burden_id gmf_burden_codes.burden_id%TYPE,
361: burden_code gmf_burden_codes.burden_code%TYPE,
362: organization_id gmf_burden_percentages.organization_id%TYPE,
363: master_organization_id gmf_burden_percentages.master_organization_id%TYPE,
364: inventory_item_id gmf_burden_percentages.inventory_item_id%TYPE,
365: gl_category_id gmf_burden_percentages.gl_category_id%TYPE,
366: cost_category_id gmf_burden_percentages.cost_category_id%TYPE,
367: gl_prod_line_category_id gmf_burden_percentages.gl_prod_line_category_id%TYPE,
360: burden_id gmf_burden_codes.burden_id%TYPE,
361: burden_code gmf_burden_codes.burden_code%TYPE,
362: organization_id gmf_burden_percentages.organization_id%TYPE,
363: master_organization_id gmf_burden_percentages.master_organization_id%TYPE,
364: inventory_item_id gmf_burden_percentages.inventory_item_id%TYPE,
365: gl_category_id gmf_burden_percentages.gl_category_id%TYPE,
366: cost_category_id gmf_burden_percentages.cost_category_id%TYPE,
367: gl_prod_line_category_id gmf_burden_percentages.gl_prod_line_category_id%TYPE,
368: gl_business_category_id gmf_burden_percentages.gl_business_category_id%TYPE,
361: burden_code gmf_burden_codes.burden_code%TYPE,
362: organization_id gmf_burden_percentages.organization_id%TYPE,
363: master_organization_id gmf_burden_percentages.master_organization_id%TYPE,
364: inventory_item_id gmf_burden_percentages.inventory_item_id%TYPE,
365: gl_category_id gmf_burden_percentages.gl_category_id%TYPE,
366: cost_category_id gmf_burden_percentages.cost_category_id%TYPE,
367: gl_prod_line_category_id gmf_burden_percentages.gl_prod_line_category_id%TYPE,
368: gl_business_category_id gmf_burden_percentages.gl_business_category_id%TYPE,
369: sspl_category_id gmf_burden_percentages.sspl_category_id%TYPE,
362: organization_id gmf_burden_percentages.organization_id%TYPE,
363: master_organization_id gmf_burden_percentages.master_organization_id%TYPE,
364: inventory_item_id gmf_burden_percentages.inventory_item_id%TYPE,
365: gl_category_id gmf_burden_percentages.gl_category_id%TYPE,
366: cost_category_id gmf_burden_percentages.cost_category_id%TYPE,
367: gl_prod_line_category_id gmf_burden_percentages.gl_prod_line_category_id%TYPE,
368: gl_business_category_id gmf_burden_percentages.gl_business_category_id%TYPE,
369: sspl_category_id gmf_burden_percentages.sspl_category_id%TYPE,
370: percentage gmf_burden_percentages.percentage%TYPE
363: master_organization_id gmf_burden_percentages.master_organization_id%TYPE,
364: inventory_item_id gmf_burden_percentages.inventory_item_id%TYPE,
365: gl_category_id gmf_burden_percentages.gl_category_id%TYPE,
366: cost_category_id gmf_burden_percentages.cost_category_id%TYPE,
367: gl_prod_line_category_id gmf_burden_percentages.gl_prod_line_category_id%TYPE,
368: gl_business_category_id gmf_burden_percentages.gl_business_category_id%TYPE,
369: sspl_category_id gmf_burden_percentages.sspl_category_id%TYPE,
370: percentage gmf_burden_percentages.percentage%TYPE
371: );
364: inventory_item_id gmf_burden_percentages.inventory_item_id%TYPE,
365: gl_category_id gmf_burden_percentages.gl_category_id%TYPE,
366: cost_category_id gmf_burden_percentages.cost_category_id%TYPE,
367: gl_prod_line_category_id gmf_burden_percentages.gl_prod_line_category_id%TYPE,
368: gl_business_category_id gmf_burden_percentages.gl_business_category_id%TYPE,
369: sspl_category_id gmf_burden_percentages.sspl_category_id%TYPE,
370: percentage gmf_burden_percentages.percentage%TYPE
371: );
372:
365: gl_category_id gmf_burden_percentages.gl_category_id%TYPE,
366: cost_category_id gmf_burden_percentages.cost_category_id%TYPE,
367: gl_prod_line_category_id gmf_burden_percentages.gl_prod_line_category_id%TYPE,
368: gl_business_category_id gmf_burden_percentages.gl_business_category_id%TYPE,
369: sspl_category_id gmf_burden_percentages.sspl_category_id%TYPE,
370: percentage gmf_burden_percentages.percentage%TYPE
371: );
372:
373: TYPE curtyp_brdn_pct IS REF CURSOR;
366: cost_category_id gmf_burden_percentages.cost_category_id%TYPE,
367: gl_prod_line_category_id gmf_burden_percentages.gl_prod_line_category_id%TYPE,
368: gl_business_category_id gmf_burden_percentages.gl_business_category_id%TYPE,
369: sspl_category_id gmf_burden_percentages.sspl_category_id%TYPE,
370: percentage gmf_burden_percentages.percentage%TYPE
371: );
372:
373: TYPE curtyp_brdn_pct IS REF CURSOR;
374:
379: ******************/
380:
381: l_sql_stmt VARCHAR2(2000);
382: l_sql_periods VARCHAR2(2000);
383: l_period_id_to gmf_burden_percentages.period_id%TYPE ;
384: l_brdn_rows NUMBER;
385: l_brdn_rows_upd NUMBER;
386: l_brdn_rows_ins NUMBER;
387: l_period_id_from gmf_burden_percentages.period_id%TYPE;
383: l_period_id_to gmf_burden_percentages.period_id%TYPE ;
384: l_brdn_rows NUMBER;
385: l_brdn_rows_upd NUMBER;
386: l_brdn_rows_ins NUMBER;
387: l_period_id_from gmf_burden_percentages.period_id%TYPE;
388: pi_period_id_from gmf_burden_percentages.period_id%TYPE;
389: pi_period_id_to gmf_burden_percentages.period_id%TYPE;
390:
391:
384: l_brdn_rows NUMBER;
385: l_brdn_rows_upd NUMBER;
386: l_brdn_rows_ins NUMBER;
387: l_period_id_from gmf_burden_percentages.period_id%TYPE;
388: pi_period_id_from gmf_burden_percentages.period_id%TYPE;
389: pi_period_id_to gmf_burden_percentages.period_id%TYPE;
390:
391:
392: r_brdn_pct rectype_brdn_pct;
385: l_brdn_rows_upd NUMBER;
386: l_brdn_rows_ins NUMBER;
387: l_period_id_from gmf_burden_percentages.period_id%TYPE;
388: pi_period_id_from gmf_burden_percentages.period_id%TYPE;
389: pi_period_id_to gmf_burden_percentages.period_id%TYPE;
390:
391:
392: r_brdn_pct rectype_brdn_pct;
393: cv_brdn_pct curtyp_brdn_pct;
414: ' pct.gl_business_category_id, ' ||
415: ' pct.sspl_category_id, ' ||
416: ' pct.percentage ' ||
417: ' FROM ' ||
418: ' gmf_burden_percentages pct, ' ||
419: ' gmf_burden_codes bur ' ||
420: ' WHERE ' ||
421: ' pct.legal_entity_id = :b_legal_entity_id AND ' ||
422: ' pct.period_id = :b_period_id AND ' ||
564: IF( pi_rem_repl = 1 ) THEN
565: RAISE e_insert_row_b;
566: END IF;
567:
568: UPDATE gmf_burden_percentages
569: SET burden_percentage_id = GMF_BURDEN_PERCENTAGE_ID_S.NEXTVAL,
570: percentage = r_brdn_pct.percentage,
571: delete_mark = 0,
572: last_updated_by = g_user_id,
597:
598: EXCEPTION
599: WHEN e_insert_row_b THEN
600:
601: INSERT INTO gmf_burden_percentages
602: (
603: burden_percentage_id,
604: legal_entity_id,
605: period_id,
684: **************************************************************/
685:
686: PROCEDURE delete_burden_pct
687: (
688: pi_legal_entity_id IN gmf_burden_percentages.legal_entity_id%TYPE,
689: pi_period_id IN gmf_burden_percentages.period_id%TYPE,
690: pi_cost_type_id IN cm_mthd_mst.cost_type_id%TYPE,
691: pi_from_range IN gmf_burden_codes.burden_code%TYPE,
692: pi_to_range IN gmf_burden_codes.burden_code%TYPE
685:
686: PROCEDURE delete_burden_pct
687: (
688: pi_legal_entity_id IN gmf_burden_percentages.legal_entity_id%TYPE,
689: pi_period_id IN gmf_burden_percentages.period_id%TYPE,
690: pi_cost_type_id IN cm_mthd_mst.cost_type_id%TYPE,
691: pi_from_range IN gmf_burden_codes.burden_code%TYPE,
692: pi_to_range IN gmf_burden_codes.burden_code%TYPE
693: )
704:
705: l_del_stmt := '';
706: l_sub_qry := '';
707:
708: l_del_stmt := ' DELETE FROM gmf_burden_percentages pct ' ||
709: ' WHERE ' ||
710: ' pct.legal_entity_id = :b_legal_entity_id AND ' ||
711: ' pct.period_id = :b_period_id AND ' ||
712: ' pct.cost_type_id = :b_cost_type_id AND ' ||
785: *******************************************************************************/
786:
787: FUNCTION do_pct_exist
788: (
789: pi_legal_entity_id IN gmf_burden_percentages.legal_entity_id%TYPE,
790: pi_period_id IN gmf_burden_percentages.period_id%TYPE,
791: pi_cost_type_id IN cm_mthd_mst.cost_type_id%TYPE,
792: pi_burden_code_from IN gmf_burden_codes.burden_code%TYPE,
793: pi_burden_code_to IN gmf_burden_codes.burden_code%TYPE
786:
787: FUNCTION do_pct_exist
788: (
789: pi_legal_entity_id IN gmf_burden_percentages.legal_entity_id%TYPE,
790: pi_period_id IN gmf_burden_percentages.period_id%TYPE,
791: pi_cost_type_id IN cm_mthd_mst.cost_type_id%TYPE,
792: pi_burden_code_from IN gmf_burden_codes.burden_code%TYPE,
793: pi_burden_code_to IN gmf_burden_codes.burden_code%TYPE
794: )
800: **********/
801:
802: CURSOR cur_num_pct_rows
803: (
804: p_legal_entity_id IN gmf_burden_percentages.legal_entity_id%TYPE,
805: p_period_id IN gmf_burden_percentages.period_id%TYPE,
806: p_burden_code_from IN gmf_burden_codes.burden_code%TYPE,
807: p_burden_code_to IN gmf_burden_codes.burden_code%TYPE
808: )
801:
802: CURSOR cur_num_pct_rows
803: (
804: p_legal_entity_id IN gmf_burden_percentages.legal_entity_id%TYPE,
805: p_period_id IN gmf_burden_percentages.period_id%TYPE,
806: p_burden_code_from IN gmf_burden_codes.burden_code%TYPE,
807: p_burden_code_to IN gmf_burden_codes.burden_code%TYPE
808: )
809: IS
807: p_burden_code_to IN gmf_burden_codes.burden_code%TYPE
808: )
809: IS
810: SELECT COUNT(1)
811: FROM gmf_burden_percentages pct,
812: gmf_burden_codes bur
813: WHERE pct.legal_entity_id = p_legal_entity_id
814: AND pct.period_id = p_period_id
815: AND pct.delete_mark = 0