DBA Data[Home] [Help]

APPS.PAY_GB_EDI_P46_CAR SQL Statements

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

Line: 18

SELECT vehicle_allocation_id,
       Vehicle_repository_id,
       Usage_type,
       effective_start_date,
       effective_end_date
FROM pqp_vehicle_allocations_f va
WHERE va.assignment_id = p_assignment_id
AND ( (va.effective_start_date BETWEEN g_start_date AND g_end_date
       OR va.effective_end_date BETWEEN g_start_date AND g_end_date)
    OR (g_start_date BETWEEN va.effective_start_date AND va.effective_end_date
        AND g_end_date BETWEEN va.effective_start_date AND va.effective_end_date) )
AND 'C' = (SELECT vr.vehicle_type
           FROM pqp_vehicle_repository_f vr
           WHERE vr.vehicle_repository_id =
                    va.vehicle_repository_id
           AND vr.vehicle_ownership = 'C'
           AND va.effective_start_date
               BETWEEN vr.effective_start_date
               AND vr.effective_end_date)
ORDER BY vehicle_allocation_id,
         effective_start_date;
Line: 41

SELECT min(paaf.assignment_id) assignment_id
FROM   pay_all_payrolls_f papf,
       hr_soft_coding_keyflex sck,
       per_all_assignments_f paaf,
       per_all_assignments_f paaf2,
       Pqp_vehicle_repository_f vr,
       Pqp_vehicle_allocations_f va
WHERE  paaf2.assignment_id = p_assignment_id
AND    paaf2.person_id = paaf.person_id
AND    p_eff_date
       BETWEEN paaf.effective_start_date
       AND paaf.effective_end_date
AND    papf.payroll_id = paaf.payroll_id
AND    p_eff_date
       BETWEEN papf.effective_start_date
       AND papf.effective_end_date
AND    papf.soft_coding_keyflex_id =
          sck.soft_coding_keyflex_id
AND    sck.segment1 = g_tax_ref
AND    paaf.assignment_id = va.assignment_id
AND    p_eff_date
       BETWEEN va.effective_start_date
       AND va.effective_end_date
AND    va.usage_type = 'P'
AND    va.vehicle_repository_id =
             vr.vehicle_repository_id
AND    p_eff_date
       BETWEEN vr.effective_start_date
       AND vr.effective_end_date
AND    vr.vehicle_ownership = 'C'
AND    vr.vehicle_type = 'C';
Line: 76

SELECT min(effective_start_Date) min_start_date,
       max(effective_end_date) max_end_Date
FROM pqp_vehicle_allocations_f va
WHERE va.vehicle_allocation_id = p_vehicle_allocation_id;
Line: 84

SELECT va.vehicle_allocation_id,
       vr.vehicle_repository_id
FROM   Pqp_vehicle_repository_f vr,
       Pqp_vehicle_allocations_f va
WHERE  va.assignment_id = p_assignment_id
AND    p_eff_date
       BETWEEN va.effective_start_date
       AND va.effective_end_date
AND    va.usage_type = 'P'
AND    va.vehicle_repository_id =
             vr.vehicle_repository_id
AND    p_eff_date
       BETWEEN vr.effective_start_date
       AND vr.effective_end_date
AND    vr.vehicle_ownership = 'C'
AND    vr.vehicle_type = 'C';
Line: 106

SELECT va.vehicle_allocation_id,
       Va.vehicle_repository_id,
       vr.make,
       vr.model,
       vr.engine_capacity_in_cc,
       va.effective_end_date
FROM   Pqp_vehicle_allocations_f va,
       pqp_vehicle_repository_f vr
WHERE  va.assignment_id = p_assignment_id
AND    va.effective_end_date
       BETWEEN (p_new_car_start_date - 30)
       AND (p_new_car_start_date - 1)
AND    va.usage_type = 'P'
AND    va.effective_end_date =
         (SELECT max(va2.effective_end_date)
          FROM   Pqp_vehicle_allocations_f va2
          WHERE  va2.assignment_id = p_assignment_id
          AND    va2.effective_end_date
                 BETWEEN (p_new_car_start_date - 30)
                 AND (p_new_car_start_date - 1)
          AND    va2.usage_type = 'P')
AND    va.vehicle_repository_id = vr.vehicle_repository_id
AND    vr.vehicle_ownership = 'C'
AND    vr.vehicle_type = 'C'
AND    va.effective_end_date
       BETWEEN vr.effective_start_date
       AND vr.effective_end_Date;
Line: 139

SELECT va.vehicle_allocation_id,
       Va.vehicle_repository_id,
       vr.make,
       vr.model,
       vr.engine_capacity_in_cc,
       va.effective_end_date
FROM   Pqp_vehicle_allocations_f va,
       pqp_vehicle_repository_f vr
WHERE  va.assignment_id = p_assignment_id
AND    va.effective_start_date
       BETWEEN (p_withdrawn_car_end_date + 1)
       AND least((p_withdrawn_car_end_date + 30), g_end_date)
AND    va.usage_type = 'P'
AND    va.effective_start_date =
         (SELECT min(va2.effective_start_date)
          FROM   Pqp_vehicle_allocations_f va2
          WHERE  va2.assignment_id = p_assignment_id
          AND    va2.effective_start_date
          BETWEEN (p_withdrawn_car_end_date + 1)
          AND least((p_withdrawn_car_end_date + 30), g_end_date)
          AND    va2.usage_type = 'P')
AND    va.vehicle_repository_id = vr.vehicle_repository_id
AND    vr.vehicle_ownership = 'C'
AND    vr.vehicle_type = 'C'
AND    va.effective_end_date
       BETWEEN vr.effective_start_date
       AND vr.effective_end_Date;
Line: 171

SELECT effective_start_date,
       effective_end_date,
       h1.description fuel_type
FROM pqp_vehicle_repository_f vr1,
     hr_lookups h1
WHERE vr1.vehicle_repository_id = p_vehicle_repository_id
AND   vr1.effective_start_date BETWEEN g_start_date AND g_end_date
AND   vr1.fuel_type = h1.lookup_code
AND   h1.lookup_type = 'PQP_FUEL_TYPE'
AND   h1.enabled_flag = 'Y'
AND   trunc(sysdate) BETWEEN trunc(nvl(h1.start_date_active, sysdate-1)) AND trunc(nvl(h1.end_date_active,sysdate+1))
AND EXISTS (SELECT 1
            FROM pqp_vehicle_repository_f vr2
            WHERE vr2.vehicle_repository_id =
                           p_vehicle_repository_id
            AND vr2.effective_end_date =
                       vr1.effective_start_date-1
            AND vr2.fuel_type <> vr1.fuel_type)
ORDER BY vr1.effective_start_date;
Line: 193

SELECT va.vehicle_allocation_id,
       va.vehicle_repository_id,
       va.usage_type usage_type,
       va.effective_start_date,
       va.effective_end_date
FROM   Pqp_vehicle_repository_f vr,
       Pqp_vehicle_allocations_f va
WHERE  va.assignment_id = p_assignment_id
AND    p_eff_date BETWEEN va.effective_start_date AND va.effective_end_date
AND    va.vehicle_repository_id = vr.vehicle_repository_id
AND    p_eff_date BETWEEN vr.effective_start_date AND vr.effective_end_date
AND    vr.vehicle_ownership = 'C'
AND    vr.vehicle_type = 'C';
Line: 209

SELECT flex.segment1 tax_ref
FROM   hr_soft_coding_keyflex flex,
       per_assignments_f asg,
       Pay_payrolls_f ppf
WHERE  asg.assignment_id = p_assignment_id
AND    p_eff_date BETWEEN asg.effective_start_date AND asg.effective_end_date
AND    asg.payroll_id = ppf.payroll_id
AND    p_eff_date BETWEEN ppf.effective_start_Date and ppf.effective_end_date
AND    ppf.soft_coding_keyflex_id = flex.soft_coding_keyflex_id;
Line: 233

   SELECT 'Y' found_flag
   FROM pay_action_information pai,
        pay_assignment_actions act,
        pay_payroll_actions ppa
   WHERE ppa.report_type = 'P46_CAR_EDI'
   AND   ppa.report_qualifier='GB'
   AND   ppa.report_category ='EDI'
   AND   ppa.action_type = 'X'
   AND   g_business_group_id = ppa.business_group_id
   AND   ppa.payroll_action_id = act.payroll_action_id
   AND   p_assignment_id = act.assignment_id
   AND   act.assignment_action_id = pai.action_context_id
   AND   'AAP' = pai.action_context_type
   AND   'GB P46 CAR EDI ALLOCATION' = pai.action_information_category
   AND   p_action_flag = pai.action_information1
   AND   to_char(p_vehicle_allocation_id) = pai.action_information2
   AND   fnd_date.date_to_canonical(p_allocation_start_date) = pai.action_information3;
Line: 286

   SELECT 'Y' found_flag
   FROM pay_action_information pai,
        pay_assignment_actions act,
        pay_payroll_actions ppa
   WHERE ppa.report_type IN ('P46_CAR_EDI_V2','P46_CAR_EDI')
   AND   ppa.report_qualifier='GB'
   AND   ppa.report_category ='EDI'
   AND   ppa.action_type = 'X'
   AND   g_business_group_id = ppa.business_group_id
   AND   ppa.payroll_action_id = act.payroll_action_id
   AND   p_assignment_id = act.assignment_id
   AND   act.assignment_action_id = pai.action_context_id
   AND   'AAP' = pai.action_context_type
   AND   'GB P46 CAR EDI ALLOCATION' = pai.action_information_category
   AND   p_action_flag = pai.action_information1
   AND   to_char(p_vehicle_allocation_id) = pai.action_information2
   AND   fnd_date.date_to_canonical(p_allocation_start_date) = pai.action_information3;
Line: 334

   SELECT
       substr(org.org_information3,1,36)    employer_name,
       substr(org.org_information4,1,60)    employer_address_line,
       substr(org.org_information2 ,1,40)   tax_district_name,
       organization_id,
       ppa.effective_date
     FROM
       pay_payroll_actions ppa,
       hr_organization_information org
     WHERE ppa.payroll_action_id = pactid
     AND   org.org_information_context = 'Tax Details References'
     AND   NVL(org.org_information10,'UK') = 'UK'
     AND   org.organization_id = ppa.business_group_id
     AND   substr(ppa.legislative_parameters,
                instr(ppa.legislative_parameters,'TAX_REF=') + 8,
                    instr(ppa.legislative_parameters||' ',' ',
                          instr(ppa.legislative_parameters,'TAX_REF=')+8)
                - instr(ppa.legislative_parameters,'TAX_REF=') - 8)
             = org.org_information1
     AND   ppa.report_type  = 'P46_CAR_EDI'
     AND   report_qualifier = 'GB'
     AND   ppa.report_category = 'EDI';
Line: 402

   sqlstr := 'select distinct person_id '||
             'from per_people_f ppf, '||
             'pay_payroll_actions ppa '||
             'where ppa.payroll_action_id = :payroll_action_id '||
             'and ppa.business_group_id = ppf.business_group_id '||
             'order by ppf.person_id';
Line: 416

    sqlstr := 'select 1 '||
              '/* ERROR - Employer Details Fetch failed with: '||
              sqlerrm(sqlcode)||' */ '||
              'from dual where to_char(:payroll_action_id) = dummy';
Line: 431

   SELECT
       substr(org.org_information3,1,36)    employer_name,
       substr(org.org_information4,1,60)    employer_address_line,
       substr(org.org_information2 ,1,40)   tax_district_name,
       organization_id,
       ppa.effective_date
     FROM
       pay_payroll_actions ppa,
       hr_organization_information org
     WHERE ppa.payroll_action_id = pactid
     AND   org.org_information_context = 'Tax Details References'
     AND   NVL(org.org_information10,'UK') = 'UK'
     AND   org.organization_id = ppa.business_group_id
     AND   substr(ppa.legislative_parameters,
                instr(ppa.legislative_parameters,'TAX_REF=') + 8,
                    instr(ppa.legislative_parameters||' ',' ',
                          instr(ppa.legislative_parameters,'TAX_REF=')+8)
                - instr(ppa.legislative_parameters,'TAX_REF=') - 8)
             = org.org_information1
     AND   ppa.report_type = 'P46_CAR_EDI_V2'
     AND   report_qualifier = 'GB'
     AND   ppa.report_category = 'EDI';
Line: 499

   sqlstr := 'select distinct person_id '||
             'from per_people_f ppf, '||
             'pay_payroll_actions ppa '||
             'where ppa.payroll_action_id = :payroll_action_id '||
             'and ppa.business_group_id = ppf.business_group_id '||
             'order by ppf.person_id';
Line: 513

    sqlstr := 'select 1 '||
              '/* ERROR - Employer Details Fetch failed with: '||
              sqlerrm(sqlcode)||' */ '||
              'from dual where to_char(:payroll_action_id) = dummy';
Line: 534

   SELECT to_number( pay_gb_eoy_archive.get_parameter(
                          legislative_parameters,
                          'PAYROLL_ID')) payroll_id,
          substr( pay_gb_eoy_archive.get_parameter(
                          legislative_parameters,
                          'TAX_REF'),1,20) tax_ref,
          start_date,
          effective_date,
          fnd_date.canonical_to_date(
             pay_gb_eoy_archive.get_parameter(
                          legislative_parameters,
                              'END_DATE'))  end_date,
          business_group_id
   FROM  pay_payroll_actions
   WHERE payroll_action_id = pactid;
Line: 551

   SELECT /* USE_INDEX(va,PQP_VEHICLE_ALLOCATIONS_F_N1)
          */
          asg.assignment_id,
          min(asg.effective_start_date) asg_min_start_date,
          max(asg.effective_end_date) asg_max_end_date
   FROM   hr_soft_coding_keyflex flex,
          per_all_assignments_f asg,
          pay_payrolls_f ppf,
          pqp_vehicle_allocations_f va,
          pqp_vehicle_repository_f vr
   WHERE  asg.person_id BETWEEN stperson AND endperson
   AND    asg.business_group_id = g_business_group_id
   AND    asg.payroll_id = nvl(g_payroll_id,asg.payroll_id)
   AND    asg.payroll_id = ppf.payroll_id
   AND    ppf.soft_coding_keyflex_id = flex.soft_coding_keyflex_id
   AND    flex.segment1 = g_tax_ref
   AND    (   g_start_date BETWEEN asg.effective_start_date AND asg.effective_end_date
           OR g_end_date   BETWEEN asg.effective_start_date AND asg.effective_end_date
           OR (    asg.effective_start_date BETWEEN g_start_date AND g_end_Date
               AND asg.effective_end_date  BETWEEN g_start_date AND g_end_Date))
   AND    va.assignment_id = asg.assignment_id
   AND    va.business_group_id = g_business_group_id
   AND    ( (   va.effective_start_date BETWEEN g_start_date AND g_end_date
             OR va.effective_end_date BETWEEN g_start_date AND g_end_date)
             OR (    g_start_date BETWEEN va.effective_start_date AND va.effective_end_date
                 AND g_end_date BETWEEN va.effective_start_date AND va.effective_end_date) )
   AND    vr.vehicle_repository_id = va.vehicle_repository_id
   AND    vr.vehicle_ownership = 'C'
   AND    vr.vehicle_type = 'C'
   AND    va.effective_start_date BETWEEN vr.effective_start_date AND vr.effective_end_date
   GROUP by asg.assignment_id;
Line: 954

         SELECT pay_assignment_actions_s.nextval
         INTO l_actid
         FROM dual;
Line: 999

   SELECT to_number( pay_gb_eoy_archive.get_parameter(
                          legislative_parameters,
                          'PAYROLL_ID')) payroll_id,
          substr( pay_gb_eoy_archive.get_parameter(
                          legislative_parameters,
                          'TAX_REF'),1,20) tax_ref,
          start_date,
          effective_date,
          fnd_date.canonical_to_date(
             pay_gb_eoy_archive.get_parameter(
                          legislative_parameters,
                              'END_DATE'))  end_date,
          business_group_id
   FROM  pay_payroll_actions
   WHERE payroll_action_id = pactid;
Line: 1016

   SELECT /* USE_INDEX(va,PQP_VEHICLE_ALLOCATIONS_F_N1)
          */
          asg.assignment_id,
          min(asg.effective_start_date) asg_min_start_date,
          max(asg.effective_end_date) asg_max_end_date
   FROM   hr_soft_coding_keyflex flex,
          per_all_assignments_f asg,
          pay_payrolls_f ppf,
          pqp_vehicle_allocations_f va,
          pqp_vehicle_repository_f vr
   WHERE  asg.person_id BETWEEN stperson AND endperson
   AND    asg.business_group_id = g_business_group_id
   AND    asg.payroll_id = nvl(g_payroll_id,asg.payroll_id)
   AND    asg.payroll_id = ppf.payroll_id
   AND    ppf.soft_coding_keyflex_id = flex.soft_coding_keyflex_id
   AND    flex.segment1 = g_tax_ref
   AND    (   g_start_date BETWEEN asg.effective_start_date AND asg.effective_end_date
           OR g_end_date   BETWEEN asg.effective_start_date AND asg.effective_end_date
           OR (    asg.effective_start_date BETWEEN g_start_date AND g_end_Date
               AND asg.effective_end_date  BETWEEN g_start_date AND g_end_Date))
   AND    va.assignment_id = asg.assignment_id
   AND    va.business_group_id = g_business_group_id
   AND    ( (   va.effective_start_date BETWEEN g_start_date AND g_end_date
             OR va.effective_end_date BETWEEN g_start_date AND g_end_date)
             OR (    g_start_date BETWEEN va.effective_start_date AND va.effective_end_date
                 AND g_end_date BETWEEN va.effective_start_date AND va.effective_end_date) )
   AND    vr.vehicle_repository_id = va.vehicle_repository_id
   AND    vr.vehicle_ownership = 'C'
   AND    vr.vehicle_type = 'C'
   AND    va.effective_start_date BETWEEN vr.effective_start_date AND vr.effective_end_date
   GROUP by asg.assignment_id;
Line: 1419

         SELECT pay_assignment_actions_s.nextval
         INTO l_actid
         FROM dual;
Line: 1467

SELECT p.last_name
     , p.title
     , p.first_name
     , p.middle_names
     , p.person_id
     , p.national_identifier
     , p.date_of_birth   --For Bug 6652235
	 , p.sex             --For Bug 6652235
FROM per_people_f p, per_assignments_f a
WHERE a.assignment_id = p_assignment_id
AND   l_eff_date between
                   a.effective_start_date and a.effective_end_date
AND   a.person_id = p.person_id
AND   l_eff_date between
                   p.effective_start_date and p.effective_end_date;
Line: 1486

SELECT addr.address_line1,
       addr.address_line2,
       addr.address_line3,
       addr.town_or_city,
       substr(hr_general.decode_lookup('GB_COUNTY',
         addr.region_1), 1, 35) region_1,
       addr.country,
       addr.postal_code
 FROM  per_addresses addr
 WHERE addr.person_id = p_person_id
 AND   addr.primary_flag = 'Y'
 AND   l_eff_date  BETWEEN addr.date_from
                   AND  nvl(addr.date_to, fnd_date.canonical_to_date('4712/12/31'));
Line: 1503

SELECT capital_contribution,
       private_contribution,
       fuel_benefit
FROM   pqp_vehicle_allocations_f
WHERE  vehicle_allocation_id = p_vehicle_allocation_id
AND    l_eff_date  between effective_start_date
       and effective_end_Date;
Line: 1514

SELECT registration_number,
       vehicle_type,
       vehicle_id_number,
       make,
       model,
       initial_registration,
       last_registration_renew_date,
       engine_capacity_in_cc,
       h1.description fuel_type,
       currency_code,
       list_price ,
       accessory_value_at_startdate,
       accessory_value_added_later,
       market_value_classic_car,
       fiscal_ratings,
       fiscal_ratings_uom,
       shared_vehicle,
       vehicle_status,
       taxation_method
FROM pqp_vehicle_repository_f,
     hr_lookups h1
WHERE vehicle_repository_id = p_vehicle_repository_id
AND   l_eff_date BETWEEN effective_start_date AND effective_end_Date
AND   fuel_type = h1.lookup_code
AND   h1.lookup_type = 'PQP_FUEL_TYPE'
AND   h1.enabled_flag = 'Y'
AND   trunc(sysdate) BETWEEN trunc(nvl(h1.start_date_active, sysdate-1)) AND trunc(nvl(h1.end_date_active,sysdate+1));
Line: 1857

   SELECT asg.assignment_id,
          min(asg.effective_start_date) asg_min_start_date,
          max(asg.effective_end_date) asg_max_end_date
   FROM   hr_soft_coding_keyflex flex,
          per_all_assignments_f asg,
          Pay_payrolls_f ppf,
          pay_assignment_actions act
   WHERE  act.assignment_action_id = p_assactid
   AND    act.assignment_id = asg.assignment_id
   AND    asg.payroll_id +0 = nvl(g_payroll_id,asg.payroll_id)
   AND    asg.payroll_id = ppf.payroll_id
   AND    ppf.soft_coding_keyflex_id = flex.soft_coding_keyflex_id
   AND    flex.segment1 = g_tax_ref
   AND   ( g_start_date BETWEEN asg.effective_start_date AND asg.effective_end_date
         OR g_end_date BETWEEN asg.effective_start_date AND asg.effective_end_date
         OR (asg.effective_start_date BETWEEN g_start_date AND g_end_Date
             AND asg.effective_end_date BETWEEN g_start_date AND g_end_Date))
   GROUP by asg.assignment_id;
Line: 2294

   SELECT asg.assignment_id,
          min(asg.effective_start_date) asg_min_start_date,
          max(asg.effective_end_date) asg_max_end_date
   FROM   hr_soft_coding_keyflex flex,
          per_all_assignments_f asg,
          Pay_payrolls_f ppf,
          pay_assignment_actions act
   WHERE  act.assignment_action_id = p_assactid
   AND    act.assignment_id = asg.assignment_id
   AND    asg.payroll_id +0 = nvl(g_payroll_id,asg.payroll_id)
   AND    asg.payroll_id = ppf.payroll_id
   AND    ppf.soft_coding_keyflex_id = flex.soft_coding_keyflex_id
   AND    flex.segment1 = g_tax_ref
   AND   ( g_start_date BETWEEN asg.effective_start_date AND asg.effective_end_date
         OR g_end_date BETWEEN asg.effective_start_date AND asg.effective_end_date
         OR (asg.effective_start_date BETWEEN g_start_date AND g_end_Date
             AND asg.effective_end_date BETWEEN g_start_date AND g_end_Date))
   GROUP by asg.assignment_id;