26: BEGIN
27: --
28: -- Added for GSI Bug 5472781
29: --
30: IF hr_utility.chk_product_install('Oracle Human Resources', 'ES') THEN
31: --
32: hr_api.mandatory_arg_error
33: (p_api_name => l_proc,
34: p_argument => hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_1'),
38: l_validate_profile := FND_PROFILE.VALUE('PER_NATIONAL_IDENTIFIER_VALIDATION');
39:
40: IF p_per_information3 IS NOT NULL AND
41: p_per_information2 IS NULL THEN
42: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
43: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_FORM_LABELS','IDENTIFIER_TYPE'));
44: hr_utility.raise_error;
45: ELSIF p_per_information2 IS NOT NULL AND
46: p_per_information3 IS NULL THEN
39:
40: IF p_per_information3 IS NOT NULL AND
41: p_per_information2 IS NULL THEN
42: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
43: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_FORM_LABELS','IDENTIFIER_TYPE'));
44: hr_utility.raise_error;
45: ELSIF p_per_information2 IS NOT NULL AND
46: p_per_information3 IS NULL THEN
47: OPEN get_lookup_type(p_per_information2);
40: IF p_per_information3 IS NOT NULL AND
41: p_per_information2 IS NULL THEN
42: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
43: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_FORM_LABELS','IDENTIFIER_TYPE'));
44: hr_utility.raise_error;
45: ELSIF p_per_information2 IS NOT NULL AND
46: p_per_information3 IS NULL THEN
47: OPEN get_lookup_type(p_per_information2);
48: FETCH get_lookup_type into l_identifier_type;
46: p_per_information3 IS NULL THEN
47: OPEN get_lookup_type(p_per_information2);
48: FETCH get_lookup_type into l_identifier_type;
49: IF get_lookup_type%NOTFOUND THEN
50: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
51: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_FORM_LABELS','IDENTIFIER_TYPE'));
52: hr_utility.raise_error;
53: END IF;
54: CLOSE get_lookup_type;
47: OPEN get_lookup_type(p_per_information2);
48: FETCH get_lookup_type into l_identifier_type;
49: IF get_lookup_type%NOTFOUND THEN
50: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
51: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_FORM_LABELS','IDENTIFIER_TYPE'));
52: hr_utility.raise_error;
53: END IF;
54: CLOSE get_lookup_type;
55: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
48: FETCH get_lookup_type into l_identifier_type;
49: IF get_lookup_type%NOTFOUND THEN
50: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
51: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_FORM_LABELS','IDENTIFIER_TYPE'));
52: hr_utility.raise_error;
53: END IF;
54: CLOSE get_lookup_type;
55: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
56: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_IDENTIFIER_TYPE',p_per_information2));
51: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_FORM_LABELS','IDENTIFIER_TYPE'));
52: hr_utility.raise_error;
53: END IF;
54: CLOSE get_lookup_type;
55: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
56: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_IDENTIFIER_TYPE',p_per_information2));
57: hr_utility.raise_error;
58: END IF;
59: --
52: hr_utility.raise_error;
53: END IF;
54: CLOSE get_lookup_type;
55: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
56: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_IDENTIFIER_TYPE',p_per_information2));
57: hr_utility.raise_error;
58: END IF;
59: --
60: IF l_validate_profile <> 'NONE' THEN --No Validation
53: END IF;
54: CLOSE get_lookup_type;
55: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
56: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_IDENTIFIER_TYPE',p_per_information2));
57: hr_utility.raise_error;
58: END IF;
59: --
60: IF l_validate_profile <> 'NONE' THEN --No Validation
61: IF p_national_identifier IS NULL THEN
59: --
60: IF l_validate_profile <> 'NONE' THEN --No Validation
61: IF p_national_identifier IS NULL THEN
62: IF p_per_information3 IS NULL THEN
63: hr_utility.set_message(800, 'HR_ES_REQ_NIF_IDT_MISSING');
64: hr_utility.raise_error;
65: END IF;
66: ELSE
67: l_national_identifier := hr_es_utility.check_NIF(p_national_identifier);
60: IF l_validate_profile <> 'NONE' THEN --No Validation
61: IF p_national_identifier IS NULL THEN
62: IF p_per_information3 IS NULL THEN
63: hr_utility.set_message(800, 'HR_ES_REQ_NIF_IDT_MISSING');
64: hr_utility.raise_error;
65: END IF;
66: ELSE
67: l_national_identifier := hr_es_utility.check_NIF(p_national_identifier);
68: IF l_national_identifier = 'N' THEN
65: END IF;
66: ELSE
67: l_national_identifier := hr_es_utility.check_NIF(p_national_identifier);
68: IF l_national_identifier = 'N' THEN
69: hr_utility.set_message(800, 'HR_ES_INVALID_NIF');
70: hr_utility.raise_error;
71: END IF;
72: END IF;
73: END IF;
66: ELSE
67: l_national_identifier := hr_es_utility.check_NIF(p_national_identifier);
68: IF l_national_identifier = 'N' THEN
69: hr_utility.set_message(800, 'HR_ES_INVALID_NIF');
70: hr_utility.raise_error;
71: END IF;
72: END IF;
73: END IF;
74:
75: IF p_per_information2 IS NOT NULL THEN
76: OPEN get_lookup_type(p_per_information2);
77: FETCH get_lookup_type into l_identifier_type;
78: IF get_lookup_type%NOTFOUND THEN
79: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
80: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_FORM_LABELS','IDENTIFIER_TYPE'));
81: hr_utility.raise_error;
82: ELSIF l_validate_profile <> 'NONE' THEN
83: l_identifier_value := hr_es_utility.validate_identifier(p_per_information2,p_per_information3);
76: OPEN get_lookup_type(p_per_information2);
77: FETCH get_lookup_type into l_identifier_type;
78: IF get_lookup_type%NOTFOUND THEN
79: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
80: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_FORM_LABELS','IDENTIFIER_TYPE'));
81: hr_utility.raise_error;
82: ELSIF l_validate_profile <> 'NONE' THEN
83: l_identifier_value := hr_es_utility.validate_identifier(p_per_information2,p_per_information3);
84: END IF;
77: FETCH get_lookup_type into l_identifier_type;
78: IF get_lookup_type%NOTFOUND THEN
79: hr_utility.set_message(800,'HR_ES_INVALID_VALUE');
80: hr_utility.set_message_token(800,'FIELD',hr_general.decode_lookup('ES_FORM_LABELS','IDENTIFIER_TYPE'));
81: hr_utility.raise_error;
82: ELSIF l_validate_profile <> 'NONE' THEN
83: l_identifier_value := hr_es_utility.validate_identifier(p_per_information2,p_per_information3);
84: END IF;
85: CLOSE get_lookup_type;
89: OPEN get_lookup_type(p_per_information2);
90: FETCH get_lookup_type into l_identifier_type;
91: if l_identifier_type='DNI' then
92: If substr(p_national_identifier,1,8) <> p_per_information3 then
93: hr_utility.set_message(800,'HR_ES_INVALID_DNI_NIF');
94: hr_utility.raise_error;
95: end if;
96: end if;
97: CLOSE get_lookup_type;
90: FETCH get_lookup_type into l_identifier_type;
91: if l_identifier_type='DNI' then
92: If substr(p_national_identifier,1,8) <> p_per_information3 then
93: hr_utility.set_message(800,'HR_ES_INVALID_DNI_NIF');
94: hr_utility.raise_error;
95: end if;
96: end if;
97: CLOSE get_lookup_type;
98: end if;
97: CLOSE get_lookup_type;
98: end if;
99:
100: IF length(p_last_name)>40 THEN
101: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
102: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_1'));
103: hr_utility.set_message_token('COLUMN_VALUE',p_last_name);
104: hr_utility.set_message_token('MAX_LENGTH','40');
105: hr_utility.raise_error;
98: end if;
99:
100: IF length(p_last_name)>40 THEN
101: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
102: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_1'));
103: hr_utility.set_message_token('COLUMN_VALUE',p_last_name);
104: hr_utility.set_message_token('MAX_LENGTH','40');
105: hr_utility.raise_error;
106: END IF;
99:
100: IF length(p_last_name)>40 THEN
101: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
102: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_1'));
103: hr_utility.set_message_token('COLUMN_VALUE',p_last_name);
104: hr_utility.set_message_token('MAX_LENGTH','40');
105: hr_utility.raise_error;
106: END IF;
107:
100: IF length(p_last_name)>40 THEN
101: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
102: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_1'));
103: hr_utility.set_message_token('COLUMN_VALUE',p_last_name);
104: hr_utility.set_message_token('MAX_LENGTH','40');
105: hr_utility.raise_error;
106: END IF;
107:
108: IF length(p_first_name)>40 THEN
101: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
102: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_1'));
103: hr_utility.set_message_token('COLUMN_VALUE',p_last_name);
104: hr_utility.set_message_token('MAX_LENGTH','40');
105: hr_utility.raise_error;
106: END IF;
107:
108: IF length(p_first_name)>40 THEN
109: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
105: hr_utility.raise_error;
106: END IF;
107:
108: IF length(p_first_name)>40 THEN
109: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
110: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','NAME'));
111: hr_utility.set_message_token('COLUMN_VALUE',p_first_name);
112: hr_utility.set_message_token('MAX_LENGTH','40');
113: hr_utility.raise_error;
106: END IF;
107:
108: IF length(p_first_name)>40 THEN
109: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
110: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','NAME'));
111: hr_utility.set_message_token('COLUMN_VALUE',p_first_name);
112: hr_utility.set_message_token('MAX_LENGTH','40');
113: hr_utility.raise_error;
114: END IF;
107:
108: IF length(p_first_name)>40 THEN
109: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
110: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','NAME'));
111: hr_utility.set_message_token('COLUMN_VALUE',p_first_name);
112: hr_utility.set_message_token('MAX_LENGTH','40');
113: hr_utility.raise_error;
114: END IF;
115:
108: IF length(p_first_name)>40 THEN
109: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
110: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','NAME'));
111: hr_utility.set_message_token('COLUMN_VALUE',p_first_name);
112: hr_utility.set_message_token('MAX_LENGTH','40');
113: hr_utility.raise_error;
114: END IF;
115:
116: IF length(p_per_information1)>40 THEN
109: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
110: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','NAME'));
111: hr_utility.set_message_token('COLUMN_VALUE',p_first_name);
112: hr_utility.set_message_token('MAX_LENGTH','40');
113: hr_utility.raise_error;
114: END IF;
115:
116: IF length(p_per_information1)>40 THEN
117: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
113: hr_utility.raise_error;
114: END IF;
115:
116: IF length(p_per_information1)>40 THEN
117: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
118: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_2'));
119: hr_utility.set_message_token('COLUMN_VALUE',p_per_information1);
120: hr_utility.set_message_token('MAX_LENGTH','40');
121: hr_utility.raise_error;
114: END IF;
115:
116: IF length(p_per_information1)>40 THEN
117: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
118: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_2'));
119: hr_utility.set_message_token('COLUMN_VALUE',p_per_information1);
120: hr_utility.set_message_token('MAX_LENGTH','40');
121: hr_utility.raise_error;
122: END IF;
115:
116: IF length(p_per_information1)>40 THEN
117: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
118: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_2'));
119: hr_utility.set_message_token('COLUMN_VALUE',p_per_information1);
120: hr_utility.set_message_token('MAX_LENGTH','40');
121: hr_utility.raise_error;
122: END IF;
123: --
116: IF length(p_per_information1)>40 THEN
117: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
118: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_2'));
119: hr_utility.set_message_token('COLUMN_VALUE',p_per_information1);
120: hr_utility.set_message_token('MAX_LENGTH','40');
121: hr_utility.raise_error;
122: END IF;
123: --
124: END IF;
117: hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
118: hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_2'));
119: hr_utility.set_message_token('COLUMN_VALUE',p_per_information1);
120: hr_utility.set_message_token('MAX_LENGTH','40');
121: hr_utility.raise_error;
122: END IF;
123: --
124: END IF;
125: --