95: lv_print varchar2(10);
96: lv_report_type varchar2(50);
97:
98: BEGIN
99: hr_utility.trace('Entered get_payroll_action_info');
100: open c_payroll_action_info(p_payroll_action_id);
101: fetch c_payroll_action_info into ln_tax_unit_id,
102: ln_person_id,
103: ln_asg_set,
107: ln_business_group_id,
108: lv_report_type;
109: close c_payroll_action_info;
110:
111: hr_utility.trace('ld_end_date = ' || to_char(ld_end_date));
112: hr_utility.trace('ld_start_date = ' || to_char(ld_start_date));
113: hr_utility.trace('ln_tax_unit_id = '|| to_char(ln_tax_unit_id));
114: hr_utility.trace('ln_person_id = ' || to_char(ln_person_id));
115: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
108: lv_report_type;
109: close c_payroll_action_info;
110:
111: hr_utility.trace('ld_end_date = ' || to_char(ld_end_date));
112: hr_utility.trace('ld_start_date = ' || to_char(ld_start_date));
113: hr_utility.trace('ln_tax_unit_id = '|| to_char(ln_tax_unit_id));
114: hr_utility.trace('ln_person_id = ' || to_char(ln_person_id));
115: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
116:
109: close c_payroll_action_info;
110:
111: hr_utility.trace('ld_end_date = ' || to_char(ld_end_date));
112: hr_utility.trace('ld_start_date = ' || to_char(ld_start_date));
113: hr_utility.trace('ln_tax_unit_id = '|| to_char(ln_tax_unit_id));
114: hr_utility.trace('ln_person_id = ' || to_char(ln_person_id));
115: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
116:
117: p_end_date := ld_end_date;
110:
111: hr_utility.trace('ld_end_date = ' || to_char(ld_end_date));
112: hr_utility.trace('ld_start_date = ' || to_char(ld_start_date));
113: hr_utility.trace('ln_tax_unit_id = '|| to_char(ln_tax_unit_id));
114: hr_utility.trace('ln_person_id = ' || to_char(ln_person_id));
115: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
116:
117: p_end_date := ld_end_date;
118: p_start_date := ld_start_date;
111: hr_utility.trace('ld_end_date = ' || to_char(ld_end_date));
112: hr_utility.trace('ld_start_date = ' || to_char(ld_start_date));
113: hr_utility.trace('ln_tax_unit_id = '|| to_char(ln_tax_unit_id));
114: hr_utility.trace('ln_person_id = ' || to_char(ln_person_id));
115: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
116:
117: p_end_date := ld_end_date;
118: p_start_date := ld_start_date;
119: p_business_group_id := ln_business_group_id;
122: p_asg_set := ln_asg_set;
123: p_print := lv_print;
124: p_report_type := lv_report_type;
125:
126: hr_utility.trace('Leaving get_payroll_action_info');
127:
128: EXCEPTION
129: when others then
130: hr_utility.trace('Error in ' || gv_procedure_name ||
126: hr_utility.trace('Leaving get_payroll_action_info');
127:
128: EXCEPTION
129: when others then
130: hr_utility.trace('Error in ' || gv_procedure_name ||
131: to_char(sqlcode) || '-' || sqlerrm);
132: raise hr_utility.hr_error;
133:
134: END get_payroll_action_info;
128: EXCEPTION
129: when others then
130: hr_utility.trace('Error in ' || gv_procedure_name ||
131: to_char(sqlcode) || '-' || sqlerrm);
132: raise hr_utility.hr_error;
133:
134: END get_payroll_action_info;
135:
136:
191: lv_report_cat pay_payroll_actions.report_category%type;
192: l_print_term varchar2(1) := 'N';
193:
194: BEGIN
195: hr_utility.trace('Entered get_payroll_action_info');
196: open c_payroll_action_info(p_payroll_action_id);
197: fetch c_payroll_action_info into ln_tax_unit_id,
198: ln_person_id,
199: ln_asg_set,
206: lv_report_cat,
207: l_print_term;
208: close c_payroll_action_info;
209:
210: hr_utility.trace('ld_end_date = ' || to_char(ld_end_date));
211: hr_utility.trace('ld_start_date = ' || to_char(ld_start_date));
212: hr_utility.trace('ln_tax_unit_id = ' || to_char(ln_tax_unit_id));
213: hr_utility.trace('ln_person_id = ' || to_char(ln_person_id));
214: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
207: l_print_term;
208: close c_payroll_action_info;
209:
210: hr_utility.trace('ld_end_date = ' || to_char(ld_end_date));
211: hr_utility.trace('ld_start_date = ' || to_char(ld_start_date));
212: hr_utility.trace('ln_tax_unit_id = ' || to_char(ln_tax_unit_id));
213: hr_utility.trace('ln_person_id = ' || to_char(ln_person_id));
214: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
215: hr_utility.trace('lv_report_type = ' || lv_report_type);
208: close c_payroll_action_info;
209:
210: hr_utility.trace('ld_end_date = ' || to_char(ld_end_date));
211: hr_utility.trace('ld_start_date = ' || to_char(ld_start_date));
212: hr_utility.trace('ln_tax_unit_id = ' || to_char(ln_tax_unit_id));
213: hr_utility.trace('ln_person_id = ' || to_char(ln_person_id));
214: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
215: hr_utility.trace('lv_report_type = ' || lv_report_type);
216: hr_utility.trace('lv_report_qualifier = '|| lv_report_qualifier);
209:
210: hr_utility.trace('ld_end_date = ' || to_char(ld_end_date));
211: hr_utility.trace('ld_start_date = ' || to_char(ld_start_date));
212: hr_utility.trace('ln_tax_unit_id = ' || to_char(ln_tax_unit_id));
213: hr_utility.trace('ln_person_id = ' || to_char(ln_person_id));
214: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
215: hr_utility.trace('lv_report_type = ' || lv_report_type);
216: hr_utility.trace('lv_report_qualifier = '|| lv_report_qualifier);
217: hr_utility.trace('lv_report_cat = ' || lv_report_cat);
210: hr_utility.trace('ld_end_date = ' || to_char(ld_end_date));
211: hr_utility.trace('ld_start_date = ' || to_char(ld_start_date));
212: hr_utility.trace('ln_tax_unit_id = ' || to_char(ln_tax_unit_id));
213: hr_utility.trace('ln_person_id = ' || to_char(ln_person_id));
214: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
215: hr_utility.trace('lv_report_type = ' || lv_report_type);
216: hr_utility.trace('lv_report_qualifier = '|| lv_report_qualifier);
217: hr_utility.trace('lv_report_cat = ' || lv_report_cat);
218: hr_utility.trace('l_print_term = ' || l_print_term);
211: hr_utility.trace('ld_start_date = ' || to_char(ld_start_date));
212: hr_utility.trace('ln_tax_unit_id = ' || to_char(ln_tax_unit_id));
213: hr_utility.trace('ln_person_id = ' || to_char(ln_person_id));
214: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
215: hr_utility.trace('lv_report_type = ' || lv_report_type);
216: hr_utility.trace('lv_report_qualifier = '|| lv_report_qualifier);
217: hr_utility.trace('lv_report_cat = ' || lv_report_cat);
218: hr_utility.trace('l_print_term = ' || l_print_term);
219:
212: hr_utility.trace('ln_tax_unit_id = ' || to_char(ln_tax_unit_id));
213: hr_utility.trace('ln_person_id = ' || to_char(ln_person_id));
214: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
215: hr_utility.trace('lv_report_type = ' || lv_report_type);
216: hr_utility.trace('lv_report_qualifier = '|| lv_report_qualifier);
217: hr_utility.trace('lv_report_cat = ' || lv_report_cat);
218: hr_utility.trace('l_print_term = ' || l_print_term);
219:
220: p_end_date := ld_end_date;
213: hr_utility.trace('ln_person_id = ' || to_char(ln_person_id));
214: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
215: hr_utility.trace('lv_report_type = ' || lv_report_type);
216: hr_utility.trace('lv_report_qualifier = '|| lv_report_qualifier);
217: hr_utility.trace('lv_report_cat = ' || lv_report_cat);
218: hr_utility.trace('l_print_term = ' || l_print_term);
219:
220: p_end_date := ld_end_date;
221: p_start_date := ld_start_date;
214: hr_utility.trace('ln_asg_set = ' || to_char(ln_asg_set));
215: hr_utility.trace('lv_report_type = ' || lv_report_type);
216: hr_utility.trace('lv_report_qualifier = '|| lv_report_qualifier);
217: hr_utility.trace('lv_report_cat = ' || lv_report_cat);
218: hr_utility.trace('l_print_term = ' || l_print_term);
219:
220: p_end_date := ld_end_date;
221: p_start_date := ld_start_date;
222: p_business_group_id := ln_business_group_id;
228: p_state := lv_report_qualifier;
229: p_report_cat := lv_report_cat;
230: p_print_term := l_print_term;
231:
232: hr_utility.trace('Leaving get_payroll_action_info');
233:
234: EXCEPTION
235: when others then
236: hr_utility.trace('Error in ' || gv_procedure_name ||
232: hr_utility.trace('Leaving get_payroll_action_info');
233:
234: EXCEPTION
235: when others then
236: hr_utility.trace('Error in ' || gv_procedure_name ||
237: to_char(sqlcode) || '-' || sqlerrm);
238: raise hr_utility.hr_error;
239:
240: END get_payroll_action_info;
234: EXCEPTION
235: when others then
236: hr_utility.trace('Error in ' || gv_procedure_name ||
237: to_char(sqlcode) || '-' || sqlerrm);
238: raise hr_utility.hr_error;
239:
240: END get_payroll_action_info;
241:
242:
267: ln_year number;
268: lv_report_type varchar2(50);
269:
270: BEGIN
271: hr_utility.trace('Entered range_cursor');
272: hr_utility.trace('p_payroll_action_id = ' ||
273: to_char(p_payroll_action_id));
274:
275: get_payroll_action_info(p_payroll_action_id => p_payroll_action_id
268: lv_report_type varchar2(50);
269:
270: BEGIN
271: hr_utility.trace('Entered range_cursor');
272: hr_utility.trace('p_payroll_action_id = ' ||
273: to_char(p_payroll_action_id));
274:
275: get_payroll_action_info(p_payroll_action_id => p_payroll_action_id
276: ,p_start_date => ld_start_date
283: ,p_report_type => lv_report_type);
284:
285: ln_year := to_number(to_char(ld_end_date,'YYYY'));
286:
287: hr_utility.trace('Checking for Preprocess Agent GRE setup');
288:
289: if ln_person_id is not null then
290:
291: lv_sql_string :=
293: from per_assignments_f asg
294: where person_id = ' || ln_person_id ||
295: ' and :payroll_action_id > 0';
296:
297: hr_utility.trace('Range for person_id not null');
298:
299: elsif ln_asg_set is not null then
300:
301: lv_sql_string :=
307: and asgset.include_or_exclude = ''I''
308: and :payroll_action_id > 0
309: order by paf.person_id';
310:
311: hr_utility.trace('Range for asg_set not null');
312:
313: elsif ln_tax_unit_id is not NULL then
314:
315: lv_sql_string :=
347:
348: end if;
349:
350: p_sqlstr := lv_sql_string;
351: hr_utility.trace('p_sqlstr = ' ||p_sqlstr);
352:
353: hr_utility.trace('Leaving range_cursor');
354:
355: END range_cursor;
349:
350: p_sqlstr := lv_sql_string;
351: hr_utility.trace('p_sqlstr = ' ||p_sqlstr);
352:
353: hr_utility.trace('Leaving range_cursor');
354:
355: END range_cursor;
356:
357:
802: l_effective_end_date date; --Added for bug 15886428
803:
804: BEGIN
805:
806: hr_utility.trace('Inside action_creation');
807: ln_iteration := 0;
808: if lv_print = 'LATEST' then
809: if nvl(l_print_term,'N') = 'Y' then
810: open get_latest_t4a_cancel_term(p_person_id
835: end if;
836:
837: if (nvl(l_print_term,'N') = 'Y' and get_latest_t4a_cancel_term%notfound)
838: or (nvl(l_print_term,'N') = 'N' and get_latest_t4a_cancel_dtls%notfound) then
839: hr_utility.trace('get_latest_t4a_cancel_dtls not found ln_iteration:'||ln_iteration);
840: if ln_iteration = 0 then
841: open get_warning_dtls_for_ee(p_person_id);
842: fetch get_warning_dtls_for_ee into lv_full_name
843: ,lv_employee_number;
842: fetch get_warning_dtls_for_ee into lv_full_name
843: ,lv_employee_number;
844: close get_warning_dtls_for_ee;
845:
846: hr_utility.trace('get_latest_t4a_cancel_dtls not found');
847: hr_utility.trace('p_person_id :'||to_char(p_person_id));
848:
849: lv_record_name := 'T4A Cancel PDF Report';
850: lv_message := 'Either T4A PDF or T4A Amendment PDF were not run for the employee';
843: ,lv_employee_number;
844: close get_warning_dtls_for_ee;
845:
846: hr_utility.trace('get_latest_t4a_cancel_dtls not found');
847: hr_utility.trace('p_person_id :'||to_char(p_person_id));
848:
849: lv_record_name := 'T4A Cancel PDF Report';
850: lv_message := 'Either T4A PDF or T4A Amendment PDF were not run for the employee';
851:
864: or (nvl(l_print_term,'N') = 'N' and get_latest_t4a_cancel_dtls%found) then
865:
866: ln_iteration := ln_iteration + 1;
867: ln_arch_act_to_lock := substr(lv_serial_number,1,14);
868: hr_utility.trace('ln_arch_act_to_lock:'||ln_arch_act_to_lock);
869:
870: open check_arch_action_exists(ln_arch_act_to_lock);
871: fetch check_arch_action_exists into l_arch_asg_action_check;
872: if check_arch_action_exists%notfound then
875: fetch get_warning_dtls_for_ee into lv_full_name
876: ,lv_employee_number;
877: close get_warning_dtls_for_ee;
878:
879: hr_utility.trace('check_arch_action_exists not found');
880: hr_utility.trace('p_person_id :'||to_char(p_person_id));
881: hr_utility.trace('ln_arch_act_to_lock :'||to_char(ln_arch_act_to_lock));
882: hr_utility.trace('lv_report_type :'||lv_report_type);
883: hr_utility.trace('ln_rep_act_to_lock :'||ln_rep_act_to_lock);
876: ,lv_employee_number;
877: close get_warning_dtls_for_ee;
878:
879: hr_utility.trace('check_arch_action_exists not found');
880: hr_utility.trace('p_person_id :'||to_char(p_person_id));
881: hr_utility.trace('ln_arch_act_to_lock :'||to_char(ln_arch_act_to_lock));
882: hr_utility.trace('lv_report_type :'||lv_report_type);
883: hr_utility.trace('ln_rep_act_to_lock :'||ln_rep_act_to_lock);
884: lv_record_name := 'T4A Cancel PDF Report';
877: close get_warning_dtls_for_ee;
878:
879: hr_utility.trace('check_arch_action_exists not found');
880: hr_utility.trace('p_person_id :'||to_char(p_person_id));
881: hr_utility.trace('ln_arch_act_to_lock :'||to_char(ln_arch_act_to_lock));
882: hr_utility.trace('lv_report_type :'||lv_report_type);
883: hr_utility.trace('ln_rep_act_to_lock :'||ln_rep_act_to_lock);
884: lv_record_name := 'T4A Cancel PDF Report';
885: lv_message := 'Archiver run with assignment action id '||ln_arch_act_to_lock||' is rolled back';
878:
879: hr_utility.trace('check_arch_action_exists not found');
880: hr_utility.trace('p_person_id :'||to_char(p_person_id));
881: hr_utility.trace('ln_arch_act_to_lock :'||to_char(ln_arch_act_to_lock));
882: hr_utility.trace('lv_report_type :'||lv_report_type);
883: hr_utility.trace('ln_rep_act_to_lock :'||ln_rep_act_to_lock);
884: lv_record_name := 'T4A Cancel PDF Report';
885: lv_message := 'Archiver run with assignment action id '||ln_arch_act_to_lock||' is rolled back';
886:
879: hr_utility.trace('check_arch_action_exists not found');
880: hr_utility.trace('p_person_id :'||to_char(p_person_id));
881: hr_utility.trace('ln_arch_act_to_lock :'||to_char(ln_arch_act_to_lock));
882: hr_utility.trace('lv_report_type :'||lv_report_type);
883: hr_utility.trace('ln_rep_act_to_lock :'||ln_rep_act_to_lock);
884: lv_record_name := 'T4A Cancel PDF Report';
885: lv_message := 'Archiver run with assignment action id '||ln_arch_act_to_lock||' is rolled back';
886:
887: pay_core_utils.push_message(801,'PAY_INVALID_EE_FORMAT','I');
896: end if;
897: close check_arch_action_exists;
898:
899: lv_negative_bal_flag := substr(lv_serial_number,29,1);
900: hr_utility.trace('lv_negative_bal_flag:'||lv_negative_bal_flag);
901:
902: if lv_negative_bal_flag ='Y' then
903:
904: open get_warning_dtls_for_ee(p_person_id);
905: fetch get_warning_dtls_for_ee into lv_full_name
906: ,lv_employee_number;
907: close get_warning_dtls_for_ee;
908:
909: hr_utility.trace('Negative_bal_flag is Y');
910: hr_utility.trace('p_person_id :'||to_char(p_person_id));
911:
912: lv_record_name := 'T4A Cancel PDF Report';
913: lv_message := 'This employee has negative balance';
906: ,lv_employee_number;
907: close get_warning_dtls_for_ee;
908:
909: hr_utility.trace('Negative_bal_flag is Y');
910: hr_utility.trace('p_person_id :'||to_char(p_person_id));
911:
912: lv_record_name := 'T4A Cancel PDF Report';
913: lv_message := 'This employee has negative balance';
914:
925: ln_tax_unit_id := ln_gre_id_null;
926: end if;
927:
928: /* Create an assignment action for this person */
929: hr_utility.trace('get_latest_t4A_cancel_dtls found ');
930: hr_utility.trace('Report Type: '||lv_report_type);
931:
932: if nvl(pay_us_employee_payslip_web.get_doc_eit('T4APDF',
933: 'PRINT',
926: end if;
927:
928: /* Create an assignment action for this person */
929: hr_utility.trace('get_latest_t4A_cancel_dtls found ');
930: hr_utility.trace('Report Type: '||lv_report_type);
931:
932: if nvl(pay_us_employee_payslip_web.get_doc_eit('T4APDF',
933: 'PRINT',
934: 'ASSIGNMENT',
937: select pay_assignment_actions_s.nextval
938: into ln_t4acancel_asg_action
939: from dual;
940:
941: hr_utility.trace('New T4A Cancel Action = ' ||
942: to_char(ln_t4acancel_asg_action));
943:
944: /* Insert into pay_assignment_actions. */
945: hr_nonrun_asact.insact(ln_t4acancel_asg_action
965: update pay_assignment_actions aa
966: set aa.serial_number = ln_serial_number
967: where aa.assignment_action_id = ln_t4acancel_asg_action;
968:
969: hr_utility.trace('Archiver Asg Act :'||substr(ln_serial_number,1,14));
970: hr_utility.trace('Archiver PactID :'||substr(ln_serial_number,15,14));
971:
972:
973: --Added to lock the PDF Report Run
966: set aa.serial_number = ln_serial_number
967: where aa.assignment_action_id = ln_t4acancel_asg_action;
968:
969: hr_utility.trace('Archiver Asg Act :'||substr(ln_serial_number,1,14));
970: hr_utility.trace('Archiver PactID :'||substr(ln_serial_number,15,14));
971:
972:
973: --Added to lock the PDF Report Run
974: hr_nonrun_asact.insint(ln_t4acancel_asg_action,ln_rep_act_to_lock);
971:
972:
973: --Added to lock the PDF Report Run
974: hr_nonrun_asact.insint(ln_t4acancel_asg_action,ln_rep_act_to_lock);
975: hr_utility.trace('Locking the PDF Assignment Action');
976: hr_utility.trace('Locking Action'||ln_t4acancel_asg_action);
977: hr_utility.trace('Locked Action = ' || to_char(ln_rep_act_to_lock));
978:
979: --Added to lock the Archiver
972:
973: --Added to lock the PDF Report Run
974: hr_nonrun_asact.insint(ln_t4acancel_asg_action,ln_rep_act_to_lock);
975: hr_utility.trace('Locking the PDF Assignment Action');
976: hr_utility.trace('Locking Action'||ln_t4acancel_asg_action);
977: hr_utility.trace('Locked Action = ' || to_char(ln_rep_act_to_lock));
978:
979: --Added to lock the Archiver
980: hr_nonrun_asact.insint(ln_t4acancel_asg_action,ln_arch_act_to_lock);
973: --Added to lock the PDF Report Run
974: hr_nonrun_asact.insint(ln_t4acancel_asg_action,ln_rep_act_to_lock);
975: hr_utility.trace('Locking the PDF Assignment Action');
976: hr_utility.trace('Locking Action'||ln_t4acancel_asg_action);
977: hr_utility.trace('Locked Action = ' || to_char(ln_rep_act_to_lock));
978:
979: --Added to lock the Archiver
980: hr_nonrun_asact.insint(ln_t4acancel_asg_action,ln_arch_act_to_lock);
981: hr_utility.trace('Locking the Archiver Assignment Action');
977: hr_utility.trace('Locked Action = ' || to_char(ln_rep_act_to_lock));
978:
979: --Added to lock the Archiver
980: hr_nonrun_asact.insint(ln_t4acancel_asg_action,ln_arch_act_to_lock);
981: hr_utility.trace('Locking the Archiver Assignment Action');
982: hr_utility.trace('Locking Action'||ln_t4acancel_asg_action);
983: hr_utility.trace('Locked Action = ' || to_char(ln_arch_act_to_lock));
984: end if;
985:
978:
979: --Added to lock the Archiver
980: hr_nonrun_asact.insint(ln_t4acancel_asg_action,ln_arch_act_to_lock);
981: hr_utility.trace('Locking the Archiver Assignment Action');
982: hr_utility.trace('Locking Action'||ln_t4acancel_asg_action);
983: hr_utility.trace('Locked Action = ' || to_char(ln_arch_act_to_lock));
984: end if;
985:
986: end if; /* get_latest_t4a_cancel_dtls found*/
979: --Added to lock the Archiver
980: hr_nonrun_asact.insint(ln_t4acancel_asg_action,ln_arch_act_to_lock);
981: hr_utility.trace('Locking the Archiver Assignment Action');
982: hr_utility.trace('Locking Action'||ln_t4acancel_asg_action);
983: hr_utility.trace('Locked Action = ' || to_char(ln_arch_act_to_lock));
984: end if;
985:
986: end if; /* get_latest_t4a_cancel_dtls found*/
987:
1028:
1029: if (nvl(l_print_term,'N') = 'Y' and get_reprint_t4a_cancel_term%notfound)
1030: or (nvl(l_print_term,'N') = 'N' and get_reprint_t4a_cancel_dtls%notfound) then
1031:
1032: hr_utility.trace('get_latest_t4a_cancel_dtls not found ln_iteration:'||ln_iteration);
1033:
1034: if ln_iteration = 0 then
1035:
1036: open get_warning_dtls_for_ee(p_person_id);
1037: fetch get_warning_dtls_for_ee into lv_full_name
1038: ,lv_employee_number;
1039: close get_warning_dtls_for_ee;
1040:
1041: hr_utility.trace('get_reprint_t4a_cancel_dtls not found');
1042: hr_utility.trace('p_person_id :'||to_char(p_person_id));
1043:
1044: lv_record_name := 'T4A Cancel PDF Report';
1045: lv_message := 'As T4A Cancel PDF was not run in Unprint Mode, Reprint mode will not be applicable';
1038: ,lv_employee_number;
1039: close get_warning_dtls_for_ee;
1040:
1041: hr_utility.trace('get_reprint_t4a_cancel_dtls not found');
1042: hr_utility.trace('p_person_id :'||to_char(p_person_id));
1043:
1044: lv_record_name := 'T4A Cancel PDF Report';
1045: lv_message := 'As T4A Cancel PDF was not run in Unprint Mode, Reprint mode will not be applicable';
1046:
1060:
1061: ln_iteration := ln_iteration + 1;
1062:
1063: ln_arch_act_to_lock := substr(lv_serial_number,1,14);
1064: hr_utility.trace('ln_arch_act_to_lock:'||ln_arch_act_to_lock);
1065:
1066: open check_arch_action_exists(ln_arch_act_to_lock);
1067: fetch check_arch_action_exists into l_arch_asg_action_check;
1068: if check_arch_action_exists%notfound then
1071: fetch get_warning_dtls_for_ee into lv_full_name
1072: ,lv_employee_number;
1073: close get_warning_dtls_for_ee;
1074:
1075: hr_utility.trace('check_arch_action_exists not found');
1076: hr_utility.trace('p_person_id :'||to_char(p_person_id));
1077: hr_utility.trace('ln_arch_act_to_lock :'||to_char(ln_arch_act_to_lock));
1078: hr_utility.trace('lv_report_type :'||lv_report_type);
1079: hr_utility.trace('ln_rep_act_to_lock :'||ln_rep_act_to_lock);
1072: ,lv_employee_number;
1073: close get_warning_dtls_for_ee;
1074:
1075: hr_utility.trace('check_arch_action_exists not found');
1076: hr_utility.trace('p_person_id :'||to_char(p_person_id));
1077: hr_utility.trace('ln_arch_act_to_lock :'||to_char(ln_arch_act_to_lock));
1078: hr_utility.trace('lv_report_type :'||lv_report_type);
1079: hr_utility.trace('ln_rep_act_to_lock :'||ln_rep_act_to_lock);
1080: lv_record_name := 'T4A Cancel PDF Report';
1073: close get_warning_dtls_for_ee;
1074:
1075: hr_utility.trace('check_arch_action_exists not found');
1076: hr_utility.trace('p_person_id :'||to_char(p_person_id));
1077: hr_utility.trace('ln_arch_act_to_lock :'||to_char(ln_arch_act_to_lock));
1078: hr_utility.trace('lv_report_type :'||lv_report_type);
1079: hr_utility.trace('ln_rep_act_to_lock :'||ln_rep_act_to_lock);
1080: lv_record_name := 'T4A Cancel PDF Report';
1081: lv_message := 'Archiver run with assignment action id '||ln_arch_act_to_lock||' is rolled back';
1074:
1075: hr_utility.trace('check_arch_action_exists not found');
1076: hr_utility.trace('p_person_id :'||to_char(p_person_id));
1077: hr_utility.trace('ln_arch_act_to_lock :'||to_char(ln_arch_act_to_lock));
1078: hr_utility.trace('lv_report_type :'||lv_report_type);
1079: hr_utility.trace('ln_rep_act_to_lock :'||ln_rep_act_to_lock);
1080: lv_record_name := 'T4A Cancel PDF Report';
1081: lv_message := 'Archiver run with assignment action id '||ln_arch_act_to_lock||' is rolled back';
1082:
1075: hr_utility.trace('check_arch_action_exists not found');
1076: hr_utility.trace('p_person_id :'||to_char(p_person_id));
1077: hr_utility.trace('ln_arch_act_to_lock :'||to_char(ln_arch_act_to_lock));
1078: hr_utility.trace('lv_report_type :'||lv_report_type);
1079: hr_utility.trace('ln_rep_act_to_lock :'||ln_rep_act_to_lock);
1080: lv_record_name := 'T4A Cancel PDF Report';
1081: lv_message := 'Archiver run with assignment action id '||ln_arch_act_to_lock||' is rolled back';
1082:
1083: pay_core_utils.push_message(801,'PAY_INVALID_EE_FORMAT','I');
1088: end if;
1089: close check_arch_action_exists;
1090:
1091: lv_negative_bal_flag := substr(lv_serial_number,29,1);
1092: hr_utility.trace('lv_negative_bal_flag:'||lv_negative_bal_flag);
1093:
1094: if lv_negative_bal_flag ='Y' then
1095:
1096: open get_warning_dtls_for_ee(p_person_id);
1097: fetch get_warning_dtls_for_ee into lv_full_name
1098: ,lv_employee_number;
1099: close get_warning_dtls_for_ee;
1100:
1101: hr_utility.trace('negative_bal_flag is Y');
1102: hr_utility.trace('p_person_id :'||to_char(p_person_id));
1103:
1104: lv_record_name := 'T4A Cancel PDF Report';
1105: lv_message := 'This employee has negative balance';
1098: ,lv_employee_number;
1099: close get_warning_dtls_for_ee;
1100:
1101: hr_utility.trace('negative_bal_flag is Y');
1102: hr_utility.trace('p_person_id :'||to_char(p_person_id));
1103:
1104: lv_record_name := 'T4A Cancel PDF Report';
1105: lv_message := 'This employee has negative balance';
1106:
1116: end if;
1117:
1118:
1119: /* Create an assignment action for this person */
1120: hr_utility.trace('get_reprint_t4a_cancel_dtls found ');
1121: hr_utility.trace('Report Type: '||lv_report_type);
1122:
1123: if nvl(pay_us_employee_payslip_web.get_doc_eit('T4APDF',
1124: 'PRINT',
1117:
1118:
1119: /* Create an assignment action for this person */
1120: hr_utility.trace('get_reprint_t4a_cancel_dtls found ');
1121: hr_utility.trace('Report Type: '||lv_report_type);
1122:
1123: if nvl(pay_us_employee_payslip_web.get_doc_eit('T4APDF',
1124: 'PRINT',
1125: 'ASSIGNMENT',
1129: select pay_assignment_actions_s.nextval
1130: into ln_t4acancel_asg_action
1131: from dual;
1132:
1133: hr_utility.trace('New T4A Cancel Action = ' ||
1134: to_char(ln_t4acancel_asg_action));
1135:
1136: /* Insert into pay_assignment_actions. */
1137: hr_nonrun_asact.insact(ln_t4acancel_asg_action
1157: update pay_assignment_actions aa
1158: set aa.serial_number = ln_serial_number
1159: where aa.assignment_action_id = ln_t4acancel_asg_action;
1160:
1161: hr_utility.trace('Archiver Asg Act :'||substr(ln_serial_number,1,14));
1162: hr_utility.trace('Archiver PactID :'||substr(ln_serial_number,15,14));
1163: end if; -- 'T4APDF'
1164:
1165: end if; /* get_reprint_t4amendpdf_dtls found*/
1158: set aa.serial_number = ln_serial_number
1159: where aa.assignment_action_id = ln_t4acancel_asg_action;
1160:
1161: hr_utility.trace('Archiver Asg Act :'||substr(ln_serial_number,1,14));
1162: hr_utility.trace('Archiver PactID :'||substr(ln_serial_number,15,14));
1163: end if; -- 'T4APDF'
1164:
1165: end if; /* get_reprint_t4amendpdf_dtls found*/
1166:
1173: end if;
1174:
1175: end if; --REPRINT
1176:
1177: hr_utility.trace('Leaving action_creation');
1178:
1179: END action_creation;
1180:
1181: BEGIN
1178:
1179: END action_creation;
1180:
1181: BEGIN
1182: hr_utility.trace('Entered action_creation ');
1183: hr_utility.trace('p_payroll_action_id = '|| to_char(p_payroll_action_id));
1184: hr_utility.trace('p_start_person_id ='|| to_char(p_start_person_id));
1185: hr_utility.trace('p_end_person_id = '|| to_char(p_end_person_id));
1186: hr_utility.trace('p_chunk = ' || to_char(p_chunk));
1179: END action_creation;
1180:
1181: BEGIN
1182: hr_utility.trace('Entered action_creation ');
1183: hr_utility.trace('p_payroll_action_id = '|| to_char(p_payroll_action_id));
1184: hr_utility.trace('p_start_person_id ='|| to_char(p_start_person_id));
1185: hr_utility.trace('p_end_person_id = '|| to_char(p_end_person_id));
1186: hr_utility.trace('p_chunk = ' || to_char(p_chunk));
1187:
1180:
1181: BEGIN
1182: hr_utility.trace('Entered action_creation ');
1183: hr_utility.trace('p_payroll_action_id = '|| to_char(p_payroll_action_id));
1184: hr_utility.trace('p_start_person_id ='|| to_char(p_start_person_id));
1185: hr_utility.trace('p_end_person_id = '|| to_char(p_end_person_id));
1186: hr_utility.trace('p_chunk = ' || to_char(p_chunk));
1187:
1188: get_payroll_action_info(p_payroll_action_id => p_payroll_action_id
1181: BEGIN
1182: hr_utility.trace('Entered action_creation ');
1183: hr_utility.trace('p_payroll_action_id = '|| to_char(p_payroll_action_id));
1184: hr_utility.trace('p_start_person_id ='|| to_char(p_start_person_id));
1185: hr_utility.trace('p_end_person_id = '|| to_char(p_end_person_id));
1186: hr_utility.trace('p_chunk = ' || to_char(p_chunk));
1187:
1188: get_payroll_action_info(p_payroll_action_id => p_payroll_action_id
1189: ,p_start_date => ld_start_date
1182: hr_utility.trace('Entered action_creation ');
1183: hr_utility.trace('p_payroll_action_id = '|| to_char(p_payroll_action_id));
1184: hr_utility.trace('p_start_person_id ='|| to_char(p_start_person_id));
1185: hr_utility.trace('p_end_person_id = '|| to_char(p_end_person_id));
1186: hr_utility.trace('p_chunk = ' || to_char(p_chunk));
1187:
1188: get_payroll_action_info(p_payroll_action_id => p_payroll_action_id
1189: ,p_start_date => ld_start_date
1190: ,p_end_date => ld_end_date
1199: ,p_report_cat => l_report_cat
1200: ,p_print_term => l_print_term);
1201: -- Added for bug 10399514
1202:
1203: hr_utility.trace('lv_ppr_report_type: '||lv_ppr_report_type);
1204:
1205: ln_tax_unit_id := ln_gre_parameter;
1206:
1207: -- Code modification for bug 10399514 start here
1231: action_creation(p_start_person_id);
1232:
1233: elsif ln_asg_set is not null then
1234:
1235: hr_utility.trace('Entered Asg Set logic');
1236: hr_utility.trace('Asg Set ='||to_char(ln_asg_set));
1237: hr_utility.trace('p_start_person_id ='||to_char(p_start_person_id));
1238: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1239:
1232:
1233: elsif ln_asg_set is not null then
1234:
1235: hr_utility.trace('Entered Asg Set logic');
1236: hr_utility.trace('Asg Set ='||to_char(ln_asg_set));
1237: hr_utility.trace('p_start_person_id ='||to_char(p_start_person_id));
1238: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1239:
1240: -- Code modification for bug 10399514 start here
1233: elsif ln_asg_set is not null then
1234:
1235: hr_utility.trace('Entered Asg Set logic');
1236: hr_utility.trace('Asg Set ='||to_char(ln_asg_set));
1237: hr_utility.trace('p_start_person_id ='||to_char(p_start_person_id));
1238: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1239:
1240: -- Code modification for bug 10399514 start here
1241: if l_person_on then
1234:
1235: hr_utility.trace('Entered Asg Set logic');
1236: hr_utility.trace('Asg Set ='||to_char(ln_asg_set));
1237: hr_utility.trace('p_start_person_id ='||to_char(p_start_person_id));
1238: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1239:
1240: -- Code modification for bug 10399514 start here
1241: if l_person_on then
1242: hr_utility.trace('opening c_selected_asg_set_range CURSOR');
1238: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1239:
1240: -- Code modification for bug 10399514 start here
1241: if l_person_on then
1242: hr_utility.trace('opening c_selected_asg_set_range CURSOR');
1243: OPEN c_selected_asg_set_range (p_start_person_id
1244: ,p_end_person_id
1245: ,ln_asg_set
1246: ,ld_end_date);
1244: ,p_end_person_id
1245: ,ln_asg_set
1246: ,ld_end_date);
1247: else
1248: hr_utility.trace('opening c_selected_asg_set CURSOR');
1249: OPEN c_selected_asg_set (p_start_person_id
1250: ,p_end_person_id
1251: ,ln_asg_set
1252: ,ld_end_date);
1258:
1259:
1260: -- Code modification for bug 10399514 starts here
1261: if l_person_on then
1262: hr_utility.trace('fetching from c_selected_asg_set_range CURSOR');
1263: fetch c_selected_asg_set_range
1264: into ln_set_person_id;
1265: exit when c_selected_asg_set_range%NOTFOUND;
1266: else
1263: fetch c_selected_asg_set_range
1264: into ln_set_person_id;
1265: exit when c_selected_asg_set_range%NOTFOUND;
1266: else
1267: hr_utility.trace('fetching from c_selected_asg_set CURSOR');
1268: fetch c_selected_asg_set
1269: into ln_set_person_id;
1270: exit when c_selected_asg_set%NOTFOUND;
1271: end if ;
1270: exit when c_selected_asg_set%NOTFOUND;
1271: end if ;
1272: -- Code modification for bug 10399514 ends here
1273:
1274: hr_utility.trace('Assignment Set Person ='||to_char(ln_set_person_id));
1275: action_creation(ln_set_person_id);
1276:
1277: end loop;
1278:
1277: end loop;
1278:
1279: -- Code modification for bug 10399514 starts here
1280: if l_person_on then
1281: hr_utility.trace('closing c_selected_asg_set_range CURSOR');
1282: close c_selected_asg_set_range;
1283: else
1284: hr_utility.trace('closing c_selected_asg_set CURSOR');
1285: close c_selected_asg_set;
1280: if l_person_on then
1281: hr_utility.trace('closing c_selected_asg_set_range CURSOR');
1282: close c_selected_asg_set_range;
1283: else
1284: hr_utility.trace('closing c_selected_asg_set CURSOR');
1285: close c_selected_asg_set;
1286: end if ;
1287: -- Code modification for bug 10399514 ends here
1288:
1287: -- Code modification for bug 10399514 ends here
1288:
1289: elsif ln_tax_unit_id is not null then
1290:
1291: hr_utility.trace('Entered GRE not null logic');
1292: hr_utility.trace('GRE ='||to_char(ln_tax_unit_id));
1293: hr_utility.trace('p_start_person_id ='||to_char(p_start_person_id));
1294: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1295:
1288:
1289: elsif ln_tax_unit_id is not null then
1290:
1291: hr_utility.trace('Entered GRE not null logic');
1292: hr_utility.trace('GRE ='||to_char(ln_tax_unit_id));
1293: hr_utility.trace('p_start_person_id ='||to_char(p_start_person_id));
1294: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1295:
1296: -- Code modification for bug 10399514 start here
1289: elsif ln_tax_unit_id is not null then
1290:
1291: hr_utility.trace('Entered GRE not null logic');
1292: hr_utility.trace('GRE ='||to_char(ln_tax_unit_id));
1293: hr_utility.trace('p_start_person_id ='||to_char(p_start_person_id));
1294: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1295:
1296: -- Code modification for bug 10399514 start here
1297: if l_person_on then
1290:
1291: hr_utility.trace('Entered GRE not null logic');
1292: hr_utility.trace('GRE ='||to_char(ln_tax_unit_id));
1293: hr_utility.trace('p_start_person_id ='||to_char(p_start_person_id));
1294: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1295:
1296: -- Code modification for bug 10399514 start here
1297: if l_person_on then
1298: hr_utility.trace('opening c_all_asg_range CURSOR');
1294: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1295:
1296: -- Code modification for bug 10399514 start here
1297: if l_person_on then
1298: hr_utility.trace('opening c_all_asg_range CURSOR');
1299: OPEN c_all_asg_range (ln_business_group_id
1300: ,ln_tax_unit_id
1301: ,ld_end_date
1302: ,p_start_person_id
1301: ,ld_end_date
1302: ,p_start_person_id
1303: ,p_end_person_id);
1304: else
1305: hr_utility.trace('opening c_all_asg CURSOR');
1306: OPEN c_all_asg (ln_business_group_id
1307: ,ln_tax_unit_id
1308: ,ld_end_date
1309: ,p_start_person_id
1314: loop
1315:
1316: -- Code modification for bug 10399514 starts here
1317: if l_person_on then
1318: hr_utility.trace('fetching from c_all_asg_range CURSOR');
1319: fetch c_all_asg_range
1320: into ln_set_person_id;
1321: exit when c_all_asg_range%NOTFOUND;
1322: else
1319: fetch c_all_asg_range
1320: into ln_set_person_id;
1321: exit when c_all_asg_range%NOTFOUND;
1322: else
1323: hr_utility.trace('fetching from c_all_asg CURSOR');
1324: fetch c_all_asg
1325: into ln_set_person_id;
1326: exit when c_all_asg%NOTFOUND;
1327: end if ;
1331:
1332: end loop;
1333: -- Code modification for bug 10399514 starts here
1334: if l_person_on then
1335: hr_utility.trace('closing c_all_asg_range CURSOR');
1336: close c_all_asg_range;
1337: else
1338: hr_utility.trace('closing c_all_asg CURSOR');
1339: close c_all_asg;
1334: if l_person_on then
1335: hr_utility.trace('closing c_all_asg_range CURSOR');
1336: close c_all_asg_range;
1337: else
1338: hr_utility.trace('closing c_all_asg CURSOR');
1339: close c_all_asg;
1340: end if ;
1341: -- Code modification for bug 10399514 ends here
1342: else
1340: end if ;
1341: -- Code modification for bug 10399514 ends here
1342: else
1343:
1344: hr_utility.trace('Entered All GRE logic');
1345:
1346: open c_all_gres(ln_business_group_id,
1347: ld_end_date);
1348:
1349: loop -- c_all_gres
1350:
1351: fetch c_all_gres into ln_gre_id;
1352: if c_all_gres%NOTFOUND then
1353: hr_utility.trace('c_all_gres NOT FOUND');
1354: exit;
1355: end if;
1356:
1357: hr_utility.trace('GRE ='||to_char(ln_gre_id));
1353: hr_utility.trace('c_all_gres NOT FOUND');
1354: exit;
1355: end if;
1356:
1357: hr_utility.trace('GRE ='||to_char(ln_gre_id));
1358: hr_utility.trace('p_start_person_id ='||to_char(p_start_person_id));
1359: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1360:
1361: -- Code modification for bug 10399514 start here
1354: exit;
1355: end if;
1356:
1357: hr_utility.trace('GRE ='||to_char(ln_gre_id));
1358: hr_utility.trace('p_start_person_id ='||to_char(p_start_person_id));
1359: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1360:
1361: -- Code modification for bug 10399514 start here
1362: if l_person_on then
1355: end if;
1356:
1357: hr_utility.trace('GRE ='||to_char(ln_gre_id));
1358: hr_utility.trace('p_start_person_id ='||to_char(p_start_person_id));
1359: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1360:
1361: -- Code modification for bug 10399514 start here
1362: if l_person_on then
1363: hr_utility.trace('opening c_all_asg_range CURSOR');
1359: hr_utility.trace('End Person ='||to_char(p_end_person_id));
1360:
1361: -- Code modification for bug 10399514 start here
1362: if l_person_on then
1363: hr_utility.trace('opening c_all_asg_range CURSOR');
1364: OPEN c_all_asg_range (ln_business_group_id
1365: ,ln_gre_id
1366: ,ld_end_date
1367: ,p_start_person_id
1366: ,ld_end_date
1367: ,p_start_person_id
1368: ,p_end_person_id);
1369: else
1370: hr_utility.trace('opening c_all_asg CURSOR');
1371: OPEN c_all_asg (ln_business_group_id
1372: ,ln_gre_id
1373: ,ld_end_date
1374: ,p_start_person_id
1380: loop -- c_all_asg
1381:
1382: -- Code modification for bug 10399514 starts here
1383: if l_person_on then
1384: hr_utility.trace('fetching from c_all_asg_range CURSOR');
1385: fetch c_all_asg_range
1386: into ln_set_person_id;
1387: exit when c_all_asg_range%NOTFOUND;
1388: else
1385: fetch c_all_asg_range
1386: into ln_set_person_id;
1387: exit when c_all_asg_range%NOTFOUND;
1388: else
1389: hr_utility.trace('fetching from c_all_asg CURSOR');
1390: fetch c_all_asg
1391: into ln_set_person_id;
1392: exit when c_all_asg%NOTFOUND;
1393: end if ;
1398:
1399: end loop; -- c_all_asg
1400: -- Code modification for bug 10399514 starts here
1401: if l_person_on then
1402: hr_utility.trace('closing c_all_asg_range CURSOR');
1403: close c_all_asg_range;
1404: else
1405: hr_utility.trace('closing c_all_asg CURSOR');
1406: close c_all_asg;
1401: if l_person_on then
1402: hr_utility.trace('closing c_all_asg_range CURSOR');
1403: close c_all_asg_range;
1404: else
1405: hr_utility.trace('closing c_all_asg CURSOR');
1406: close c_all_asg;
1407: end if ;
1408: -- Code modification for bug 10399514 ends here
1409:
1466: where ppa.payroll_action_id = payactid;
1467:
1468: exception
1469: when no_data_found then
1470: hr_utility.trace('Error in Sort Procedure - getting legislative param');
1471: raise;
1472: end;
1473:
1474: if l_year_end > l_dt then
1474: if l_year_end > l_dt then
1475: l_dt := l_year_end;
1476: end if;
1477:
1478: hr_utility.trace('Beginning of the sort_action cursor');
1479:
1480: sqlstr := 'select paa1.rowid
1481: from hr_all_organization_units hou,
1482: hr_all_organization_units hou1,
1524: ppf.last_name,first_name';
1525:
1526:
1527: len := length(sqlstr); -- return the length of the string.
1528: hr_utility.trace('End of the sort_Action cursor');
1529:
1530: end sort_action;
1531:
1532:
1562:
1563: END get_parameter;
1564: Begin
1565:
1566: /* hr_utility.trace_on(null,'T4A_CANCEL_PDF'); */
1567: null;
1568:
1569: end pay_ca_eoy_t4a_cancel_pkg;