8: g_basis_end date;
9: g_basis_start date;
10: g_basis_year varchar2(4);
11: g_legal_entity_id varchar2(20);
12: g_person_id per_all_people_f.person_id%type;
13: g_assignment_set_id hr_assignment_sets.assignment_set_id%type;
14: g_setup_action_id pay_payroll_actions.payroll_action_id%type;
15: g_report_type varchar2(30);
16:
13: g_assignment_set_id hr_assignment_sets.assignment_set_id%type;
14: g_setup_action_id pay_payroll_actions.payroll_action_id%type;
15: g_report_type varchar2(30);
16:
17: g_previous_person_id per_all_people_f.person_id%type;
18: g_moa_369_date ff_archive_items.value%type;
19: -- Added for bug 5435088 org cursor only need to run once
20: g_name_of_bank ff_archive_items.value%type;
21: g_org_run char(1);
72: -- Assignment actions are created for all assignments processed by pre-processor
73: ----------------------------------------------------------------------------
74: procedure assignment_action_code
75: ( p_payroll_action_id in pay_payroll_actions.payroll_action_id%type,
76: p_start_person_id in per_all_people_f.person_id%type,
77: p_end_person_id in per_all_people_f.person_id%type,
78: p_chunk in number )
79: is
80: v_next_action_id pay_assignment_actions.assignment_action_id%type;
73: ----------------------------------------------------------------------------
74: procedure assignment_action_code
75: ( p_payroll_action_id in pay_payroll_actions.payroll_action_id%type,
76: p_start_person_id in per_all_people_f.person_id%type,
77: p_end_person_id in per_all_people_f.person_id%type,
78: p_chunk in number )
79: is
80: v_next_action_id pay_assignment_actions.assignment_action_id%type;
81: v_setup_action_id pay_payroll_actions.payroll_action_id%type;
79: is
80: v_next_action_id pay_assignment_actions.assignment_action_id%type;
81: v_setup_action_id pay_payroll_actions.payroll_action_id%type;
82: v_assignment_id per_all_assignments_f.assignment_id%type;
83: v_person_id per_all_people_f.person_id%type;
84: v_assignment_set_id hr_assignment_sets.assignment_set_id%type;
85: --
86: cursor get_params(c_payroll_action_id in pay_payroll_actions.payroll_action_id%type) is
87: select pay_core_utils.get_parameter('SETUP_ACTION_ID',legislative_parameters)
95: from dual;
96: --
97: cursor process_assignments
98: (c_setup_action_id in pay_payroll_actions.payroll_action_id%type,
99: c_person_id in per_all_people_f.person_id%type,
100: c_assignment_set_id in hr_assignment_sets.assignment_set_id%type) is
101: select distinct pai.assignment_id
102: from pay_action_information pai
103: where pai.action_context_id = c_setup_action_id
276: procedure archive_code
277: ( p_assignment_action_id in pay_assignment_actions.assignment_action_id%type,
278: p_effective_date in date )
279: is
280: v_person_id per_all_people_f.person_id%type;
281: v_assignment_id per_all_assignments_f.assignment_id%type;
282: v_national_identifier varchar2(50);
283: v_archive_date pay_payroll_actions.effective_date%type;
284: l_person_id per_all_people_f.person_id%type;
280: v_person_id per_all_people_f.person_id%type;
281: v_assignment_id per_all_assignments_f.assignment_id%type;
282: v_national_identifier varchar2(50);
283: v_archive_date pay_payroll_actions.effective_date%type;
284: l_person_id per_all_people_f.person_id%type;
285: l_archived_person_id binary_integer;
286:
287: ------------------------------------------------------------------------
288: -- Bug 2920732 - Modified the cursor to use secured views per_people_f, per_assignments_f
859: -- earnings by month.
860: ---------------------------------------------------------------------------
861: procedure archive_balances
862: ( p_assignment_action_id in pay_assignment_actions.assignment_action_id%type,
863: p_person_id in per_all_people_f.person_id%type,
864: p_business_group_id in hr_organization_units.business_group_id%type,
865: p_tax_unit_id in ff_archive_item_contexts.context%type,
866: p_basis_year in varchar2 )
867: is
967: -- Bug# 2920732 - Modified the cursor to use secured view per_assignments_f
968: -- Cursor month_year_action_sequence
969: ---------------------------------------------------------------------------------------------------
970: cursor month_year_action_sequence
971: ( c_person_id per_all_people_f.person_id%type,
972: c_business_group_id hr_organization_units.business_group_id%type,
973: c_legal_entity_id pay_assignment_actions.tax_unit_id%type,
974: c_basis_year varchar2 )
975: is
992: ---------------------------------------------------------------------------------------------------
993: -- cursor month_year_action
994: ---------------------------------------------------------------------------------------------------
995: cursor month_year_action
996: ( c_person_id per_all_people_f.person_id%type,
997: c_business_group_id hr_organization_units.business_group_id%type,
998: c_legal_entity_id pay_assignment_actions.tax_unit_id%type,
999: c_basis_year varchar2,
1000: c_action_sequence pay_assignment_actions.action_sequence%type )
1084: ---------------------------------------------------------------------------------------------------
1085: -- Type to store the person ids with same national_identifier (Bug 2649107)
1086: ---------------------------------------------------------------------------------------------------
1087: type person_id_store_rec is record
1088: ( person_id per_all_people_f.person_id%type );
1089: type person_id_tab is table of person_id_store_rec index by binary_integer;
1090: person_id_rec person_id_tab;
1091: ---------------------------------------------------------------------------------------------------
1092: -- Type to store the months on which payroll is run for a perticular person id
1105: month_year_action_sequence_rec month_year_action_sequence%rowtype;
1106: month_year_action_rec month_year_action%rowtype;
1107: per_le_ytd_bal number;
1108: per_le_mtd_bal number;
1109: l_person_id per_all_people_f.person_id%type;
1110: l_ytd_counter_ir8a number;
1111: l_ytd_counter_ir8s number;
1112: l_mon_counter number;
1113: counter number;
2211:
2212: ---------------------------------------------------------------------------
2213: procedure archive_shares_details
2214: ( p_assignment_action_id in pay_assignment_actions.assignment_action_id%type,
2215: p_person_id in per_all_people_f.person_id%type,
2216: p_tax_unit_id in ff_archive_item_contexts.context%type,
2217: p_basis_start in date,
2218: p_basis_end in date )
2219: is
2294: -- Bug 4314453 - Modified the cursor to use the table instead of view
2295: -- Bug 5435088 - Added grant type
2296: ---------------------------------------------------------------------------
2297: cursor shares_details
2298: ( c_person_id per_all_people_f.person_id%type,
2299: c_basis_start date,
2300: c_basis_end date )
2301: is
2302: select distinct pei.person_extra_info_id,
2313: pei2.pei_information5 grant_type,
2314: decode(pei2.pei_information3, null, null, to_char(fnd_date.canonical_to_date(pei2.pei_information3),'YYYY')||'/'||
2315: to_char(fnd_date.canonical_to_date(pei2.pei_information3),'MM')||'/'||to_char(fnd_date.canonical_to_date(pei2.pei_information3),'DD')) grant_date,
2316: pei2.pei_information4 shares_granted
2317: from per_all_people_f pap,
2318: per_people_extra_info pei,
2319: per_people_extra_info pei2,
2320: hr_all_organization_units hou,
2321: hr_organization_information hoi2,
2769: -- which is entered via assignment extra information screen, bug 3027801
2770: ---------------------------------------------------------------------------
2771: procedure archive_ir8s_c_details
2772: (p_assignment_action_id in pay_assignment_actions.assignment_action_id%type,
2773: p_person_id in per_all_people_f.person_id%type,
2774: p_tax_unit_id in ff_archive_item_contexts.context%type,
2775: p_business_group_id in per_assignments_f.business_group_id%type,
2776: p_basis_start in date,
2777: p_basis_end in date) is
2778:
2779: /* Type to store the person ids with same national_identifier */
2780:
2781: type person_id_store_rec is record
2782: (person_id per_all_people_f.person_id%type);
2783:
2784: type person_id_tab is table of person_id_store_rec index by binary_integer;
2785: person_id_rec person_id_tab;
2786:
2783:
2784: type person_id_tab is table of person_id_store_rec index by binary_integer;
2785: person_id_rec person_id_tab;
2786:
2787: l_person_id per_all_people_f.person_id%type;
2788: l_temp_person_id per_all_people_f.person_id%type;
2789: l_archive_person_id per_all_people_f.person_id%type;
2790: counter number;
2791: l_counter number;
2784: type person_id_tab is table of person_id_store_rec index by binary_integer;
2785: person_id_rec person_id_tab;
2786:
2787: l_person_id per_all_people_f.person_id%type;
2788: l_temp_person_id per_all_people_f.person_id%type;
2789: l_archive_person_id per_all_people_f.person_id%type;
2790: counter number;
2791: l_counter number;
2792: duplicate_exists varchar2(1);
2785: person_id_rec person_id_tab;
2786:
2787: l_person_id per_all_people_f.person_id%type;
2788: l_temp_person_id per_all_people_f.person_id%type;
2789: l_archive_person_id per_all_people_f.person_id%type;
2790: counter number;
2791: l_counter number;
2792: duplicate_exists varchar2(1);
2793: l_ir8s_c_counts number;
2844:
2845:
2846: procedure archive_ir8s_c_detail_moas
2847: (p_assignment_action_id in pay_assignment_actions.assignment_action_id%type,
2848: p_1_person_id in per_all_people_f.person_id%type,
2849: p_person_id in per_all_people_f.person_id%type,
2850: p_tax_unit_id in ff_archive_item_contexts.context%type,
2851: p_business_group_id in per_assignments_f.business_group_id%type,
2852: p_basis_start in date,
2845:
2846: procedure archive_ir8s_c_detail_moas
2847: (p_assignment_action_id in pay_assignment_actions.assignment_action_id%type,
2848: p_1_person_id in per_all_people_f.person_id%type,
2849: p_person_id in per_all_people_f.person_id%type,
2850: p_tax_unit_id in ff_archive_item_contexts.context%type,
2851: p_business_group_id in per_assignments_f.business_group_id%type,
2852: p_basis_start in date,
2853: p_basis_end in date) is
3437: -- system Or if current employee is latest in case duplicates exist in the system
3438: -- For second case it also populates global table with all its previous employement records
3439: ----------------------------------------------------------------------
3440: function employee_if_latest ( p_national_identifier in varchar2,
3441: p_person_id in per_all_people_f.person_id%type,
3442: p_setup_action_id in pay_payroll_actions.payroll_action_id%type,
3443: p_report_type in varchar2 ) return boolean
3444: is
3445: type t_person_start_date_tab is table of per_all_people_f.start_date%type;
3441: p_person_id in per_all_people_f.person_id%type,
3442: p_setup_action_id in pay_payroll_actions.payroll_action_id%type,
3443: p_report_type in varchar2 ) return boolean
3444: is
3445: type t_person_start_date_tab is table of per_all_people_f.start_date%type;
3446: g_person_start_date_tab t_person_start_date_tab;
3447: begin
3448: g_person_id_tab.delete;
3449: --
3477: -------------------------------------------------------------------------
3478: -- Bug 4688761, this function checks the same person_id has been archived
3479: -------------------------------------------------------------------------
3480:
3481: function person_if_archived (p_person_id in per_all_people_f.person_id%type) return boolean
3482: is
3483: l_archived_person_id binary_integer;
3484: begin
3485: if g_debug then
3506: -- primary assignment, it needs for share details.
3507: -------------------------------------------------------------------------
3508:
3509: function pri_if_latest
3510: ( p_person_id in per_all_people_f.person_id%type
3511: , p_tax_unit_id in ff_archive_item_contexts.context%type
3512: , p_basis_start in date
3513: , p_basis_end in date) return boolean
3514: is
3513: , p_basis_end in date) return boolean
3514: is
3515: v_dummy varchar2(1);
3516: cursor pri_latest
3517: ( c_person_id per_all_people_f.person_id%type,
3518: c_tax_unit_id pay_assignment_actions.tax_unit_id%type,
3519: c_basis_start date,
3520: c_basis_end date )
3521: is
3569: -- effective_start_date with the primary defined
3570: -------------------------------------------------------------------------
3571:
3572: function pri_LE_if_latest
3573: ( p_person_id in per_all_people_f.person_id%type
3574: , p_tax_unit_id in ff_archive_item_contexts.context%type
3575: , p_basis_start in date
3576: , p_basis_end in date) return number
3577: is
3576: , p_basis_end in date) return number
3577: is
3578: v_assignment_id number(10);
3579: cursor pri_latest_LE
3580: ( c_person_id per_all_people_f.person_id%type,
3581: c_tax_unit_id pay_assignment_actions.tax_unit_id%type,
3582: c_basis_start date,
3583: c_basis_end date )
3584: is
3638: -- not return an assignment_id.
3639: -------------------------------------------------------------------------
3640:
3641: function id_LE_if_latest
3642: ( p_person_id in per_all_people_f.person_id%type
3643: , p_tax_unit_id in ff_archive_item_contexts.context%type
3644: , p_basis_start in date
3645: , p_basis_end in date) return number
3646: is
3645: , p_basis_end in date) return number
3646: is
3647: v_assignment_id number(10);
3648: cursor id_latest_LE
3649: ( c_person_id per_all_people_f.person_id%type,
3650: c_tax_unit_id pay_assignment_actions.tax_unit_id%type,
3651: c_basis_start date,
3652: c_basis_end date )
3653: is