Friday, July 3, 2015

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;         

No comments:

Post a Comment