504: g_archive_item t_archive_item;
505: ------------------------------------------------------------------------
506: -- Global variable for debugging
507: ------------------------------------------------------------------------
508: g_debug constant boolean := hr_utility.debug_enabled;
509: l_pay_periods_per_year constant number := 12;
510: ------------------------------------------------------------------------
511: function convert_to_rec(
512: p_user_entity_id_tbl in t_number_tbl,
2333: --
2334: begin
2335: --
2336: if g_debug then
2337: hr_utility.trace('Ora Inside procedure pledt_donation_details');
2338: end if;
2339: -- Bug 16094871
2340: if p_effective_date >= c_20120101 then
2341: for irec in csr_pledt_don_current loop
2369: close csr_pledt_details_ordby_latest;
2370: end if;
2371: end if;
2372: if g_debug then
2373: hr_utility.trace('Ora After procedure pledt_donation_details');
2374: end if;
2375: --
2376: end;
2377: ------------------------------------------------------------------------
2440: --
2441: begin
2442: --
2443: if g_debug then
2444: hr_utility.trace('Ora Inside procedure tlaw_donation_details');
2445: end if;
2446: -- Bug 16094871
2447: if p_effective_date >= c_20120101 then
2448: for irec in csr_tlaw_don_current loop
2476: close csr_tlaw_details_ordby_latest;
2477: end if;
2478: end if;
2479: if g_debug then
2480: hr_utility.trace('Ora After procedure tlaw_donation_details');
2481: end if;
2482: --
2483: end;
2484: ------------------------------------------------------------------------
2546: --
2547: begin
2548: --
2549: if g_debug then
2550: hr_utility.trace('Ora Inside procedure stat_donation_details');
2551: end if;
2552: -- Bug 16094871
2553: if p_effective_date >= c_20120101 then
2554: for irec in csr_stat_don_current loop
2582: close csr_stat_details_ordby_latest;
2583: end if;
2584: end if;
2585: if g_debug then
2586: hr_utility.trace('Ora After procedure stat_donation_details');
2587: end if;
2588: --
2589: end;
2590: ------------------------------------------------------------------------
2613: --
2614: begin
2615: --
2616: if g_debug then
2617: hr_utility.trace('Ora Inside procedure specified_donation_details');
2618: end if;
2619: open csr_spec_details;
2620: fetch csr_spec_details bulk collect into
2621: p_spec_asg_info_id_tbl,
2622: p_spec_donated_year_tbl,
2623: p_spec_amt_sub_to_exem_tbl;
2624: close csr_spec_details;
2625: if g_debug then
2626: hr_utility.trace('Ora After procedure specified_donation_details');
2627: end if;
2628: --
2629: end;
2630: ------------------------------------------------------------------------
2653: --
2654: begin
2655: --
2656: if g_debug then
2657: hr_utility.trace('Ora Inside procedure religious_donation_details');
2658: end if;
2659: open csr_rel_details;
2660: fetch csr_rel_details bulk collect into
2661: p_rel_asg_info_id_tbl,
2662: p_rel_donated_year_tbl,
2663: p_rel_amt_sub_to_exem_tbl;
2664: close csr_rel_details;
2665: if g_debug then
2666: hr_utility.trace('Ora After procedure religious_donation_details');
2667: end if;
2668: --
2669: end;
2670:
2769:
2770: begin
2771: --
2772: if g_debug then
2773: hr_utility.trace('Ora Inside procedure spec_don_details_grpby_year');
2774: end if;
2775: open csr_rel_spec_details;
2776: fetch csr_rel_spec_details bulk collect into
2777: p_spec_rel_amt_grpby_year_tbl,
2799: p_don_priority_flag := 'N';
2800: end if;
2801:
2802: if g_debug then
2803: hr_utility.trace('Ora After procedure spec_don_details_grpby_year');
2804: end if;
2805: --
2806: end;
2807:
2888: l_year number := 2012;
2889: begin
2890: --
2891: if g_debug then
2892: hr_utility.trace('Ora Inside procedure spec_rel_donation_details');
2893: hr_utility.trace('p_don_priority_flag'||p_don_priority_flag);
2894: end if;
2895: if p_effective_date < c_20120101 then
2896: if p_don_priority_flag = 'Y' then
2889: begin
2890: --
2891: if g_debug then
2892: hr_utility.trace('Ora Inside procedure spec_rel_donation_details');
2893: hr_utility.trace('p_don_priority_flag'||p_don_priority_flag);
2894: end if;
2895: if p_effective_date < c_20120101 then
2896: if p_don_priority_flag = 'Y' then
2897: open csr_spec_rel_ordby_prev_don;
2936: end loop;
2937: end if;
2938:
2939: if g_debug then
2940: hr_utility.trace('Ora After procedure spec_rel_donation_details');
2941: end if;
2942: end;
2943:
2944: ------------------------------------------------------------------------
3152:
3153: begin
3154: --
3155: if g_debug then
3156: hr_utility.trace('*** Inside SP_TAX_EXEM_INFO() ***');
3157: end if;
3158: --
3159: open csr_aei;
3160: fetch csr_aei into
3652: + nvl(l_tm_dpnt_direct_nts,0) + nvl(l_tm_dpnt_direct_oth,0);
3653: p_total_cards_amount := p_traditional_market_exp + p_credit_card_exp + p_cash_receipt_exp2005 + l_giro_tuition_paid_exp + p_direct_card_exp;
3654: p_credit_card_expense:= p_total_cards_amount - p_traditional_market_exp - p_direct_card_exp;
3655: -- Bug 14219478 End
3656: hr_utility.trace('p_traditional_market_exp = '||to_char(p_traditional_market_exp));
3657: hr_utility.trace('p_total_cards_amount = '||to_char(p_total_cards_amount));
3658: hr_utility.trace('p_credit_card_expense = '||to_char(p_credit_card_expense));
3659:
3660: end tax_exem_info;
3653: p_total_cards_amount := p_traditional_market_exp + p_credit_card_exp + p_cash_receipt_exp2005 + l_giro_tuition_paid_exp + p_direct_card_exp;
3654: p_credit_card_expense:= p_total_cards_amount - p_traditional_market_exp - p_direct_card_exp;
3655: -- Bug 14219478 End
3656: hr_utility.trace('p_traditional_market_exp = '||to_char(p_traditional_market_exp));
3657: hr_utility.trace('p_total_cards_amount = '||to_char(p_total_cards_amount));
3658: hr_utility.trace('p_credit_card_expense = '||to_char(p_credit_card_expense));
3659:
3660: end tax_exem_info;
3661: ------------------------------------------------------------------------
3654: p_credit_card_expense:= p_total_cards_amount - p_traditional_market_exp - p_direct_card_exp;
3655: -- Bug 14219478 End
3656: hr_utility.trace('p_traditional_market_exp = '||to_char(p_traditional_market_exp));
3657: hr_utility.trace('p_total_cards_amount = '||to_char(p_total_cards_amount));
3658: hr_utility.trace('p_credit_card_expense = '||to_char(p_credit_card_expense));
3659:
3660: end tax_exem_info;
3661: ------------------------------------------------------------------------
3662: procedure tax_break_info(
3972: else
3973: l_expiry_date := least(l_emp_term_date, l_fin_end_date, l_calc_end_date);
3974: end if;
3975: end if;
3976: hr_utility.trace('l_calc_end_date '||to_char(l_calc_end_date,'DD-MON-YYYY'));
3977: hr_utility.trace('l_start_date '||to_char(l_start_date,'DD-MON-YYYY'));
3978: hr_utility.trace('l_expiry_date '||to_char(l_expiry_date,'DD-MON-YYYY'));
3979: hr_utility.trace('l_20131231 '||to_char(l_20131231,'DD-MON-YYYY'));
3980: if extract(year from p_effective_date) between extract(year from l_start_date) and extract(year from l_expiry_date) then
3973: l_expiry_date := least(l_emp_term_date, l_fin_end_date, l_calc_end_date);
3974: end if;
3975: end if;
3976: hr_utility.trace('l_calc_end_date '||to_char(l_calc_end_date,'DD-MON-YYYY'));
3977: hr_utility.trace('l_start_date '||to_char(l_start_date,'DD-MON-YYYY'));
3978: hr_utility.trace('l_expiry_date '||to_char(l_expiry_date,'DD-MON-YYYY'));
3979: hr_utility.trace('l_20131231 '||to_char(l_20131231,'DD-MON-YYYY'));
3980: if extract(year from p_effective_date) between extract(year from l_start_date) and extract(year from l_expiry_date) then
3981: if l_start_date between c_20120101 and l_20131231 then
3974: end if;
3975: end if;
3976: hr_utility.trace('l_calc_end_date '||to_char(l_calc_end_date,'DD-MON-YYYY'));
3977: hr_utility.trace('l_start_date '||to_char(l_start_date,'DD-MON-YYYY'));
3978: hr_utility.trace('l_expiry_date '||to_char(l_expiry_date,'DD-MON-YYYY'));
3979: hr_utility.trace('l_20131231 '||to_char(l_20131231,'DD-MON-YYYY'));
3980: if extract(year from p_effective_date) between extract(year from l_start_date) and extract(year from l_expiry_date) then
3981: if l_start_date between c_20120101 and l_20131231 then
3982: open csr_get_def_bal_id;
3975: end if;
3976: hr_utility.trace('l_calc_end_date '||to_char(l_calc_end_date,'DD-MON-YYYY'));
3977: hr_utility.trace('l_start_date '||to_char(l_start_date,'DD-MON-YYYY'));
3978: hr_utility.trace('l_expiry_date '||to_char(l_expiry_date,'DD-MON-YYYY'));
3979: hr_utility.trace('l_20131231 '||to_char(l_20131231,'DD-MON-YYYY'));
3980: if extract(year from p_effective_date) between extract(year from l_start_date) and extract(year from l_expiry_date) then
3981: if l_start_date between c_20120101 and l_20131231 then
3982: open csr_get_def_bal_id;
3983: fetch csr_get_def_bal_id into l_get_def_bal_id;
3992: end if;
3993: close csr_get_def_bal_id;
3994: end if;
3995: end if;
3996: hr_utility.trace('p_eligible_earnings :='||to_char(p_eligible_earnings));
3997: end tax_reduction_info;
3998: -- BUg 14754822 end
3999: ------------------------------------------------------------------------
4000: procedure yea_info(
4089: And information_type = 'KR_YEA_FOREIGN_WORKER_TAX';
4090: begin
4091: --
4092: if g_debug then
4093: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',10);
4094: end if;
4095: --
4096: ------------------------------------------------------------------------
4097: -- Derive Resident/Non-resident Information from element entry.
4112: end;
4113: /* End of Bug 6716506 */
4114: --
4115: if g_debug then
4116: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',15);
4117: end if;
4118: ------------------------------------------------------------------------
4119: -- Bug 3201332 Derive Nationality from national identifier
4120: -- Bug 3172960 Calling pay_kr_ff_functions_pkg for nationality
4138: CLOSE csr_fixed_tax_rate;
4139: end if;
4140: --
4141: if g_debug then
4142: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',20);
4143: end if;
4144: --
4145: ------------------------------------------------------------------------
4146: -- Get latest assignment action in previous calendar year.
4163: fetch csr_assact into l_assignment_action_id;
4164: if csr_assact%FOUND then
4165: --
4166: if g_debug then
4167: hr_utility.trace('l_assignment_action_id '||to_char(l_assignment_action_id));
4168: end if;
4169: --
4170: ------------------------------------------------------------------------
4171: -- Current Employer's Information
4178: pay_balance_pkg.get_value ( p_assignment_action_id => l_assignment_action_id
4179: ,p_defined_balance_lst => g_balance_value_tab );
4180: --
4181: if g_debug then
4182: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',30);
4183: end if;
4184: -- End of bug 8644512
4185: --
4186: p_yea_info.cur_ntax_frgn_M01 := g_balance_value_tab(82).balance_value
4313: l_corp_pension_prem_bal_value := g_balance_value_tab(21).balance_value+
4314: p_yea_info.corp_pension_prem;
4315: --
4316: if g_debug then
4317: hr_utility.trace('p_yea_info.cur_itax '||to_char(p_yea_info.cur_itax));
4318: hr_utility.trace('p_yea_info.cur_rtax '||to_char(p_yea_info.cur_rtax));
4319: hr_utility.trace('p_yea_info.cur_stax '||to_char(p_yea_info.cur_stax));
4320: end if;
4321: --
4314: p_yea_info.corp_pension_prem;
4315: --
4316: if g_debug then
4317: hr_utility.trace('p_yea_info.cur_itax '||to_char(p_yea_info.cur_itax));
4318: hr_utility.trace('p_yea_info.cur_rtax '||to_char(p_yea_info.cur_rtax));
4319: hr_utility.trace('p_yea_info.cur_stax '||to_char(p_yea_info.cur_stax));
4320: end if;
4321: --
4322: end if;
4315: --
4316: if g_debug then
4317: hr_utility.trace('p_yea_info.cur_itax '||to_char(p_yea_info.cur_itax));
4318: hr_utility.trace('p_yea_info.cur_rtax '||to_char(p_yea_info.cur_rtax));
4319: hr_utility.trace('p_yea_info.cur_stax '||to_char(p_yea_info.cur_stax));
4320: end if;
4321: --
4322: end if;
4323: close csr_assact;
4326: -- This code will be changed in the near future by using PER_CONTACT_RELATIONSHIPS.
4327: ------------------------------------------------------------------------
4328: --
4329: if g_debug then
4330: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',40);
4331: end if;
4332: --
4333: l_dummy := pay_kr_ff_functions_pkg.get_dependent_info(
4334: p_assignment_id => p_assignment_id,
4357: ------------------------------------------------------------------------
4358: -- Derive YEA Information from assignment EIT.
4359: ------------------------------------------------------------------------
4360: if g_debug then
4361: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',50);
4362: end if;
4363: --
4364: ------------------------------------------------------------------------
4365: -- Bug 8644512
4789: ------------------------------------------------------------------------
4790: -- Special Tax Exemption Information
4791: ------------------------------------------------------------------------
4792: if g_debug then
4793: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',60);
4794: end if;
4795: --
4796: sp_tax_exem_info(
4797: p_assignment_id => p_assignment_id,
4850: ------------------------------------------------------------------------
4851: -- Dependent Education Expense Tax Exemption Information
4852: ------------------------------------------------------------------------
4853: if g_debug then
4854: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',70);
4855: end if;
4856: --
4857: dpnt_educ_tax_exem_info(
4858: p_assignment_id => p_assignment_id,
4866: -- Changes for Bug 3201332
4867: -- Foreign Worker PreTax Deduction Information
4868: ------------------------------------------------------------------------
4869: if g_debug then
4870: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',75);
4871: end if;
4872: --
4873: fw_tax_exem_info(
4874: p_assignment_id => p_assignment_id,
4879: -- Housing Expenses Tax Exemption
4880: -- Changed for Bug 2523481
4881: ------------------------------------------------------------------------
4882: if g_debug then
4883: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',80);
4884: end if;
4885: --
4886: hous_exp_tax_exem_info(
4887: p_assignment_id => p_assignment_id,
4892: -- Tax Exemption Information
4893: -- Direct card expenses introduced for fix 2879008
4894: ------------------------------------------------------------------------
4895: if g_debug then
4896: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',90);
4897: end if;
4898: --
4899: tax_exem_info(
4900: p_assignment_id => p_assignment_id,
4958: ------------------------------------------------------------------------
4959: -- Tax Break Information
4960: ------------------------------------------------------------------------
4961: if g_debug then
4962: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',100);
4963: end if;
4964: --
4965: tax_break_info(
4966: p_assignment_id => p_assignment_id,
4972: ------------------------------------------------------------------------
4973: -- Overseas Tax Break Information
4974: ------------------------------------------------------------------------
4975: if g_debug then
4976: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',110);
4977: end if;
4978: --
4979: ovs_tax_break_info(
4980: p_assignment_id => p_assignment_id,
4998: ------------------------------------------------------------------------
4999: -- Foreign Worker Tax Break Information
5000: ------------------------------------------------------------------------
5001: if g_debug then
5002: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',120);
5003: end if;
5004: --
5005: -- Bug 5083240: Update call for new parameters p_assignment_action_id, p_contr_taxable_earn, and p_contr_non_taxable_earn
5006: fw_tax_break_info(
5141: -- Derive Tax Exemption, Tax Break, Tax Adjustment etc.
5142: -- which depends on effective_date.
5143: ------------------------------------------------------------------------
5144: if g_debug then
5145: hr_utility.set_location('pay_kr_yea_pkg.yea_info.',130);
5146: end if;
5147: --
5148: -- Bug 9393732
5149: -- BUG 14219478
5318: end loop;
5319:
5320: ---------------
5321: if g_debug then
5322: hr_utility.trace('=====================================================');
5323: hr_utility.trace('Current Taxable : '||to_char(p_yea_info.cur_taxable));
5324: hr_utility.trace('Previous Taxable : '||to_char(p_yea_info.prev_taxable));
5325: hr_utility.trace('Taxable : '||to_char(p_yea_info.taxable1)); --Bug 7615517
5326: hr_utility.trace('Total Taxable : '||to_char(p_yea_info.taxable));
5319:
5320: ---------------
5321: if g_debug then
5322: hr_utility.trace('=====================================================');
5323: hr_utility.trace('Current Taxable : '||to_char(p_yea_info.cur_taxable));
5324: hr_utility.trace('Previous Taxable : '||to_char(p_yea_info.prev_taxable));
5325: hr_utility.trace('Taxable : '||to_char(p_yea_info.taxable1)); --Bug 7615517
5326: hr_utility.trace('Total Taxable : '||to_char(p_yea_info.taxable));
5327: hr_utility.trace('Income Tax : '||to_char(p_yea_info.cur_itax));
5320: ---------------
5321: if g_debug then
5322: hr_utility.trace('=====================================================');
5323: hr_utility.trace('Current Taxable : '||to_char(p_yea_info.cur_taxable));
5324: hr_utility.trace('Previous Taxable : '||to_char(p_yea_info.prev_taxable));
5325: hr_utility.trace('Taxable : '||to_char(p_yea_info.taxable1)); --Bug 7615517
5326: hr_utility.trace('Total Taxable : '||to_char(p_yea_info.taxable));
5327: hr_utility.trace('Income Tax : '||to_char(p_yea_info.cur_itax));
5328: hr_utility.trace('Resident Tax : '||to_char(p_yea_info.cur_itax));
5321: if g_debug then
5322: hr_utility.trace('=====================================================');
5323: hr_utility.trace('Current Taxable : '||to_char(p_yea_info.cur_taxable));
5324: hr_utility.trace('Previous Taxable : '||to_char(p_yea_info.prev_taxable));
5325: hr_utility.trace('Taxable : '||to_char(p_yea_info.taxable1)); --Bug 7615517
5326: hr_utility.trace('Total Taxable : '||to_char(p_yea_info.taxable));
5327: hr_utility.trace('Income Tax : '||to_char(p_yea_info.cur_itax));
5328: hr_utility.trace('Resident Tax : '||to_char(p_yea_info.cur_itax));
5329: hr_utility.trace('Income Tax Adjustment : '||to_char(p_yea_info.itax_adj));
5322: hr_utility.trace('=====================================================');
5323: hr_utility.trace('Current Taxable : '||to_char(p_yea_info.cur_taxable));
5324: hr_utility.trace('Previous Taxable : '||to_char(p_yea_info.prev_taxable));
5325: hr_utility.trace('Taxable : '||to_char(p_yea_info.taxable1)); --Bug 7615517
5326: hr_utility.trace('Total Taxable : '||to_char(p_yea_info.taxable));
5327: hr_utility.trace('Income Tax : '||to_char(p_yea_info.cur_itax));
5328: hr_utility.trace('Resident Tax : '||to_char(p_yea_info.cur_itax));
5329: hr_utility.trace('Income Tax Adjustment : '||to_char(p_yea_info.itax_adj));
5330: hr_utility.trace('Resident Tax Adjustment : '||to_char(p_yea_info.rtax_adj));
5323: hr_utility.trace('Current Taxable : '||to_char(p_yea_info.cur_taxable));
5324: hr_utility.trace('Previous Taxable : '||to_char(p_yea_info.prev_taxable));
5325: hr_utility.trace('Taxable : '||to_char(p_yea_info.taxable1)); --Bug 7615517
5326: hr_utility.trace('Total Taxable : '||to_char(p_yea_info.taxable));
5327: hr_utility.trace('Income Tax : '||to_char(p_yea_info.cur_itax));
5328: hr_utility.trace('Resident Tax : '||to_char(p_yea_info.cur_itax));
5329: hr_utility.trace('Income Tax Adjustment : '||to_char(p_yea_info.itax_adj));
5330: hr_utility.trace('Resident Tax Adjustment : '||to_char(p_yea_info.rtax_adj));
5331: hr_utility.trace('=====================================================');
5324: hr_utility.trace('Previous Taxable : '||to_char(p_yea_info.prev_taxable));
5325: hr_utility.trace('Taxable : '||to_char(p_yea_info.taxable1)); --Bug 7615517
5326: hr_utility.trace('Total Taxable : '||to_char(p_yea_info.taxable));
5327: hr_utility.trace('Income Tax : '||to_char(p_yea_info.cur_itax));
5328: hr_utility.trace('Resident Tax : '||to_char(p_yea_info.cur_itax));
5329: hr_utility.trace('Income Tax Adjustment : '||to_char(p_yea_info.itax_adj));
5330: hr_utility.trace('Resident Tax Adjustment : '||to_char(p_yea_info.rtax_adj));
5331: hr_utility.trace('=====================================================');
5332: end if;
5325: hr_utility.trace('Taxable : '||to_char(p_yea_info.taxable1)); --Bug 7615517
5326: hr_utility.trace('Total Taxable : '||to_char(p_yea_info.taxable));
5327: hr_utility.trace('Income Tax : '||to_char(p_yea_info.cur_itax));
5328: hr_utility.trace('Resident Tax : '||to_char(p_yea_info.cur_itax));
5329: hr_utility.trace('Income Tax Adjustment : '||to_char(p_yea_info.itax_adj));
5330: hr_utility.trace('Resident Tax Adjustment : '||to_char(p_yea_info.rtax_adj));
5331: hr_utility.trace('=====================================================');
5332: end if;
5333: ----------------
5326: hr_utility.trace('Total Taxable : '||to_char(p_yea_info.taxable));
5327: hr_utility.trace('Income Tax : '||to_char(p_yea_info.cur_itax));
5328: hr_utility.trace('Resident Tax : '||to_char(p_yea_info.cur_itax));
5329: hr_utility.trace('Income Tax Adjustment : '||to_char(p_yea_info.itax_adj));
5330: hr_utility.trace('Resident Tax Adjustment : '||to_char(p_yea_info.rtax_adj));
5331: hr_utility.trace('=====================================================');
5332: end if;
5333: ----------------
5334: ------------------------------------------------------------------------
5327: hr_utility.trace('Income Tax : '||to_char(p_yea_info.cur_itax));
5328: hr_utility.trace('Resident Tax : '||to_char(p_yea_info.cur_itax));
5329: hr_utility.trace('Income Tax Adjustment : '||to_char(p_yea_info.itax_adj));
5330: hr_utility.trace('Resident Tax Adjustment : '||to_char(p_yea_info.rtax_adj));
5331: hr_utility.trace('=====================================================');
5332: end if;
5333: ----------------
5334: ------------------------------------------------------------------------
5335: -- Setup output warnings
5638:
5639: begin
5640: --
5641: if g_debug then
5642: hr_utility.set_location('pay_kr_yea_pkg.chk_assignment_id.',10);
5643: end if;
5644: --
5645: hr_api.mandatory_arg_error(
5646: p_api_name => l_proc,
5663: p_argument => 'report_category',
5664: p_argument_value => p_report_category);
5665: --
5666: if g_debug then
5667: hr_utility.set_location('pay_kr_yea_pkg.chk_assignment_id.',20);
5668: end if;
5669: --
5670: open csr_asg;
5671: fetch csr_asg into l_business_group_id, l_esd, l_eed, l_payroll_id;
5674: --
5675: close csr_asg;
5676: --
5677: if g_debug then
5678: hr_utility.set_location('pay_kr_yea_pkg.chk_assignment_id.',30);
5679: end if;
5680: --
5681: fnd_message.set_name('PAY', 'PAY_KR_INV_ASG');
5682: p_error := fnd_message.get;
5685: --
5686: close csr_asg;
5687: --
5688: if g_debug then
5689: hr_utility.set_location('pay_kr_yea_pkg.chk_assignment_id.',40);
5690: end if;
5691: --
5692: --
5693: -- Business Group Validation
5715: end if;
5716: end if;
5717: --
5718: if g_debug then
5719: hr_utility.set_location('pay_kr_yea_pkg.chk_assignment_id.',50);
5720: end if;
5721: ------------------------------------------------------------------------
5722: -- If invalid assacts exist before effective_date, raise error.
5723: ------------------------------------------------------------------------
5735: close csr_incomplete_exists;
5736: end if;
5737: --
5738: if g_debug then
5739: hr_utility.set_location('pay_kr_yea_pkg.chk_assignment_id.',60);
5740: end if;
5741: ------------------------------------------------------------------------
5742: -- YEA Type Validation
5743: ------------------------------------------------------------------------
5746:
5747: if csr_archive_exists%FOUND then
5748: --
5749: if g_debug then
5750: hr_utility.set_location('pay_kr_yea_pkg.chk_assignment_id.',70);
5751: end if;
5752: --
5753: close csr_archive_exists;
5754:
5766: end if;
5767: else
5768: --
5769: if g_debug then
5770: hr_utility.set_location('pay_kr_yea_pkg.chk_assignment_id.',80);
5771: end if;
5772: --
5773: close csr_archive_exists;
5774:
5849: ------------------------------------------------------------------------
5850: -- Process YEA
5851: ------------------------------------------------------------------------
5852: if g_debug then
5853: hr_utility.trace('Running YEA ..........................................');
5854: end if;
5855: --
5856: yea_info(
5857: p_assignment_id => p_assignment_id,
5869: p_tax_adj_warning => l_tax_adj_warning);
5870:
5871: --
5872: if g_debug then
5873: hr_utility.trace('p_yea_info.cur_itax '||to_char(l_yea_info.cur_itax));
5874: hr_utility.trace('p_yea_info.cur_rtax '||to_char(l_yea_info.cur_rtax));
5875: hr_utility.trace('p_yea_info.cur_stax '||to_char(l_yea_info.cur_stax));
5876: hr_utility.trace('p_yea_info.itax_adj '||to_char(l_yea_info.itax_adj));
5877: hr_utility.trace('p_yea_info.rtax_adj '||to_char(l_yea_info.rtax_adj));
5870:
5871: --
5872: if g_debug then
5873: hr_utility.trace('p_yea_info.cur_itax '||to_char(l_yea_info.cur_itax));
5874: hr_utility.trace('p_yea_info.cur_rtax '||to_char(l_yea_info.cur_rtax));
5875: hr_utility.trace('p_yea_info.cur_stax '||to_char(l_yea_info.cur_stax));
5876: hr_utility.trace('p_yea_info.itax_adj '||to_char(l_yea_info.itax_adj));
5877: hr_utility.trace('p_yea_info.rtax_adj '||to_char(l_yea_info.rtax_adj));
5878: hr_utility.trace('p_yea_info.stax_adj '||to_char(l_yea_info.stax_adj));
5871: --
5872: if g_debug then
5873: hr_utility.trace('p_yea_info.cur_itax '||to_char(l_yea_info.cur_itax));
5874: hr_utility.trace('p_yea_info.cur_rtax '||to_char(l_yea_info.cur_rtax));
5875: hr_utility.trace('p_yea_info.cur_stax '||to_char(l_yea_info.cur_stax));
5876: hr_utility.trace('p_yea_info.itax_adj '||to_char(l_yea_info.itax_adj));
5877: hr_utility.trace('p_yea_info.rtax_adj '||to_char(l_yea_info.rtax_adj));
5878: hr_utility.trace('p_yea_info.stax_adj '||to_char(l_yea_info.stax_adj));
5879: hr_utility.trace('Checking Balance...........');
5872: if g_debug then
5873: hr_utility.trace('p_yea_info.cur_itax '||to_char(l_yea_info.cur_itax));
5874: hr_utility.trace('p_yea_info.cur_rtax '||to_char(l_yea_info.cur_rtax));
5875: hr_utility.trace('p_yea_info.cur_stax '||to_char(l_yea_info.cur_stax));
5876: hr_utility.trace('p_yea_info.itax_adj '||to_char(l_yea_info.itax_adj));
5877: hr_utility.trace('p_yea_info.rtax_adj '||to_char(l_yea_info.rtax_adj));
5878: hr_utility.trace('p_yea_info.stax_adj '||to_char(l_yea_info.stax_adj));
5879: hr_utility.trace('Checking Balance...........');
5880: end if;
5873: hr_utility.trace('p_yea_info.cur_itax '||to_char(l_yea_info.cur_itax));
5874: hr_utility.trace('p_yea_info.cur_rtax '||to_char(l_yea_info.cur_rtax));
5875: hr_utility.trace('p_yea_info.cur_stax '||to_char(l_yea_info.cur_stax));
5876: hr_utility.trace('p_yea_info.itax_adj '||to_char(l_yea_info.itax_adj));
5877: hr_utility.trace('p_yea_info.rtax_adj '||to_char(l_yea_info.rtax_adj));
5878: hr_utility.trace('p_yea_info.stax_adj '||to_char(l_yea_info.stax_adj));
5879: hr_utility.trace('Checking Balance...........');
5880: end if;
5881: --
5874: hr_utility.trace('p_yea_info.cur_rtax '||to_char(l_yea_info.cur_rtax));
5875: hr_utility.trace('p_yea_info.cur_stax '||to_char(l_yea_info.cur_stax));
5876: hr_utility.trace('p_yea_info.itax_adj '||to_char(l_yea_info.itax_adj));
5877: hr_utility.trace('p_yea_info.rtax_adj '||to_char(l_yea_info.rtax_adj));
5878: hr_utility.trace('p_yea_info.stax_adj '||to_char(l_yea_info.stax_adj));
5879: hr_utility.trace('Checking Balance...........');
5880: end if;
5881: --
5882: pay_balance_pkg.get_value ( p_assignment_action_id => p_bal_asg_action_id
5875: hr_utility.trace('p_yea_info.cur_stax '||to_char(l_yea_info.cur_stax));
5876: hr_utility.trace('p_yea_info.itax_adj '||to_char(l_yea_info.itax_adj));
5877: hr_utility.trace('p_yea_info.rtax_adj '||to_char(l_yea_info.rtax_adj));
5878: hr_utility.trace('p_yea_info.stax_adj '||to_char(l_yea_info.stax_adj));
5879: hr_utility.trace('Checking Balance...........');
5880: end if;
5881: --
5882: pay_balance_pkg.get_value ( p_assignment_action_id => p_bal_asg_action_id
5883: ,p_defined_balance_lst => g_tax_adj_balance_tab );
5882: pay_balance_pkg.get_value ( p_assignment_action_id => p_bal_asg_action_id
5883: ,p_defined_balance_lst => g_tax_adj_balance_tab );
5884: --
5885: if g_debug then
5886: hr_utility.trace('Balance Value of itax_adj = '||to_char(g_tax_adj_balance_tab(1).balance_value));
5887: hr_utility.trace('Balance Value of rtax_adj = '||to_char(g_tax_adj_balance_tab(2).balance_value));
5888: hr_utility.trace('Balance Value of stax_adj = '||to_char(g_tax_adj_balance_tab(3).balance_value));
5889: end if;
5890: -----------------------------------------------------------------------
5883: ,p_defined_balance_lst => g_tax_adj_balance_tab );
5884: --
5885: if g_debug then
5886: hr_utility.trace('Balance Value of itax_adj = '||to_char(g_tax_adj_balance_tab(1).balance_value));
5887: hr_utility.trace('Balance Value of rtax_adj = '||to_char(g_tax_adj_balance_tab(2).balance_value));
5888: hr_utility.trace('Balance Value of stax_adj = '||to_char(g_tax_adj_balance_tab(3).balance_value));
5889: end if;
5890: -----------------------------------------------------------------------
5891: if g_tax_adj_balance_tab(1).balance_value <> l_yea_info.itax_adj OR
5884: --
5885: if g_debug then
5886: hr_utility.trace('Balance Value of itax_adj = '||to_char(g_tax_adj_balance_tab(1).balance_value));
5887: hr_utility.trace('Balance Value of rtax_adj = '||to_char(g_tax_adj_balance_tab(2).balance_value));
5888: hr_utility.trace('Balance Value of stax_adj = '||to_char(g_tax_adj_balance_tab(3).balance_value));
5889: end if;
5890: -----------------------------------------------------------------------
5891: if g_tax_adj_balance_tab(1).balance_value <> l_yea_info.itax_adj OR
5892: g_tax_adj_balance_tab(2).balance_value <> l_yea_info.rtax_adj OR
5893: g_tax_adj_balance_tab(3).balance_value <> l_yea_info.stax_adj
5894: then
5895: --
5896: if g_debug then
5897: hr_utility.trace('Incorrect Balance Adjustment amount');
5898: end if;
5899: --
5900: fnd_message.set_name('PAY', 'PAY_KR_INCORRECT_ADJ_AMT');
5901: fnd_message.set_token('ASSIGNMENT_ID', p_assignment_id);
5917: fnd_message.raise_error;
5918: else
5919: --
5920: if g_debug then
5921: hr_utility.trace('Archiving...................');
5922: end if;
5923: ------------------------------------------------------------------------
5924: -- Convert from YEA result from record variable to PL/SQL table.
5925: ------------------------------------------------------------------------
6037: --
6038: hr_api.validate_bus_grp_id(p_business_group_id);
6039: --
6040: if g_debug then
6041: hr_utility.trace('Assignment Id: '||to_char(p_assignment_id)||' Payroll Action Id: '||to_char(p_payroll_action_id));
6042: hr_utility.trace('Effective Date: '||to_char(p_effective_date)||' Business Group Id: '||to_char(p_business_group_id));
6043: end if;
6044: --
6045: open csr_pact;
6038: hr_api.validate_bus_grp_id(p_business_group_id);
6039: --
6040: if g_debug then
6041: hr_utility.trace('Assignment Id: '||to_char(p_assignment_id)||' Payroll Action Id: '||to_char(p_payroll_action_id));
6042: hr_utility.trace('Effective Date: '||to_char(p_effective_date)||' Business Group Id: '||to_char(p_business_group_id));
6043: end if;
6044: --
6045: open csr_pact;
6046: fetch csr_pact into r_pact;
6046: fetch csr_pact into r_pact;
6047: close csr_pact;
6048: --
6049: if g_debug then
6050: hr_utility.trace('Checking Assignment');
6051: end if;
6052: ------------------------------------------------------------------------
6053: -- Assignment validation
6054: ------------------------------------------------------------------------
6061: p_report_category => r_pact.report_category,
6062: p_error => p_error);
6063: --
6064: if g_debug then
6065: hr_utility.trace('After checking assignment');
6066: end if;
6067: --
6068: if p_error is not null then
6069: return 1; -- failure
6069: return 1; -- failure
6070: else
6071: --
6072: if g_debug then
6073: hr_utility.trace('Calculating Adjustments');
6074: end if;
6075: --
6076: -------------------------------------------------------------------------
6077: -- Calculate Tax Adjustments
6095: p_rtax_adj := l_yea_info.rtax_adj;
6096: p_stax_adj := l_yea_info.stax_adj;
6097:
6098: if g_debug then
6099: hr_utility.trace('p_itax_adj '||to_char(p_itax_adj));
6100: hr_utility.trace('p_rtax_adj '||to_char(p_rtax_adj));
6101: hr_utility.trace('p_stax_adj '||to_char(p_stax_adj));
6102: end if;
6103:
6096: p_stax_adj := l_yea_info.stax_adj;
6097:
6098: if g_debug then
6099: hr_utility.trace('p_itax_adj '||to_char(p_itax_adj));
6100: hr_utility.trace('p_rtax_adj '||to_char(p_rtax_adj));
6101: hr_utility.trace('p_stax_adj '||to_char(p_stax_adj));
6102: end if;
6103:
6104: return 0; -- success
6097:
6098: if g_debug then
6099: hr_utility.trace('p_itax_adj '||to_char(p_itax_adj));
6100: hr_utility.trace('p_rtax_adj '||to_char(p_rtax_adj));
6101: hr_utility.trace('p_stax_adj '||to_char(p_stax_adj));
6102: end if;
6103:
6104: return 0; -- success
6105: end if;