38: l_doc_exist :=0;
39: end;
40:
41: if l_doc_exist = 0 then
42: hr_utility.set_message(800, 'HR_520016_INVALID_DEI_TYPE');
43: hr_utility.raise_error;
44: end if;
45:
46: /* open csr_document_type;
39: end;
40:
41: if l_doc_exist = 0 then
42: hr_utility.set_message(800, 'HR_520016_INVALID_DEI_TYPE');
43: hr_utility.raise_error;
44: end if;
45:
46: /* open csr_document_type;
47: fetch csr_document_type into l_sys_doc_type;
51: ,'RO Others Identity document','RO Residence card','RO Residence permit'
52: ,'RO Permanent workers','RO Season workers','RO Interns'
53: ,'RO Sportsmen','RO Cross-border workers','RO Nominal authorization'
54: ,'RO High-qualified workers','RO Foreign citizens') THEN
55: hr_utility.set_message(800, 'HR_520016_INVALID_DEI_TYPE');
56: hr_utility.raise_error;
57: end if; */
58:
59: /* Document Number si mandatory */
52: ,'RO Permanent workers','RO Season workers','RO Interns'
53: ,'RO Sportsmen','RO Cross-border workers','RO Nominal authorization'
54: ,'RO High-qualified workers','RO Foreign citizens') THEN
55: hr_utility.set_message(800, 'HR_520016_INVALID_DEI_TYPE');
56: hr_utility.raise_error;
57: end if; */
58:
59: /* Document Number si mandatory */
60: if p_document_number is null then
57: end if; */
58:
59: /* Document Number si mandatory */
60: if p_document_number is null then
61: hr_utility.set_message(800,'HR_375885_DEI_NO_REQD');
62: hr_utility.raise_error;
63: end if;
64:
65: /* Document number should be unique */
58:
59: /* Document Number si mandatory */
60: if p_document_number is null then
61: hr_utility.set_message(800,'HR_375885_DEI_NO_REQD');
62: hr_utility.raise_error;
63: end if;
64:
65: /* Document number should be unique */
66: open csr_doc_no_unique;
65: /* Document number should be unique */
66: open csr_doc_no_unique;
67: fetch csr_doc_no_unique into l_unique;
68: IF csr_doc_no_unique%FOUND then
69: hr_utility.set_location('l_unique '||l_unique ,15);
70: hr_utility.set_message(800,'HR_520015_DEI_NO_UNIQUE');
71: hr_utility.raise_error;
72: end if;
73: close csr_doc_no_unique;
66: open csr_doc_no_unique;
67: fetch csr_doc_no_unique into l_unique;
68: IF csr_doc_no_unique%FOUND then
69: hr_utility.set_location('l_unique '||l_unique ,15);
70: hr_utility.set_message(800,'HR_520015_DEI_NO_UNIQUE');
71: hr_utility.raise_error;
72: end if;
73: close csr_doc_no_unique;
74:
67: fetch csr_doc_no_unique into l_unique;
68: IF csr_doc_no_unique%FOUND then
69: hr_utility.set_location('l_unique '||l_unique ,15);
70: hr_utility.set_message(800,'HR_520015_DEI_NO_UNIQUE');
71: hr_utility.raise_error;
72: end if;
73: close csr_doc_no_unique;
74:
75: /* Valid To Date is mandatory */
73: close csr_doc_no_unique;
74:
75: /* Valid To Date is mandatory */
76: if P_DATE_TO is null then
77: hr_utility.set_message(800,'HR_520014_DEI_DATE_TO_REQD');
78: hr_utility.raise_error;
79: end if;
80:
81: /* validating the expiry date in case of Fiscal Residence Certificate (usually the respective calendar year plus the next 60 days) */
74:
75: /* Valid To Date is mandatory */
76: if P_DATE_TO is null then
77: hr_utility.set_message(800,'HR_520014_DEI_DATE_TO_REQD');
78: hr_utility.raise_error;
79: end if;
80:
81: /* validating the expiry date in case of Fiscal Residence Certificate (usually the respective calendar year plus the next 60 days) */
82: if l_sys_doc_type = 'RO Foreign citizens' then
81: /* validating the expiry date in case of Fiscal Residence Certificate (usually the respective calendar year plus the next 60 days) */
82: if l_sys_doc_type = 'RO Foreign citizens' then
83: select ((add_months(trunc(P_DATE_FROM,'Y'),12)-1) + 60) into l_expiry_date from dual;
84: if l_expiry_date <> P_DATE_TO THEN
85: hr_utility.set_message(800,'HR_520016_DEI_DATE_TO_CHK');
86: hr_utility.raise_error;
87: end if;
88: end if;
89:
82: if l_sys_doc_type = 'RO Foreign citizens' then
83: select ((add_months(trunc(P_DATE_FROM,'Y'),12)-1) + 60) into l_expiry_date from dual;
84: if l_expiry_date <> P_DATE_TO THEN
85: hr_utility.set_message(800,'HR_520016_DEI_DATE_TO_CHK');
86: hr_utility.raise_error;
87: end if;
88: end if;
89:
90:
111: l_proc varchar2(60);
112:
113: BEGIN
114: l_proc:= g_package||'CREATE_RO_DEI_INFO';
115: hr_utility.set_location('Entering : '||l_proc,5);
116: IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'RO') THEN
117: hr_utility.set_location('Leaving : '||l_proc,10);
118: return;
119: END IF;
112:
113: BEGIN
114: l_proc:= g_package||'CREATE_RO_DEI_INFO';
115: hr_utility.set_location('Entering : '||l_proc,5);
116: IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'RO') THEN
117: hr_utility.set_location('Leaving : '||l_proc,10);
118: return;
119: END IF;
120:
113: BEGIN
114: l_proc:= g_package||'CREATE_RO_DEI_INFO';
115: hr_utility.set_location('Entering : '||l_proc,5);
116: IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'RO') THEN
117: hr_utility.set_location('Leaving : '||l_proc,10);
118: return;
119: END IF;
120:
121: CHECK_RO_DEI_INFO(P_DOCUMENT_EXTRA_INFO_ID => NULL,
127: /* Another document of the same type should not exists in the same period when the current record is created */
128: open csr_doc_exists;
129: fetch csr_doc_exists into l_exists;
130: if csr_doc_exists%FOUND then
131: hr_utility.set_message(800,'HR_375877_OVERLAP_DEI_INFO');
132: hr_utility.raise_error;
133: end if;
134: close csr_doc_exists;
135:
128: open csr_doc_exists;
129: fetch csr_doc_exists into l_exists;
130: if csr_doc_exists%FOUND then
131: hr_utility.set_message(800,'HR_375877_OVERLAP_DEI_INFO');
132: hr_utility.raise_error;
133: end if;
134: close csr_doc_exists;
135:
136: hr_utility.set_location('Leaving : '||l_proc,20);
132: hr_utility.raise_error;
133: end if;
134: close csr_doc_exists;
135:
136: hr_utility.set_location('Leaving : '||l_proc,20);
137:
138: END CREATE_RO_DEI_INFO;
139:
140:
159: l_exists varchar2(1);
160: l_proc varchar2(60);
161: BEGIN
162: l_proc:= g_package||'UPDATE_RO_DEI_INFO';
163: hr_utility.set_location('Entering : '||l_proc,5);
164: IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'RO') THEN
165: hr_utility.set_location('Leaving : '||l_proc,10);
166: return;
167: END IF;
160: l_proc varchar2(60);
161: BEGIN
162: l_proc:= g_package||'UPDATE_RO_DEI_INFO';
163: hr_utility.set_location('Entering : '||l_proc,5);
164: IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'RO') THEN
165: hr_utility.set_location('Leaving : '||l_proc,10);
166: return;
167: END IF;
168:
161: BEGIN
162: l_proc:= g_package||'UPDATE_RO_DEI_INFO';
163: hr_utility.set_location('Entering : '||l_proc,5);
164: IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'RO') THEN
165: hr_utility.set_location('Leaving : '||l_proc,10);
166: return;
167: END IF;
168:
169:
177:
178: open csr_doc_exists;
179: fetch csr_doc_exists into l_exists;
180: if csr_doc_exists%FOUND then
181: hr_utility.set_message(800,'HR_375877_OVERLAP_DEI_INFO');
182: hr_utility.raise_error;
183: end if;
184: close csr_doc_exists;
185:
178: open csr_doc_exists;
179: fetch csr_doc_exists into l_exists;
180: if csr_doc_exists%FOUND then
181: hr_utility.set_message(800,'HR_375877_OVERLAP_DEI_INFO');
182: hr_utility.raise_error;
183: end if;
184: close csr_doc_exists;
185:
186: hr_utility.set_location('Leaving : '||l_proc,20);
182: hr_utility.raise_error;
183: end if;
184: close csr_doc_exists;
185:
186: hr_utility.set_location('Leaving : '||l_proc,20);
187: END UPDATE_RO_DEI_INFO;
188:
189: END PER_RO_DEI_INFO;