DBA Data[Home] [Help]

APPS.PAY_CA_EOY_RL2_AMEND_REG SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 58

      select to_number(pay_ca_eoy_rl1_amend_reg.get_parameter(
                         'PRE_ORGANIZATION_ID',ppa.legislative_parameters)),
             to_number(pay_ca_eoy_rl1_amend_reg.get_parameter(
                          'PER_ID',ppa.legislative_parameters)),
             to_number(pay_ca_eoy_rl1_amend_reg.get_parameter(
                          'ASG_SET_ID',ppa.legislative_parameters)),
             pay_ca_eoy_rl1_amend_reg.get_parameter(
                          'MODE',ppa.legislative_parameters),
             effective_date,
             start_date,
             business_group_id,
             report_type
        from pay_payroll_actions ppa
       where ppa.payroll_action_id = cp_payroll_action_id;
Line: 123

   Purpose   : This returns the select statement that is
               used to created the range rows for the
               RL2 Amendment Paper.
   Arguments :
   Notes     : Calls procedure - get_payroll_action_info
  ******************************************************************/
  PROCEDURE range_cursor(
                    p_payroll_action_id in number
                   ,p_sqlstr           out nocopy  varchar2)
  IS

    ld_end_date          DATE;
Line: 165

         'select distinct asg.person_id person_id
            from per_assignments_f asg
           where person_id = ' || ln_person_id ||
         ' and :payroll_action_id > 0';
Line: 175

           'select distinct paf.person_id
             from hr_assignment_set_amendments asgset,
                  per_assignments_f paf
            where assignment_set_id = ' || ln_asg_set || '
              and asgset.assignment_id = paf.assignment_id
              and asgset.include_or_exclude = ''I''
              and :payroll_action_id > 0
            order by paf.person_id ';
Line: 189

        'select distinct paf.person_id
         from pay_payroll_actions ppa_arch,
              pay_assignment_actions paa_arch,
              per_assignments_f paf,
              pay_payroll_actions ppa
        where paa_arch.assignment_id = paf.assignment_id
          and ppa.payroll_action_id = :payroll_action_id
          and ppa_arch.business_group_id = ppa.business_group_id
          and ppa_arch.effective_date = ppa.effective_date
          and ppa_arch.report_type = ''CAEOY_RL2_AMEND_PP''
          and pycadar_pkg.get_parameter(''PRE_ORGANIZATION_ID'',
                                   ppa_arch.legislative_parameters) = '|| ln_pre_org_id ||'
          and paa_arch.action_status = ''C''
          and ppa_arch.payroll_action_id = paa_arch.payroll_action_id
        order by paf.person_id ';
Line: 208

        'select distinct paf.person_id
         from pay_payroll_actions ppa_arch,
              pay_assignment_actions paa_arch,
              per_assignments_f paf,
              pay_payroll_actions ppa
        where paa_arch.assignment_id = paf.assignment_id
          and ppa.payroll_action_id  = :payroll_action_id
          and ppa_arch.business_group_id = ppa.business_group_id
          and ppa_arch.effective_date = ppa.effective_date
          and ppa_arch.report_type = ''CAEOY_RL2_AMEND_PP''
          and paa_arch.action_status = ''C''
          and ppa_arch.payroll_action_id = paa_arch.payroll_action_id
        order by paf.person_id ';
Line: 276

   CURSOR c_selected_asg_set(cp_start_person in number
                            ,cp_end_person in number
                            ,cp_asg_set in number
                            ,cp_effective_date in date) is
      select distinct paf.person_id
        from hr_assignment_set_amendments asgset,
             per_assignments_f paf,
             pay_payroll_actions ppa_arch,
             pay_assignment_actions paa_arch
       where asgset.assignment_set_id = cp_asg_set
         and asgset.include_or_exclude = 'I'
         and paf.assignment_id = asgset.assignment_id
         and paf.person_id between cp_start_person
                                   and cp_end_person
         and ppa_arch.business_group_id = ln_business_group_id
         and ppa_arch.report_type       = 'CAEOY_RL2_AMEND_PP'
         and ppa_arch.payroll_action_id = paa_arch.payroll_action_id
         and pay_ca_eoy_rl1_amend_reg.get_parameter('PRE_ORGANIZATION_ID',
                                   ppa_arch.legislative_parameters) =
            nvl(ln_pre_org_id,pay_ca_eoy_rl1_amend_reg.get_parameter('PRE_ORGANIZATION_ID',
                                   ppa_arch.legislative_parameters))
         and paa_arch.action_status     = 'C'
         and ppa_arch.effective_date    = cp_effective_date
         and paf.person_id = to_number(paa_arch.serial_number);
Line: 301

   /* Cursor c_all_pres to select RL2 Amendment PRE based on Business Group
      and effective date  */
   CURSOR c_all_pres(cp_bg_id number,
                     cp_eff_date date) IS
   select hou.organization_id
   from hr_organization_information hoi,
        hr_all_organization_units   hou
   where hou.business_group_id  = cp_bg_id
   AND hou.organization_id = hoi.organization_id
   AND hou.date_from <= cp_eff_date
   AND nvl(hou.date_to,
           fnd_date.canonical_to_date('4712/12/31 00:00:00')) >= cp_eff_date
   AND hoi.org_information_context = 'Prov Reporting Est'
   AND hoi.org_information4        = 'P02'
   AND exists ( SELECT 1
                FROM pay_payroll_actions ppa ,
                     pay_assignment_actions paa
                WHERE ppa.report_type     = 'CAEOY_RL2_AMEND_PP'
                AND ppa.report_qualifier  = 'CAEOY_RL2_AMEND_PPQ'
                AND ppa.business_group_id = cp_bg_id
                AND ppa.effective_date    = cp_eff_date
                AND paa.payroll_action_id = ppa.payroll_action_id
                AND pycadar_pkg.get_parameter('PRE_ORGANIZATION_ID',
                             ppa.legislative_parameters) = to_char(hou.organization_id));
Line: 331

   select distinct paa_arch.serial_number
   from  pay_payroll_actions ppa_arch,
         pay_assignment_actions paa_arch
   where ppa_arch.business_group_id =  cp_bg_id
   and ppa_arch.report_type      = 'CAEOY_RL2_AMEND_PP'
   AND ppa_arch.report_qualifier = 'CAEOY_RL2_AMEND_PPQ'
   and ppa_arch.effective_date = cp_eff_date
   and ppa_arch.action_status = 'C'
   and paa_arch.payroll_action_id = ppa_arch.payroll_action_id
   and paa_arch.action_status = 'C'
   and pycadar_pkg.get_parameter('PRE_ORGANIZATION_ID',
                                 ppa_arch.legislative_parameters) = to_char(cp_pre_org_id)
   and to_number(paa_arch.serial_number) between
                 cp_start_person and cp_end_person;
Line: 355

        select ppa.report_type,
               paa.assignment_id,
               paa.assignment_action_id,
               pay_ca_eoy_rl1_amend_reg.get_parameter('PRE_ORGANIZATION_ID',
                                                       ppa.legislative_parameters)
        from pay_payroll_actions ppa,
             pay_assignment_actions paa
        where paa.serial_number = to_char(cp_person_id)
        and pay_ca_eoy_rl1_amend_reg.get_parameter('PRE_ORGANIZATION_ID',
                                   ppa.legislative_parameters) =
            nvl(cp_pre_org_id,pay_ca_eoy_rl1_amend_reg.get_parameter('PRE_ORGANIZATION_ID',
                                   ppa.legislative_parameters))
        and paa.action_status = 'C'
        and ppa.payroll_action_id = paa.payroll_action_id
        and ppa.effective_date = cp_effective_date
        and ppa.business_group_id = cp_business_group_id
        and ppa.report_type = 'CAEOY_RL2_AMEND_PP'
        and not exists (select 1
                        from pay_action_interlocks
                        where locked_action_id = paa.assignment_action_id)
        and exists (select 1
                    from per_assignments_f paf
                    where paf.assignment_id = paa.assignment_id
                    and   paf.effective_start_date <= cp_effective_date
                    and   paf.effective_end_date   >= trunc(cp_effective_date,'Y'))
        order by paa.assignment_action_id desc;
Line: 386

        select ppa.report_type,
               paa.assignment_id,
               paa.assignment_action_id,
               pay_ca_eoy_rl1_amend_reg.get_parameter('PRE_ORGANIZATION_ID',
                                                      ppa.legislative_parameters)
        from pay_payroll_actions ppa,
             pay_assignment_actions paa
        where paa.serial_number = to_char(cp_person_id)
        and pay_ca_eoy_rl1_amend_reg.get_parameter('PRE_ORGANIZATION_ID',
                                   ppa.legislative_parameters) =
            nvl(cp_pre_org_id,pay_ca_eoy_rl1_amend_reg.get_parameter('PRE_ORGANIZATION_ID',
                                   ppa.legislative_parameters))
        and paa.action_status = 'C'
        and ppa.business_group_id = cp_business_group_id
        and ppa.payroll_action_id = paa.payroll_action_id
        and ppa.effective_date = cp_effective_date
        and ppa.report_type = 'CAEOY_RL2_AMEND_PP'
        and exists (select 1
                    from per_assignments_f paf
                    where paf.assignment_id = paa.assignment_id
                    and   paf.effective_start_date <= cp_effective_date
                    and   paf.effective_end_date   >= trunc(cp_effective_date,'Y'))
        order by paa.assignment_action_id desc;
Line: 413

      select payroll_action_id
      from pay_payroll_actions
      where business_group_id = cp_bg_id
      and report_type         = 'RL2'
      and report_qualifier    = 'CAEOYRL2'
      and action_type = 'X'
      and action_status = 'C'
      and effective_date = cp_year
      and pay_ca_eoy_rl1_amend_reg.get_parameter('PRE_ORGANIZATION_ID',
                                                 legislative_parameters) = to_char(cp_pre);
Line: 425

     select substr(full_name,1,48), employee_number
     from per_people_f
     where person_id = cp_person_id
     order by effective_end_date desc;
Line: 431

     select action_information2
     from pay_action_information
     where action_context_id = cp_asg_act_id
     and   action_information_category = 'CAEOY RL2 EMPLOYEE INFO2'
     and   action_context_type = 'AAP'
     and   jurisdiction_code   = 'QC';
Line: 521

                   select pay_assignment_actions_s.nextval
                   into ln_rl2_amend_reg_asg_action
                   from dual;
Line: 528

                    /* Insert into pay_assignment_actions. */
                    hr_nonrun_asact.insact(ln_rl2_amend_reg_asg_action,
                                           ln_primary_assignment_id,
                                           p_payroll_action_id,
                                           p_chunk,
                                           ln_pre_org_id);
Line: 540

                   ** Update the serial number column with Province_code QC,
                   ** Archiver assignment_action and Archiver Payroll_action_id
                   ** so that we need not refer back in the reports. This
                   ** logic works for both RL2 Amendment Register and RL2 Register
                   ** reports.
                   ***********************************************************/
                   ln_serial_number := 'QC'||
                                       lpad(to_char(ln_asg_act_to_lock),14,0)||
                                       lpad(to_char(ln_yepp_pact_id),14,0);
Line: 550

                   update pay_assignment_actions aa
                   set aa.serial_number = ln_serial_number
                   where  aa.assignment_action_id = ln_rl2_amend_reg_asg_action;
Line: 626

                   select pay_assignment_actions_s.nextval
                   into ln_rl2_amend_reg_asg_action
                   from dual;
Line: 632

                   /* Insert into pay_assignment_actions. */
                   hr_nonrun_asact.insact(ln_rl2_amend_reg_asg_action,
                                          ln_primary_assignment_id,
                                          p_payroll_action_id,
                                          p_chunk,
                                          ln_pre_org_id);
Line: 644

                   ** Update the serial number column with Province_code QC,
                   ** Archiver assignment_action and Archiver Payroll_action_id
                   ** so that we need not refer back in the reports. This
                   ** logic works for both RL2 Amendment Register and RL2 Register
                   ** reports.
                   ***********************************************************/
                   ln_serial_number := 'QC'||
                                       lpad(to_char(ln_asg_act_to_lock),14,0)||
                                       lpad(to_char(ln_yepp_pact_id),14,0);
Line: 658

                   update pay_assignment_actions aa
                   set aa.serial_number = ln_serial_number
                   where  aa.assignment_action_id = ln_rl2_amend_reg_asg_action;
Line: 706

        open c_selected_asg_set  (p_start_person_id
                                 ,p_end_person_id
                                 ,ln_asg_set
                                 ,ld_end_date);
Line: 710

        hr_utility.trace('Opened cusor c_selected_asg_set');
Line: 712

           fetch c_selected_asg_set into ln_set_person_id;
Line: 713

           if c_selected_asg_set%notfound then
              hr_utility.trace('c_selected_asg_set not found ');
Line: 722

        close c_selected_asg_set;
Line: 813

      sqlstr :=  'select paa1.rowid /* we need the row id of the assignment actions that are created by PYUGEN */
                   from hr_all_organization_units  hou1,
                        hr_all_organization_units  hou,
                        hr_locations_all           loc,
                        per_all_people_f           ppf,
                        per_all_assignments_f      paf,
                        pay_assignment_actions     paa1,
                        pay_payroll_actions        ppa1
                   where ppa1.payroll_action_id = :pactid
                   and   paa1.payroll_action_id = ppa1.payroll_action_id
                   and   paa1.assignment_id = paf.assignment_id
                   and   paf.business_group_id = ppa1.business_group_id
                   and   ppa1.effective_date >= paf.effective_start_date
                   and   hou.organization_id = paa1.tax_unit_id
                   and   loc.location_id  = paf.location_id
                   and   hou1.organization_id  = paf.organization_id
                   and   ppf.person_id = paf.person_id
                   and   ppa1.effective_date between
                         ppf.effective_start_date and ppf.effective_end_date
                   and paf.effective_end_date = (
                          select max(paaf2.effective_end_date)
                          from per_all_assignments_f paaf2
                          where paaf2.assignment_id = paf.assignment_id
                          and paaf2.effective_start_date <= ppa1.effective_date)
    order by
      decode(pay_ca_rl2_reg.get_parameter(''P_S1'',ppa1.legislative_parameters),
                            ''RL1_PRE'',hou.name,
                            ''RL1_ORG'',hou1.name,
                            ''RL1_LOC'',loc.location_code,null)
     ,decode(pay_ca_rl2_reg.get_parameter(''P_S2'',ppa1.legislative_parameters),
                            ''RL1_PRE'',hou.name,
                            ''RL1_ORG'',hou1.name,
                            ''RL1_LOC'',loc.location_code,null)
     ,decode(pay_ca_rl2_reg.get_parameter(''P_S3'',ppa1.legislative_parameters),
                            ''RL1_PRE'',hou.name,
                            ''RL1_ORG'',hou1.name,
                            ''RL1_LOC'',loc.location_code,null)
     ,ppf.last_name,ppf.first_name';