The following lines contain the word 'select', 'insert', 'update' or 'delete':
c_proc_ass_select_clause varchar2(32767)
:= 'select wic_v.person_id,
wic_v.assignment_id,
wic_v.assignment_action_id,
wic_v.effective_date,
wic_v.spr_term_valid';
:= '(select pjwa_v.pa_person_id person_id,
pjwa_v.assignment_id,
pjwa_v.assignment_action_id,
pjwa_v.effective_date,
pjwa_v.itax_organization_id,
decode(padr.address_id,null,padc.town_or_city,padr.town_or_city) town_or_city,
pjwa_v.spr_term_valid
from
(select pa.person_id pa_person_id,
pjwa.assignment_id,
pjwa.assignment_action_id,
pjwa.effective_date,
pjwa.person_id pjwa_person_id,
pjwa.itax_organization_id,
pjwa.actual_termination_date,
to_number(decode(to_char(pjwa.actual_termination_date,''YYYY/MM/DD''),null,0,
pay_jp_wic_pkg.spr_term_valid(
pjwa.assignment_action_id,
pjwa.assignment_id,
pjwa.action_sequence,
pjwa.effective_date,
pjwa.itax_organization_id,
pjwa.itax_category,
pjwa.itax_yea_category,
pjwa.employment_category,
pjwa.actual_termination_date))) spr_term_valid
from pay_payroll_actions ppa,
pay_assignment_actions paa,
per_all_assignments_f pa,
pay_jp_wic_assacts_v pjwa
where ppa.effective_date
between fnd_date.canonical_to_date(''i_effective_soy'') and fnd_date.canonical_to_date(''i_effective_eoy'')
and ppa.business_group_id + 0 = to_number(''i_business_group_id'')
and pa.business_group_id + 0 = to_number(''i_business_group_id'')
and ppa.action_type in (''R'',''Q'',''B'',''I'')
and paa.payroll_action_id = ppa.payroll_action_id
and paa.action_status = ''C''
and ppa.action_status = ''C''
and pa.assignment_id = paa.assignment_id
and ppa.effective_date
between pa.effective_start_date and pa.effective_end_date
and pjwa.assignment_action_id = paa.assignment_action_id
and pjwa.payroll_action_id = ppa.payroll_action_id
and pjwa.itax_organization_id = nvl(to_number(''i_organization_id''),pjwa.itax_organization_id)) pjwa_v,
per_addresses padr,
per_addresses padc
where padr.person_id (+) = pjwa_v.pjwa_person_id
and padr.address_type (+) = ''JP_R''
and nvl(pjwa_v.actual_termination_date, add_months(trunc(pjwa_v.effective_date, ''YYYY''), 12))
between padr.date_from (+) and nvl(padr.date_to(+), fnd_date.canonical_to_date(''i_eot''))
and padc.person_id (+) = pjwa_v.pjwa_person_id
and padc.address_type (+) = ''JP_C''
and nvl(pjwa_v.actual_termination_date, add_months(trunc(pjwa_v.effective_date, ''YYYY''), 12))
between padc.date_from (+) and nvl(padc.date_to(+), fnd_date.canonical_to_date(''i_eot''))) wic_v,
(select pjsn_act.organization_id,
pjsn_act.district_code act_district_code,
substrb(nvl(pjsn_act.report_district_code,pjsn_act.district_code),1,5) rep_district_code,
pjsn_rep.swot_number rep_swot_number,
pjsn_rep.output_file_name rep_output_file_name,
pjsn_rep.efile_exclusive_flag rep_efile_exclusive_flag
from pay_jp_swot_numbers pjsn_rep,
pay_jp_swot_numbers pjsn_act
where pjsn_rep.organization_id = pjsn_act.organization_id
and pjsn_rep.district_code = nvl(pjsn_act.report_district_code,pjsn_act.district_code)) pjsn_v';
c_proc_ass_hasa_select_clause varchar2(32767)
:= ', hasa.include_or_exclude';
c_proc_arch_select_clause varchar2(32767)
:= 'select
pjia.person_id,
pjia.assignment_id,
pjia.assignment_action_id,
pjia.effective_date,
to_number(decode(to_char(pjip.actual_termination_date,''YYYY/MM/DD''),null,0,
decode(sign(fnd_number.canonical_to_number(pjit.taxable_income) - to_number(''i_valid_term_taxable_amt'')),1,0,1))) spr_term_valid';
(select pjsn_act.organization_id,
pjsn_act.district_code act_district_code,
substrb(nvl(pjsn_act.report_district_code,pjsn_act.district_code),1,5) rep_district_code,
pjsn_rep.swot_number rep_swot_number,
pjsn_rep.output_file_name rep_output_file_name,
pjsn_rep.efile_exclusive_flag rep_efile_exclusive_flag
from pay_jp_swot_numbers pjsn_rep,
pay_jp_swot_numbers pjsn_act
where pjsn_rep.organization_id = pjsn_act.organization_id
and pjsn_rep.district_code = nvl(pjsn_act.report_district_code,pjsn_act.district_code)) pjsn_v';
c_proc_arch_hasa_select_clause varchar2(32767)
:= ', hasa.include_or_exclude';
c_data_ass_select_clause varchar2(32767)
:= 'select /*+ ORDERED */
wic_v.mag_assignment_action_id,
wic_v.assignment_action_id,
wic_v.assignment_id,
wic_v.action_sequence,
wic_v.effective_date,
wic_v.date_earned,
wic_v.itax_organization_id,
wic_v.itax_category,
wic_v.itax_yea_category,
wic_v.dpnt_ref_type,
wic_v.dpnt_effective_date,
wic_v.person_id,
wic_v.sex,
wic_v.date_of_birth,
wic_v.leaving_reason,
wic_v.last_name,
wic_v.last_name_kana,
wic_v.first_name,
wic_v.first_name_kana,
wic_v.employment_category,
nvl(pjsn_v.rep_district_code,wic_v.town_or_city)||per_jp_validations.district_code_check_digit(nvl(pjsn_v.rep_district_code,wic_v.town_or_city)) district_code,
wic_v.address,
wic_v.address_kana,
wic_v.address_jp,
wic_v.full_name,
wic_v.actual_termination_date,
wic_v.date_start,
wic_v.full_name_kana,
wic_v.employee_number,
pjsn_v.rep_swot_number swot_number,
nvl(pjsn_v.rep_output_file_name,
pay_jp_spr_efile_pkg.default_file_name(nvl(pjsn_v.rep_district_code,wic_v.town_or_city)||
per_jp_validations.district_code_check_digit(nvl(pjsn_v.rep_district_code,wic_v.town_or_city)))) output_file_name,
hoi.org_information6||hoi.org_information7||hoi.org_information8 itax_org_address,
hoi.org_information9||hoi.org_information10||hoi.org_information11 itax_org_address_kana,
hoi.org_information1 itax_org_name,
hoi.org_information2 itax_org_name_kana,
hoi.org_information12 itax_org_phone,
hoiw.org_information4 itax_org_serial1,
hoiw.org_information5 itax_org_serial2,
null taxable_income,
null net_taxable_income,
null total_income_exempt,
null withholding_itax,
null spouse_special_exempt,
null social_insurance_premium,
null mutual_aid_premium,
null life_insurance_premium_exempt,
null damage_insurance_premium_exem,
null housing_tax_reduction,
null private_pension_premium,
null spouse_net_taxable_income,
null long_damage_insurance_premium,
null disaster_tax_reduction,
null dependent_spouse_exists_kou,
null dependent_spouse_no_exist_kou,
null dependent_spouse_exists_otsu,
null dependent_spouse_no_exist_otsu,
null aged_spouse_exists,
null num_specifieds_kou,
null num_specifieds_otsu,
null num_aged_parents_partial,
null num_ageds_kou,
null num_ageds_otsu,
null num_dependents_kou,
null num_dependents_otsu,
null num_special_disableds_partial,
null num_special_disableds,
null num_disableds,
null husband_exists,
null minor,
null otsu,
null special_disabled,
null disabled,
null aged,
null widow,
null special_widow,
null widower,
null working_student,
null deceased_termination,
null disastered,
null foreigner,
null prev_job_employer_name,
null prev_job_employer_name_kana,
null prev_job_employer_add,
null prev_job_employer_add_kana,
null prev_job_foreign_address,
null prev_job_taxable_income,
null prev_job_itax,
null prev_job_si_prem,
null prev_job_termination_date,
null prev_job_termination_year,
null prev_job_termination_month,
null prev_job_termination_day,
null hld_residence_date_1_date,
null hld_residence_date_1_year,
null hld_residence_date_1_month,
null hld_residence_date_1_day,
null hld_loan_count,
null hld_payable_loan,
null hld_loan_type_1,
null hld_loan_balance_1,
null hld_residence_date_2_date,
null hld_residence_date_2_year,
null hld_residence_date_2_month,
null hld_residence_date_2_day,
null hld_loan_type_2,
null hld_loan_balance_2,
null original_description,
null original_description_kana,
null wtm_system_desc,
null wtm_system_desc_kana,
null wtm_user_desc,
null wtm_user_desc_kana,
null num_junior_deps,
null new_life_ins_prem,
null old_life_ins_prem,
null new_care_med_prem,
null new_pens_ins_prem';
:= '(select /*+ ORDERED */
paa.assignment_action_id mag_assignment_action_id,
pjwa.assignment_action_id,
pjwa.assignment_id,
pjwa.action_sequence,
pjwa.effective_date,
pjwa.date_earned,
pjwa.itax_organization_id,
pjwa.itax_category,
pjwa.itax_yea_category,
nvl(nvl(pap.prl_information1,''i_bg_itax_dpnt_ref_type''),''CTR_EE'') dpnt_ref_type,
nvl(fnd_date.canonical_to_date(pay_core_utils.get_parameter(''ITAX_DPNT_EFFECTIVE_DATE'',pjwa.legislative_parameters)),pjwa.effective_date) dpnt_effective_date,
pp.person_id,
pp.sex,
pp.date_of_birth,
pjwa.leaving_reason,
pp.per_information18 last_name,
pp.last_name last_name_kana,
pp.per_information19 first_name,
pp.first_name first_name_kana,
pjwa.employment_category,
decode(padr.address_id,null,padc.town_or_city,padr.town_or_city) town_or_city,
decode(padr.address_id, null,
padc.address_line1||padc.address_line2||padc.address_line3,
padr.address_line1||padr.address_line2||padr.address_line3) address,
decode(padr.address_id, null,
padc.region_1||padc.region_2||padc.region_3,
padr.region_1||padr.region_2||padr.region_3) address_kana,
decode(decode(padr.address_id,null,padc.country,padr.country),''JP'',''0'',''1'') address_jp,
pp.per_information18||'' ''||pp.per_information19 full_name,
pjwa.actual_termination_date,
pjwa.date_start,
pp.last_name||'' ''||pp.first_name full_name_kana,
pp.employee_number
from pay_payroll_actions ppa,
pay_assignment_actions paa,
pay_jp_wic_assacts_v pjwa,
pay_all_payrolls_f pap,
per_all_people_f pp,
per_addresses padr,
per_addresses padc
where ppa.payroll_action_id = :p_payroll_action_id
and paa.payroll_action_id = ppa.payroll_action_id
and pjwa.assignment_action_id = paa.source_action_id
and pjwa.assignment_id = paa.assignment_id
and pjwa.business_group_id + 0 = to_number(''i_business_group_id'')
and pjwa.effective_date
between fnd_date.canonical_to_date(''i_effective_soy'') and fnd_date.canonical_to_date(''i_effective_eoy'')
and pjwa.itax_organization_id = nvl(to_number(''i_organization_id''),pjwa.itax_organization_id)
and pap.payroll_id = pjwa.payroll_id
and pjwa.effective_date
between pap.effective_start_date and pap.effective_end_date
and pp.person_id = pjwa.person_id
and pjwa.effective_date
between pp.effective_start_date and pp.effective_end_date
and padr.person_id (+) = pjwa.person_id
and padr.address_type (+) = ''JP_R''
and nvl(pjwa.actual_termination_date, add_months(trunc(pjwa.effective_date, ''YYYY''), 12))
between padr.date_from (+) and nvl(padr.date_to(+), fnd_date.canonical_to_date(''i_eot''))
and padc.person_id (+) = pjwa.person_id
and padc.address_type (+) = ''JP_C''
and nvl(pjwa.actual_termination_date, add_months(trunc(pjwa.effective_date, ''YYYY''), 12))
between padc.date_from (+) and nvl(padc.date_to(+), fnd_date.canonical_to_date(''i_eot''))) wic_v,
(select pjsn_act.organization_id,
pjsn_act.district_code act_district_code,
substrb(nvl(pjsn_act.report_district_code,pjsn_act.district_code),1,5) rep_district_code,
pjsn_rep.swot_number rep_swot_number,
pjsn_rep.output_file_name rep_output_file_name,
pjsn_rep.efile_exclusive_flag rep_efile_exclusive_flag
from pay_jp_swot_numbers pjsn_rep,
pay_jp_swot_numbers pjsn_act
where pjsn_rep.organization_id = pjsn_act.organization_id
and pjsn_rep.district_code = nvl(pjsn_act.report_district_code,pjsn_act.district_code)) pjsn_v,
hr_organization_information hoi,
hr_organization_information hoiw';
c_data_arch_select_clause varchar2(32767)
:= 'select
paa.assignment_action_id mag_assignment_action_id,
pjia.assignment_action_id,
pjia.assignment_id,
pjia.action_sequence,
pjia.effective_date,
pjia.date_earned,
pjip.itax_organization_id,
pjia.itax_category,
pjia.itax_yea_category,
null dpnt_ref_type,
null dpnt_effective_date,
pjia.person_id,
pjip.sex,
pjip.date_of_birth,
pjip.leaving_reason,
pjip.last_name_kanji last_name,
pjip.last_name_kana,
pjip.first_name_kanji first_name,
pjip.first_name_kana,
pjia.employment_category,
nvl(pjsn_v.rep_district_code,pjip.district_code)||per_jp_validations.district_code_check_digit(nvl(pjsn_v.rep_district_code,pjip.district_code)) district_code,
pjip.address_kanji address,
pjip.address_kana address_kana,
decode(pjip.country,''JP'',''0'',''1'') address_jp,
pjip.last_name_kanji||'' ''||pjip.first_name_kanji full_name,
pjip.actual_termination_date,
pjip.date_start,
pjip.last_name_kana||'' ''||pjip.first_name_kana full_name_kana,
pjip.employee_number,
pjsn_v.rep_swot_number swot_number,
nvl(pjsn_v.rep_output_file_name,
pay_jp_spr_efile_pkg.default_file_name(nvl(pjsn_v.rep_district_code,pjip.district_code)||
per_jp_validations.district_code_check_digit(nvl(pjsn_v.rep_district_code,pjip.district_code)))) output_file_name,
pjia.employer_address itax_org_address,
null itax_org_address_kana,
pjia.employer_name itax_org_name,
null itax_org_name_kana,
pjia.employer_telephone_number itax_org_phone,
pjia.reference_number1 itax_org_serial1,
pjia.reference_number2 itax_org_serial2,
fnd_number.canonical_to_number(pjit.taxable_income) taxable_income,
fnd_number.canonical_to_number(pjit.net_taxable_income) net_taxable_income,
fnd_number.canonical_to_number(pjit.total_income_exempt) total_income_exempt,
fnd_number.canonical_to_number(pjit.withholding_itax) withholding_itax,
fnd_number.canonical_to_number(pjit.spouse_special_exempt) spouse_special_exempt,
fnd_number.canonical_to_number(pjit.social_insurance_premium) social_insurance_premium,
fnd_number.canonical_to_number(pjit.mutual_aid_premium) mutual_aid_premium,
fnd_number.canonical_to_number(pjit.life_insurance_premium_exempt) life_insurance_premium_exempt,
fnd_number.canonical_to_number(pjit.damage_insurance_premium_exem) damage_insurance_premium_exem,
fnd_number.canonical_to_number(pjit.housing_tax_reduction) housing_tax_reduction,
fnd_number.canonical_to_number(pjit.private_pension_premium) private_pension_premium,
fnd_number.canonical_to_number(pjit.spouse_net_taxable_income) spouse_net_taxable_income,
fnd_number.canonical_to_number(pjit.long_damage_insurance_premium) long_damage_insurance_premium,
fnd_number.canonical_to_number(pjit.disaster_tax_reduction) disaster_tax_reduction,
pjio.dependent_spouse_exists_kou,
pjio.dependent_spouse_no_exist_kou,
pjio.dependent_spouse_exists_otsu,
pjio.dependent_spouse_no_exist_otsu,
pjio.aged_spouse_exists,
fnd_number.canonical_to_number(pjio.num_specifieds_kou) num_specifieds_kou,
fnd_number.canonical_to_number(pjio.num_specifieds_otsu) num_specifieds_otsu,
fnd_number.canonical_to_number(pjio.num_aged_parents_partial) num_aged_parents_partial,
fnd_number.canonical_to_number(pjio.num_ageds_kou) num_ageds_kou,
fnd_number.canonical_to_number(pjio.num_ageds_otsu) num_ageds_otsu,
fnd_number.canonical_to_number(pjio.num_dependents_kou) num_dependents_kou,
fnd_number.canonical_to_number(pjio.num_dependents_otsu) num_dependents_otsu,
fnd_number.canonical_to_number(pjio.num_special_disableds_partial) num_special_disableds_partial,
fnd_number.canonical_to_number(pjio.num_special_disableds) num_special_disableds,
fnd_number.canonical_to_number(pjio.num_disableds) num_disableds,
pjio.husband_exists,
pjio.minor,
pjio.otsu,
pjio.special_disabled,
pjio.disabled,
pjio.aged,
pjio.widow,
pjio.special_widow,
pjio.widower,
pjio.working_student,
pjio.deceased_termination,
pjio.disastered,
pjio.foreigner,
pjit.prev_job_employer_name_kanji prev_job_employer_name,
pjit.prev_job_employer_name_kana,
pjit.prev_job_employer_add_kanji prev_job_employer_add,
pjit.prev_job_employer_add_kana,
pjit.prev_job_foreign_address,
fnd_number.canonical_to_number(pjit.prev_job_taxable_income) prev_job_taxable_income,
fnd_number.canonical_to_number(pjit.prev_job_itax) prev_job_itax,
fnd_number.canonical_to_number(pjit.prev_job_si_prem) prev_job_si_prem,
null prev_job_termination_date,
fnd_number.canonical_to_number(pjit.prev_job_termination_year) prev_job_termination_year,
fnd_number.canonical_to_number(pjit.prev_job_termination_month) prev_job_termination_month,
fnd_number.canonical_to_number(pjit.prev_job_termination_day) prev_job_termination_day,
null hld_residence_date_1_date,
fnd_number.canonical_to_number(pjit.housing_residence_year) hld_residence_date_1_year,
fnd_number.canonical_to_number(pjit.housing_residence_month) hld_residence_date_1_month,
fnd_number.canonical_to_number(pjit.housing_residence_day) hld_residence_date_1_day,
null hld_loan_count,
null hld_payable_loan,
null hld_loan_type_1,
null hld_loan_balance_1,
null hld_residence_date_2_date,
null hld_residence_date_2_year,
null hld_residence_date_2_month,
null hld_residence_date_2_day,
null hld_loan_type_2,
null hld_loan_balance_2,
null original_description,
null original_description_kana,
pjio2.wtm_system_desc_kanji wtm_system_desc,
pjio2.wtm_system_desc_kana,
pjio2.wtm_user_desc_kanji wtm_user_desc,
pjio2.wtm_user_desc_kana,
null num_junior_deps,
null new_life_ins_prem,
null old_life_ins_prem,
null new_care_med_prem,
null new_pens_ins_prem';
(select pjsn_act.organization_id,
pjsn_act.district_code act_district_code,
substrb(nvl(pjsn_act.report_district_code,pjsn_act.district_code),1,5) rep_district_code,
pjsn_rep.swot_number rep_swot_number,
pjsn_rep.output_file_name rep_output_file_name,
pjsn_rep.efile_exclusive_flag rep_efile_exclusive_flag
from pay_jp_swot_numbers pjsn_rep,
pay_jp_swot_numbers pjsn_act
where pjsn_rep.organization_id = pjsn_act.organization_id
and pjsn_rep.district_code = nvl(pjsn_act.report_district_code,pjsn_act.district_code)) pjsn_v';
c_data_arch_select_clause_2009 varchar2(32767)
:= 'select
paa.assignment_action_id mag_assignment_action_id,
pjia.assignment_action_id,
pjia.assignment_id,
pjia.action_sequence,
pjia.effective_date,
pjia.date_earned,
pjip.itax_organization_id,
pjia.itax_category,
pjia.itax_yea_category,
null dpnt_ref_type,
null dpnt_effective_date,
pjia.person_id,
pjip.sex,
pjip.date_of_birth,
pjip.leaving_reason,
pjip.last_name_kanji last_name,
pjip.last_name_kana,
pjip.first_name_kanji first_name,
pjip.first_name_kana,
pjia.employment_category,
nvl(pjsn_v.rep_district_code,pjip.district_code)||per_jp_validations.district_code_check_digit(nvl(pjsn_v.rep_district_code,pjip.district_code)) district_code,
pjip.address_kanji address,
pjip.address_kana address_kana,
decode(pjip.country,''JP'',''0'',''1'') address_jp,
pjip.last_name_kanji||'' ''||pjip.first_name_kanji full_name,
pjip.actual_termination_date,
pjip.date_start,
pjip.last_name_kana||'' ''||pjip.first_name_kana full_name_kana,
pjip.employee_number,
pjsn_v.rep_swot_number swot_number,
nvl(pjsn_v.rep_output_file_name,
pay_jp_spr_efile_pkg.default_file_name(nvl(pjsn_v.rep_district_code,pjip.district_code)||
per_jp_validations.district_code_check_digit(nvl(pjsn_v.rep_district_code,pjip.district_code)))) output_file_name,
pjia.employer_address itax_org_address,
null itax_org_address_kana,
pjia.employer_name itax_org_name,
null itax_org_name_kana,
pjia.employer_telephone_number itax_org_phone,
pjia.reference_number1 itax_org_serial1,
pjia.reference_number2 itax_org_serial2,
fnd_number.canonical_to_number(pjit.taxable_income) taxable_income,
fnd_number.canonical_to_number(pjit.net_taxable_income) net_taxable_income,
fnd_number.canonical_to_number(pjit.total_income_exempt) total_income_exempt,
fnd_number.canonical_to_number(pjit.withholding_itax) withholding_itax,
fnd_number.canonical_to_number(pjit.spouse_special_exempt) spouse_special_exempt,
fnd_number.canonical_to_number(pjit.social_insurance_premium) social_insurance_premium,
fnd_number.canonical_to_number(pjit.mutual_aid_premium) mutual_aid_premium,
fnd_number.canonical_to_number(pjit.life_insurance_premium_exempt) life_insurance_premium_exempt,
fnd_number.canonical_to_number(pjit.damage_insurance_premium_exem) damage_insurance_premium_exem,
fnd_number.canonical_to_number(pjit.housing_tax_reduction) housing_tax_reduction,
fnd_number.canonical_to_number(pjit.private_pension_premium) private_pension_premium,
fnd_number.canonical_to_number(pjit.spouse_net_taxable_income) spouse_net_taxable_income,
fnd_number.canonical_to_number(pjit.long_damage_insurance_premium) long_damage_insurance_premium,
fnd_number.canonical_to_number(pjit.disaster_tax_reduction) disaster_tax_reduction,
pjio.dependent_spouse_exists_kou,
pjio.dependent_spouse_no_exist_kou,
pjio.dependent_spouse_exists_otsu,
pjio.dependent_spouse_no_exist_otsu,
pjio.aged_spouse_exists,
fnd_number.canonical_to_number(pjio.num_specifieds_kou) num_specifieds_kou,
fnd_number.canonical_to_number(pjio.num_specifieds_otsu) num_specifieds_otsu,
fnd_number.canonical_to_number(pjio.num_aged_parents_partial) num_aged_parents_partial,
fnd_number.canonical_to_number(pjio.num_ageds_kou) num_ageds_kou,
fnd_number.canonical_to_number(pjio.num_ageds_otsu) num_ageds_otsu,
fnd_number.canonical_to_number(pjio.num_dependents_kou) num_dependents_kou,
fnd_number.canonical_to_number(pjio.num_dependents_otsu) num_dependents_otsu,
fnd_number.canonical_to_number(pjio.num_special_disableds_partial) num_special_disableds_partial,
fnd_number.canonical_to_number(pjio.num_special_disableds) num_special_disableds,
fnd_number.canonical_to_number(pjio.num_disableds) num_disableds,
pjio.husband_exists,
pjio.minor,
pjio.otsu,
pjio.special_disabled,
pjio.disabled,
pjio.aged,
pjio.widow,
pjio.special_widow,
pjio.widower,
pjio.working_student,
pjio.deceased_termination,
pjio.disastered,
pjio.foreigner,
pjit.prev_job_employer_name_kanji prev_job_employer_name,
pjit.prev_job_employer_name_kana,
pjit.prev_job_employer_add_kanji prev_job_employer_add,
pjit.prev_job_employer_add_kana,
pjit.prev_job_foreign_address,
fnd_number.canonical_to_number(pjit.prev_job_taxable_income) prev_job_taxable_income,
fnd_number.canonical_to_number(pjit.prev_job_itax) prev_job_itax,
fnd_number.canonical_to_number(pjit.prev_job_si_prem) prev_job_si_prem,
null prev_job_termination_date,
fnd_number.canonical_to_number(pjit.prev_job_termination_year) prev_job_termination_year,
fnd_number.canonical_to_number(pjit.prev_job_termination_month) prev_job_termination_month,
fnd_number.canonical_to_number(pjit.prev_job_termination_day) prev_job_termination_day,
pjih.residence_date_1 hld_residence_date_1_date,
null hld_residence_date_1_year,
null hld_residence_date_1_month,
null hld_residence_date_1_day,
pjih.loan_count hld_loan_count,
pjih.payable_loan hld_payable_loan,
pjih.loan_type_1 hld_loan_type_1,
pjih.loan_balance_1 hld_loan_balance_1,
pjih.residence_date_2 hld_residence_date_2_date,
null hld_residence_date_2_year,
null hld_residence_date_2_month,
null hld_residence_date_2_day,
pjih.loan_type_2 hld_loan_type_2,
pjih.loan_balance_2 hld_loan_balance_2,
null original_description,
null original_description_kana,
pjio2.wtm_system_desc_kanji wtm_system_desc,
pjio2.wtm_system_desc_kana,
pjio2.wtm_user_desc_kanji wtm_user_desc,
pjio2.wtm_user_desc_kana,
null num_junior_deps,
null new_life_ins_prem,
null old_life_ins_prem,
null new_care_med_prem,
null new_pens_ins_prem';
(select pjsn_act.organization_id,
pjsn_act.district_code act_district_code,
substrb(nvl(pjsn_act.report_district_code,pjsn_act.district_code),1,5) rep_district_code,
pjsn_rep.swot_number rep_swot_number,
pjsn_rep.output_file_name rep_output_file_name,
pjsn_rep.efile_exclusive_flag rep_efile_exclusive_flag
from pay_jp_swot_numbers pjsn_rep,
pay_jp_swot_numbers pjsn_act
where pjsn_rep.organization_id = pjsn_act.organization_id
and pjsn_rep.district_code = nvl(pjsn_act.report_district_code,pjsn_act.district_code)) pjsn_v';
c_data_arch_select_clause_2011 varchar2(32767)
:= 'select
paa.assignment_action_id mag_assignment_action_id,
pjia.assignment_action_id,
pjia.assignment_id,
pjia.action_sequence,
pjia.effective_date,
pjia.date_earned,
pjip.itax_organization_id,
pjia.itax_category,
pjia.itax_yea_category,
null dpnt_ref_type,
null dpnt_effective_date,
pjia.person_id,
pjip.sex,
pjip.date_of_birth,
pjip.leaving_reason,
pjip.last_name_kanji last_name,
pjip.last_name_kana,
pjip.first_name_kanji first_name,
pjip.first_name_kana,
pjia.employment_category,
nvl(pjsn_v.rep_district_code,pjip.district_code)||per_jp_validations.district_code_check_digit(nvl(pjsn_v.rep_district_code,pjip.district_code)) district_code,
pjip.address_kanji address,
pjip.address_kana address_kana,
decode(pjip.country,''JP'',''0'',''1'') address_jp,
pjip.last_name_kanji||'' ''||pjip.first_name_kanji full_name,
pjip.actual_termination_date,
pjip.date_start,
pjip.last_name_kana||'' ''||pjip.first_name_kana full_name_kana,
pjip.employee_number,
pjsn_v.rep_swot_number swot_number,
nvl(pjsn_v.rep_output_file_name,
pay_jp_spr_efile_pkg.default_file_name(nvl(pjsn_v.rep_district_code,pjip.district_code)||
per_jp_validations.district_code_check_digit(nvl(pjsn_v.rep_district_code,pjip.district_code)))) output_file_name,
pjia.employer_address itax_org_address,
null itax_org_address_kana,
pjia.employer_name itax_org_name,
null itax_org_name_kana,
pjia.employer_telephone_number itax_org_phone,
pjia.reference_number1 itax_org_serial1,
pjia.reference_number2 itax_org_serial2,
fnd_number.canonical_to_number(pjit.taxable_income) taxable_income,
fnd_number.canonical_to_number(pjit.net_taxable_income) net_taxable_income,
fnd_number.canonical_to_number(pjit.total_income_exempt) total_income_exempt,
fnd_number.canonical_to_number(pjit.withholding_itax) withholding_itax,
fnd_number.canonical_to_number(pjit.spouse_special_exempt) spouse_special_exempt,
fnd_number.canonical_to_number(pjit.social_insurance_premium) social_insurance_premium,
fnd_number.canonical_to_number(pjit.mutual_aid_premium) mutual_aid_premium,
fnd_number.canonical_to_number(pjit.life_insurance_premium_exempt) life_insurance_premium_exempt,
fnd_number.canonical_to_number(pjit.damage_insurance_premium_exem) damage_insurance_premium_exem,
fnd_number.canonical_to_number(pjit.housing_tax_reduction) housing_tax_reduction,
fnd_number.canonical_to_number(pjit.private_pension_premium) private_pension_premium,
fnd_number.canonical_to_number(pjit.spouse_net_taxable_income) spouse_net_taxable_income,
fnd_number.canonical_to_number(pjit.long_damage_insurance_premium) long_damage_insurance_premium,
fnd_number.canonical_to_number(pjit.disaster_tax_reduction) disaster_tax_reduction,
pjio.dependent_spouse_exists_kou,
pjio.dependent_spouse_no_exist_kou,
pjio.dependent_spouse_exists_otsu,
pjio.dependent_spouse_no_exist_otsu,
pjio.aged_spouse_exists,
fnd_number.canonical_to_number(pjio.num_specifieds_kou) num_specifieds_kou,
fnd_number.canonical_to_number(pjio.num_specifieds_otsu) num_specifieds_otsu,
fnd_number.canonical_to_number(pjio.num_aged_parents_partial) num_aged_parents_partial,
fnd_number.canonical_to_number(pjio.num_ageds_kou) num_ageds_kou,
fnd_number.canonical_to_number(pjio.num_ageds_otsu) num_ageds_otsu,
fnd_number.canonical_to_number(pjio.num_dependents_kou) num_dependents_kou,
fnd_number.canonical_to_number(pjio.num_dependents_otsu) num_dependents_otsu,
fnd_number.canonical_to_number(pjio.num_special_disableds_partial) num_special_disableds_partial,
fnd_number.canonical_to_number(pjio.num_special_disableds) num_special_disableds,
fnd_number.canonical_to_number(pjio.num_disableds) num_disableds,
pjio.husband_exists,
pjio.minor,
pjio.otsu,
pjio.special_disabled,
pjio.disabled,
pjio.aged,
pjio.widow,
pjio.special_widow,
pjio.widower,
pjio.working_student,
pjio.deceased_termination,
pjio.disastered,
pjio.foreigner,
pjit.prev_job_employer_name_kanji prev_job_employer_name,
pjit.prev_job_employer_name_kana,
pjit.prev_job_employer_add_kanji prev_job_employer_add,
pjit.prev_job_employer_add_kana,
pjit.prev_job_foreign_address,
fnd_number.canonical_to_number(pjit.prev_job_taxable_income) prev_job_taxable_income,
fnd_number.canonical_to_number(pjit.prev_job_itax) prev_job_itax,
fnd_number.canonical_to_number(pjit.prev_job_si_prem) prev_job_si_prem,
null prev_job_termination_date,
fnd_number.canonical_to_number(pjit.prev_job_termination_year) prev_job_termination_year,
fnd_number.canonical_to_number(pjit.prev_job_termination_month) prev_job_termination_month,
fnd_number.canonical_to_number(pjit.prev_job_termination_day) prev_job_termination_day,
pjih.residence_date_1 hld_residence_date_1_date,
null hld_residence_date_1_year,
null hld_residence_date_1_month,
null hld_residence_date_1_day,
pjih.loan_count hld_loan_count,
pjih.payable_loan hld_payable_loan,
pjih.loan_type_1 hld_loan_type_1,
pjih.loan_balance_1 hld_loan_balance_1,
pjih.residence_date_2 hld_residence_date_2_date,
null hld_residence_date_2_year,
null hld_residence_date_2_month,
null hld_residence_date_2_day,
pjih.loan_type_2 hld_loan_type_2,
pjih.loan_balance_2 hld_loan_balance_2,
null original_description,
null original_description_kana,
pjio2.wtm_system_desc_kanji wtm_system_desc,
pjio2.wtm_system_desc_kana,
pjio2.wtm_user_desc_kanji wtm_user_desc,
pjio2.wtm_user_desc_kana,
fnd_number.canonical_to_number(pjid.num_junior_deps) num_junior_deps,
null new_life_ins_prem,
null old_life_ins_prem,
null new_care_med_prem,
null new_pens_ins_prem';
(select pjsn_act.organization_id,
pjsn_act.district_code act_district_code,
substrb(nvl(pjsn_act.report_district_code,pjsn_act.district_code),1,5) rep_district_code,
pjsn_rep.swot_number rep_swot_number,
pjsn_rep.output_file_name rep_output_file_name,
pjsn_rep.efile_exclusive_flag rep_efile_exclusive_flag
from pay_jp_swot_numbers pjsn_rep,
pay_jp_swot_numbers pjsn_act
where pjsn_rep.organization_id = pjsn_act.organization_id
and pjsn_rep.district_code = nvl(pjsn_act.report_district_code,pjsn_act.district_code)) pjsn_v';
c_data_arch_select_clause_2012 varchar2(32767)
:= 'select
paa.assignment_action_id mag_assignment_action_id,
pjia.assignment_action_id,
pjia.assignment_id,
pjia.action_sequence,
pjia.effective_date,
pjia.date_earned,
pjip.itax_organization_id,
pjia.itax_category,
pjia.itax_yea_category,
null dpnt_ref_type,
null dpnt_effective_date,
pjia.person_id,
pjip.sex,
pjip.date_of_birth,
pjip.leaving_reason,
pjip.last_name_kanji last_name,
pjip.last_name_kana,
pjip.first_name_kanji first_name,
pjip.first_name_kana,
pjia.employment_category,
nvl(pjsn_v.rep_district_code,pjip.district_code)||per_jp_validations.district_code_check_digit(nvl(pjsn_v.rep_district_code,pjip.district_code)) district_code,
pjip.address_kanji address,
pjip.address_kana address_kana,
decode(pjip.country,''JP'',''0'',''1'') address_jp,
pjip.last_name_kanji||'' ''||pjip.first_name_kanji full_name,
pjip.actual_termination_date,
pjip.date_start,
pjip.last_name_kana||'' ''||pjip.first_name_kana full_name_kana,
pjip.employee_number,
pjsn_v.rep_swot_number swot_number,
nvl(pjsn_v.rep_output_file_name,
pay_jp_spr_efile_pkg.default_file_name(nvl(pjsn_v.rep_district_code,pjip.district_code)||
per_jp_validations.district_code_check_digit(nvl(pjsn_v.rep_district_code,pjip.district_code)))) output_file_name,
pjia.employer_address itax_org_address,
null itax_org_address_kana,
pjia.employer_name itax_org_name,
null itax_org_name_kana,
pjia.employer_telephone_number itax_org_phone,
pjia.reference_number1 itax_org_serial1,
pjia.reference_number2 itax_org_serial2,
fnd_number.canonical_to_number(pjit.taxable_income) taxable_income,
fnd_number.canonical_to_number(pjit.net_taxable_income) net_taxable_income,
fnd_number.canonical_to_number(pjit.total_income_exempt) total_income_exempt,
fnd_number.canonical_to_number(pjit.withholding_itax) withholding_itax,
fnd_number.canonical_to_number(pjit.spouse_special_exempt) spouse_special_exempt,
fnd_number.canonical_to_number(pjit.social_insurance_premium) social_insurance_premium,
fnd_number.canonical_to_number(pjit.mutual_aid_premium) mutual_aid_premium,
fnd_number.canonical_to_number(pjit.life_insurance_premium_exempt) life_insurance_premium_exempt,
fnd_number.canonical_to_number(pjit.damage_insurance_premium_exem) damage_insurance_premium_exem,
fnd_number.canonical_to_number(pjit.housing_tax_reduction) housing_tax_reduction,
fnd_number.canonical_to_number(pjit.private_pension_premium) private_pension_premium,
fnd_number.canonical_to_number(pjit.spouse_net_taxable_income) spouse_net_taxable_income,
fnd_number.canonical_to_number(pjit.long_damage_insurance_premium) long_damage_insurance_premium,
fnd_number.canonical_to_number(pjit.disaster_tax_reduction) disaster_tax_reduction,
pjio.dependent_spouse_exists_kou,
pjio.dependent_spouse_no_exist_kou,
pjio.dependent_spouse_exists_otsu,
pjio.dependent_spouse_no_exist_otsu,
pjio.aged_spouse_exists,
fnd_number.canonical_to_number(pjio.num_specifieds_kou) num_specifieds_kou,
fnd_number.canonical_to_number(pjio.num_specifieds_otsu) num_specifieds_otsu,
fnd_number.canonical_to_number(pjio.num_aged_parents_partial) num_aged_parents_partial,
fnd_number.canonical_to_number(pjio.num_ageds_kou) num_ageds_kou,
fnd_number.canonical_to_number(pjio.num_ageds_otsu) num_ageds_otsu,
fnd_number.canonical_to_number(pjio.num_dependents_kou) num_dependents_kou,
fnd_number.canonical_to_number(pjio.num_dependents_otsu) num_dependents_otsu,
fnd_number.canonical_to_number(pjio.num_special_disableds_partial) num_special_disableds_partial,
fnd_number.canonical_to_number(pjio.num_special_disableds) num_special_disableds,
fnd_number.canonical_to_number(pjio.num_disableds) num_disableds,
pjio.husband_exists,
pjio.minor,
pjio.otsu,
pjio.special_disabled,
pjio.disabled,
pjio.aged,
pjio.widow,
pjio.special_widow,
pjio.widower,
pjio.working_student,
pjio.deceased_termination,
pjio.disastered,
pjio.foreigner,
pjit.prev_job_employer_name_kanji prev_job_employer_name,
pjit.prev_job_employer_name_kana,
pjit.prev_job_employer_add_kanji prev_job_employer_add,
pjit.prev_job_employer_add_kana,
pjit.prev_job_foreign_address,
fnd_number.canonical_to_number(pjit.prev_job_taxable_income) prev_job_taxable_income,
fnd_number.canonical_to_number(pjit.prev_job_itax) prev_job_itax,
fnd_number.canonical_to_number(pjit.prev_job_si_prem) prev_job_si_prem,
null prev_job_termination_date,
fnd_number.canonical_to_number(pjit.prev_job_termination_year) prev_job_termination_year,
fnd_number.canonical_to_number(pjit.prev_job_termination_month) prev_job_termination_month,
fnd_number.canonical_to_number(pjit.prev_job_termination_day) prev_job_termination_day,
pjih.residence_date_1 hld_residence_date_1_date,
null hld_residence_date_1_year,
null hld_residence_date_1_month,
null hld_residence_date_1_day,
pjih.loan_count hld_loan_count,
pjih.payable_loan hld_payable_loan,
pjih.loan_type_1 hld_loan_type_1,
pjih.loan_balance_1 hld_loan_balance_1,
pjih.residence_date_2 hld_residence_date_2_date,
null hld_residence_date_2_year,
null hld_residence_date_2_month,
null hld_residence_date_2_day,
pjih.loan_type_2 hld_loan_type_2,
pjih.loan_balance_2 hld_loan_balance_2,
null original_description,
null original_description_kana,
pjio2.wtm_system_desc_kanji wtm_system_desc,
pjio2.wtm_system_desc_kana,
pjio2.wtm_user_desc_kanji wtm_user_desc,
pjio2.wtm_user_desc_kana,
fnd_number.canonical_to_number(pjid.num_junior_deps) num_junior_deps,
fnd_number.canonical_to_number(tax1.new_life_ins_prem) new_life_ins_prem,
fnd_number.canonical_to_number(tax1.old_life_ins_prem) old_life_ins_prem,
fnd_number.canonical_to_number(tax1.care_med_ins_prem) new_care_med_prem,
fnd_number.canonical_to_number(tax1.new_pen_ins_prem) new_pens_ins_prem';
(select pjsn_act.organization_id,
pjsn_act.district_code act_district_code,
substrb(nvl(pjsn_act.report_district_code,pjsn_act.district_code),1,5) rep_district_code,
pjsn_rep.swot_number rep_swot_number,
pjsn_rep.output_file_name rep_output_file_name,
pjsn_rep.efile_exclusive_flag rep_efile_exclusive_flag
from pay_jp_swot_numbers pjsn_rep,
pay_jp_swot_numbers pjsn_act
where pjsn_rep.organization_id = pjsn_act.organization_id
and pjsn_rep.district_code = nvl(pjsn_act.report_district_code,pjsn_act.district_code)) pjsn_v';
select parameter_value
from pay_action_parameters
where parameter_name = 'JP_DEBUG_PAYJPSPE';
select ppa.business_group_id,
ppa.effective_date,
ppa.legislative_parameters,
pbg.legislation_code,
ppa.request_id
from pay_payroll_actions ppa,
per_business_groups_perf pbg
where ppa.payroll_action_id = p_payroll_action_id
and pbg.business_group_id = ppa.business_group_id;
select 'Y'
from dual
where not exists(
select null
from hr_organization_information hoi,
hr_all_organization_units hou
where hoi.org_information_context = 'CLASS'
and hoi.org_information1 = 'JP_TAX_SWOT'
and hoi.organization_id = nvl(g_organization_id,hoi.organization_id)
and hou.organization_id = hoi.organization_id
and hou.business_group_id + 0 = g_business_group_id
and hou.date_from <= g_effective_eoy
and nvl(hou.date_to,hr_api.g_eot) >= g_effective_soy
and not exists(
select null
from pay_payroll_actions ppa,
pay_jp_itax_pact_v2 pjip
where ppa.business_group_id + 0 = g_business_group_id
and ppa.effective_date
between g_effective_soy and g_effective_eoy
and ppa.action_type = 'X'
and ppa.report_type = 'JPTW'
and ppa.report_qualifier = 'JP'
and ppa.report_category = 'ARCHIVE'
and pjip.action_context_id = ppa.payroll_action_id
and nvl(pjip.itax_organization_id,hou.organization_id) = hou.organization_id
and pjip.effective_date
between g_effective_soy and g_effective_eoy
and exists(
select null
from pay_assignment_actions paa,
pay_jp_itax_person_v2 pjips
where paa.payroll_action_id = ppa.payroll_action_id
and pjips.action_context_id = paa.assignment_action_id
and pjips.itax_organization_id = hoi.organization_id
and (to_number(to_char(pjip.effective_date,'YYYY')) < 2009
or (to_number(to_char(pjip.effective_date,'YYYY')) >= 2009
and to_number(to_char(pjip.effective_date,'YYYY')) < 2011
and exists(
select null
from pay_jp_itax_housing_v pjih
where pjih.action_context_id = pjips.action_context_id
and pjih.effective_date = pjips.effective_date))
or (to_number(to_char(pjip.effective_date,'YYYY')) >= 2011 and to_number(to_char(pjip.effective_date,'YYYY')) < 2012
and exists(
select null
from pay_jp_itax_housing_v pjih
where pjih.action_context_id = pjips.action_context_id
and pjih.effective_date = pjips.effective_date)
and exists(
select null
from pay_jp_itax_dep_v pjid
where pjid.action_context_id = pjips.action_context_id
and pjid.effective_date = pjips.effective_date))
or (to_number(to_char(pjip.effective_date,'YYYY')) >= 2012
and exists(
select null
from pay_jp_itax_housing_v pjih
where pjih.action_context_id = pjips.action_context_id
and pjih.effective_date = pjips.effective_date)
and exists(
select null
from pay_jp_itax_dep_v pjid
where pjid.action_context_id = pjips.action_context_id
and pjid.effective_date = pjips.effective_date))
))));
select nvl(hoi.org_information2,'CTR_EE')
from /* Business Group details */
hr_organization_information hoi
where hoi.organization_id = g_business_group_id
and hoi.org_information_context = 'JP_BUSINESS_GROUP_INFO';
select fcp.plsql_dir
from fnd_concurrent_requests fcr,
fnd_concurrent_processes fcp
where fcr.request_id = g_request_id
and fcp.concurrent_process_id = fcr.controlling_manager;
'select /*+ ORDERED
INDEX(PPOS PER_PERIODS_OF_SERVICE_N3) */
distinct ppos.person_id
from pay_payroll_actions ppa,
per_all_people_f pp,
per_periods_of_service ppos
where ppa.payroll_action_id = :payroll_action_id
and pp.business_group_id = ppa.business_group_id + 0
and ppos.person_id = pp.person_id
and ppos.business_group_id + 0 = pp.business_group_id
and ppos.date_start <= fnd_date.canonical_to_date(''i_effective_eoy'')
and nvl(ppos.final_process_date,fnd_date.canonical_to_date(''i_effective_soy'')) >= fnd_date.canonical_to_date(''i_effective_soy'')
order by
ppos.person_id';
l_select_clause varchar2(32767);
l_hasa_select_clause varchar2(32767);
g_per_ind_tbl.delete;
g_ass_ind_tbl.delete;
g_ass_tbl.delete;
pay_jp_report_pkg.append_select_clause(c_proc_arch_select_clause,l_select_clause);
l_hasa_select_clause := c_proc_arch_hasa_select_clause;
pay_jp_report_pkg.append_select_clause(c_proc_ass_select_clause,l_select_clause);
l_hasa_select_clause := c_proc_ass_hasa_select_clause;
pay_jp_report_pkg.append_select_clause(l_hasa_select_clause,l_select_clause);
pay_jp_report_pkg.append_select_clause(', null include_or_exclude',l_select_clause);
l_select_clause := replace(l_select_clause,'i_valid_term_taxable_amt',to_char(pay_jp_wic_pkg.g_valid_term_taxable_amt));
pay_jp_report_pkg.show_debug(l_select_clause);
l_select_clause||
l_from_clause||
l_where_clause||
l_order_by_clause
bulk collect into g_ass_tbl;
l_ass_id_tbl.delete;
select pay_assignment_actions_s.nextval
into l_spr_assignment_action_id
from dual;
l_select_clause varchar2(32767);
select hoi.org_information2 itax_org_name_kana,
hoi.org_information9||hoi.org_information10||hoi.org_information11 itax_org_address_kana
from hr_organization_information hoi
where hoi.organization_id = p_itax_organization_id
and hoi.org_information_context = 'JP_TAX_SWOT_INFO';
g_per_ind_tbl.delete;
g_ass_ind_tbl.delete;
g_ass_tbl.delete;
g_assact_tbl.delete;
g_body_tbl.delete;
g_file_tbl.delete;
g_summary_tbl.delete;
pay_jp_report_pkg.append_select_clause(c_data_arch_select_clause,l_select_clause);
pay_jp_report_pkg.append_select_clause(c_data_arch_select_clause_2009,l_select_clause);
pay_jp_report_pkg.append_select_clause(c_data_arch_select_clause_2011,l_select_clause);
pay_jp_report_pkg.append_select_clause(c_data_arch_select_clause_2012,l_select_clause);
pay_jp_report_pkg.append_select_clause(c_data_ass_select_clause,l_select_clause);
pay_jp_report_pkg.show_debug(l_select_clause);
l_select_clause||
l_from_clause||
l_where_clause||
l_order_by_clause
bulk collect into l_data_tbl
using p_payroll_action_id;
select per.employee_number,
nvl(adrr.address_id, adrc.address_id) address_id,
rtrim(substrb(decode(adrr.address_id, null,
adrc.region_1 || adrc.region_2 || adrc.region_3,
adrr.region_1 || adrr.region_2 || adrr.region_3), 1, 240)) address_kana,
rtrim(substrb(decode(adrr.address_id, null,
adrc.address_line1 || adrc.address_line2 || adrc.address_line3,
adrr.address_line1 || adrr.address_line2 || adrr.address_line3), 1, 240)) address_kanji,
decode(adrr.address_id, null, adrc.country, adrr.country) country,
decode(adrr.address_id, null, adrc.town_or_city, adrr.town_or_city) district_code,
asg.organization_id
from per_all_assignments_f asg,
per_all_people_f per,
per_addresses adrr,
per_addresses adrc
where asg.assignment_id = cp_assignment_id
and cp_effective_date
between asg.effective_start_date and asg.effective_end_date
and per.person_id = asg.person_id
and cp_effective_date
between per.effective_start_date and per.effective_end_date
and adrr.person_id(+) = per.person_id
and adrr.address_type(+) = 'JP_R'
and cp_adr_effective_date
between adrr.date_from(+) and nvl(adrr.date_to(+), cp_adr_effective_date)
and adrc.person_id(+) = per.person_id
and adrc.address_type(+) = 'JP_C'
and cp_adr_effective_date
between adrc.date_from(+) and nvl(adrc.date_to(+), cp_adr_effective_date);
select per.employee_number,
nvl(adrr.address_id, adrc.address_id) address_id,
rtrim(substrb(decode(adrr.address_id, null,
adrc.region_1 || adrc.region_2 || adrc.region_3,
adrr.region_1 || adrr.region_2 || adrr.region_3), 1, 240)) address_kana,
rtrim(substrb(decode(adrr.address_id, null,
adrc.address_line1 || adrc.address_line2 || adrc.address_line3,
adrr.address_line1 || adrr.address_line2 || adrr.address_line3), 1, 240)) address_kanji,
decode(adrr.address_id, null, adrc.country, adrr.country) country,
decode(adrr.address_id, null, adrc.town_or_city, adrr.town_or_city) district_code,
asg.organization_id
from per_all_assignments_f asg,
per_all_people_f per,
per_addresses adrr,
per_addresses adrc
where asg.assignment_id = cp_assignment_id
and cp_effective_date
between asg.effective_start_date and asg.effective_end_date
and per.person_id = asg.person_id
and cp_effective_date
between per.effective_start_date and per.effective_end_date
and adrr.person_id(+) = per.person_id
and adrr.address_type(+) = 'JP_R'
and cp_adr_effective_date
between adrr.date_from(+) and nvl(adrr.date_to(+), cp_adr_effective_date)
and adrc.person_id(+) = per.person_id
and adrc.address_type(+) = 'JP_C'
and cp_adr_effective_date
between adrc.date_from(+) and nvl(adrc.date_to(+), cp_adr_effective_date);
l_open_file_tbl.delete;
l_select_clause varchar2(32767);
select ppa.payroll_action_id
from pay_payroll_actions ppa
where ppa.request_id = p_request_id
and ppa.action_type = 'X'
and ppa.report_type = 'JP_SPR_EFILE'
and ppa.report_qualifier = 'JP'
and ppa.report_category = 'XML';
select fcp.plsql_dir
from fnd_concurrent_requests fcr,
fnd_concurrent_processes fcp
where fcr.request_id = p_request_id
and fcp.concurrent_process_id = fcr.controlling_manager;
pay_jp_report_pkg.delete_file(l_file_dir,p_file_name);
hr_utility.trace(p_file_name||' was deleted');
pay_jp_report_pkg.delete_file(l_file_dir,l_file_name);
hr_utility.trace(l_file_name||' was deleted');
pay_jp_report_pkg.append_select_clause(c_data_arch_select_clause,l_select_clause);
pay_jp_report_pkg.append_select_clause(c_data_ass_select_clause,l_select_clause);
pay_jp_report_pkg.show_debug(l_select_clause);
l_select_clause||
l_from_clause||
l_where_clause||
l_order_by_clause
bulk collect into l_data_tbl
using l_payroll_action_id;
pay_jp_report_pkg.delete_file(l_file_dir,l_file_name);
hr_utility.trace(to_char(i)||' : '||l_file_name||' was deleted');
hr_utility.trace('target of delete : '||to_char(i)||' : '||l_file_tbl(i).file_name);
g_per_ind_tbl.delete;
g_ass_ind_tbl.delete;
g_ass_tbl.delete;
g_assact_tbl.delete;
g_body_tbl.delete;
g_file_tbl.delete;
g_summary_tbl.delete;