[Home] [Help]
216:
217:
218: cursor c_check_for_reversal(cp_assignment_action_id in number) is
219: select 1
220: from pay_action_interlocks pai_pre
221: where pai_pre.locking_action_id = cp_assignment_action_id
222: and exists (
223: select 1
224: from pay_payroll_actions ppa,
222: and exists (
223: select 1
224: from pay_payroll_actions ppa,
225: pay_assignment_actions paa,
226: pay_action_interlocks pai_run
227: /* Get the run assignment action id locked by pre-payment */
228: where pai_run.locked_action_id = pai_pre.locked_action_id
229: /* Check if the Run is being locked by Reversal */
230: and pai_run.locking_action_id = paa.assignment_action_id
238: ** have been made fro the employee.
239: ****************************************************************/
240: cursor c_prepay_arch_action(cp_assignment_action_id in number) is
241: select paa.assignment_action_id
242: from pay_action_interlocks paci,
243: pay_assignment_actions paa,
244: pay_payroll_actions ppa
245: where paci.locking_action_id = cp_assignment_action_id
246: and paa.assignment_action_id = paci.locked_action_id
255: ** means there is a seperate check.
256: * ***************************************************************/
257: cursor c_prepay_run_arch_action(cp_assignment_action_id in number) is
258: select paa_pre.assignment_action_id
259: from pay_action_interlocks pai_run,
260: pay_action_interlocks pai_pre,
261: pay_assignment_actions paa_pre,
262: pay_payroll_actions ppa_pre
263: where pai_run.locking_action_id = cp_assignment_action_id
256: * ***************************************************************/
257: cursor c_prepay_run_arch_action(cp_assignment_action_id in number) is
258: select paa_pre.assignment_action_id
259: from pay_action_interlocks pai_run,
260: pay_action_interlocks pai_pre,
261: pay_assignment_actions paa_pre,
262: pay_payroll_actions ppa_pre
263: where pai_run.locking_action_id = cp_assignment_action_id
264: and pai_pre.locked_action_id = pai_run.locked_action_id
269: cursor c_get_date_earned(cp_assignment_action_id in number) is
270: select nvl(max(ppa.date_earned), max(ppa.effective_date))
271: from pay_payroll_actions ppa
272: ,pay_assignment_actions paa
273: ,pay_action_interlocks pai
274: where ppa.payroll_action_id = paa.payroll_action_id
275: and pai.locked_action_id = paa.assignment_action_id
276: and pai.locking_action_id = cp_assignment_action_id
277: and ppa.action_type in ('R', 'Q', 'B', 'V');
468: --bug 6840881 starts here
469: /*
470: cursor c_check_for_reversal(cp_assignment_action_id in number) is
471: select 1
472: from pay_action_interlocks pai_pre
473: where pai_pre.locking_action_id = cp_assignment_action_id
474: and exists (
475: select 1
476: from pay_payroll_actions ppa,
474: and exists (
475: select 1
476: from pay_payroll_actions ppa,
477: pay_assignment_actions paa,
478: pay_action_interlocks pai_run
479: where pai_run.locked_action_id = pai_pre.locked_action_id
480: and pai_run.locking_action_id = paa.assignment_action_id
481: and ppa.payroll_action_id = paa.payroll_action_id
482: and paa.action_status = 'C'
485: cursor c_check_for_reversal(cp_assignment_action_id in number) is
486: select 1
487: from pay_payroll_actions ppa,
488: pay_assignment_actions paa,
489: pay_action_interlocks pai_run
490: where pai_run.locked_action_id = cp_assignment_action_id
491: and pai_run.locking_action_id = paa.assignment_action_id
492: and ppa.payroll_action_id = paa.payroll_action_id
493: and paa.action_status = 'C'
499: ** have been made fro the employee.
500: ****************************************************************/
501: cursor c_prepay_arch_action(cp_assignment_action_id in number) is
502: select paa.assignment_action_id
503: from pay_action_interlocks paci,
504: pay_assignment_actions paa,
505: pay_payroll_actions ppa
506: where paci.locking_action_id = cp_assignment_action_id
507: and paa.assignment_action_id = paci.locked_action_id
516: ** means there is a seperate check.
517: * ***************************************************************/
518: cursor c_prepay_run_arch_action(cp_assignment_action_id in number) is
519: select paa_pre.assignment_action_id
520: from pay_action_interlocks pai_run,
521: pay_action_interlocks pai_pre,
522: pay_assignment_actions paa_pre,
523: pay_payroll_actions ppa_pre
524: where pai_run.locking_action_id = cp_assignment_action_id
517: * ***************************************************************/
518: cursor c_prepay_run_arch_action(cp_assignment_action_id in number) is
519: select paa_pre.assignment_action_id
520: from pay_action_interlocks pai_run,
521: pay_action_interlocks pai_pre,
522: pay_assignment_actions paa_pre,
523: pay_payroll_actions ppa_pre
524: where pai_run.locking_action_id = cp_assignment_action_id
525: and pai_pre.locked_action_id = pai_run.locked_action_id
530: cursor c_get_date_earned(cp_assignment_action_id in number) is
531: select nvl(max(ppa.date_earned), max(ppa.effective_date))
532: from pay_payroll_actions ppa
533: ,pay_assignment_actions paa
534: ,pay_action_interlocks pai
535: where ppa.payroll_action_id = paa.payroll_action_id
536: and pai.locked_action_id = paa.assignment_action_id
537: and pai.locking_action_id = cp_assignment_action_id
538: and ppa.action_type in ('R', 'Q', 'B', 'V');
551: from pay_assignment_actions where assignment_action_id=p_assignment_action;
552:
553: cursor get_regular_action(p_action_id in number,xfr_action_id in number)is
554: select locked_action_id from
555: pay_action_interlocks pai ,pay_assignment_actions paa
556: where pai.locking_action_id = p_action_id
557: and pai.locked_action_id not in (
558: select to_number(substr(SERIAL_NUMBER,3)) from pay_assignment_actions
559: where payroll_action_id in (select distinct payroll_action_id
709: cursor c_get_date_earned(cp_assignment_action_id in number) is
710: select nvl(max(ppa.date_earned), max(ppa.effective_date))
711: from pay_payroll_actions ppa
712: ,pay_assignment_actions paa
713: ,pay_action_interlocks pai
714: where ppa.payroll_action_id = paa.payroll_action_id
715: and pai.locked_action_id = paa.assignment_action_id
716: and pai.locking_action_id = cp_assignment_action_id
717: and ppa.action_type in ('R', 'Q', 'B', 'V');
1122: paa_pymt.serial_number)
1123: from pay_pre_payments ppp,
1124: pay_assignment_actions paa_pymt,
1125: pay_payroll_actions ppa_pymt,
1126: pay_action_interlocks pai
1127: where pai.locked_action_id = cp_pre_payment_action
1128: and paa_pymt.assignment_action_id = pai.locking_action_id
1129: and ppa_pymt.payroll_action_id = paa_pymt.payroll_action_id
1130: and ppa_pymt.action_type in ('M','H', 'E')
1133: and not exists (
1134: select 1
1135: from pay_payroll_actions ppa,
1136: pay_assignment_actions paa,
1137: pay_action_interlocks pai_void
1138: /* Assignment Action of Payment Type - NACHA/Check */
1139: where pai_void.locked_action_id = paa_pymt.assignment_action_id --Void
1140: /* Check if the locking is that of Void Pymt */
1141: and pai_void.locking_action_id = paa.assignment_action_id