84: g_paye_input15 constant varchar2(60) := 'SFSS';
85: g_paye_input16 constant varchar2(60) := 'EXEMPT FLOOD LEVY';
86: g_legislation_code constant varchar2(2) := 'AU';
87:
88: g_debug boolean := hr_utility.debug_enabled;
89:
90:
91: PROCEDURE maintain_PAYE_tax_info
92: (p_validate IN BOOLEAN DEFAULT FALSE
433: OPEN csr_leave_loading_flag (p_assignment_id, l_session_date);
434: FETCH csr_leave_loading_flag INTO l_lev_lod_flg;
435: CLOSE csr_leave_loading_flag;
436:
437: hr_utility.trace('after leave loading');
438:
439: --SFSS Value cannot exist before 31-JUL-2000
440: -- Bug#5258625
441: if ((l_session_date < to_date('31/07/2000','DD/MM/YYYY')) and (substr(P_help_sfss_flag,2,1) is not null)) then
438:
439: --SFSS Value cannot exist before 31-JUL-2000
440: -- Bug#5258625
441: if ((l_session_date < to_date('31/07/2000','DD/MM/YYYY')) and (substr(P_help_sfss_flag,2,1) is not null)) then
442: hr_utility.set_message(801,'HR_AU_SFSS_NOT_VALID');
443: hr_utility.raise_error;
444: end If;
445:
446: -- MLS is not valid before 01-JUL-2000
439: --SFSS Value cannot exist before 31-JUL-2000
440: -- Bug#5258625
441: if ((l_session_date < to_date('31/07/2000','DD/MM/YYYY')) and (substr(P_help_sfss_flag,2,1) is not null)) then
442: hr_utility.set_message(801,'HR_AU_SFSS_NOT_VALID');
443: hr_utility.raise_error;
444: end If;
445:
446: -- MLS is not valid before 01-JUL-2000
447: if ((l_session_date < to_date('01/07/2000','DD/MM/YYYY')) and (substr(p_spouse_mls_flag,2,1) =
446: -- MLS is not valid before 01-JUL-2000
447: if ((l_session_date < to_date('01/07/2000','DD/MM/YYYY')) and (substr(p_spouse_mls_flag,2,1) =
448: 'Y'))
449: then
450: hr_utility.set_message(801,'HR_AU_MLS_NOT_VALID');
451: hr_utility.raise_error;
452: end If;
453:
454:
447: if ((l_session_date < to_date('01/07/2000','DD/MM/YYYY')) and (substr(p_spouse_mls_flag,2,1) =
448: 'Y'))
449: then
450: hr_utility.set_message(801,'HR_AU_MLS_NOT_VALID');
451: hr_utility.raise_error;
452: end If;
453:
454:
455: -- Derive the tax scale
461: ,p_lev_lod_flg => l_lev_lod_flg
462: ,p_medicare_levy_variation_code => p_medicare_levy_variation_code
463: ,p_tax_variation_type => substr(p_tax_variation_type,1,1) /*Bug 4598178*/
464: );
465: hr_utility.trace('Tax Scale : '||to_char(L_tax_scale));
466: --
467: -- Get the element type id for the Tax element
468: hr_utility.trace('element_type_id');
469: --
464: );
465: hr_utility.trace('Tax Scale : '||to_char(L_tax_scale));
466: --
467: -- Get the element type id for the Tax element
468: hr_utility.trace('element_type_id');
469: --
470: OPEN csr_paye_tax_element;
471: fetch csr_paye_tax_element into l_element_type_id;
472: IF (csr_paye_tax_element%NOTFOUND)
471: fetch csr_paye_tax_element into l_element_type_id;
472: IF (csr_paye_tax_element%NOTFOUND)
473: THEN
474: CLOSE csr_paye_tax_element;
475: hr_utility.set_message(801,'HR_AU_NZ_ELE_TYP_NOT_FND');
476: hr_utility.raise_error;
477: END IF;
478: CLOSE csr_paye_tax_element;
479:
472: IF (csr_paye_tax_element%NOTFOUND)
473: THEN
474: CLOSE csr_paye_tax_element;
475: hr_utility.set_message(801,'HR_AU_NZ_ELE_TYP_NOT_FND');
476: hr_utility.raise_error;
477: END IF;
478: CLOSE csr_paye_tax_element;
479:
480: --
479:
480: --
481: -- Get the Input Value Id for each Tax Input
482:
483: hr_utility.trace('input value id');
484:
485: --
486: FOR rec_paye_tax_element in csr_paye_tax_input_values(l_element_type_id) LOOP
487: IF UPPER(rec_paye_tax_element.name) = 'AUSTRALIAN RESIDENT' THEN
542:
543:
544: IF (l_element_link_id IS NULL OR l_element_link_id = 0)
545: THEN
546: hr_utility.set_message(801,'HR_AU_ELE_LNK_NOT_FND');
547: hr_utility.raise_error;
548: END IF;
549:
550:
543:
544: IF (l_element_link_id IS NULL OR l_element_link_id = 0)
545: THEN
546: hr_utility.set_message(801,'HR_AU_ELE_LNK_NOT_FND');
547: hr_utility.raise_error;
548: END IF;
549:
550:
551: IF (l_mode IN ('CORRECTION','UPDATE','UPDATE_CHANGE_INSERT','UPDATE_OVERRIDE')) THEN
551: IF (l_mode IN ('CORRECTION','UPDATE','UPDATE_CHANGE_INSERT','UPDATE_OVERRIDE')) THEN
552: -----------------------------------------------------------------------------
553: -- Get the element entry of the tax element entry that is to be updated
554: ------------------------------------------------------------------------------
555: hr_utility.set_location('hr_au_tax_api.maintain_tax_info' ,7);
556:
557: OPEN csr_ele_entry(l_element_link_id, l_inp_value_id_table(1));
558: FETCH csr_ele_entry INTO l_element_entry_id,l_object_version_number;
559: IF (csr_ele_entry%NOTFOUND) THEN
557: OPEN csr_ele_entry(l_element_link_id, l_inp_value_id_table(1));
558: FETCH csr_ele_entry INTO l_element_entry_id,l_object_version_number;
559: IF (csr_ele_entry%NOTFOUND) THEN
560: CLOSE csr_ele_entry;
561: hr_utility.set_message(801,'HR_AU_ELE_ENT_NOT_FND');
562: hr_utility.raise_error;
563: END IF;
564: CLOSE csr_ele_entry;
565:
558: FETCH csr_ele_entry INTO l_element_entry_id,l_object_version_number;
559: IF (csr_ele_entry%NOTFOUND) THEN
560: CLOSE csr_ele_entry;
561: hr_utility.set_message(801,'HR_AU_ELE_ENT_NOT_FND');
562: hr_utility.raise_error;
563: END IF;
564: CLOSE csr_ele_entry;
565:
566:
586: ELSE
587: l_upd_tax_scale := l_tax_scale;
588: END IF;
589:
590: hr_utility.trace('Session Date = '||l_session_date);
591: hr_utility.trace('to_date = '||to_date('01/07/2008','DD/MM/YYYY'));
592:
593: /* Bug 7042960: 2008 Statutory Updates - FTA Claim Changes */
594: IF (l_session_date >= to_date('01/07/2008','DD/MM/YYYY')) THEN
587: l_upd_tax_scale := l_tax_scale;
588: END IF;
589:
590: hr_utility.trace('Session Date = '||l_session_date);
591: hr_utility.trace('to_date = '||to_date('01/07/2008','DD/MM/YYYY'));
592:
593: /* Bug 7042960: 2008 Statutory Updates - FTA Claim Changes */
594: IF (l_session_date >= to_date('01/07/2008','DD/MM/YYYY')) THEN
595: open get_fta_claim_flag(p_fta_claim_flag);
594: IF (l_session_date >= to_date('01/07/2008','DD/MM/YYYY')) THEN
595: open get_fta_claim_flag(p_fta_claim_flag);
596: fetch get_fta_claim_flag into l_fta_claim_flag;
597: close get_fta_claim_flag;
598: hr_utility.trace('Inside IF: l_fta_claim_flag Value = '||l_fta_claim_flag);
599: ELSE
600: l_fta_claim_flag := p_fta_claim_flag;
601: hr_utility.trace('Inside ELSE: l_fta_claim_flag Value = '||l_fta_claim_flag);
602: END IF;
597: close get_fta_claim_flag;
598: hr_utility.trace('Inside IF: l_fta_claim_flag Value = '||l_fta_claim_flag);
599: ELSE
600: l_fta_claim_flag := p_fta_claim_flag;
601: hr_utility.trace('Inside ELSE: l_fta_claim_flag Value = '||l_fta_claim_flag);
602: END IF;
603:
604: -- Check if the API is called from Tax Declaration form or not
605:
694: l_entry_information_category := 'AU_TAX DEDUCTIONS';
695: l_entry_information1 := null;
696: END IF;
697:
698: hr_utility.trace('Upd Tax Scale' || l_upd_tax_scale);
699: hr_utility.trace('fta_claim_flag' || p_fta_claim_flag);
700: /* Bug 12570937 - Added flood levy parameter to the below call */
701: py_element_entry_api.update_element_entry
702: (p_validate => p_validate
695: l_entry_information1 := null;
696: END IF;
697:
698: hr_utility.trace('Upd Tax Scale' || l_upd_tax_scale);
699: hr_utility.trace('fta_claim_flag' || p_fta_claim_flag);
700: /* Bug 12570937 - Added flood levy parameter to the below call */
701: py_element_entry_api.update_element_entry
702: (p_validate => p_validate
703: ,p_datetrack_update_mode=> l_mode
892: FETCH csr_paye_tax_element INTO l_element_type_id;
893: IF (csr_paye_tax_element%NOTFOUND)
894: THEN
895: CLOSE csr_paye_tax_element;
896: hr_utility.set_message(801,'HR_AU_NZ_ELE_TYP_NOT_FND');
897: hr_utility.raise_error;
898: END IF;
899: CLOSE csr_paye_tax_element;
900:
893: IF (csr_paye_tax_element%NOTFOUND)
894: THEN
895: CLOSE csr_paye_tax_element;
896: hr_utility.set_message(801,'HR_AU_NZ_ELE_TYP_NOT_FND');
897: hr_utility.raise_error;
898: END IF;
899: CLOSE csr_paye_tax_element;
900:
901: --
915: ,p_element_type_id => l_element_type_id
916: ,p_session_date => l_session_date);
917: IF (l_element_link_id IS NULL OR l_element_link_id = 0)
918: THEN
919: hr_utility.set_message(801,'HR_AU_ELE_LNK_NOT_FND');
920: hr_utility.raise_error;
921: END IF;
922:
923: IF (p_mode IN ('CORRECTION','UPDATE','UPDATE_CHANGE_INSERT','UPDATE_OVERRIDE')) THEN
916: ,p_session_date => l_session_date);
917: IF (l_element_link_id IS NULL OR l_element_link_id = 0)
918: THEN
919: hr_utility.set_message(801,'HR_AU_ELE_LNK_NOT_FND');
920: hr_utility.raise_error;
921: END IF;
922:
923: IF (p_mode IN ('CORRECTION','UPDATE','UPDATE_CHANGE_INSERT','UPDATE_OVERRIDE')) THEN
924:
925: -----------------------------------------------------------------------------
926: -- Get the element entry of the tax element entry that is to be updated
927: ------------------------------------------------------------------------------
928:
929: hr_utility.set_location('hr_au_tax_api.maintain_tax_info' ,7);
930:
931: OPEN csr_ele_entry(l_element_link_id, l_inp_value_id_table(1));
932: FETCH csr_ele_entry INTO l_element_entry_id,l_object_version_number;
933: IF (csr_ele_entry%NOTFOUND) THEN
931: OPEN csr_ele_entry(l_element_link_id, l_inp_value_id_table(1));
932: FETCH csr_ele_entry INTO l_element_entry_id,l_object_version_number;
933: IF (csr_ele_entry%NOTFOUND) THEN
934: CLOSE csr_ele_entry;
935: hr_utility.set_message(801,'HR_AU_ELE_ENT_NOT_FND');
936: hr_utility.raise_error;
937: END IF;
938: CLOSE csr_ele_entry;
939:
932: FETCH csr_ele_entry INTO l_element_entry_id,l_object_version_number;
933: IF (csr_ele_entry%NOTFOUND) THEN
934: CLOSE csr_ele_entry;
935: hr_utility.set_message(801,'HR_AU_ELE_ENT_NOT_FND');
936: hr_utility.raise_error;
937: END IF;
938: CLOSE csr_ele_entry;
939:
940: -- Bug 2601218 : Update 'Tax Information' segment 1 as last update date
1037: BEGIN
1038: l_procedure := 'tax_scale'; -- Bug No: 3648796
1039: L_tax_scale := -1; -- Bug No: 3648796
1040:
1041: hr_utility.set_location(g_package||l_procedure, 1);
1042: hr_utility.trace('p_tax_file_number - '||p_tax_file_number);
1043: hr_utility.trace('p_australian_resident_flag - '||p_australian_resident_flag);
1044: hr_utility.trace('p_tax_free_threshold_flag - '||p_tax_free_threshold_flag);
1045: hr_utility.trace('p_lev_lod_flg - '||p_lev_lod_flg);
1038: l_procedure := 'tax_scale'; -- Bug No: 3648796
1039: L_tax_scale := -1; -- Bug No: 3648796
1040:
1041: hr_utility.set_location(g_package||l_procedure, 1);
1042: hr_utility.trace('p_tax_file_number - '||p_tax_file_number);
1043: hr_utility.trace('p_australian_resident_flag - '||p_australian_resident_flag);
1044: hr_utility.trace('p_tax_free_threshold_flag - '||p_tax_free_threshold_flag);
1045: hr_utility.trace('p_lev_lod_flg - '||p_lev_lod_flg);
1046: hr_utility.trace('p_medicare_levy_variation_code - '||p_medicare_levy_variation_code);
1039: L_tax_scale := -1; -- Bug No: 3648796
1040:
1041: hr_utility.set_location(g_package||l_procedure, 1);
1042: hr_utility.trace('p_tax_file_number - '||p_tax_file_number);
1043: hr_utility.trace('p_australian_resident_flag - '||p_australian_resident_flag);
1044: hr_utility.trace('p_tax_free_threshold_flag - '||p_tax_free_threshold_flag);
1045: hr_utility.trace('p_lev_lod_flg - '||p_lev_lod_flg);
1046: hr_utility.trace('p_medicare_levy_variation_code - '||p_medicare_levy_variation_code);
1047: hr_utility.trace('p_tax_variation_type - '||p_tax_variation_type);
1040:
1041: hr_utility.set_location(g_package||l_procedure, 1);
1042: hr_utility.trace('p_tax_file_number - '||p_tax_file_number);
1043: hr_utility.trace('p_australian_resident_flag - '||p_australian_resident_flag);
1044: hr_utility.trace('p_tax_free_threshold_flag - '||p_tax_free_threshold_flag);
1045: hr_utility.trace('p_lev_lod_flg - '||p_lev_lod_flg);
1046: hr_utility.trace('p_medicare_levy_variation_code - '||p_medicare_levy_variation_code);
1047: hr_utility.trace('p_tax_variation_type - '||p_tax_variation_type);
1048: --
1041: hr_utility.set_location(g_package||l_procedure, 1);
1042: hr_utility.trace('p_tax_file_number - '||p_tax_file_number);
1043: hr_utility.trace('p_australian_resident_flag - '||p_australian_resident_flag);
1044: hr_utility.trace('p_tax_free_threshold_flag - '||p_tax_free_threshold_flag);
1045: hr_utility.trace('p_lev_lod_flg - '||p_lev_lod_flg);
1046: hr_utility.trace('p_medicare_levy_variation_code - '||p_medicare_levy_variation_code);
1047: hr_utility.trace('p_tax_variation_type - '||p_tax_variation_type);
1048: --
1049: -- Check if a valid TFN has been supplied
1042: hr_utility.trace('p_tax_file_number - '||p_tax_file_number);
1043: hr_utility.trace('p_australian_resident_flag - '||p_australian_resident_flag);
1044: hr_utility.trace('p_tax_free_threshold_flag - '||p_tax_free_threshold_flag);
1045: hr_utility.trace('p_lev_lod_flg - '||p_lev_lod_flg);
1046: hr_utility.trace('p_medicare_levy_variation_code - '||p_medicare_levy_variation_code);
1047: hr_utility.trace('p_tax_variation_type - '||p_tax_variation_type);
1048: --
1049: -- Check if a valid TFN has been supplied
1050: IF nvl(P_Tax_File_number,'000 000 000') ='000 000 000' THEN
1043: hr_utility.trace('p_australian_resident_flag - '||p_australian_resident_flag);
1044: hr_utility.trace('p_tax_free_threshold_flag - '||p_tax_free_threshold_flag);
1045: hr_utility.trace('p_lev_lod_flg - '||p_lev_lod_flg);
1046: hr_utility.trace('p_medicare_levy_variation_code - '||p_medicare_levy_variation_code);
1047: hr_utility.trace('p_tax_variation_type - '||p_tax_variation_type);
1048: --
1049: -- Check if a valid TFN has been supplied
1050: IF nvl(P_Tax_File_number,'000 000 000') ='000 000 000' THEN
1051: L_valid_tfn_provided := FALSE;
1058: L_tax_scale := 8;
1059:
1060: -- No further processing needed.
1061: -- Bug 980658
1062: hr_utility.trace('tax_scale - '||to_char(l_tax_scale));
1063: return (L_tax_scale);
1064: END IF;
1065:
1066: -- TAX SCALE 9
1067: IF P_tax_variation_Type = 'P' THEN
1068: L_tax_scale := 9;
1069: -- No further processing needed.
1070: -- Bug 980658
1071: hr_utility.trace('tax_scale - '||to_char(l_tax_scale));
1072: return (L_tax_scale);
1073: END IF;
1074:
1075: -- TAX SCALE 10
1076: IF P_tax_variation_Type = 'F' THEN
1077: L_tax_scale := 10;
1078: -- No further processing needed.
1079: -- Bug 980658
1080: hr_utility.trace('tax_scale - '||to_char(l_tax_scale));
1081: return (L_tax_scale);
1082: END IF;
1083:
1084: -- TAX SCALE 4
1087: L_tax_scale := 4;
1088:
1089: -- No further processing necessary, is no valid TFN supplied
1090: -- then always scale 4. Refer to bug 971984
1091: hr_utility.trace('tax_scale - '||to_char(l_tax_scale));
1092: return (L_tax_scale);
1093: END IF;
1094:
1095: -- TAX SCALE 3
1099:
1100: -- No further processing needed.
1101: -- If a person has a TFN and is non resident the scale is
1102: -- always 3, refer to bug 971982
1103: hr_utility.trace('tax_scale - '||to_char(l_tax_scale));
1104: return (L_tax_scale);
1105: END IF;
1106:
1107: -- TAX SCALE 1
1111: L_tax_scale := 1;
1112:
1113: -- No further processing needed.
1114: -- Bug 971980
1115: hr_utility.trace('tax_scale - '||to_char(l_tax_scale));
1116: return (L_tax_scale);
1117: END IF;
1118:
1119: -- Bug 2145933 - Tax Scales 11 - 13 based on Tax Scales C,S,I
1120:
1121: IF L_valid_tfn_provided
1122: AND substr(p_australian_resident_flag,2,1) = 'S' THEN
1123: L_tax_scale := 11;
1124: hr_utility.trace('tax_scale - '||to_char(l_tax_scale));
1125: return(L_tax_scale);
1126: END IF;
1127:
1128: IF L_valid_tfn_provided
1127:
1128: IF L_valid_tfn_provided
1129: AND substr(p_australian_resident_flag,2,1) = 'I' THEN
1130: L_tax_scale := 12;
1131: hr_utility.trace('tax_scale - '||to_char(l_tax_scale));
1132: return(L_tax_scale);
1133: END IF;
1134:
1135: IF L_valid_tfn_provided
1134:
1135: IF L_valid_tfn_provided
1136: AND substr(p_australian_resident_flag,2,1) = 'C' THEN
1137: L_tax_scale := 13;
1138: hr_utility.trace('tax_scale - '||to_char(l_tax_scale));
1139: return(L_tax_scale);
1140: END IF;
1141:
1142:
1147: AND P_medicare_levy_variation_code = 'F' THEN
1148: L_tax_scale := 5;
1149: -- No further processing needed.
1150: -- Bug 971978
1151: hr_utility.trace('tax_scale - '||to_char(l_tax_scale));
1152: return (L_tax_scale);
1153: END IF;
1154:
1155: -- TAX SCALE 6
1157: AND substr(P_australian_resident_flag,1,1) = 'Y' /* Bug 2145933 */
1158: AND P_tax_free_threshold_flag = 'Y'
1159: AND p_medicare_levy_variation_code in ('H','HA') THEN
1160: L_tax_scale := 6;
1161: hr_utility.trace('tax_scale - '||to_char(l_tax_scale));
1162: return (L_tax_scale);
1163: END IF;
1164:
1165: -- TAX SCALE 2
1167: AND substr(P_australian_resident_flag,1,1) = 'Y' /* Bug 2145933 */
1168: AND P_tax_free_threshold_flag = 'Y'
1169: AND P_lev_lod_flg = 'Y' THEN
1170: L_tax_scale := 2;
1171: hr_utility.trace('tax_scale - '||to_char(l_tax_scale));
1172: return (L_tax_scale);
1173: END IF;
1174:
1175: -- TAX SCALE 7
1177: AND substr(P_australian_resident_flag,1,1) = 'Y' /* Bug 2145933 */
1178: AND P_tax_free_threshold_flag = 'Y'
1179: AND P_lev_lod_flg = 'N' THEN
1180: L_tax_scale := 7;
1181: hr_utility.trace('tax_scale - '||to_char(l_tax_scale));
1182: return (L_tax_scale);
1183: END IF;
1184:
1185: return (L_tax_scale);
1241: '222 222 222' ) THEN
1242: null;
1243:
1244: ELSE
1245: hr_utility.set_message(801, 'HR_AU_INVALID_NATIONAL_ID');
1246: hr_utility.raise_error;
1247:
1248: END IF;
1249: EXCEPTION WHEN OTHERS THEN
1242: null;
1243:
1244: ELSE
1245: hr_utility.set_message(801, 'HR_AU_INVALID_NATIONAL_ID');
1246: hr_utility.raise_error;
1247:
1248: END IF;
1249: EXCEPTION WHEN OTHERS THEN
1250: hr_utility.set_message(801, 'HR_AU_INVALID_NATIONAL_ID');
1246: hr_utility.raise_error;
1247:
1248: END IF;
1249: EXCEPTION WHEN OTHERS THEN
1250: hr_utility.set_message(801, 'HR_AU_INVALID_NATIONAL_ID');
1251: hr_utility.raise_error;
1252:
1253: END VALIDATE_TFN;
1254: --
1247:
1248: END IF;
1249: EXCEPTION WHEN OTHERS THEN
1250: hr_utility.set_message(801, 'HR_AU_INVALID_NATIONAL_ID');
1251: hr_utility.raise_error;
1252:
1253: END VALIDATE_TFN;
1254: --
1255: --
1288: begin
1289: --
1290: -- get the element type id for the paye element
1291: --
1292: hr_utility.set_location(g_package||l_procedure, 1);
1293: --
1294: open csr_paye_element(p_effective_date);
1295: fetch csr_paye_element
1296: into p_element_type_id;
1296: into p_element_type_id;
1297: if (csr_paye_element%notfound)
1298: then
1299: close csr_paye_element;
1300: hr_utility.trace('p_effective_date: '||to_char(p_effective_date,'MM/DD/YYYY'));
1301: hr_utility.set_message(801,'HR_AU_NZ_ELE_TYP_NOT_FND');
1302: hr_utility.raise_error;
1303: end if;
1304: close csr_paye_element;
1297: if (csr_paye_element%notfound)
1298: then
1299: close csr_paye_element;
1300: hr_utility.trace('p_effective_date: '||to_char(p_effective_date,'MM/DD/YYYY'));
1301: hr_utility.set_message(801,'HR_AU_NZ_ELE_TYP_NOT_FND');
1302: hr_utility.raise_error;
1303: end if;
1304: close csr_paye_element;
1305: --
1298: then
1299: close csr_paye_element;
1300: hr_utility.trace('p_effective_date: '||to_char(p_effective_date,'MM/DD/YYYY'));
1301: hr_utility.set_message(801,'HR_AU_NZ_ELE_TYP_NOT_FND');
1302: hr_utility.raise_error;
1303: end if;
1304: close csr_paye_element;
1305: --
1306: -- get the input value id for each tax input
1367: then
1368: p_inp_value_id_table(15) := rec_paye_element.input_value_id; --
1369:
1370: else
1371: hr_utility.trace('p_element_type_id: '||to_char(p_element_type_id));
1372: hr_utility.trace('Input name: '||rec_paye_element.name);
1373: hr_utility.trace('p_effective_date: '||to_char(p_effective_date,'MM/DD/YYYY'));
1374: hr_utility.set_message(801,'HR_NZ_INPUT_VALUE_NOT_FOUND');
1375: hr_utility.raise_error;
1368: p_inp_value_id_table(15) := rec_paye_element.input_value_id; --
1369:
1370: else
1371: hr_utility.trace('p_element_type_id: '||to_char(p_element_type_id));
1372: hr_utility.trace('Input name: '||rec_paye_element.name);
1373: hr_utility.trace('p_effective_date: '||to_char(p_effective_date,'MM/DD/YYYY'));
1374: hr_utility.set_message(801,'HR_NZ_INPUT_VALUE_NOT_FOUND');
1375: hr_utility.raise_error;
1376: end if;
1369:
1370: else
1371: hr_utility.trace('p_element_type_id: '||to_char(p_element_type_id));
1372: hr_utility.trace('Input name: '||rec_paye_element.name);
1373: hr_utility.trace('p_effective_date: '||to_char(p_effective_date,'MM/DD/YYYY'));
1374: hr_utility.set_message(801,'HR_NZ_INPUT_VALUE_NOT_FOUND');
1375: hr_utility.raise_error;
1376: end if;
1377: end loop;
1370: else
1371: hr_utility.trace('p_element_type_id: '||to_char(p_element_type_id));
1372: hr_utility.trace('Input name: '||rec_paye_element.name);
1373: hr_utility.trace('p_effective_date: '||to_char(p_effective_date,'MM/DD/YYYY'));
1374: hr_utility.set_message(801,'HR_NZ_INPUT_VALUE_NOT_FOUND');
1375: hr_utility.raise_error;
1376: end if;
1377: end loop;
1378: --
1371: hr_utility.trace('p_element_type_id: '||to_char(p_element_type_id));
1372: hr_utility.trace('Input name: '||rec_paye_element.name);
1373: hr_utility.trace('p_effective_date: '||to_char(p_effective_date,'MM/DD/YYYY'));
1374: hr_utility.set_message(801,'HR_NZ_INPUT_VALUE_NOT_FOUND');
1375: hr_utility.raise_error;
1376: end if;
1377: end loop;
1378: --
1379: hr_utility.set_location(g_package||l_procedure, 10);
1375: hr_utility.raise_error;
1376: end if;
1377: end loop;
1378: --
1379: hr_utility.set_location(g_package||l_procedure, 10);
1380: --
1381: end get_paye_input_ids;
1382: --
1383: ---------------------------------------------------------------------------------------------
1397: from per_business_groups
1398: where business_group_id = p_business_group_id;
1399: --
1400: begin
1401: hr_utility.set_location(g_package||l_procedure, 1);
1402: open csr_per_business_groups;
1403: fetch csr_per_business_groups
1404: into l_legislation_code;
1405: if csr_per_business_groups%notfound
1404: into l_legislation_code;
1405: if csr_per_business_groups%notfound
1406: then
1407: close csr_per_business_groups;
1408: hr_utility.set_location(g_package||l_procedure, 2);
1409: hr_utility.trace('p_business_group_id: '||to_char(p_business_group_id));
1410: return false;
1411: end if;
1412: close csr_per_business_groups;
1405: if csr_per_business_groups%notfound
1406: then
1407: close csr_per_business_groups;
1408: hr_utility.set_location(g_package||l_procedure, 2);
1409: hr_utility.trace('p_business_group_id: '||to_char(p_business_group_id));
1410: return false;
1411: end if;
1412: close csr_per_business_groups;
1413: --
1410: return false;
1411: end if;
1412: close csr_per_business_groups;
1413: --
1414: hr_utility.set_location(g_package||l_procedure, 10);
1415: if l_legislation_code = g_legislation_code
1416: then
1417: return true;
1418: else
1498: --
1499: begin
1500: l_procedure := 'create_paye_tax_info'; -- Bug No: 3648796
1501:
1502: hr_utility.set_location(g_package||l_procedure, 1);
1503: --
1504: -- Ensure business group supplied is Australian
1505: --
1506: if not valid_business_group(p_business_group_id)
1504: -- Ensure business group supplied is Australian
1505: --
1506: if not valid_business_group(p_business_group_id)
1507: then
1508: hr_utility.set_location(g_package||l_procedure, 2);
1509: hr_utility.set_message(801,'HR_7208_API_BUS_GRP_INVALID');
1510: hr_utility.raise_error;
1511: end if;
1512: --
1505: --
1506: if not valid_business_group(p_business_group_id)
1507: then
1508: hr_utility.set_location(g_package||l_procedure, 2);
1509: hr_utility.set_message(801,'HR_7208_API_BUS_GRP_INVALID');
1510: hr_utility.raise_error;
1511: end if;
1512: --
1513: -- Get Element type id and input value ids
1506: if not valid_business_group(p_business_group_id)
1507: then
1508: hr_utility.set_location(g_package||l_procedure, 2);
1509: hr_utility.set_message(801,'HR_7208_API_BUS_GRP_INVALID');
1510: hr_utility.raise_error;
1511: end if;
1512: --
1513: -- Get Element type id and input value ids
1514: --
1522: ,p_session_date => p_effective_date
1523: );
1524: if (l_element_link_id is null or l_element_link_id = 0)
1525: then
1526: hr_utility.set_message(801,'HR_AU_NZ_ELE_LNK_NOT_FND');
1527: hr_utility.raise_error;
1528: end if;
1529: --
1530: validate_tfn(p_tax_file_number);
1523: );
1524: if (l_element_link_id is null or l_element_link_id = 0)
1525: then
1526: hr_utility.set_message(801,'HR_AU_NZ_ELE_LNK_NOT_FND');
1527: hr_utility.raise_error;
1528: end if;
1529: --
1530: validate_tfn(p_tax_file_number);
1531: --
1621: ,p_exempt_flood_levy_flag => p_exempt_flood_levy_flag
1622: ,p_update_warning => l_update_warning
1623: );
1624: --
1625: hr_utility.set_location(g_package||l_procedure, 30);
1626:
1627: end create_paye_tax_info;
1628:
1629: ---------------------------------------------------------------------------------------------
1728: l_exempt_flood_levy_flag varchar2(10);
1729: l_date date;
1730: --
1731: begin
1732: g_debug := hr_utility.debug_enabled;
1733: if g_debug then
1734: hr_utility.set_location(l_procedure,10);
1735: hr_utility.trace('p_assignment_id => '||p_assignment_id);
1736: hr_utility.trace('p_business_group_id => '||p_business_group_id);
1730: --
1731: begin
1732: g_debug := hr_utility.debug_enabled;
1733: if g_debug then
1734: hr_utility.set_location(l_procedure,10);
1735: hr_utility.trace('p_assignment_id => '||p_assignment_id);
1736: hr_utility.trace('p_business_group_id => '||p_business_group_id);
1737: hr_utility.trace('p_hire_date => '||p_hire_date);
1738: hr_utility.trace('p_payroll_id => '||to_char(p_payroll_id));
1731: begin
1732: g_debug := hr_utility.debug_enabled;
1733: if g_debug then
1734: hr_utility.set_location(l_procedure,10);
1735: hr_utility.trace('p_assignment_id => '||p_assignment_id);
1736: hr_utility.trace('p_business_group_id => '||p_business_group_id);
1737: hr_utility.trace('p_hire_date => '||p_hire_date);
1738: hr_utility.trace('p_payroll_id => '||to_char(p_payroll_id));
1739: END if;
1732: g_debug := hr_utility.debug_enabled;
1733: if g_debug then
1734: hr_utility.set_location(l_procedure,10);
1735: hr_utility.trace('p_assignment_id => '||p_assignment_id);
1736: hr_utility.trace('p_business_group_id => '||p_business_group_id);
1737: hr_utility.trace('p_hire_date => '||p_hire_date);
1738: hr_utility.trace('p_payroll_id => '||to_char(p_payroll_id));
1739: END if;
1740: --
1733: if g_debug then
1734: hr_utility.set_location(l_procedure,10);
1735: hr_utility.trace('p_assignment_id => '||p_assignment_id);
1736: hr_utility.trace('p_business_group_id => '||p_business_group_id);
1737: hr_utility.trace('p_hire_date => '||p_hire_date);
1738: hr_utility.trace('p_payroll_id => '||to_char(p_payroll_id));
1739: END if;
1740: --
1741: -- Need the object_version_number to update the assignment
1734: hr_utility.set_location(l_procedure,10);
1735: hr_utility.trace('p_assignment_id => '||p_assignment_id);
1736: hr_utility.trace('p_business_group_id => '||p_business_group_id);
1737: hr_utility.trace('p_hire_date => '||p_hire_date);
1738: hr_utility.trace('p_payroll_id => '||to_char(p_payroll_id));
1739: END if;
1740: --
1741: -- Need the object_version_number to update the assignment
1742: --
1768: ,p_no_managers_warning => l_no_managers_warning -- out parameter
1769: ,p_other_manager_warning => l_other_manager_warning -- out parameter
1770: );
1771: IF g_debug THEN
1772: hr_utility.set_location(l_procedure,20);
1773: hr_utility.trace('l_object_version_number => '||l_object_version_number);
1774: END if;
1775:
1776: --
1769: ,p_other_manager_warning => l_other_manager_warning -- out parameter
1770: );
1771: IF g_debug THEN
1772: hr_utility.set_location(l_procedure,20);
1773: hr_utility.trace('l_object_version_number => '||l_object_version_number);
1774: END if;
1775:
1776: --
1777: -- The intended use of the following API call is to allow the update of
1800: ,p_concatenated_segments => l_concatenated_segments
1801: );
1802:
1803: IF g_debug THEN
1804: hr_utility.set_location(l_procedure,30);
1805: hr_utility.trace('p_australian_resident_flag => '||p_australian_resident);
1806: hr_utility.trace('p_senior_australian => '||p_senior_australian);
1807: hr_utility.trace('p_payroll_id => '||to_char(p_payroll_id));
1808:
1801: );
1802:
1803: IF g_debug THEN
1804: hr_utility.set_location(l_procedure,30);
1805: hr_utility.trace('p_australian_resident_flag => '||p_australian_resident);
1806: hr_utility.trace('p_senior_australian => '||p_senior_australian);
1807: hr_utility.trace('p_payroll_id => '||to_char(p_payroll_id));
1808:
1809: END if;
1802:
1803: IF g_debug THEN
1804: hr_utility.set_location(l_procedure,30);
1805: hr_utility.trace('p_australian_resident_flag => '||p_australian_resident);
1806: hr_utility.trace('p_senior_australian => '||p_senior_australian);
1807: hr_utility.trace('p_payroll_id => '||to_char(p_payroll_id));
1808:
1809: END if;
1810:
1803: IF g_debug THEN
1804: hr_utility.set_location(l_procedure,30);
1805: hr_utility.trace('p_australian_resident_flag => '||p_australian_resident);
1806: hr_utility.trace('p_senior_australian => '||p_senior_australian);
1807: hr_utility.trace('p_payroll_id => '||to_char(p_payroll_id));
1808:
1809: END if;
1810:
1811: --
1829: else
1830: l_australian_resident_flag := p_australian_resident || p_senior_australian;
1831: end if;
1832: if g_debug then
1833: hr_utility.set_location(l_procedure,31);
1834: end if;
1835:
1836: if p_exempt_flood_levy = 'N' THEN
1837: l_exempt_flood_levy_flag := 'N';
1847: --l_fta_claim_flag values N,NC,NF,NP,Y,YC,YF,YP
1848: --
1849: l_fta_claim_flag := p_ftb_claim || p_basis_of_payment;
1850: if g_debug then
1851: hr_utility.set_location(l_procedure,32);
1852: end if;
1853:
1854: -- ---------------------------------------
1855: -- HECS and SFSS
1864: l_hecs_sfss_flag := p_hecs || p_sfss;
1865: end if;
1866: --
1867: if g_debug then
1868: hr_utility.set_location(l_procedure,33);
1869: end if;
1870:
1871: -- ---------------------------------------
1872: -- SPOUSE and MLS
1897: l_tax_variation_type := p_tax_variation_type || p_tax_variation_bonus;
1898: end if;
1899:
1900: if g_debug then
1901: hr_utility.set_location(l_procedure,40);
1902: hr_utility.trace('l_australian_resident_flag => '||l_australian_resident_flag);
1903: hr_utility.trace('l_fta_claim_flag => '||l_fta_claim_flag);
1904: hr_utility.trace('l_hecs_sfss_flag => '||l_hecs_sfss_flag);
1905: hr_utility.trace('l_spouse_mls_flag => '||l_spouse_mls_flag);
1898: end if;
1899:
1900: if g_debug then
1901: hr_utility.set_location(l_procedure,40);
1902: hr_utility.trace('l_australian_resident_flag => '||l_australian_resident_flag);
1903: hr_utility.trace('l_fta_claim_flag => '||l_fta_claim_flag);
1904: hr_utility.trace('l_hecs_sfss_flag => '||l_hecs_sfss_flag);
1905: hr_utility.trace('l_spouse_mls_flag => '||l_spouse_mls_flag);
1906: hr_utility.trace('l_tax_variation_type => '||l_tax_variation_type);
1899:
1900: if g_debug then
1901: hr_utility.set_location(l_procedure,40);
1902: hr_utility.trace('l_australian_resident_flag => '||l_australian_resident_flag);
1903: hr_utility.trace('l_fta_claim_flag => '||l_fta_claim_flag);
1904: hr_utility.trace('l_hecs_sfss_flag => '||l_hecs_sfss_flag);
1905: hr_utility.trace('l_spouse_mls_flag => '||l_spouse_mls_flag);
1906: hr_utility.trace('l_tax_variation_type => '||l_tax_variation_type);
1907: end if;
1900: if g_debug then
1901: hr_utility.set_location(l_procedure,40);
1902: hr_utility.trace('l_australian_resident_flag => '||l_australian_resident_flag);
1903: hr_utility.trace('l_fta_claim_flag => '||l_fta_claim_flag);
1904: hr_utility.trace('l_hecs_sfss_flag => '||l_hecs_sfss_flag);
1905: hr_utility.trace('l_spouse_mls_flag => '||l_spouse_mls_flag);
1906: hr_utility.trace('l_tax_variation_type => '||l_tax_variation_type);
1907: end if;
1908:
1901: hr_utility.set_location(l_procedure,40);
1902: hr_utility.trace('l_australian_resident_flag => '||l_australian_resident_flag);
1903: hr_utility.trace('l_fta_claim_flag => '||l_fta_claim_flag);
1904: hr_utility.trace('l_hecs_sfss_flag => '||l_hecs_sfss_flag);
1905: hr_utility.trace('l_spouse_mls_flag => '||l_spouse_mls_flag);
1906: hr_utility.trace('l_tax_variation_type => '||l_tax_variation_type);
1907: end if;
1908:
1909: -- If the Tax Information already exists for this assignment then
1902: hr_utility.trace('l_australian_resident_flag => '||l_australian_resident_flag);
1903: hr_utility.trace('l_fta_claim_flag => '||l_fta_claim_flag);
1904: hr_utility.trace('l_hecs_sfss_flag => '||l_hecs_sfss_flag);
1905: hr_utility.trace('l_spouse_mls_flag => '||l_spouse_mls_flag);
1906: hr_utility.trace('l_tax_variation_type => '||l_tax_variation_type);
1907: end if;
1908:
1909: -- If the Tax Information already exists for this assignment then
1910: -- call maintain_paye_tax_info... otherwise call call create_paye_tax_info.
1919: if (csr_tax_element%notfound)
1920: then
1921: close csr_tax_element;
1922: IF g_debug THEN
1923: hr_utility.set_location(l_procedure, 50);
1924: hr_utility.trace('p_effective_date: '||to_char(p_hire_date,'MM/DD/YYYY'));
1925: END if;
1926: hr_utility.set_message(801,'HR_AU_NZ_ELE_TYP_NOT_FND');
1927: hr_utility.raise_error;
1920: then
1921: close csr_tax_element;
1922: IF g_debug THEN
1923: hr_utility.set_location(l_procedure, 50);
1924: hr_utility.trace('p_effective_date: '||to_char(p_hire_date,'MM/DD/YYYY'));
1925: END if;
1926: hr_utility.set_message(801,'HR_AU_NZ_ELE_TYP_NOT_FND');
1927: hr_utility.raise_error;
1928: end if;
1922: IF g_debug THEN
1923: hr_utility.set_location(l_procedure, 50);
1924: hr_utility.trace('p_effective_date: '||to_char(p_hire_date,'MM/DD/YYYY'));
1925: END if;
1926: hr_utility.set_message(801,'HR_AU_NZ_ELE_TYP_NOT_FND');
1927: hr_utility.raise_error;
1928: end if;
1929: close csr_tax_element;
1930:
1923: hr_utility.set_location(l_procedure, 50);
1924: hr_utility.trace('p_effective_date: '||to_char(p_hire_date,'MM/DD/YYYY'));
1925: END if;
1926: hr_utility.set_message(801,'HR_AU_NZ_ELE_TYP_NOT_FND');
1927: hr_utility.raise_error;
1928: end if;
1929: close csr_tax_element;
1930:
1931: if g_debug then
1928: end if;
1929: close csr_tax_element;
1930:
1931: if g_debug then
1932: hr_utility.set_location(l_procedure,60);
1933: hr_utility.trace('p_assignment_id => '||p_assignment_id);
1934: hr_utility.trace('l_element_type_id => '||l_element_type_id);
1935: end if;
1936: --
1929: close csr_tax_element;
1930:
1931: if g_debug then
1932: hr_utility.set_location(l_procedure,60);
1933: hr_utility.trace('p_assignment_id => '||p_assignment_id);
1934: hr_utility.trace('l_element_type_id => '||l_element_type_id);
1935: end if;
1936: --
1937: -- Got the element_type_id so can now get the element_link_id
1930:
1931: if g_debug then
1932: hr_utility.set_location(l_procedure,60);
1933: hr_utility.trace('p_assignment_id => '||p_assignment_id);
1934: hr_utility.trace('l_element_type_id => '||l_element_type_id);
1935: end if;
1936: --
1937: -- Got the element_type_id so can now get the element_link_id
1938: l_element_link_id := hr_entry_api.get_link
1942: );
1943: if (l_element_link_id is null or l_element_link_id = 0)
1944: then
1945: if g_debug then
1946: hr_utility.set_location(l_procedure, 61);
1947: end if;
1948: --
1949: -- It is possible that the current assignment is on a payroll for which an element link does
1950: -- not exist, therefore we need to check the link before we create.
1980: ,P_EFFECTIVE_END_DATE => l_effective_end_date
1981: );
1982:
1983: end if;
1984: --hr_utility.set_message(801,'HR_AU_NZ_ELE_LNK_NOT_FND');
1985: --hr_utility.raise_error;
1986: end if;
1987: --
1988: if g_debug then
1981: );
1982:
1983: end if;
1984: --hr_utility.set_message(801,'HR_AU_NZ_ELE_LNK_NOT_FND');
1985: --hr_utility.raise_error;
1986: end if;
1987: --
1988: if g_debug then
1989: hr_utility.set_location(l_procedure, 62);
1985: --hr_utility.raise_error;
1986: end if;
1987: --
1988: if g_debug then
1989: hr_utility.set_location(l_procedure, 62);
1990: hr_utility.trace('l_element_link_id = '||to_char(l_element_link_id));
1991: end if;
1992: --
1993: -- Verify whether an element entry exists.
1986: end if;
1987: --
1988: if g_debug then
1989: hr_utility.set_location(l_procedure, 62);
1990: hr_utility.trace('l_element_link_id = '||to_char(l_element_link_id));
1991: end if;
1992: --
1993: -- Verify whether an element entry exists.
1994: -- (This is where to use the element_link_id)
1996: open csr_element_entry(l_element_link_id);
1997: fetch csr_element_entry into l_element_entry_id;
1998: if csr_element_entry%notfound then
1999: if g_debug then
2000: hr_utility.set_location(l_procedure,70);
2001: end if;
2002: --
2003: -- The element entry does not exist so call the CREATE API
2004: --
2037: ,p_create_warning => l_create_warning
2038: );
2039: else
2040: if g_debug then
2041: hr_utility.set_location(l_procedure,80);
2042: hr_utility.trace('dep children = '||p_medicare_levy_dep_children);
2043:
2044: end if;
2045: --
2038: );
2039: else
2040: if g_debug then
2041: hr_utility.set_location(l_procedure,80);
2042: hr_utility.trace('dep children = '||p_medicare_levy_dep_children);
2043:
2044: end if;
2045: --
2046: -- The element entry exists so call the UPDATE API
2081: );
2082: end if;
2083: --
2084: if g_debug then
2085: hr_utility.set_location(l_procedure,90);
2086: end if;
2087: end update_adi_tax_crp;
2088:
2089: END hr_au_tax_api ;