Friday, July 3, 2015

Query: Grade Pay Scales





select
    pps.name                            "Name",
    --
    pps.last_automatic_increment_date   "Last Auto Increment",
    pps.increment_frequency             "Increment Freq:Number",
    pps.increment_period                "Increment Freq:Period",
    psp.spinal_point                    "Point",
    psp.sequence                        "Sequence",
    --
    pps.parent_spine_id
from
    per_parent_spines pps,
    per_spinal_points psp
where
    1=1
and pps.parent_spine_id = psp.parent_spine_id
--
and pps.name = 'Hrly Pay Scale:Welder /Laborer'
order by
    1,2,3;

Query: Grade Scale Rates





select
    pgtl.name                   "Grade Name" ,
    --
    pps.name                    "Pay Scale Name",
    pspsf.sequence              "Ceiling: Step",
    grs.starting_step           "Starting Step",
    grs.effective_start_date    "Effective Start Date",
    rownum                      "Step",
    psp.spinal_point            "Point",
    --
    pgtl.grade_id
from
    per_grades_tl pgtl,
    per_grade_spines_f grs,
    per_parent_spines pps,
    per_spinal_points psp,
    per_spinal_point_steps_f pspsf
where
    1=1
and grs.grade_id = pgtl.grade_id
and grs.parent_spine_id = pps.parent_spine_id
and psp.parent_spine_id = pps.parent_spine_id
AND grs.ceiling_step_id = pspsf.step_id
--
and  pgtl.name = '200.2.Central'
order by
    1,2,5,6;

Query: People Assignment Salary - Current





select
    ppf.employee_number                                             "Employee Number",
    --
    ppp.change_date                                                 "From",
    ppp.proposed_salary_n                                           "Salary",
    (ppp.proposed_salary_n*12)                                      "Annual Salary",
    (ppp.proposed_salary_n*12)                                      "FT Annual Salary",
    per_saladmin_utility.get_fte_factor (ppp.assignment_id,ppp.change_date)     "FTE Factor",  
    hr_general.decode_lookup ('PER_SAL_PROPOSAL_STATUS', approved)  "Status",
    ppp.next_perf_review_date                                       "Next Salary Review",
    hr_general.decode_lookup ('PROPOSAL_REASON', proposal_reason)   "Reason For Change",
    ppp.date_to                                                     "To",
    --
    ppp.pay_proposal_id,
    ppp.assignment_id,
    ppp.event_id,
    ppp.business_group_id
    --
from
    per_pay_proposals ppp,
    per_performance_reviews ppr,
    per_assignments_f2 paa,
    per_people_f ppf,
    per_pay_bases ppb,
    pay_input_values_f piv,
    pay_element_types_f pet  
where  
    1=1
and ppp.performance_review_id =ppr.performance_review_id(+)
and ppp.assignment_id = paa.assignment_id
and paa.person_id = ppf.person_id
and sysdate between ppp.change_date and nvl (ppp.date_to, hr_general.end_of_time)
and ppp.change_date between paa.effective_start_date and paa.effective_end_date
and paa.pay_basis_id(+) = ppb.pay_basis_id
and ppb.input_value_id = piv.input_value_id
and piv.element_type_id = pet.element_type_id
and ppp.change_date between piv.effective_start_date and piv.effective_end_date
and ppp.change_date between pet.effective_start_date and pet.effective_end_date
--
and ppf.employee_number = '1309'
order by
   1,2,3;

Query: People





select
    ppf.employee_number       "Employee Number",
--
    ppf.last_name             "Last Name",
    ppf.first_name            "First Name",
    ppf.title                 "Title",
    ppf.pre_name_adjunct      "Prefix",
    ppf.suffix                "Suffix",
    ppf.middle_names          "Middle",
    decode(ppf.sex,
           'M','Male',
           'F','Female',
           ppf.sex)             "Gender",
    ppttl.user_person_type      "Person Type",
    ppf.applicant_number        "Applicant Number",
    ppf.national_identifier     "Social Security",
    ppf.effective_start_date    "Effective Date - From",
    ppf.effective_end_date      "Effective Date - To",
    ppf.start_date              "Latest Start Date",
    --
    ppf.date_of_birth         "Personal: Birth Date",
    ppf.town_of_birth         "Personal: Town Of Birth",
    ppf.region_of_birth       "Personal: Region of Birth",
    ppf.country_of_birth      "Personal: Country of Birth",
    trunc((sysdate -
      ppf.date_of_birth)/365) "Personal: Age",
    hl1.meaning               "Personal: Status",                
    ppf.nationality           "Personal: Nationality",
    hl2.meaning               "Personal: Registered Disabled",
    --
    hl5.meaning                         "Employment:Ethnic Origin",
    decode(ppf.per_information11,
        'N','No',
        'Y','Yes',
        ppf.per_information11)          "Employment:Ethnicity Disclosed",
    hl6.meaning                         "Employment:VETS100",
    decode(ppf.per_information9,
        'N','No',
        'Y','Yes',
        ppf.per_information9)           "Employment:Child Support",
    decode(ppf.per_information10,
        'N','No',
        'Y','Yes',
        ppf.per_information10)          "Employment:Opted for Medicare",
    decode(ppf.per_information2,
        'N','No',
        'Y','Yes',
        ppf.per_information2)           "Employment:I-9 Status",
    ppf.per_information3                "Employment:I-9 Expiration",
    hl7.meaning                         "Employment:New Hire",
    hl9.meaning                         "Employment:Exception Reason",
    hl8.meaning                         "Employment:Vets 100A",
    ppf.office_number              "Office Details: Office",
    ppf.internal_location          "Office Details:Location",
    ppf.mailstop                   "Office Details:MailStop",
    ppf.email_address              "Office Details:Email Address",
    hl1.meaning                    "Office Details:Mail To",
    ppf.resume_exists              "Applicant:Resume Exists",
    ppf.resume_last_updated        "Applicant:Last Updated",
    ppf.hold_applicant_date_until  "Hold Application Until",
    ppf.background_check_status    "Background:Checked",
    ppf.background_date_check      "Background:Date Checked",
    ppf.rehire_recommendation      "Rehire:Recommendation",
    ppf.rehire_reason              "Rehire:Reason",
    ppf.honors                     "Further Name:Honors",
    ppf.known_as                   "Further Name:Preferred Name",
    ppf.previous_last_name         "Previuos Last Name",
    hl3.meaning                    "Medical: Blood Type",
    ppf.last_medical_test_date     "Medical:Last Test Date",
    ppf.last_medical_test_by       "Medical:Last Test By",
    ppf.work_schedule              "Other:Work Schedule",
    ppf.fte_capacity               "Other:Full Time Availability",
    ppf.correspondence_language    "Correspondance language",
    ppf.date_of_death              "Date of Death",
    ppf.student_status             "Other:Student Status",
    ppf.date_employee_data_verified  "Other:Date Last Verified",
    ppf.on_military_service          "Other:On Military Service",
    ppf.second_passport_exists       "Other:Second Passport Exist",
    bbg.name                         "Benifits:Benifit Group",
    ppf.uses_tobacco_flag            "Benifits:Uses Tobacco",
    ppf.coord_ben_med_pln_no         "Benifits:Medical Plan",
    ppf.dpdnt_adoption_date          "Benifits:Adoption Date",
    ppf.receipt_of_death_cert_date   "Date Received Death Cert",
    pps.adjusted_svc_date            "Benifits:Adjusted Service Date" ,
    ppf.original_date_of_hire        "Benifits:Original Date Of Hire",
    ppf.coord_ben_no_cvg_flag        "Benifits:Other Coverage",
    ppf.dpdnt_vlntry_svce_flag       "Benifits:Voluntary Service",
    --
    ppf.person_id
from
    per_people_f ppf,
    per_person_types ppt,
    per_person_types_tl ppttl,
    hr_lookups hl1,
    hr_lookups hl2,
    ben_benfts_grp bbg,
    per_periods_of_service pps,
    hr_lookups hl11,
    hr_lookups hl12,
    hr_lookups hl3,
    hr_lookups hl4,
    hr_lookups hl5,
    hr_lookups hl6,
    hr_lookups hl7,
    hr_lookups hl8,
    hr_lookups hl9
where
    1=1
and ppt.person_type_id = ppf.person_type_id
and ppt.person_type_id = ppttl.person_type_id
and bbg.benfts_grp_id(+) = ppf.benefit_group_id
and pps.person_id(+) = ppf.person_id
and hl1.lookup_type(+) = 'STUDENT_STATUS'
and hl1.lookup_code(+) = ppf.student_status
and hl2.lookup_type(+) = 'REGISTERED_DISABLED'
and hl2.lookup_code(+) = ppf.registered_disabled_flag
and hl11.lookup_type(+) = 'HOME_OFFICE'
and hl11.lookup_code(+) = ppf.expense_check_send_to_address
and hl12.lookup_type(+) = 'WORK_SCHEDULE'
and hl12.lookup_code(+) = ppf.work_schedule
and hl3.lookup_type(+) = 'BLOOD_TYPE'
and hl3.lookup_code(+) = ppf.blood_type
and hl4.lookup_type(+) = 'STUDENT_STATUS'
and hl4.lookup_code(+) = ppf.student_status
and hl5.lookup_type(+) = 'US_ETHNIC_GROUP'
and hl5.lookup_code(+) = ppf.per_information1
and hl6.lookup_type(+) = 'US_VETERAN_STATUS'
and hl6.lookup_code(+) = ppf.per_information5
and hl7.lookup_type(+) = 'US_NEW_HIRE_STATUS'
and hl7.lookup_code(+) = ppf.per_information7
and hl8.lookup_type(+) = 'US_VETERAN_STATUS'
and hl8.lookup_code(+) = ppf.per_information25
and hl9.lookup_type(+) = 'US_NEW_HIRE_EXCEPTIONS'
and hl9.lookup_code(+) = ppf.per_information8
and ppttl.language = userenv ('LANG')
--
and ppf.employee_number = '1309'
order by
    1,2,3,4

Query: People Fedral Tax Rules





select
    ppf.employee_number                                         "Employee Number",
    --
    (select state_name
        from pay_us_states
        where state_abbrev = add_information17)               "Resident",
    (select hlat.region_2
       from hr_locations_all hlat
      where hlat.location_id = paaf.location_id)              "Work",
    pus.state_name                                            "SUI State",
    paa.add_information18                                     "Resident City",
    pus.state_name                                            "Work City",
    paa.add_information19                                     "Resident County",
     (select hlat.region_1
       from hr_locations_all hlat
      where hlat.location_id = paaf.location_id)               "Work County",
    hrl1.meaning                                              "Filing Status",
    ftr.withholding_allowances                                 "Allowances",
    ftr.fit_additional_tax                                     "Additional Tax",
    ftr.fit_exempt                                             "Tax Exemption :Fit",
    ftr.futa_tax_exempt                                        "Tax Exemption :FUTA",
    ftr.medicare_tax_exempt                                    "Tax Exemption :MEDICARE",
    ftr.ss_tax_exempt                                          "Tax Exemption :SS",
    ftr.fit_override_amount                                   "FO:Regular Amount",
    ftr.fit_override_rate                                     "FO:Regular Rate",
    ftr.supp_tax_override_rate                                 "FO:Supplemental Rate",
    ftr.excessive_wa_reject_date                               "Lock in Date",
    ftr.statutory_employee                                     "Statutory Employee",
    ftr.cumulative_taxation                                    "Cumulative Taxation",
    ftr.wage_exempt                                            "FIt Exempt Wage Acc",
    hrl2.meaning                                               "EIC filling status",
    ftr.effective_start_date                                  "Effec Dates: From",
    decode (ftr.effective_end_date,
    to_date ('31124712', 'DDMMYYYY'), null,
    ftr.effective_end_date)                                   "Effec Dates: To",
    --
    ftr.emp_fed_tax_rule_id,
    paaf.assignment_id,
    paaf.location_id,
    paa.address_id
    --
from
    pay_us_emp_fed_tax_rules_f ftr,
    per_all_assignments_f paaf,
    pay_us_states pus,
    per_addresses paa,
    hr_lookups hrl1,
    hr_lookups hrl2,
    per_people_f ppf
where  
    ftr.sui_state_code = pus.state_code
and ftr.assignment_id=paaf.assignment_id
and paa.person_id=paaf.person_id
and ftr.filing_status_code = hrl1.lookup_code
and hrl1.lookup_type = 'US_FIT_FILING_STATUS'
and ftr.eic_filing_status_code = hrl2.lookup_code
and hrl2.lookup_type = 'US_EIC_FILING_STATUS'
and nvl(paaf.effective_end_date,sysdate)>sysdate-1
and ftr.assignment_id = paaf.assignment_id
and paaf.person_id = ppf.person_id
--
and ppf.employee_number='1309'
order by
      1,2;

Query: People State Tax Rules





select
    ppf.employee_number                                         "Employee Number",
    --
    pus.state_name                                             "State",
    hrl.meaning                                                "W4 Info :Filing Status",
    str.withholding_allowances                                 "W4 Info :Allowances",
    str.secondary_wa                                           "W4 Info: Secon Allowances",
    str.additional_wa_amount                                   "W4 Info:Exemption Aaount",
    str.sit_additional_tax                                     "W4 Info:Addn Tax",
    str.sit_optional_calc_ind                                  "W4 Info :Opt Calc" ,
    str.sit_exempt                                             "Tax Ex: SIT",
    str.sdi_exempt                                             "Tax Ex: SDI",
    str.sui_exempt                                             "Tax Ex: SUI",
    str.wc_exempt                                              "Tax Ex: WC",
    str.sit_override_rate                                      "SIT Override:Regular Rate",
    str.sit_override_amount                                    "SIT Override:Regular Amount",
    str.supp_tax_override_rate                                 "SIT Override: Supp Rate",
    str.sui_wage_base_override_amount                          "SUI Base Override",
    str.excessive_wa_reject_date                               "Lock in Date",
    str.state_non_resident_cert                                "Non Resi Certi",
    str.wage_exempt                                            "SIT Exm Fm Wg Accm",
    str.effective_start_date                                   "Effective Date : From",
    decode (str.effective_end_date,
    to_date ('31124712', 'DDMMYYYY'), null,
    str.effective_end_date)                                    "Effective Date: To",
    --
    str.assignment_id,
    str.business_group_id
    --
from
    pay_us_emp_state_tax_rules_f str,
    pay_us_states pus,
    pay_state_rules psr,
    hr_lookups hrl,
    per_all_assignments_f paaf,
    per_people_f ppf
where    
    pus.state_code = str.state_code
and psr.state_code = pus.state_abbrev
and hrl.lookup_type = psr.fs_lookup_type
and nvl(str.effective_end_date,sysdate)>sysdate-1
and hrl.lookup_code = ltrim (str.filing_status_code, '0')
and str.assignment_id = paaf.assignment_id
and nvl(paaf.effective_end_date,sysdate)>sysdate-1
and paaf.person_id = ppf.person_id
--
and ppf.employee_number='1309'
order by
      1,2;         

Query: People County Tax Rules




select
    ppf.employee_number                               "Employee Number",
    --
    pus.state_name                                    "State",
    puc.county_name                                   "County",
    hrl.meaning                                       "W4 Info: Filing Status",
    ctr.withholding_allowances                        "W4 Info: Allowances",
    ctr.lit_additional_tax                            "W4 Info: Additional Tax",
    ctr.additional_wa_rate                            "W4 Info:Add Alllow Rate",
    ctr.lit_exempt                                    "Tax Ex:Local Income",
    ctr.sd_exempt                                     "Tax Ex:School District",
    ctr.ht_exempt                                     "Tax Ex: Occu Privilage",
    ctr.lit_override_rate                             "LIT Override: Rate",
    ctr.lit_override_amount                           "LIT Override: Amount",
    psd.school_dst_name                               "School District",
    ctr.wage_exempt                                   "LIT Ex from Wge Accu",
    ctr.effective_start_date                          "Effective Dates: From",
    decode (ctr.effective_end_date,
    to_date ('31124712', 'DDMMYYYY'), null,
    ctr.effective_end_date)                           "Effective Dates: To",
    --
    ctr.assignment_id
from
    pay_us_emp_county_tax_rules_f ctr,
    pay_us_states pus,
    pay_us_counties puc,
    hr_lookups hrl,
    pay_us_county_school_dsts psd,
    per_all_assignments_f paaf,
    per_people_f ppf
where  
    1=1
and ctr.state_code = pus.state_code
and ctr.state_code = puc.state_code
and ctr.county_code = puc.county_code
and ctr.filing_status_code = hrl.lookup_code
and hrl.lookup_type = 'US_LIT_FILING_STATUS'
and ctr.state_code = psd.state_code(+)
and ctr.county_code = psd.county_code(+)
and ctr.school_district_code = psd.school_dst_code(+)
and ctr.assignment_id = paaf.assignment_id
and nvl(paaf.effective_end_date,sysdate)>sysdate-1
and paaf.person_id = ppf.person_id
--
and ppf.employee_number='1309'
order by
      1,2;