72: and p_effective_date between effective_start_date and
73: effective_end_date;
74: --
75: begin
76: hr_utility.set_location('Entering: '|| l_proc, 5);
77: --
78: -- Check to see if mandatory parameters have been set.
79: --
80: if p_assignment_id is null then
77: --
78: -- Check to see if mandatory parameters have been set.
79: --
80: if p_assignment_id is null then
81: hr_utility.set_message(801,'PAY_72736_CTY_ASG_NOT_NULL');
82: hr_utility.raise_error;
83: elsif p_business_group_id is null then
84: hr_utility.set_message(801,'PAY_72738_CTY_BG_NOT_NULL');
85: hr_utility.raise_error;
78: -- Check to see if mandatory parameters have been set.
79: --
80: if p_assignment_id is null then
81: hr_utility.set_message(801,'PAY_72736_CTY_ASG_NOT_NULL');
82: hr_utility.raise_error;
83: elsif p_business_group_id is null then
84: hr_utility.set_message(801,'PAY_72738_CTY_BG_NOT_NULL');
85: hr_utility.raise_error;
86: end if;
80: if p_assignment_id is null then
81: hr_utility.set_message(801,'PAY_72736_CTY_ASG_NOT_NULL');
82: hr_utility.raise_error;
83: elsif p_business_group_id is null then
84: hr_utility.set_message(801,'PAY_72738_CTY_BG_NOT_NULL');
85: hr_utility.raise_error;
86: end if;
87: --
88: hr_api.mandatory_arg_error
81: hr_utility.set_message(801,'PAY_72736_CTY_ASG_NOT_NULL');
82: hr_utility.raise_error;
83: elsif p_business_group_id is null then
84: hr_utility.set_message(801,'PAY_72738_CTY_BG_NOT_NULL');
85: hr_utility.raise_error;
86: end if;
87: --
88: hr_api.mandatory_arg_error
89: (p_api_name => l_proc
101: open csr_business_grp;
102: fetch csr_business_grp into l_business_group_id;
103: if csr_business_grp%NOTFOUND then
104: close csr_business_grp;
105: hr_utility.set_message(801, 'HR_51746_ASG_INV_ASG_ID');
106: hr_utility.raise_error;
107: else
108: --
109: close csr_business_grp;
102: fetch csr_business_grp into l_business_group_id;
103: if csr_business_grp%NOTFOUND then
104: close csr_business_grp;
105: hr_utility.set_message(801, 'HR_51746_ASG_INV_ASG_ID');
106: hr_utility.raise_error;
107: else
108: --
109: close csr_business_grp;
110: --
109: close csr_business_grp;
110: --
111: if nvl(p_business_group_id, hr_api.g_number) <> l_business_group_id
112: then
113: hr_utility.set_message(801, 'PAY_72737_CTY_BG_MATCH_ASG');
114: hr_utility.raise_error;
115: else
116: open csr_defaulting;
117: fetch csr_defaulting into l_tmp;
110: --
111: if nvl(p_business_group_id, hr_api.g_number) <> l_business_group_id
112: then
113: hr_utility.set_message(801, 'PAY_72737_CTY_BG_MATCH_ASG');
114: hr_utility.raise_error;
115: else
116: open csr_defaulting;
117: fetch csr_defaulting into l_tmp;
118: if csr_defaulting%NOTFOUND then
116: open csr_defaulting;
117: fetch csr_defaulting into l_tmp;
118: if csr_defaulting%NOTFOUND then
119: close csr_defaulting;
120: hr_utility.set_message(801, 'PAY_72731_CTY_NO_FED_RULE');
121: hr_utility.raise_error;
122: end if;
123: close csr_defaulting;
124: end if;
117: fetch csr_defaulting into l_tmp;
118: if csr_defaulting%NOTFOUND then
119: close csr_defaulting;
120: hr_utility.set_message(801, 'PAY_72731_CTY_NO_FED_RULE');
121: hr_utility.raise_error;
122: end if;
123: close csr_defaulting;
124: end if;
125: end if;
123: close csr_defaulting;
124: end if;
125: end if;
126: end if;
127: hr_utility.set_location(' Leaving: '||l_proc, 65);
128: end chk_assignment_id;
129: --
130: -- ---------------------------------------------------------------------------
131: -- |---------------------------< chk_state_code >----------------------------|
167: from pay_us_states
168: where state_code = p_state_code;
169: --
170: begin
171: hr_utility.set_location('Entering: '|| l_proc, 5);
172: --
173: -- Check state_code is not null.
174: --
175: --
173: -- Check state_code is not null.
174: --
175: --
176: if (p_state_code IS NOT NULL) then
177: hr_utility.set_location(l_proc, 10);
178: --
179: -- Check state code is valid.
180: --
181: open csr_valid_state_code;
186: ('PAY_US_EMP_CITY_TAX_RULES_FK1');
187: end if;
188: close csr_valid_state_code;
189: else
190: hr_utility.set_message(801,'PAY_72752_CTY_STA_NOT_NULL');
191: hr_utility.raise_error;
192: end if;
193: hr_utility.set_location(' Leaving: '||l_proc, 20);
194: end chk_state_code;
187: end if;
188: close csr_valid_state_code;
189: else
190: hr_utility.set_message(801,'PAY_72752_CTY_STA_NOT_NULL');
191: hr_utility.raise_error;
192: end if;
193: hr_utility.set_location(' Leaving: '||l_proc, 20);
194: end chk_state_code;
195: --
189: else
190: hr_utility.set_message(801,'PAY_72752_CTY_STA_NOT_NULL');
191: hr_utility.raise_error;
192: end if;
193: hr_utility.set_location(' Leaving: '||l_proc, 20);
194: end chk_state_code;
195: --
196: --
197: -- ---------------------------------------------------------------------------
241: where state_code = p_state_code
242: and county_code = p_county_code;
243: --
244: begin
245: hr_utility.set_location('Entering: '|| l_proc, 5);
246: --
247: -- Check to see if mandatory parameters have been set.
248: --
249: hr_api.mandatory_arg_error
252: ,p_argument_value => p_state_code
253: );
254: --
255: if (p_county_code IS NOT NULL) then
256: hr_utility.set_location(l_proc, 10);
257: --
258: -- Check for valid county code.
259: --
260: open csr_valid_county_code;
260: open csr_valid_county_code;
261: fetch csr_valid_county_code into l_county_code;
262: if csr_valid_county_code%notfound then
263: close csr_valid_county_code;
264: hr_utility.set_message(801,'HR_51279_ADD_INV_CTY_CO_ST_CMB');
265: hr_utility.raise_error;
266: end if;
267: close csr_valid_county_code;
268: hr_utility.set_location(l_proc, 20);
261: fetch csr_valid_county_code into l_county_code;
262: if csr_valid_county_code%notfound then
263: close csr_valid_county_code;
264: hr_utility.set_message(801,'HR_51279_ADD_INV_CTY_CO_ST_CMB');
265: hr_utility.raise_error;
266: end if;
267: close csr_valid_county_code;
268: hr_utility.set_location(l_proc, 20);
269: else
264: hr_utility.set_message(801,'HR_51279_ADD_INV_CTY_CO_ST_CMB');
265: hr_utility.raise_error;
266: end if;
267: close csr_valid_county_code;
268: hr_utility.set_location(l_proc, 20);
269: else
270: hr_utility.set_message(801,'PAY_72740_CTY_CNT_NOT_NULL');
271: hr_utility.raise_error;
272: end if;
266: end if;
267: close csr_valid_county_code;
268: hr_utility.set_location(l_proc, 20);
269: else
270: hr_utility.set_message(801,'PAY_72740_CTY_CNT_NOT_NULL');
271: hr_utility.raise_error;
272: end if;
273: hr_utility.set_location(' Leaving: '||l_proc, 25);
274: end chk_county_code;
267: close csr_valid_county_code;
268: hr_utility.set_location(l_proc, 20);
269: else
270: hr_utility.set_message(801,'PAY_72740_CTY_CNT_NOT_NULL');
271: hr_utility.raise_error;
272: end if;
273: hr_utility.set_location(' Leaving: '||l_proc, 25);
274: end chk_county_code;
275: --
269: else
270: hr_utility.set_message(801,'PAY_72740_CTY_CNT_NOT_NULL');
271: hr_utility.raise_error;
272: end if;
273: hr_utility.set_location(' Leaving: '||l_proc, 25);
274: end chk_county_code;
275: --
276: -- ---------------------------------------------------------------------------
277: -- |----------------------------< chk_city_code >----------------------------|
318: and county_code = p_county_code
319: and city_code = p_city_code;
320: --
321: begin
322: hr_utility.set_location('Entering: '|| l_proc, 5);
323: --
324: -- Check city_code is not null.
325: --
326: if (p_city_code IS NOT NULL) then
323: --
324: -- Check city_code is not null.
325: --
326: if (p_city_code IS NOT NULL) then
327: hr_utility.set_location(l_proc, 10);
328: --
329: -- Check city code is valid.
330: --
331: open csr_valid_city_code;
336: (p_constraint_name => 'PAY_US_EMP_CITY_TAX_RULES_FK3');
337: end if;
338: close csr_valid_city_code;
339: else
340: hr_utility.set_message(801,'PAY_72739_CTY_CTY_NOT_NULL');
341: hr_utility.raise_error;
342: end if;
343: hr_utility.set_location(' Leaving: '||l_proc, 15);
344: end chk_city_code;
337: end if;
338: close csr_valid_city_code;
339: else
340: hr_utility.set_message(801,'PAY_72739_CTY_CTY_NOT_NULL');
341: hr_utility.raise_error;
342: end if;
343: hr_utility.set_location(' Leaving: '||l_proc, 15);
344: end chk_city_code;
345: --
339: else
340: hr_utility.set_message(801,'PAY_72739_CTY_CTY_NOT_NULL');
341: hr_utility.raise_error;
342: end if;
343: hr_utility.set_location(' Leaving: '||l_proc, 15);
344: end chk_city_code;
345: --
346: --
347: -- ---------------------------------------------------------------------------
396: and city_code = p_city_code;
397: --
398: --
399: begin
400: hr_utility.set_location('Entering: '|| l_proc, 5);
401: --
402: if p_jurisdiction_code is null then
403: hr_utility.set_message(801,'PAY_72744_CTY_JD_NOT_NULL');
404: hr_utility.raise_error;
399: begin
400: hr_utility.set_location('Entering: '|| l_proc, 5);
401: --
402: if p_jurisdiction_code is null then
403: hr_utility.set_message(801,'PAY_72744_CTY_JD_NOT_NULL');
404: hr_utility.raise_error;
405: end if;
406: --
407: hr_api.mandatory_arg_error
400: hr_utility.set_location('Entering: '|| l_proc, 5);
401: --
402: if p_jurisdiction_code is null then
403: hr_utility.set_message(801,'PAY_72744_CTY_JD_NOT_NULL');
404: hr_utility.raise_error;
405: end if;
406: --
407: hr_api.mandatory_arg_error
408: (p_api_name => l_proc
421: ,p_argument => 'city_code'
422: ,p_argument_value => p_city_code
423: );
424: --
425: hr_utility.set_location(l_proc, 10);
426: --
427: --
428: -- Check for valid jurisdiction code
429: --
430: open csr_valid_jurisdiction_code;
431: fetch csr_valid_jurisdiction_code into l_jurisdiction;
432: if l_jurisdiction = 0 then
433: close csr_valid_jurisdiction_code;
434: hr_utility.set_message(801,'PAY_8003_1099R_JU_CODE');
435: hr_utility.raise_error;
436: end if;
437: close csr_valid_jurisdiction_code;
438: hr_utility.set_location(l_proc, 20);
431: fetch csr_valid_jurisdiction_code into l_jurisdiction;
432: if l_jurisdiction = 0 then
433: close csr_valid_jurisdiction_code;
434: hr_utility.set_message(801,'PAY_8003_1099R_JU_CODE');
435: hr_utility.raise_error;
436: end if;
437: close csr_valid_jurisdiction_code;
438: hr_utility.set_location(l_proc, 20);
439: end chk_jurisdiction_code;
434: hr_utility.set_message(801,'PAY_8003_1099R_JU_CODE');
435: hr_utility.raise_error;
436: end if;
437: close csr_valid_jurisdiction_code;
438: hr_utility.set_location(l_proc, 20);
439: end chk_jurisdiction_code;
440: --
441: --
442: -- ---------------------------------------------------------------------------
475: l_proc varchar2(72) := g_package||'chk_additional_wa_rate';
476: l_additional_wa_rate pay_us_emp_city_tax_rules_f.additional_wa_rate%TYPE;
477: --
478: begin
479: hr_utility.set_location('Entering: '|| l_proc, 5);
480: --
481: -- If value is being inserted or updated ...
482: --
483: if (p_emp_city_tax_rule_id is not null
487: --
488: -- Check that additional_wa_rate is not null.
489: --
490: if p_additional_wa_rate is null then
491: hr_utility.set_message(801,'PAY_72735_CTY_ADDL_WA_NOT_NULL');
492: hr_utility.raise_error;
493: else
494: --
495: -- Check that additional_wa_rate is in a valid range.
488: -- Check that additional_wa_rate is not null.
489: --
490: if p_additional_wa_rate is null then
491: hr_utility.set_message(801,'PAY_72735_CTY_ADDL_WA_NOT_NULL');
492: hr_utility.raise_error;
493: else
494: --
495: -- Check that additional_wa_rate is in a valid range.
496: --
495: -- Check that additional_wa_rate is in a valid range.
496: --
497: if p_additional_wa_rate < 0 or p_additional_wa_rate > 100 then
498: --
499: hr_utility.set_message(801,'PAY_72734_CTY_ADDL_WA_IN_RANGE');
500: hr_utility.raise_error;
501: end if;
502: end if;
503: end if;
496: --
497: if p_additional_wa_rate < 0 or p_additional_wa_rate > 100 then
498: --
499: hr_utility.set_message(801,'PAY_72734_CTY_ADDL_WA_IN_RANGE');
500: hr_utility.raise_error;
501: end if;
502: end if;
503: end if;
504: hr_utility.set_location(' Leaving: '||l_proc, 15);
500: hr_utility.raise_error;
501: end if;
502: end if;
503: end if;
504: hr_utility.set_location(' Leaving: '||l_proc, 15);
505: end chk_additional_wa_rate;
506: --
507: -- ---------------------------------------------------------------------------
508: -- |------------------------< chk_filing_status_code >-----------------------|
551: 'chk_filing_status_code';
552: --
553: begin
554: --
555: hr_utility.set_location('Entering: '|| l_proc, 5);
556: --
557: hr_api.mandatory_arg_error
558: (p_api_name => l_proc
559: ,p_argument => 'effective_date'
587: --
588: -- Check that filing_status_code is not null.
589: --
590: if p_filing_status_code is null then
591: hr_utility.set_message(801,'PAY_72742_CTY_FIL_STA_NOT_NULL');
592: hr_utility.raise_error;
593: else
594: --
595: -- Check that filing_status_code is in a valid range.
588: -- Check that filing_status_code is not null.
589: --
590: if p_filing_status_code is null then
591: hr_utility.set_message(801,'PAY_72742_CTY_FIL_STA_NOT_NULL');
592: hr_utility.raise_error;
593: else
594: --
595: -- Check that filing_status_code is in a valid range.
596: --
601: ,p_lookup_type => 'US_LIT_FILING_STATUS'
602: ,p_lookup_code => p_filing_status_code
603: ) then
604: --
605: hr_utility.set_message(801,'PAY_72741_CTY_FIL_STAT_INVALID');
606: hr_utility.raise_error;
607: end if;
608: end if;
609: end if;
602: ,p_lookup_code => p_filing_status_code
603: ) then
604: --
605: hr_utility.set_message(801,'PAY_72741_CTY_FIL_STAT_INVALID');
606: hr_utility.raise_error;
607: end if;
608: end if;
609: end if;
610:
607: end if;
608: end if;
609: end if;
610:
611: hr_utility.set_location(' Leaving: '||l_proc, 15);
612: end chk_filing_status_code;
613: --
614: --
615: -- ---------------------------------------------------------------------------
648: --
649: l_proc varchar2(72) := g_package||'chk_lit_additional_tax';
650: --
651: begin
652: hr_utility.set_location('Entering: '|| l_proc, 5);
653: --
654: -- If value is being inserted or updated ...
655: --
656: if (p_emp_city_tax_rule_id is not null
660: --
661: -- Check that lit_additional_tax is not null.
662: --
663: if p_lit_additional_tax is null then
664: hr_utility.set_message(801,'PAY_72733_CTY_ADL_TAX_NOT_NULL');
665: hr_utility.raise_error;
666: else
667: --
668: -- Check that lit_additional_tax is in a valid range.
661: -- Check that lit_additional_tax is not null.
662: --
663: if p_lit_additional_tax is null then
664: hr_utility.set_message(801,'PAY_72733_CTY_ADL_TAX_NOT_NULL');
665: hr_utility.raise_error;
666: else
667: --
668: -- Check that lit_additional_tax is in a valid range.
669: --
667: --
668: -- Check that lit_additional_tax is in a valid range.
669: --
670: if p_lit_additional_tax < 0 then
671: hr_utility.set_message(801,'PAY_72732_CTY_ADL_TAX_POSITIVE');
672: hr_utility.raise_error;
673: end if;
674: end if;
675: end if;
668: -- Check that lit_additional_tax is in a valid range.
669: --
670: if p_lit_additional_tax < 0 then
671: hr_utility.set_message(801,'PAY_72732_CTY_ADL_TAX_POSITIVE');
672: hr_utility.raise_error;
673: end if;
674: end if;
675: end if;
676:
673: end if;
674: end if;
675: end if;
676:
677: hr_utility.set_location(' Leaving: '||l_proc, 15);
678: end chk_lit_additional_tax;
679: --
680: -- ---------------------------------------------------------------------------
681: -- |------------------------< chk_lit_override_amount >----------------------|
713: l_proc varchar2(72) := g_package||
714: 'chk_lit_override_amount';
715: --
716: begin
717: hr_utility.set_location('Entering: '|| l_proc, 5);
718: --
719: -- If value is being inserted or updated ...
720: --
721: if (p_emp_city_tax_rule_id is not null
725: --
726: -- Check that lit_override_amount is not null.
727: --
728: if p_lit_override_amount is null then
729: hr_utility.set_message(801,'PAY_72747_CTY_OVRD_AMT_NOT_NUL');
730: hr_utility.raise_error;
731: else
732: --
733: -- Check that lit_override_amount is in a valid range.
726: -- Check that lit_override_amount is not null.
727: --
728: if p_lit_override_amount is null then
729: hr_utility.set_message(801,'PAY_72747_CTY_OVRD_AMT_NOT_NUL');
730: hr_utility.raise_error;
731: else
732: --
733: -- Check that lit_override_amount is in a valid range.
734: --
732: --
733: -- Check that lit_override_amount is in a valid range.
734: --
735: if p_lit_override_amount < 0 then
736: hr_utility.set_message(801,'PAY_72746_CTY_OVRD_AMT_POSTVE');
737: hr_utility.raise_error;
738: end if;
739: end if;
740: end if;
733: -- Check that lit_override_amount is in a valid range.
734: --
735: if p_lit_override_amount < 0 then
736: hr_utility.set_message(801,'PAY_72746_CTY_OVRD_AMT_POSTVE');
737: hr_utility.raise_error;
738: end if;
739: end if;
740: end if;
741:
738: end if;
739: end if;
740: end if;
741:
742: hr_utility.set_location(' Leaving: '||l_proc, 15);
743: end chk_lit_override_amount;
744: --
745: -- ---------------------------------------------------------------------------
746: -- |------------------------< chk_lit_override_rate >------------------------|
778: l_proc varchar2(72) := g_package||
779: 'chk_lit_override_rate';
780: --
781: begin
782: hr_utility.set_location('Entering: '|| l_proc, 5);
783: --
784: -- If value is being inserted or updated ...
785: --
786: if (p_emp_city_tax_rule_id is not null
790: --
791: -- Check that lit_override_rate is not null.
792: --
793: if p_lit_override_rate is null then
794: hr_utility.set_message(801,'PAY_72749_CTY_OVRD_RT_NOT_NULL');
795: hr_utility.raise_error;
796: else
797: --
798: -- Check that lit_override_rate is in a valid range.
791: -- Check that lit_override_rate is not null.
792: --
793: if p_lit_override_rate is null then
794: hr_utility.set_message(801,'PAY_72749_CTY_OVRD_RT_NOT_NULL');
795: hr_utility.raise_error;
796: else
797: --
798: -- Check that lit_override_rate is in a valid range.
799: --
797: --
798: -- Check that lit_override_rate is in a valid range.
799: --
800: if p_lit_override_rate < 0 or p_lit_override_rate > 100 then
801: hr_utility.set_message(801,'PAY_72748_CTY_OVRD_RT_IN_RANG');
802: hr_utility.raise_error;
803: end if;
804: end if;
805: end if;
798: -- Check that lit_override_rate is in a valid range.
799: --
800: if p_lit_override_rate < 0 or p_lit_override_rate > 100 then
801: hr_utility.set_message(801,'PAY_72748_CTY_OVRD_RT_IN_RANG');
802: hr_utility.raise_error;
803: end if;
804: end if;
805: end if;
806: hr_utility.set_location(' Leaving: '||l_proc, 15);
802: hr_utility.raise_error;
803: end if;
804: end if;
805: end if;
806: hr_utility.set_location(' Leaving: '||l_proc, 15);
807: end chk_lit_override_rate;
808: --
809: -- ---------------------------------------------------------------------------
810: -- |----------------------< chk_withholding_allowances >---------------------|
842: l_proc varchar2(72) := g_package||
843: 'chk_withholding_allowances';
844: --
845: begin
846: hr_utility.set_location('Entering: '|| l_proc, 5);
847: --
848: -- If value is being inserted or updated ...
849: --
850: if (p_emp_city_tax_rule_id is not null
854: --
855: -- Check that withholding_allowances is not null.
856: --
857: if p_withholding_allowances is null then
858: hr_utility.set_message(801,'PAY_72754_CTY_WA_NOT_NULL');
859: hr_utility.raise_error;
860: else
861: --
862: -- Check that withholding_allowances is in a valid range.
855: -- Check that withholding_allowances is not null.
856: --
857: if p_withholding_allowances is null then
858: hr_utility.set_message(801,'PAY_72754_CTY_WA_NOT_NULL');
859: hr_utility.raise_error;
860: else
861: --
862: -- Check that withholding_allowances is in a valid range.
863: --
861: --
862: -- Check that withholding_allowances is in a valid range.
863: --
864: if p_withholding_allowances < 0 then
865: hr_utility.set_message(801,'PAY_72753_CTY_WA_POSITIVE');
866: hr_utility.raise_error;
867: end if;
868: end if;
869: end if;
862: -- Check that withholding_allowances is in a valid range.
863: --
864: if p_withholding_allowances < 0 then
865: hr_utility.set_message(801,'PAY_72753_CTY_WA_POSITIVE');
866: hr_utility.raise_error;
867: end if;
868: end if;
869: end if;
870: hr_utility.set_location(' Leaving: '||l_proc, 15);
866: hr_utility.raise_error;
867: end if;
868: end if;
869: end if;
870: hr_utility.set_location(' Leaving: '||l_proc, 15);
871: end chk_withholding_allowances;
872: --
873: -- ---------------------------------------------------------------------------
874: -- |------------------------< chk_school_district_code >---------------------|
982: and ctr.state_code = p_sta_code
983: and ctr.county_code = p_cnt_code;
984: --
985: begin
986: hr_utility.set_location('Entering: '|| l_proc, 5);
987: --
988: hr_api.mandatory_arg_error
989: (p_api_name => l_proc
990: ,p_argument => 'state_code'
1019: --
1020: -- Check school_district_code.
1021: --
1022: if p_school_district_code is not null then
1023: hr_utility.set_location(l_proc, 10);
1024: --
1025: open csr_school_district_code (p_state_code,
1026: p_county_code,
1027: p_city_code,
1047: or (csr_cnt_school_district_code%found) then
1048: close csr_cty_school_district_code;
1049: close csr_cnt_school_district_code;
1050: --
1051: hr_utility.set_message(801,'PAY_52240_TAX_SD_CHK');
1052: hr_utility.raise_error;
1053: --
1054: end if;
1055: close csr_cty_school_district_code;
1048: close csr_cty_school_district_code;
1049: close csr_cnt_school_district_code;
1050: --
1051: hr_utility.set_message(801,'PAY_52240_TAX_SD_CHK');
1052: hr_utility.raise_error;
1053: --
1054: end if;
1055: close csr_cty_school_district_code;
1056: close csr_cnt_school_district_code;
1056: close csr_cnt_school_district_code;
1057: else
1058: --
1059: close csr_school_district_code;
1060: hr_utility.set_message(801,'PAY_72750_CTY_SCHL_DST_INVALID');
1061: hr_utility.raise_error;
1062: end if;
1063: end if;
1064: end if;
1057: else
1058: --
1059: close csr_school_district_code;
1060: hr_utility.set_message(801,'PAY_72750_CTY_SCHL_DST_INVALID');
1061: hr_utility.raise_error;
1062: end if;
1063: end if;
1064: end if;
1065: hr_utility.set_location(' Leaving: '||l_proc, 15);
1061: hr_utility.raise_error;
1062: end if;
1063: end if;
1064: end if;
1065: hr_utility.set_location(' Leaving: '||l_proc, 15);
1066: end chk_school_district_code;
1067: --
1068: -- ---------------------------------------------------------------------------
1069: -- |-------------------------------< chk_delete >----------------------------|
1194: --
1195: --
1196: --
1197: begin
1198: hr_utility.set_location('Entering: '|| l_proc, 5);
1199: --
1200: if p_delete_mode in ('ZAP','DELETE') then
1201: hr_utility.set_location(l_proc, 10);
1202: if p_delete_mode = hr_api.g_zap then
1197: begin
1198: hr_utility.set_location('Entering: '|| l_proc, 5);
1199: --
1200: if p_delete_mode in ('ZAP','DELETE') then
1201: hr_utility.set_location(l_proc, 10);
1202: if p_delete_mode = hr_api.g_zap then
1203: l_effective_date := trunc(hr_api.g_sot);
1204: else
1205: l_effective_date := trunc(p_effective_date);
1208: open chk_city_payroll(l_effective_date);
1209: fetch chk_city_payroll into l_payroll_exists;
1210: if chk_city_payroll%found then
1211: close chk_city_payroll;
1212: hr_utility.set_message(801,'PAY_52235_TAX_RULE_DELETE');
1213: hr_utility.raise_error;
1214: end if;
1215: close chk_city_payroll;
1216: end if;
1209: fetch chk_city_payroll into l_payroll_exists;
1210: if chk_city_payroll%found then
1211: close chk_city_payroll;
1212: hr_utility.set_message(801,'PAY_52235_TAX_RULE_DELETE');
1213: hr_utility.raise_error;
1214: end if;
1215: close chk_city_payroll;
1216: end if;
1217: end if;
1216: end if;
1217: end if;
1218: --
1219: if p_delete_mode = 'ZAP' and p_delete_routine <> 'ASSIGNMENT' then
1220: hr_utility.set_location(l_proc, 15);
1221: open chk_city_work(l_effective_date);
1222: fetch chk_city_work into l_city_work_exists;
1223: if chk_city_work%found then
1224: close chk_city_work;
1221: open chk_city_work(l_effective_date);
1222: fetch chk_city_work into l_city_work_exists;
1223: if chk_city_work%found then
1224: close chk_city_work;
1225: hr_utility.set_message(801,'PAY_52295_TAX_CIDEL_LOC');
1226: hr_utility.raise_error;
1227: end if;
1228: close chk_city_work;
1229: --
1222: fetch chk_city_work into l_city_work_exists;
1223: if chk_city_work%found then
1224: close chk_city_work;
1225: hr_utility.set_message(801,'PAY_52295_TAX_CIDEL_LOC');
1226: hr_utility.raise_error;
1227: end if;
1228: close chk_city_work;
1229: --
1230: hr_utility.set_location(l_proc, 20);
1226: hr_utility.raise_error;
1227: end if;
1228: close chk_city_work;
1229: --
1230: hr_utility.set_location(l_proc, 20);
1231: open chk_city_residence(l_effective_date);
1232: fetch chk_city_residence into l_city_residence;
1233: if chk_city_residence%found then
1234: close chk_city_residence;
1231: open chk_city_residence(l_effective_date);
1232: fetch chk_city_residence into l_city_residence;
1233: if chk_city_residence%found then
1234: close chk_city_residence;
1235: hr_utility.set_message(801,'PAY_52298_TAX_CIDEL_RES');
1236: hr_utility.raise_error;
1237: end if;
1238: close chk_city_residence;
1239: end if;
1232: fetch chk_city_residence into l_city_residence;
1233: if chk_city_residence%found then
1234: close chk_city_residence;
1235: hr_utility.set_message(801,'PAY_52298_TAX_CIDEL_RES');
1236: hr_utility.raise_error;
1237: end if;
1238: close chk_city_residence;
1239: end if;
1240: --
1238: close chk_city_residence;
1239: end if;
1240: --
1241: if p_delete_mode <> 'ZAP' and p_delete_routine <> 'ASSIGNMENT' then
1242: hr_utility.set_message(801,'PAY_52971_TAX_ZAP_ONLY');
1243: hr_utility.raise_error;
1244: end if;
1245: hr_utility.set_location(' Leaving: '||l_proc, 45);
1246: --
1239: end if;
1240: --
1241: if p_delete_mode <> 'ZAP' and p_delete_routine <> 'ASSIGNMENT' then
1242: hr_utility.set_message(801,'PAY_52971_TAX_ZAP_ONLY');
1243: hr_utility.raise_error;
1244: end if;
1245: hr_utility.set_location(' Leaving: '||l_proc, 45);
1246: --
1247: end chk_delete;
1241: if p_delete_mode <> 'ZAP' and p_delete_routine <> 'ASSIGNMENT' then
1242: hr_utility.set_message(801,'PAY_52971_TAX_ZAP_ONLY');
1243: hr_utility.raise_error;
1244: end if;
1245: hr_utility.set_location(' Leaving: '||l_proc, 45);
1246: --
1247: end chk_delete;
1248: --
1249: --
1280: l_error exception;
1281: l_argument varchar2(30);
1282: --
1283: Begin
1284: hr_utility.set_location('Entering: '||l_proc, 10);
1285: --
1286: --
1287: if not pay_cty_shd.api_updating
1288: (p_emp_city_tax_rule_id => p_rec.emp_city_tax_rule_id,
1288: (p_emp_city_tax_rule_id => p_rec.emp_city_tax_rule_id,
1289: p_object_version_number => p_rec.object_version_number,
1290: p_effective_date => p_effective_date
1291: ) then
1292: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
1293: hr_utility.set_message_token('PROCEDURE', l_proc);
1294: hr_utility.set_message_token('STEP',20);
1295: end if;
1296: hr_utility.set_location(l_proc, 30);
1289: p_object_version_number => p_rec.object_version_number,
1290: p_effective_date => p_effective_date
1291: ) then
1292: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
1293: hr_utility.set_message_token('PROCEDURE', l_proc);
1294: hr_utility.set_message_token('STEP',20);
1295: end if;
1296: hr_utility.set_location(l_proc, 30);
1297: --
1290: p_effective_date => p_effective_date
1291: ) then
1292: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
1293: hr_utility.set_message_token('PROCEDURE', l_proc);
1294: hr_utility.set_message_token('STEP',20);
1295: end if;
1296: hr_utility.set_location(l_proc, 30);
1297: --
1298: if (nvl(p_rec.business_group_id, hr_api.g_number) <>
1292: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
1293: hr_utility.set_message_token('PROCEDURE', l_proc);
1294: hr_utility.set_message_token('STEP',20);
1295: end if;
1296: hr_utility.set_location(l_proc, 30);
1297: --
1298: if (nvl(p_rec.business_group_id, hr_api.g_number) <>
1299: pay_cty_shd.g_old_rec.business_group_id) then
1300: l_argument := 'business_group_id';
1299: pay_cty_shd.g_old_rec.business_group_id) then
1300: l_argument := 'business_group_id';
1301: raise l_error;
1302: end if;
1303: hr_utility.set_location(l_proc, 40);
1304: --
1305: if (nvl(p_rec.assignment_id, hr_api.g_number) <>
1306: pay_cty_shd.g_old_rec.assignment_id) then
1307: l_argument := 'assignment_id';
1306: pay_cty_shd.g_old_rec.assignment_id) then
1307: l_argument := 'assignment_id';
1308: raise l_error;
1309: end if;
1310: hr_utility.set_location(l_proc, 50);
1311: --
1312: if (nvl(p_rec.state_code, hr_api.g_varchar2) <>
1313: pay_cty_shd.g_old_rec.state_code) then
1314: l_argument := 'state_code';
1313: pay_cty_shd.g_old_rec.state_code) then
1314: l_argument := 'state_code';
1315: raise l_error;
1316: end if;
1317: hr_utility.set_location(l_proc, 60);
1318: --
1319: if (nvl(p_rec.county_code, hr_api.g_varchar2) <>
1320: pay_cty_shd.g_old_rec.county_code) then
1321: l_argument := 'county_code';
1320: pay_cty_shd.g_old_rec.county_code) then
1321: l_argument := 'county_code';
1322: raise l_error;
1323: end if;
1324: hr_utility.set_location(l_proc, 70);
1325: --
1326: if (nvl(p_rec.city_code, hr_api.g_varchar2) <>
1327: pay_cty_shd.g_old_rec.city_code) then
1328: l_argument := 'city_code';
1327: pay_cty_shd.g_old_rec.city_code) then
1328: l_argument := 'city_code';
1329: raise l_error;
1330: end if;
1331: hr_utility.set_location(l_proc, 80);
1332: --
1333: if (nvl(p_rec.jurisdiction_code, hr_api.g_varchar2) <>
1334: pay_cty_shd.g_old_rec.jurisdiction_code) then
1335: l_argument := 'jurisdiction_code';
1334: pay_cty_shd.g_old_rec.jurisdiction_code) then
1335: l_argument := 'jurisdiction_code';
1336: raise l_error;
1337: end if;
1338: hr_utility.set_location('Leaving: '||l_proc, 90);
1339: --
1340: exception
1341: when l_error then
1342: hr_api.argument_changed_error
1387: l_integrity_error Exception;
1388: l_table_name all_tables.table_name%TYPE;
1389: --
1390: Begin
1391: hr_utility.set_location('Entering:'||l_proc, 5);
1392: --
1393: -- Ensure that the p_datetrack_mode argument is not null
1394: --
1395: hr_api.mandatory_arg_error
1417: --
1418: --
1419: End If;
1420: --
1421: hr_utility.set_location(' Leaving:'||l_proc, 10);
1422: Exception
1423: When l_integrity_error Then
1424: --
1425: -- A referential integrity check was violated therefore
1424: --
1425: -- A referential integrity check was violated therefore
1426: -- we must error
1427: --
1428: hr_utility.set_message(801, 'HR_7216_DT_UPD_INTEGRITY_ERR');
1429: hr_utility.set_message_token('TABLE_NAME', l_table_name);
1430: hr_utility.raise_error;
1431: When Others Then
1432: --
1425: -- A referential integrity check was violated therefore
1426: -- we must error
1427: --
1428: hr_utility.set_message(801, 'HR_7216_DT_UPD_INTEGRITY_ERR');
1429: hr_utility.set_message_token('TABLE_NAME', l_table_name);
1430: hr_utility.raise_error;
1431: When Others Then
1432: --
1433: -- An unhandled or unexpected error has occurred which
1426: -- we must error
1427: --
1428: hr_utility.set_message(801, 'HR_7216_DT_UPD_INTEGRITY_ERR');
1429: hr_utility.set_message_token('TABLE_NAME', l_table_name);
1430: hr_utility.raise_error;
1431: When Others Then
1432: --
1433: -- An unhandled or unexpected error has occurred which
1434: -- we must report
1432: --
1433: -- An unhandled or unexpected error has occurred which
1434: -- we must report
1435: --
1436: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1437: hr_utility.set_message_token('PROCEDURE', l_proc);
1438: hr_utility.set_message_token('STEP','15');
1439: hr_utility.raise_error;
1440: End dt_update_validate;
1433: -- An unhandled or unexpected error has occurred which
1434: -- we must report
1435: --
1436: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1437: hr_utility.set_message_token('PROCEDURE', l_proc);
1438: hr_utility.set_message_token('STEP','15');
1439: hr_utility.raise_error;
1440: End dt_update_validate;
1441: --
1434: -- we must report
1435: --
1436: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1437: hr_utility.set_message_token('PROCEDURE', l_proc);
1438: hr_utility.set_message_token('STEP','15');
1439: hr_utility.raise_error;
1440: End dt_update_validate;
1441: --
1442: -- ----------------------------------------------------------------------------
1435: --
1436: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1437: hr_utility.set_message_token('PROCEDURE', l_proc);
1438: hr_utility.set_message_token('STEP','15');
1439: hr_utility.raise_error;
1440: End dt_update_validate;
1441: --
1442: -- ----------------------------------------------------------------------------
1443: -- |--------------------------< dt_delete_validate >--------------------------|
1484: l_rows_exist Exception;
1485: l_table_name all_tables.table_name%TYPE;
1486: --
1487: Begin
1488: hr_utility.set_location('Entering:'||l_proc, 5);
1489: --
1490: -- Ensure that the p_datetrack_mode argument is not null
1491: --
1492: hr_api.mandatory_arg_error
1521: --
1522: --
1523: End If;
1524: --
1525: hr_utility.set_location(' Leaving:'||l_proc, 10);
1526: Exception
1527: When l_rows_exist Then
1528: --
1529: -- A referential integrity check was violated therefore
1528: --
1529: -- A referential integrity check was violated therefore
1530: -- we must error
1531: --
1532: hr_utility.set_message(801, 'HR_7215_DT_CHILD_EXISTS');
1533: hr_utility.set_message_token('TABLE_NAME', l_table_name);
1534: hr_utility.raise_error;
1535: When Others Then
1536: --
1529: -- A referential integrity check was violated therefore
1530: -- we must error
1531: --
1532: hr_utility.set_message(801, 'HR_7215_DT_CHILD_EXISTS');
1533: hr_utility.set_message_token('TABLE_NAME', l_table_name);
1534: hr_utility.raise_error;
1535: When Others Then
1536: --
1537: -- An unhandled or unexpected error has occurred which
1530: -- we must error
1531: --
1532: hr_utility.set_message(801, 'HR_7215_DT_CHILD_EXISTS');
1533: hr_utility.set_message_token('TABLE_NAME', l_table_name);
1534: hr_utility.raise_error;
1535: When Others Then
1536: --
1537: -- An unhandled or unexpected error has occurred which
1538: -- we must report
1536: --
1537: -- An unhandled or unexpected error has occurred which
1538: -- we must report
1539: --
1540: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1541: hr_utility.set_message_token('PROCEDURE', l_proc);
1542: hr_utility.set_message_token('STEP','15');
1543: hr_utility.raise_error;
1544: End dt_delete_validate;
1537: -- An unhandled or unexpected error has occurred which
1538: -- we must report
1539: --
1540: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1541: hr_utility.set_message_token('PROCEDURE', l_proc);
1542: hr_utility.set_message_token('STEP','15');
1543: hr_utility.raise_error;
1544: End dt_delete_validate;
1545: --
1538: -- we must report
1539: --
1540: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1541: hr_utility.set_message_token('PROCEDURE', l_proc);
1542: hr_utility.set_message_token('STEP','15');
1543: hr_utility.raise_error;
1544: End dt_delete_validate;
1545: --
1546: -- ----------------------------------------------------------------------------
1539: --
1540: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1541: hr_utility.set_message_token('PROCEDURE', l_proc);
1542: hr_utility.set_message_token('STEP','15');
1543: hr_utility.raise_error;
1544: End dt_delete_validate;
1545: --
1546: -- ----------------------------------------------------------------------------
1547: -- |---------------------------< insert_validate >----------------------------|
1555: --
1556: l_proc varchar2(72) := g_package||'insert_validate';
1557: --
1558: Begin
1559: hr_utility.set_location('Entering:'||l_proc, 5);
1560: --
1561: -- Call all supporting business operations
1562: --
1563: --
1639: p_object_version_number => p_rec.object_version_number
1640: );
1641: --
1642: --
1643: hr_utility.set_location(' Leaving:'||l_proc, 10);
1644: End insert_validate;
1645: --
1646: -- ----------------------------------------------------------------------------
1647: -- |---------------------------< update_validate >----------------------------|
1655: --
1656: l_proc varchar2(72) := g_package||'update_validate';
1657: --
1658: Begin
1659: hr_utility.set_location('Entering:'||l_proc, 5);
1660: --
1661: -- Call all supporting business operations
1662: --
1663: chk_non_updateable_args
1719: p_datetrack_mode => p_datetrack_mode,
1720: p_validation_start_date => p_validation_start_date,
1721: p_validation_end_date => p_validation_end_date);
1722: --
1723: hr_utility.set_location(' Leaving:'||l_proc, 10);
1724: End update_validate;
1725: --
1726: -- ----------------------------------------------------------------------------
1727: -- |---------------------------< delete_validate >----------------------------|
1736: --
1737: l_proc varchar2(72) := g_package||'delete_validate';
1738: --
1739: Begin
1740: hr_utility.set_location('Entering:'||l_proc, 5);
1741: --
1742: -- Call all supporting business operations
1743: --
1744: chk_delete
1750: p_delete_mode => p_datetrack_mode,
1751: p_delete_routine => p_delete_routine
1752: );
1753: --
1754: hr_utility.set_location(l_proc, 10);
1755: --
1756: dt_delete_validate
1757: (p_datetrack_mode => p_datetrack_mode,
1758: p_validation_start_date => p_validation_start_date,
1758: p_validation_start_date => p_validation_start_date,
1759: p_validation_end_date => p_validation_end_date,
1760: p_emp_city_tax_rule_id => p_rec.emp_city_tax_rule_id);
1761: --
1762: hr_utility.set_location(' Leaving:'||l_proc, 15);
1763: End delete_validate;
1764: --
1765: --
1766: -- ---------------------------------------------------------------------------
1785: l_proc varchar2(72) := g_package||'return_legislation_code';
1786: --
1787: begin
1788: --
1789: hr_utility.set_location('Entering:'|| l_proc, 10);
1790: --
1791: -- Ensure that all the mandatory parameter are not null
1792: --
1793: hr_api.mandatory_arg_error(p_api_name => l_proc,
1800: -- call to this function. Just return the value in the global
1801: -- variable.
1802: --
1803: l_legislation_code := g_legislation_code;
1804: hr_utility.set_location(l_proc, 20);
1805: --
1806: else
1807: --
1808: -- The ID is different to the last call to this function
1817: close csr_leg_code;
1818: --
1819: -- The primary key is invalid therefore we must error
1820: --
1821: hr_utility.set_message(801,'HR_7220_INVALID_PRIMARY_KEY');
1822: hr_utility.raise_error;
1823: --
1824: end if;
1825: hr_utility.set_location(' Leaving:'|| l_proc, 30);
1818: --
1819: -- The primary key is invalid therefore we must error
1820: --
1821: hr_utility.set_message(801,'HR_7220_INVALID_PRIMARY_KEY');
1822: hr_utility.raise_error;
1823: --
1824: end if;
1825: hr_utility.set_location(' Leaving:'|| l_proc, 30);
1826: --
1821: hr_utility.set_message(801,'HR_7220_INVALID_PRIMARY_KEY');
1822: hr_utility.raise_error;
1823: --
1824: end if;
1825: hr_utility.set_location(' Leaving:'|| l_proc, 30);
1826: --
1827: -- Set the global variables to the values are
1828: -- available for the next call to this function
1829: --
1830: close csr_leg_code;
1831: g_cty_tax_rule_id := p_emp_city_tax_rule_id;
1832: g_legislation_code := l_legislation_code;
1833: end if;
1834: hr_utility.set_location(' Leaving:'|| l_proc, 40);
1835: --
1836: return l_legislation_code;
1837: --
1838: end return_legislation_code;