Friday, July 3, 2015

Query: People City Tax Rules





select
    ppf.employee_number                                         "Employee Number",
    --
    pus.state_name                                             "State",
    pucnty.county_name                                         "County",
    pucity.city_name                                           "City",
    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: Additional All Rate",
    ctr.lit_exempt                                             "Tax Exn:Local Income",
    ctr.sd_exempt                                              "Tax Exn:School District",
    ctr.ht_exempt                                              "Tax Exn: Occupational Pri",
    ctr.lit_override_rate                                      "LIT Override:Rate",  
    ctr.lit_override_amount                                    "LIT Override:Amount",
    psd.school_dst_name                                        "School District",
    ctr.wage_exempt                                            "LIT Exmp From Wage Accn",
    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.business_group_id,
    ctr.emp_city_tax_rule_id,
    ctr.assignment_id
    --
from
    pay_us_emp_city_tax_rules_f ctr,
    pay_us_states pus,
    pay_us_counties pucnty,
    pay_us_city_names pucity,
    hr_lookups hrl,
    pay_us_city_school_dsts psd,
    per_all_assignments_f paaf,
    per_people_f ppf
where
    ctr.state_code = pus.state_code
and ctr.state_code = pucnty.state_code
and ctr.county_code = pucnty.county_code
and ctr.state_code = pucity.state_code
and ctr.county_code = pucity.county_code
and ctr.city_code = pucity.city_code
and (pucity.primary_flag = 'Y' or substr (pucity.city_code, 1, 1) = 'U')
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.city_code = psd.city_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;

No comments:

Post a Comment