98: --
99: cursor csr_status is
100: select pay_batch_balance_adj_pkg.batch_group_overall_status
101: (pabg.batch_id, pabg.batch_group_id) status
102: from pay_adjust_batch_groups pabg
103: where pabg.batch_id = p_batch_id
104: union
105: select batch_status status
106: from pay_balance_batch_headers
216: where pabl.batch_id = p_batch_id
217: and pabl.batch_group_id = p_batch_group_id
218: union
219: select batch_group_status status
220: from pay_adjust_batch_groups
221: where batch_id = p_batch_id
222: and batch_group_id = p_batch_group_id
223: union
224: select 'Y' status
221: where batch_id = p_batch_id
222: and batch_group_id = p_batch_group_id
223: union
224: select 'Y' status
225: from pay_adjust_batch_groups
226: where batch_group_id = p_batch_group_id
227: and batch_id = p_batch_id
228: and batch_group_status = 'T'
229: order by 1 desc;
323: and pabl.batch_group_id = nvl(p_batch_group_id, pabl.batch_group_id) ;
324: --
325: cursor csr_batch_groups is
326: select pabg.batch_group_id
327: from pay_adjust_batch_groups pabg
328: where pabg.batch_id = p_batch_id
329: and pabg.batch_group_id = nvl(p_batch_group_id, pabg.batch_group_id) ;
330:
331: --
376: -- Delete the batch group
377: --
378:
379: delete
380: from pay_adjust_batch_groups
381: where batch_group_id = cssr.batch_group_id;
382:
383: end loop;
384:
470:
471: --
472: cursor csr_batch_groups is
473: select batch_group_id
474: from pay_adjust_batch_groups
475: where batch_id = p_batch_id
476: and batch_group_id = nvl(p_batch_group_id, batch_group_id)
477: and batch_group_status = 'T';
478: --
504: savepoint RG;
505: py_rollback_pkg.rollback_payroll_action(l_payroll_action_id,'ROLLBACK',FALSE);
506: commit;
507:
508: update pay_adjust_batch_groups
509: set batch_group_status = 'U'
510: where batch_group_id = lcsr.batch_group_id;
511:
512: update pay_adjust_batch_lines
640: --cursors needed
641: cursor csr_batch_groups is
642: select batch_group_id, consolidation_set_id,
643: payroll_id, effective_date, prepay_flag
644: from pay_adjust_batch_groups
645: where batch_id = p_batch_id
646: and batch_group_id = nvl(p_batch_group_id, batch_group_id)
647: and batch_group_status not in ('L','P','T');
648: --
647: and batch_group_status not in ('L','P','T');
648: --
649:
650: --
651: cursor csr_batch_lines(p_arg_batch_group_id pay_adjust_batch_groups.batch_group_id%type) is
652: select *
653: from pay_adjust_batch_lines
654: where batch_id = p_batch_id
655: and batch_group_id = p_arg_batch_group_id;
654: where batch_id = p_batch_id
655: and batch_group_id = p_arg_batch_group_id;
656: --
657:
658: cursor batch_grp_stts(batch_status_arg pay_adjust_batch_groups.batch_group_status%type) is
659: select 1 from pay_adjust_batch_groups
660: where batch_group_status = batch_status_arg
661: and batch_id = p_batch_id;
662: --
655: and batch_group_id = p_arg_batch_group_id;
656: --
657:
658: cursor batch_grp_stts(batch_status_arg pay_adjust_batch_groups.batch_group_status%type) is
659: select 1 from pay_adjust_batch_groups
660: where batch_group_status = batch_status_arg
661: and batch_id = p_batch_id;
662: --
663: begin
678: update pay_adjust_batch_lines
679: set batch_line_status = 'U'
680: where batch_group_id = group_csr.batch_group_id;
681:
682: update pay_adjust_batch_groups
683: set batch_group_status = 'P'
684: where batch_group_id = group_csr.batch_group_id;
685:
686: -- deleting all the message lines for this group
926: set batch_line_status = p_batch_process_mode
927: where batch_line_status = 'U'
928: and batch_group_id = group_csr.batch_group_id;
929: --
930: update pay_adjust_batch_groups
931: set batch_group_status = p_batch_process_mode
932: where batch_group_id = group_csr.batch_group_id;
933: ---
934: elsif (l_line_error = TRUE) then
937: set batch_line_status = 'V'
938: where batch_line_status = 'U'
939: and batch_group_id = group_csr.batch_group_id;
940: --
941: update pay_adjust_batch_groups
942: set batch_group_status = 'E'
943: where batch_group_id = group_csr.batch_group_id;
944: ---
945: end if;
979: rollback to main_SP;
980: --
981: when process_batch_failed
982: then
983: update pay_adjust_batch_groups
984: set batch_group_status = 'E'
985: where batch_group_id = group_csr.batch_group_id;
986: --put a message against batch_group in pay_message_lines at group_level
987: begin