HR_API_MODULES:
---------------
select ahk.api_hook_id,
ahk.api_module_id,
ahk.hook_package,
ahk.hook_procedure
from hr_api_hooks ahk,
hr_api_modules ahm
where ahm.module_name='CREATE_PERSON_ABSENCE'
and ahm.api_module_type = 'BP'
and ahk.api_hook_type = 'AP'
and ahk.api_module_id=ahm.api_module_id;
API_HOOK_ID=3840;
API_MODULE_ID=1731;
HOOK_PACKAGE='HR_PERSON_ABSENCE_BK1';
HOOK_PROCEDURE='CREATE_PERSON_ABSENCE_A';
HR_API_HOOKS:
--------------
select ahk.api_hook_id,
ahk.hook_package,
ahk.hook_procedure
from hr_api_hooks ahk,
hr_api_modules ahm
where (ahm.module_name='PER_ABSENCE_ATTENDANCES'
or ahm.module_name='PER_ABSENCE_ATTENDANCES_F')
and ahm.api_module_type = 'RH'
and ahk.api_hook_type = 'AI'
and ahk.api_module_id=ahm.api_module_id;
API_HOOK_ID=3836;
HOOK_PACKAGE='PER_ABS_RKI';
HOOK_PROCEDURE='AFTER_INSERT';
Package for user hook overlap validation:
----------------------------------------
CREATE OR REPLACE package APPS.pfc_absence_overlap_check as
procedure PFC_ABSENCE_OVERLAP(p_person_id number,
p_date_start DATE,
p_date_end DATE);
end pfc_absence_overlap_check;
/
--pfc_absence_check.PFC_ABSENCE_OVERLAP
CREATE OR REPLACE package body APPS.pfc_absence_overlap_check as
procedure PFC_ABSENCE_OVERLAP(p_person_id number,
p_date_start DATE,
p_date_end DATE) IS
l_count number;
l_person_id number;
begin
-- l_count:= 0;
dbms_output.put_line('BEFORE BEGIN l_count:'||l_count);
--dbms_output.put_line('PERSON ID :'||p_person_id);
BEGIN
SELECT count(*) into l_count
FROM PER_ABSENCE_ATTENDANCES ABSENCE,
PER_ABSENCE_ATTENDANCE_TYPES ABSENCE_TYPES,
PER_ALL_PEOPLE_F PERSON
WHERE PERSON.PERSON_ID = ABSENCE.PERSON_ID
AND ABSENCE.ABSENCE_ATTENDANCE_TYPE_ID = ABSENCE_TYPES.ABSENCE_ATTENDANCE_TYPE_ID
AND TRUNC(SYSDATE) BETWEEN PERSON.EFFECTIVE_START_DATE AND PERSON.EFFECTIVE_END_DATE
AND PERSON.person_id = p_person_id
AND ((p_date_start BETWEEN ABSENCE.DATE_START AND ABSENCE.DATE_END) OR (p_date_end BETWEEN ABSENCE.DATE_START AND ABSENCE.DATE_END));
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('ERROR '||sqlerrm);
l_count:=0;
END;
dbms_output.put_line('l_count'||l_count);
--dbms_output.put_line('Person ID'||l_person_id);
--dbms_output.put_line('l_count'||l_count);
--dbms_output.put_line('l_count'||l_count);
IF l_count=1 THEN
dbms_output.put_line('Inside the exception validation l count is'||l_count);
dbms_standard.raise_application_error
(num => -20999
,msg => 'DUPLICATED ABSENCES SHOULD NOT BE ALLOWED'||' '||l_count||' '||p_date_start||' '||p_date_end||' '|| p_person_id);
END IF;
END PFC_ABSENCE_OVERLAP;
end pfc_absence_overlap_check;
/
Run the package:
----------------
DECLARE
P_PERSON_ID NUMBER;
P_DATE_START DATE;
P_DATE_END DATE;
BEGIN
P_PERSON_ID := 4548;
P_DATE_START := '08-dec-2010';
P_DATE_END := '08-dec-2010';
APPS.PFC_ABSENCE_OVERLAP_CHECK.PFC_ABSENCE_OVERLAP ( P_PERSON_ID, P_DATE_START, P_DATE_END );
COMMIT;
END;
This date already is there in database.
ORA-20999: DUPLICATED ABSENCES SHOULD NOT BE ALLOWED 1 08-DEC-10 08-DEC-10 4548
ORA-06512: at "APPS.PFC_ABSENCE_OVERLAP_CHECK", line 38
ORA-06512: at line 12
Registering the User Hook:
--------------------------
DECLARE
l_api_hook_call_id NUMBER;
l_object_version_number NUMBER;
BEGIN
hr_api_hook_call_api.create_api_hook_call
(p_validate => FALSE,
p_effective_date => TO_DATE
('01-JUL-1999',
'DD-MON-YYYY'
),
p_api_hook_id => 3840,
p_api_hook_call_type => 'PP',
p_sequence => 3000,
p_enabled_flag => 'Y',
p_call_package => 'PFC_ABSENCE_CHECK',
p_call_procedure => 'PFC_ABSENCE_OVERLAP',
p_api_hook_call_id => l_api_hook_call_id,
p_object_version_number => l_object_version_number
);
END;
Retrieve the data in the base table:
------------------------------------
select * from HR_API_HOOK_CALLS where call_procedure = 'PFC_ABSENCE_OVERLAP'
and trunc(creation_date)=trunc(sysdate);
output data:
-----------
API_HOOK_CALL_ID,API_HOOK_ID,API_HOOK_CALL_TYPE,LEGISLATION_CODE,SEQUENCE,ENABLED_FLAG,CALL_PACKAGE,CALL_PROCEDURE,PRE_PROCESSOR_DATE,ENCODED_ERROR,STATUS,OBJECT_VERSION_NUMBER,LAST_UPDATE_DATE,LAST_UPDATED_BY,LAST_UPDATE_LOGIN,CREATED_BY,CREATION_DATE,APPLICATION_ID,APP_INSTALL_STATUS
1101,3840,PP,,3000,Y,PFC_ABSENCE_CHECK,PFC_ABSENCE_OVERLAP,,,N,1,3/30/2011 4:40:42 PM,-1,-1,-1,3/30/2011 4:40:42 PM,,
Running the Pre-Processor:
-------------------------
rem dbdrv: none
rem/*===========================================================================*
rem | Copyright (c) 1997 Oracle Corporation |
rem | All rights reserved. |
rem*============================================================================*/
rem $Header: hrahkall.sql 120.0 2005/05/30 22:35:33 appldev noship $
rem
rem File Name
rem =========
rem hrahkall.sql
rem
rem File Information
rem ================
rem This script creates the hook package body source code for all the API
rem modules which have been defined in the HR_API_MODULES table. It should
rem be executed in the database account which contains the application
rem package code.
rem
rem This script should be executed after the core package headers, package
rem bodies and seed data have been installed. It must be executed after the
rem package headers and package bodies have been successfully compiled.
rem
rem It can also be executed by the customer after they have created their
rem specific hook definitions and loaded their extra package logic into the
rem database.
rem
rem Another script (hrahkone.sql) can be used to create the hook package
rem body source code for just one API module.
rem
rem --------------------------------------------------------------------------
rem
rem Change List
rem ===========
rem
rem Version Date Author Comment
rem -------+-----------+--------------+---------------------------------------
rem 70.0 08-APR-1997 P.K.Attwood Date Created
rem 110.1 08-OCT-1997 K.S.Habibulla Changed error handling to use
rem 'whenever sqlerror exit failure ..'.
rem 115.1 06-FEB-2002 stlocke Added dbdrv commands
rem ==========================================================================
rem
rem Create all the hook package body source code for all API modules
Set Verify Off
WhenEver SqlError Exit Failure Rollback;
execute hr_api_user_hooks_utility.create_hooks_all_modules;
rem Build the report text
set heading off
set feedback off
execute hr_api_user_hooks_utility.write_all_errors_report;
rem Output the report text
select text
from hr_api_user_hook_reports
where session_id = userenv('SESSIONID')
order by line;
rem Clear data from report table
execute hr_api_user_hooks_utility.clear_hook_report;
commit;
exit;
/
CHECK THE STATUS IN HOOK TABLE:
--------------------------------
select * from HR_API_HOOK_CALLS where call_procedure = 'PFC_ABSENCE_OVERLAP'
and trunc(creation_date)=trunc(sysdate);
STATUS=V MEANS SUCCESS;
STATUS=I MEANS INVALID;
Finally Add the custom package into Original hr_person_absence_api package:
---------------------------------------------------------------------------
CREATE OR REPLACE package body APPS.HR_PERSON_ABSENCE_BK1 as
/* $Header: peabsapi.pkb 120.4.12010000.28 2009/10/14 11:41:50 generated ship $ */
-- Code generated by the Oracle HRMS API Hook Pre-processor
-- Created on 2010/11/11 19:59:47 (YYYY/MM/DD HH24:MI:SS)
procedure CREATE_PERSON_ABSENCE_A
(P_EFFECTIVE_DATE in DATE
,P_PERSON_ID in NUMBER
,P_BUSINESS_GROUP_ID in NUMBER
,P_ABSENCE_ATTENDANCE_TYPE_ID in NUMBER
,P_ABS_ATTENDANCE_REASON_ID in NUMBER
,P_COMMENTS in LONG
,P_DATE_NOTIFICATION in DATE
,P_DATE_PROJECTED_START in DATE
,P_TIME_PROJECTED_START in VARCHAR2
,P_DATE_PROJECTED_END in DATE
,P_TIME_PROJECTED_END in VARCHAR2
,P_DATE_START in DATE
,P_TIME_START in VARCHAR2
,P_DATE_END in DATE
,P_TIME_END in VARCHAR2
,P_ABSENCE_DAYS in NUMBER
,P_ABSENCE_HOURS in NUMBER
,P_AUTHORISING_PERSON_ID in NUMBER
,P_REPLACEMENT_PERSON_ID in NUMBER
,P_ATTRIBUTE_CATEGORY in VARCHAR2
,P_ATTRIBUTE1 in VARCHAR2
,P_ATTRIBUTE2 in VARCHAR2
,P_ATTRIBUTE3 in VARCHAR2
,P_ATTRIBUTE4 in VARCHAR2
,P_ATTRIBUTE5 in VARCHAR2
,P_ATTRIBUTE6 in VARCHAR2
,P_ATTRIBUTE7 in VARCHAR2
,P_ATTRIBUTE8 in VARCHAR2
,P_ATTRIBUTE9 in VARCHAR2
,P_ATTRIBUTE10 in VARCHAR2
,P_ATTRIBUTE11 in VARCHAR2
,P_ATTRIBUTE12 in VARCHAR2
,P_ATTRIBUTE13 in VARCHAR2
,P_ATTRIBUTE14 in VARCHAR2
,P_ATTRIBUTE15 in VARCHAR2
,P_ATTRIBUTE16 in VARCHAR2
,P_ATTRIBUTE17 in VARCHAR2
,P_ATTRIBUTE18 in VARCHAR2
,P_ATTRIBUTE19 in VARCHAR2
,P_ATTRIBUTE20 in VARCHAR2
,P_OCCURRENCE in NUMBER
,P_PERIOD_OF_INCAPACITY_ID in NUMBER
,P_SSP1_ISSUED in VARCHAR2
,P_MATERNITY_ID in NUMBER
,P_SICKNESS_START_DATE in DATE
,P_SICKNESS_END_DATE in DATE
,P_PREGNANCY_RELATED_ILLNESS in VARCHAR2
,P_REASON_FOR_NOTIFICATION_DELA in VARCHAR2
,P_ACCEPT_LATE_NOTIFICATION_FLA in VARCHAR2
,P_LINKED_ABSENCE_ID in NUMBER
,P_BATCH_ID in NUMBER
,P_CREATE_ELEMENT_ENTRY in BOOLEAN
,P_ABS_INFORMATION_CATEGORY in VARCHAR2
,P_ABS_INFORMATION1 in VARCHAR2
,P_ABS_INFORMATION2 in VARCHAR2
,P_ABS_INFORMATION3 in VARCHAR2
,P_ABS_INFORMATION4 in VARCHAR2
,P_ABS_INFORMATION5 in VARCHAR2
,P_ABS_INFORMATION6 in VARCHAR2
,P_ABS_INFORMATION7 in VARCHAR2
,P_ABS_INFORMATION8 in VARCHAR2
,P_ABS_INFORMATION9 in VARCHAR2
,P_ABS_INFORMATION10 in VARCHAR2
,P_ABS_INFORMATION11 in VARCHAR2
,P_ABS_INFORMATION12 in VARCHAR2
,P_ABS_INFORMATION13 in VARCHAR2
,P_ABS_INFORMATION14 in VARCHAR2
,P_ABS_INFORMATION15 in VARCHAR2
,P_ABS_INFORMATION16 in VARCHAR2
,P_ABS_INFORMATION17 in VARCHAR2
,P_ABS_INFORMATION18 in VARCHAR2
,P_ABS_INFORMATION19 in VARCHAR2
,P_ABS_INFORMATION20 in VARCHAR2
,P_ABS_INFORMATION21 in VARCHAR2
,P_ABS_INFORMATION22 in VARCHAR2
,P_ABS_INFORMATION23 in VARCHAR2
,P_ABS_INFORMATION24 in VARCHAR2
,P_ABS_INFORMATION25 in VARCHAR2
,P_ABS_INFORMATION26 in VARCHAR2
,P_ABS_INFORMATION27 in VARCHAR2
,P_ABS_INFORMATION28 in VARCHAR2
,P_ABS_INFORMATION29 in VARCHAR2
,P_ABS_INFORMATION30 in VARCHAR2
,P_ABSENCE_CASE_ID in NUMBER
,P_ABSENCE_ATTENDANCE_ID in NUMBER
,P_OBJECT_VERSION_NUMBER in NUMBER
,P_DUR_DYS_LESS_WARNING in BOOLEAN
,P_DUR_HRS_LESS_WARNING in BOOLEAN
,P_EXCEEDS_PTO_ENTIT_WARNING in BOOLEAN
,P_EXCEEDS_RUN_TOTAL_WARNING in BOOLEAN
,P_ABS_OVERLAP_WARNING in BOOLEAN
,P_ABS_DAY_AFTER_WARNING in BOOLEAN
,P_DUR_OVERWRITTEN_WARNING in BOOLEAN
)is
l_commit_unit_number number;
l_legislation_code varchar2(30);
begin
hr_utility.set_location('Entering: HR_PERSON_ABSENCE_BK1.CREATE_PERSON_ABSENCE_A', 10);
l_commit_unit_number := hr_api.return_commit_unit;
if hr_api.call_cus_hooks then
pfc_absence_check.PFC_ABSENCE_OVERLAP
(P_PERSON_ID => P_PERSON_ID,
p_date_start =>p_date_start,
p_date_end =>p_date_end);
);
if hr_api.call_cus_hooks then
PFCPER_LEAVE_VALIDATION_PKG.CHECK_DOCUMENT
(P_PERSON_ID => P_PERSON_ID
,P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_ABSENCE_ATTENDANCE_TYPE_ID => P_ABSENCE_ATTENDANCE_TYPE_ID
,P_ABSENCE_DAYS => P_ABSENCE_DAYS
);
end if;
if hr_api.call_app_hooks then
hr_person_absence_be1.CREATE_PERSON_ABSENCE_A
(P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_PERSON_ID => P_PERSON_ID
,P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABSENCE_ATTENDANCE_TYPE_ID => P_ABSENCE_ATTENDANCE_TYPE_ID
,P_ABS_ATTENDANCE_REASON_ID => P_ABS_ATTENDANCE_REASON_ID
,P_COMMENTS => P_COMMENTS
,P_DATE_NOTIFICATION => P_DATE_NOTIFICATION
,P_DATE_PROJECTED_START => P_DATE_PROJECTED_START
,P_TIME_PROJECTED_START => P_TIME_PROJECTED_START
,P_DATE_PROJECTED_END => P_DATE_PROJECTED_END
,P_TIME_PROJECTED_END => P_TIME_PROJECTED_END
,P_DATE_START => P_DATE_START
,P_TIME_START => P_TIME_START
,P_DATE_END => P_DATE_END
,P_TIME_END => P_TIME_END
,P_ABSENCE_DAYS => P_ABSENCE_DAYS
,P_ABSENCE_HOURS => P_ABSENCE_HOURS
,P_AUTHORISING_PERSON_ID => P_AUTHORISING_PERSON_ID
,P_REPLACEMENT_PERSON_ID => P_REPLACEMENT_PERSON_ID
,P_ATTRIBUTE_CATEGORY => P_ATTRIBUTE_CATEGORY
,P_ATTRIBUTE1 => P_ATTRIBUTE1
,P_ATTRIBUTE2 => P_ATTRIBUTE2
,P_ATTRIBUTE3 => P_ATTRIBUTE3
,P_ATTRIBUTE4 => P_ATTRIBUTE4
,P_ATTRIBUTE5 => P_ATTRIBUTE5
,P_ATTRIBUTE6 => P_ATTRIBUTE6
,P_ATTRIBUTE7 => P_ATTRIBUTE7
,P_ATTRIBUTE8 => P_ATTRIBUTE8
,P_ATTRIBUTE9 => P_ATTRIBUTE9
,P_ATTRIBUTE10 => P_ATTRIBUTE10
,P_ATTRIBUTE11 => P_ATTRIBUTE11
,P_ATTRIBUTE12 => P_ATTRIBUTE12
,P_ATTRIBUTE13 => P_ATTRIBUTE13
,P_ATTRIBUTE14 => P_ATTRIBUTE14
,P_ATTRIBUTE15 => P_ATTRIBUTE15
,P_ATTRIBUTE16 => P_ATTRIBUTE16
,P_ATTRIBUTE17 => P_ATTRIBUTE17
,P_ATTRIBUTE18 => P_ATTRIBUTE18
,P_ATTRIBUTE19 => P_ATTRIBUTE19
,P_ATTRIBUTE20 => P_ATTRIBUTE20
,P_OCCURRENCE => P_OCCURRENCE
,P_PERIOD_OF_INCAPACITY_ID => P_PERIOD_OF_INCAPACITY_ID
,P_SSP1_ISSUED => P_SSP1_ISSUED
,P_MATERNITY_ID => P_MATERNITY_ID
,P_SICKNESS_START_DATE => P_SICKNESS_START_DATE
,P_SICKNESS_END_DATE => P_SICKNESS_END_DATE
,P_PREGNANCY_RELATED_ILLNESS => P_PREGNANCY_RELATED_ILLNESS
,P_REASON_FOR_NOTIFICATION_DELA => P_REASON_FOR_NOTIFICATION_DELA
,P_ACCEPT_LATE_NOTIFICATION_FLA => P_ACCEPT_LATE_NOTIFICATION_FLA
,P_LINKED_ABSENCE_ID => P_LINKED_ABSENCE_ID
,P_BATCH_ID => P_BATCH_ID
,P_CREATE_ELEMENT_ENTRY => P_CREATE_ELEMENT_ENTRY
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION2 => P_ABS_INFORMATION2
,P_ABS_INFORMATION3 => P_ABS_INFORMATION3
,P_ABS_INFORMATION4 => P_ABS_INFORMATION4
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION7 => P_ABS_INFORMATION7
,P_ABS_INFORMATION8 => P_ABS_INFORMATION8
,P_ABS_INFORMATION9 => P_ABS_INFORMATION9
,P_ABS_INFORMATION10 => P_ABS_INFORMATION10
,P_ABS_INFORMATION11 => P_ABS_INFORMATION11
,P_ABS_INFORMATION12 => P_ABS_INFORMATION12
,P_ABS_INFORMATION13 => P_ABS_INFORMATION13
,P_ABS_INFORMATION14 => P_ABS_INFORMATION14
,P_ABS_INFORMATION15 => P_ABS_INFORMATION15
,P_ABS_INFORMATION16 => P_ABS_INFORMATION16
,P_ABS_INFORMATION17 => P_ABS_INFORMATION17
,P_ABS_INFORMATION18 => P_ABS_INFORMATION18
,P_ABS_INFORMATION19 => P_ABS_INFORMATION19
,P_ABS_INFORMATION20 => P_ABS_INFORMATION20
,P_ABS_INFORMATION21 => P_ABS_INFORMATION21
,P_ABS_INFORMATION22 => P_ABS_INFORMATION22
,P_ABS_INFORMATION23 => P_ABS_INFORMATION23
,P_ABS_INFORMATION24 => P_ABS_INFORMATION24
,P_ABS_INFORMATION25 => P_ABS_INFORMATION25
,P_ABS_INFORMATION26 => P_ABS_INFORMATION26
,P_ABS_INFORMATION27 => P_ABS_INFORMATION27
,P_ABS_INFORMATION28 => P_ABS_INFORMATION28
,P_ABS_INFORMATION29 => P_ABS_INFORMATION29
,P_ABS_INFORMATION30 => P_ABS_INFORMATION30
,P_ABSENCE_CASE_ID => P_ABSENCE_CASE_ID
,P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_OBJECT_VERSION_NUMBER => P_OBJECT_VERSION_NUMBER
,P_DUR_DYS_LESS_WARNING => P_DUR_DYS_LESS_WARNING
,P_DUR_HRS_LESS_WARNING => P_DUR_HRS_LESS_WARNING
,P_EXCEEDS_PTO_ENTIT_WARNING => P_EXCEEDS_PTO_ENTIT_WARNING
,P_EXCEEDS_RUN_TOTAL_WARNING => P_EXCEEDS_RUN_TOTAL_WARNING
,P_ABS_OVERLAP_WARNING => P_ABS_OVERLAP_WARNING
,P_ABS_DAY_AFTER_WARNING => P_ABS_DAY_AFTER_WARNING
,P_DUR_OVERWRITTEN_WARNING => P_DUR_OVERWRITTEN_WARNING
);
end if;
if hr_api.call_leg_hooks then
l_legislation_code := PER_PER_BUS.return_legislation_code(P_PERSON_ID => P_PERSON_ID
);
if l_legislation_code = 'DK' then
hr_loc_absence.create_absence
(P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
);
elsif l_legislation_code = 'ES' then
PER_ES_ABSENCE.PERSON_ENTRY_CREATE
(P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION2 => P_ABS_INFORMATION2
,P_ABS_INFORMATION3 => P_ABS_INFORMATION3
,P_ABS_INFORMATION4 => P_ABS_INFORMATION4
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION7 => P_ABS_INFORMATION7
,P_ABS_INFORMATION8 => P_ABS_INFORMATION8
,P_ABS_INFORMATION9 => P_ABS_INFORMATION9
,P_ABS_INFORMATION10 => P_ABS_INFORMATION10
);
elsif l_legislation_code = 'FI' then
hr_loc_absence.create_absence
(P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
);
elsif l_legislation_code = 'FR' then
PAY_FR_SICKNESS_ABSENCE.PERSON_ENTRY_CREATE
(P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_DATE_START => P_DATE_START
);
elsif l_legislation_code = 'GB' then
PER_GB_ABSENCE_RULES.SICKNESS_DATE_UPDATE
(P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
);
PQP_GB_OSP_FUNCTIONS.ABS_PENSION_DATE_CHK
(P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
,P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_ABS_INFORMATION4 => P_ABS_INFORMATION4
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
);
elsif l_legislation_code = 'NL' then
HR_NL_DAILY_SICK_AND_RECOVERY.INSERT_PERSON_ABSENCE_CHANGES
(P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_PERSON_ID => P_PERSON_ID
,P_DATE_PROJECTED_START => P_DATE_PROJECTED_START
,P_DATE_START => P_DATE_START
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_DATE_PROJECTED_END => P_DATE_PROJECTED_END
,P_DATE_END => P_DATE_END
);
elsif l_legislation_code = 'NO' then
hr_loc_absence.create_absence
(P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
);
elsif l_legislation_code = 'SE' then
hr_loc_absence.create_absence
(P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
);
end if;
end if;
hr_multi_message.end_validation_set;
hr_api.validate_commit_unit(l_commit_unit_number, 'CREATE_PERSON_ABSENCE', 'AP');
hr_utility.set_location(' Leaving: HR_PERSON_ABSENCE_BK1.CREATE_PERSON_ABSENCE_A', 20);
end CREATE_PERSON_ABSENCE_A;
procedure CREATE_PERSON_ABSENCE_B
(P_EFFECTIVE_DATE in DATE
,P_PERSON_ID in NUMBER
,P_BUSINESS_GROUP_ID in NUMBER
,P_ABSENCE_ATTENDANCE_TYPE_ID in NUMBER
,P_ABS_ATTENDANCE_REASON_ID in NUMBER
,P_COMMENTS in LONG
,P_DATE_NOTIFICATION in DATE
,P_DATE_PROJECTED_START in DATE
,P_TIME_PROJECTED_START in VARCHAR2
,P_DATE_PROJECTED_END in DATE
,P_TIME_PROJECTED_END in VARCHAR2
,P_DATE_START in DATE
,P_TIME_START in VARCHAR2
,P_DATE_END in DATE
,P_TIME_END in VARCHAR2
,P_ABSENCE_DAYS in NUMBER
,P_ABSENCE_HOURS in NUMBER
,P_AUTHORISING_PERSON_ID in NUMBER
,P_REPLACEMENT_PERSON_ID in NUMBER
,P_ATTRIBUTE_CATEGORY in VARCHAR2
,P_ATTRIBUTE1 in VARCHAR2
,P_ATTRIBUTE2 in VARCHAR2
,P_ATTRIBUTE3 in VARCHAR2
,P_ATTRIBUTE4 in VARCHAR2
,P_ATTRIBUTE5 in VARCHAR2
,P_ATTRIBUTE6 in VARCHAR2
,P_ATTRIBUTE7 in VARCHAR2
,P_ATTRIBUTE8 in VARCHAR2
,P_ATTRIBUTE9 in VARCHAR2
,P_ATTRIBUTE10 in VARCHAR2
,P_ATTRIBUTE11 in VARCHAR2
,P_ATTRIBUTE12 in VARCHAR2
,P_ATTRIBUTE13 in VARCHAR2
,P_ATTRIBUTE14 in VARCHAR2
,P_ATTRIBUTE15 in VARCHAR2
,P_ATTRIBUTE16 in VARCHAR2
,P_ATTRIBUTE17 in VARCHAR2
,P_ATTRIBUTE18 in VARCHAR2
,P_ATTRIBUTE19 in VARCHAR2
,P_ATTRIBUTE20 in VARCHAR2
,P_PERIOD_OF_INCAPACITY_ID in NUMBER
,P_SSP1_ISSUED in VARCHAR2
,P_MATERNITY_ID in NUMBER
,P_SICKNESS_START_DATE in DATE
,P_SICKNESS_END_DATE in DATE
,P_PREGNANCY_RELATED_ILLNESS in VARCHAR2
,P_REASON_FOR_NOTIFICATION_DELA in VARCHAR2
,P_ACCEPT_LATE_NOTIFICATION_FLA in VARCHAR2
,P_LINKED_ABSENCE_ID in NUMBER
,P_BATCH_ID in NUMBER
,P_CREATE_ELEMENT_ENTRY in BOOLEAN
,P_ABS_INFORMATION_CATEGORY in VARCHAR2
,P_ABS_INFORMATION1 in VARCHAR2
,P_ABS_INFORMATION2 in VARCHAR2
,P_ABS_INFORMATION3 in VARCHAR2
,P_ABS_INFORMATION4 in VARCHAR2
,P_ABS_INFORMATION5 in VARCHAR2
,P_ABS_INFORMATION6 in VARCHAR2
,P_ABS_INFORMATION7 in VARCHAR2
,P_ABS_INFORMATION8 in VARCHAR2
,P_ABS_INFORMATION9 in VARCHAR2
,P_ABS_INFORMATION10 in VARCHAR2
,P_ABS_INFORMATION11 in VARCHAR2
,P_ABS_INFORMATION12 in VARCHAR2
,P_ABS_INFORMATION13 in VARCHAR2
,P_ABS_INFORMATION14 in VARCHAR2
,P_ABS_INFORMATION15 in VARCHAR2
,P_ABS_INFORMATION16 in VARCHAR2
,P_ABS_INFORMATION17 in VARCHAR2
,P_ABS_INFORMATION18 in VARCHAR2
,P_ABS_INFORMATION19 in VARCHAR2
,P_ABS_INFORMATION20 in VARCHAR2
,P_ABS_INFORMATION21 in VARCHAR2
,P_ABS_INFORMATION22 in VARCHAR2
,P_ABS_INFORMATION23 in VARCHAR2
,P_ABS_INFORMATION24 in VARCHAR2
,P_ABS_INFORMATION25 in VARCHAR2
,P_ABS_INFORMATION26 in VARCHAR2
,P_ABS_INFORMATION27 in VARCHAR2
,P_ABS_INFORMATION28 in VARCHAR2
,P_ABS_INFORMATION29 in VARCHAR2
,P_ABS_INFORMATION30 in VARCHAR2
,P_ABSENCE_CASE_ID in NUMBER
)is
l_commit_unit_number number;
l_legislation_code varchar2(30);
begin
hr_utility.set_location('Entering: HR_PERSON_ABSENCE_BK1.CREATE_PERSON_ABSENCE_B', 10);
l_commit_unit_number := hr_api.return_commit_unit;
if hr_api.call_cus_hooks then
PFCPER_LEAVE_VALIDATION_PKG.LEAVE_VALIDATION
(P_PERSON_ID => P_PERSON_ID
,P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABSENCE_ATTENDANCE_TYPE_ID => P_ABSENCE_ATTENDANCE_TYPE_ID
,P_ABS_ATTENDANCE_REASON_ID => P_ABS_ATTENDANCE_REASON_ID
,P_ABSENCE_DAYS => P_ABSENCE_DAYS
,P_ABSENCE_HOURS => P_ABSENCE_HOURS
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
);
end if;
if hr_api.call_leg_hooks then
l_legislation_code := PER_PER_BUS.return_legislation_code(P_PERSON_ID => P_PERSON_ID
);
if l_legislation_code = 'ES' then
PER_ES_ABSENCE.VALIDATE_ABS_CREATE
(P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_PERSON_ID => P_PERSON_ID
,P_ABSENCE_ATTENDANCE_TYPE_ID => P_ABSENCE_ATTENDANCE_TYPE_ID
,P_DATE_START => P_DATE_START
,P_TIME_START => P_TIME_START
,P_DATE_END => P_DATE_END
,P_TIME_END => P_TIME_END
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION2 => P_ABS_INFORMATION2
,P_ABS_INFORMATION3 => P_ABS_INFORMATION3
,P_ABS_INFORMATION4 => P_ABS_INFORMATION4
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION7 => P_ABS_INFORMATION7
,P_ABS_INFORMATION8 => P_ABS_INFORMATION8
,P_ABS_INFORMATION9 => P_ABS_INFORMATION9
,P_ABS_INFORMATION10 => P_ABS_INFORMATION10
);
elsif l_legislation_code = 'FI' then
HR_FI_VALIDATE_PKG.PERSON_ABSENCE_CREATE
(P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_PERSON_ID => P_PERSON_ID
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION2 => P_ABS_INFORMATION2
,P_ABS_INFORMATION3 => P_ABS_INFORMATION3
,P_ABS_INFORMATION4 => P_ABS_INFORMATION4
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
);
elsif l_legislation_code = 'FR' then
PAY_FR_SICKNESS_ABSENCE.CHECK_ADD_ABS_ENT_CREATE
(P_ABSENCE_DAYS => P_ABSENCE_DAYS
,P_ABSENCE_ATTENDANCE_TYPE_ID => P_ABSENCE_ATTENDANCE_TYPE_ID
,P_DATE_START => P_DATE_START
,P_PERSON_ID => P_PERSON_ID
);
PAY_FR_SICKNESS_ABSENCE.CHK_TRG_CATG_HRS
(P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION7 => P_ABS_INFORMATION7
,P_ABS_INFORMATION8 => P_ABS_INFORMATION8
,P_ABS_INFORMATION9 => P_ABS_INFORMATION9
,P_ABS_INFORMATION10 => P_ABS_INFORMATION10
,P_ABS_INFORMATION11 => P_ABS_INFORMATION11
,P_ABS_INFORMATION12 => P_ABS_INFORMATION12
,P_ABS_INFORMATION13 => P_ABS_INFORMATION13
,P_ABS_INFORMATION14 => P_ABS_INFORMATION14
,P_ABS_INFORMATION15 => P_ABS_INFORMATION15
,P_ABS_INFORMATION16 => P_ABS_INFORMATION16
,P_ABS_INFORMATION18 => P_ABS_INFORMATION18
,P_ABS_INFORMATION19 => P_ABS_INFORMATION19
,P_ABS_INFORMATION20 => P_ABS_INFORMATION20
,P_ABS_INFORMATION21 => P_ABS_INFORMATION21
,P_ABS_INFORMATION22 => P_ABS_INFORMATION22
,P_DATE_START => P_DATE_START
);
PAY_FR_SICKNESS_ABSENCE.PERSON_ABSENCE_CREATE
(P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_PERSON_ID => P_PERSON_ID
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION4 => P_ABS_INFORMATION4
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION7 => P_ABS_INFORMATION7
,P_ABS_INFORMATION8 => P_ABS_INFORMATION8
,P_ABS_INFORMATION9 => P_ABS_INFORMATION9
,P_ABS_INFORMATION10 => P_ABS_INFORMATION10
,P_ABS_INFORMATION11 => P_ABS_INFORMATION11
,P_ABS_INFORMATION12 => P_ABS_INFORMATION12
);
elsif l_legislation_code = 'GB' then
PER_GB_ABSENCE_RULES.VALIDATE_ABS_CREATE
(P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_PERSON_ID => P_PERSON_ID
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
,P_TIME_START => P_TIME_START
,P_TIME_END => P_TIME_END
,P_ABSENCE_ATTENDANCE_TYPE_ID => P_ABSENCE_ATTENDANCE_TYPE_ID
);
elsif l_legislation_code = 'NO' then
PAY_NO_ABS_VALIDATION.CREATE_ABS_VALIDATION
(P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_PERSON_ID => P_PERSON_ID
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION2 => P_ABS_INFORMATION2
,P_ABS_INFORMATION3 => P_ABS_INFORMATION3
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION15 => P_ABS_INFORMATION15
,P_ABS_INFORMATION16 => P_ABS_INFORMATION16
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
,P_DATE_PROJECTED_START => P_DATE_PROJECTED_START
,P_DATE_PROJECTED_END => P_DATE_PROJECTED_END
,P_ABS_ATTENDANCE_REASON_ID => P_ABS_ATTENDANCE_REASON_ID
);
end if;
end if;
hr_api.validate_commit_unit(l_commit_unit_number, 'CREATE_PERSON_ABSENCE', 'BP');
hr_utility.set_location(' Leaving: HR_PERSON_ABSENCE_BK1.CREATE_PERSON_ABSENCE_B', 20);
end CREATE_PERSON_ABSENCE_B;
end HR_PERSON_ABSENCE_BK1;
/
---------------
select ahk.api_hook_id,
ahk.api_module_id,
ahk.hook_package,
ahk.hook_procedure
from hr_api_hooks ahk,
hr_api_modules ahm
where ahm.module_name='CREATE_PERSON_ABSENCE'
and ahm.api_module_type = 'BP'
and ahk.api_hook_type = 'AP'
and ahk.api_module_id=ahm.api_module_id;
API_HOOK_ID=3840;
API_MODULE_ID=1731;
HOOK_PACKAGE='HR_PERSON_ABSENCE_BK1';
HOOK_PROCEDURE='CREATE_PERSON_ABSENCE_A';
HR_API_HOOKS:
--------------
select ahk.api_hook_id,
ahk.hook_package,
ahk.hook_procedure
from hr_api_hooks ahk,
hr_api_modules ahm
where (ahm.module_name='PER_ABSENCE_ATTENDANCES'
or ahm.module_name='PER_ABSENCE_ATTENDANCES_F')
and ahm.api_module_type = 'RH'
and ahk.api_hook_type = 'AI'
and ahk.api_module_id=ahm.api_module_id;
API_HOOK_ID=3836;
HOOK_PACKAGE='PER_ABS_RKI';
HOOK_PROCEDURE='AFTER_INSERT';
Package for user hook overlap validation:
----------------------------------------
CREATE OR REPLACE package APPS.pfc_absence_overlap_check as
procedure PFC_ABSENCE_OVERLAP(p_person_id number,
p_date_start DATE,
p_date_end DATE);
end pfc_absence_overlap_check;
/
--pfc_absence_check.PFC_ABSENCE_OVERLAP
CREATE OR REPLACE package body APPS.pfc_absence_overlap_check as
procedure PFC_ABSENCE_OVERLAP(p_person_id number,
p_date_start DATE,
p_date_end DATE) IS
l_count number;
l_person_id number;
begin
-- l_count:= 0;
dbms_output.put_line('BEFORE BEGIN l_count:'||l_count);
--dbms_output.put_line('PERSON ID :'||p_person_id);
BEGIN
SELECT count(*) into l_count
FROM PER_ABSENCE_ATTENDANCES ABSENCE,
PER_ABSENCE_ATTENDANCE_TYPES ABSENCE_TYPES,
PER_ALL_PEOPLE_F PERSON
WHERE PERSON.PERSON_ID = ABSENCE.PERSON_ID
AND ABSENCE.ABSENCE_ATTENDANCE_TYPE_ID = ABSENCE_TYPES.ABSENCE_ATTENDANCE_TYPE_ID
AND TRUNC(SYSDATE) BETWEEN PERSON.EFFECTIVE_START_DATE AND PERSON.EFFECTIVE_END_DATE
AND PERSON.person_id = p_person_id
AND ((p_date_start BETWEEN ABSENCE.DATE_START AND ABSENCE.DATE_END) OR (p_date_end BETWEEN ABSENCE.DATE_START AND ABSENCE.DATE_END));
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('ERROR '||sqlerrm);
l_count:=0;
END;
dbms_output.put_line('l_count'||l_count);
--dbms_output.put_line('Person ID'||l_person_id);
--dbms_output.put_line('l_count'||l_count);
--dbms_output.put_line('l_count'||l_count);
IF l_count=1 THEN
dbms_output.put_line('Inside the exception validation l count is'||l_count);
dbms_standard.raise_application_error
(num => -20999
,msg => 'DUPLICATED ABSENCES SHOULD NOT BE ALLOWED'||' '||l_count||' '||p_date_start||' '||p_date_end||' '|| p_person_id);
END IF;
END PFC_ABSENCE_OVERLAP;
end pfc_absence_overlap_check;
/
Run the package:
----------------
DECLARE
P_PERSON_ID NUMBER;
P_DATE_START DATE;
P_DATE_END DATE;
BEGIN
P_PERSON_ID := 4548;
P_DATE_START := '08-dec-2010';
P_DATE_END := '08-dec-2010';
APPS.PFC_ABSENCE_OVERLAP_CHECK.PFC_ABSENCE_OVERLAP ( P_PERSON_ID, P_DATE_START, P_DATE_END );
COMMIT;
END;
This date already is there in database.
ORA-20999: DUPLICATED ABSENCES SHOULD NOT BE ALLOWED 1 08-DEC-10 08-DEC-10 4548
ORA-06512: at "APPS.PFC_ABSENCE_OVERLAP_CHECK", line 38
ORA-06512: at line 12
Registering the User Hook:
--------------------------
DECLARE
l_api_hook_call_id NUMBER;
l_object_version_number NUMBER;
BEGIN
hr_api_hook_call_api.create_api_hook_call
(p_validate => FALSE,
p_effective_date => TO_DATE
('01-JUL-1999',
'DD-MON-YYYY'
),
p_api_hook_id => 3840,
p_api_hook_call_type => 'PP',
p_sequence => 3000,
p_enabled_flag => 'Y',
p_call_package => 'PFC_ABSENCE_CHECK',
p_call_procedure => 'PFC_ABSENCE_OVERLAP',
p_api_hook_call_id => l_api_hook_call_id,
p_object_version_number => l_object_version_number
);
END;
Retrieve the data in the base table:
------------------------------------
select * from HR_API_HOOK_CALLS where call_procedure = 'PFC_ABSENCE_OVERLAP'
and trunc(creation_date)=trunc(sysdate);
output data:
-----------
API_HOOK_CALL_ID,API_HOOK_ID,API_HOOK_CALL_TYPE,LEGISLATION_CODE,SEQUENCE,ENABLED_FLAG,CALL_PACKAGE,CALL_PROCEDURE,PRE_PROCESSOR_DATE,ENCODED_ERROR,STATUS,OBJECT_VERSION_NUMBER,LAST_UPDATE_DATE,LAST_UPDATED_BY,LAST_UPDATE_LOGIN,CREATED_BY,CREATION_DATE,APPLICATION_ID,APP_INSTALL_STATUS
1101,3840,PP,,3000,Y,PFC_ABSENCE_CHECK,PFC_ABSENCE_OVERLAP,,,N,1,3/30/2011 4:40:42 PM,-1,-1,-1,3/30/2011 4:40:42 PM,,
Running the Pre-Processor:
-------------------------
rem dbdrv: none
rem/*===========================================================================*
rem | Copyright (c) 1997 Oracle Corporation |
rem | All rights reserved. |
rem*============================================================================*/
rem $Header: hrahkall.sql 120.0 2005/05/30 22:35:33 appldev noship $
rem
rem File Name
rem =========
rem hrahkall.sql
rem
rem File Information
rem ================
rem This script creates the hook package body source code for all the API
rem modules which have been defined in the HR_API_MODULES table. It should
rem be executed in the database account which contains the application
rem package code.
rem
rem This script should be executed after the core package headers, package
rem bodies and seed data have been installed. It must be executed after the
rem package headers and package bodies have been successfully compiled.
rem
rem It can also be executed by the customer after they have created their
rem specific hook definitions and loaded their extra package logic into the
rem database.
rem
rem Another script (hrahkone.sql) can be used to create the hook package
rem body source code for just one API module.
rem
rem --------------------------------------------------------------------------
rem
rem Change List
rem ===========
rem
rem Version Date Author Comment
rem -------+-----------+--------------+---------------------------------------
rem 70.0 08-APR-1997 P.K.Attwood Date Created
rem 110.1 08-OCT-1997 K.S.Habibulla Changed error handling to use
rem 'whenever sqlerror exit failure ..'.
rem 115.1 06-FEB-2002 stlocke Added dbdrv commands
rem ==========================================================================
rem
rem Create all the hook package body source code for all API modules
Set Verify Off
WhenEver SqlError Exit Failure Rollback;
execute hr_api_user_hooks_utility.create_hooks_all_modules;
rem Build the report text
set heading off
set feedback off
execute hr_api_user_hooks_utility.write_all_errors_report;
rem Output the report text
select text
from hr_api_user_hook_reports
where session_id = userenv('SESSIONID')
order by line;
rem Clear data from report table
execute hr_api_user_hooks_utility.clear_hook_report;
commit;
exit;
/
CHECK THE STATUS IN HOOK TABLE:
--------------------------------
select * from HR_API_HOOK_CALLS where call_procedure = 'PFC_ABSENCE_OVERLAP'
and trunc(creation_date)=trunc(sysdate);
STATUS=V MEANS SUCCESS;
STATUS=I MEANS INVALID;
Finally Add the custom package into Original hr_person_absence_api package:
---------------------------------------------------------------------------
CREATE OR REPLACE package body APPS.HR_PERSON_ABSENCE_BK1 as
/* $Header: peabsapi.pkb 120.4.12010000.28 2009/10/14 11:41:50 generated ship $ */
-- Code generated by the Oracle HRMS API Hook Pre-processor
-- Created on 2010/11/11 19:59:47 (YYYY/MM/DD HH24:MI:SS)
procedure CREATE_PERSON_ABSENCE_A
(P_EFFECTIVE_DATE in DATE
,P_PERSON_ID in NUMBER
,P_BUSINESS_GROUP_ID in NUMBER
,P_ABSENCE_ATTENDANCE_TYPE_ID in NUMBER
,P_ABS_ATTENDANCE_REASON_ID in NUMBER
,P_COMMENTS in LONG
,P_DATE_NOTIFICATION in DATE
,P_DATE_PROJECTED_START in DATE
,P_TIME_PROJECTED_START in VARCHAR2
,P_DATE_PROJECTED_END in DATE
,P_TIME_PROJECTED_END in VARCHAR2
,P_DATE_START in DATE
,P_TIME_START in VARCHAR2
,P_DATE_END in DATE
,P_TIME_END in VARCHAR2
,P_ABSENCE_DAYS in NUMBER
,P_ABSENCE_HOURS in NUMBER
,P_AUTHORISING_PERSON_ID in NUMBER
,P_REPLACEMENT_PERSON_ID in NUMBER
,P_ATTRIBUTE_CATEGORY in VARCHAR2
,P_ATTRIBUTE1 in VARCHAR2
,P_ATTRIBUTE2 in VARCHAR2
,P_ATTRIBUTE3 in VARCHAR2
,P_ATTRIBUTE4 in VARCHAR2
,P_ATTRIBUTE5 in VARCHAR2
,P_ATTRIBUTE6 in VARCHAR2
,P_ATTRIBUTE7 in VARCHAR2
,P_ATTRIBUTE8 in VARCHAR2
,P_ATTRIBUTE9 in VARCHAR2
,P_ATTRIBUTE10 in VARCHAR2
,P_ATTRIBUTE11 in VARCHAR2
,P_ATTRIBUTE12 in VARCHAR2
,P_ATTRIBUTE13 in VARCHAR2
,P_ATTRIBUTE14 in VARCHAR2
,P_ATTRIBUTE15 in VARCHAR2
,P_ATTRIBUTE16 in VARCHAR2
,P_ATTRIBUTE17 in VARCHAR2
,P_ATTRIBUTE18 in VARCHAR2
,P_ATTRIBUTE19 in VARCHAR2
,P_ATTRIBUTE20 in VARCHAR2
,P_OCCURRENCE in NUMBER
,P_PERIOD_OF_INCAPACITY_ID in NUMBER
,P_SSP1_ISSUED in VARCHAR2
,P_MATERNITY_ID in NUMBER
,P_SICKNESS_START_DATE in DATE
,P_SICKNESS_END_DATE in DATE
,P_PREGNANCY_RELATED_ILLNESS in VARCHAR2
,P_REASON_FOR_NOTIFICATION_DELA in VARCHAR2
,P_ACCEPT_LATE_NOTIFICATION_FLA in VARCHAR2
,P_LINKED_ABSENCE_ID in NUMBER
,P_BATCH_ID in NUMBER
,P_CREATE_ELEMENT_ENTRY in BOOLEAN
,P_ABS_INFORMATION_CATEGORY in VARCHAR2
,P_ABS_INFORMATION1 in VARCHAR2
,P_ABS_INFORMATION2 in VARCHAR2
,P_ABS_INFORMATION3 in VARCHAR2
,P_ABS_INFORMATION4 in VARCHAR2
,P_ABS_INFORMATION5 in VARCHAR2
,P_ABS_INFORMATION6 in VARCHAR2
,P_ABS_INFORMATION7 in VARCHAR2
,P_ABS_INFORMATION8 in VARCHAR2
,P_ABS_INFORMATION9 in VARCHAR2
,P_ABS_INFORMATION10 in VARCHAR2
,P_ABS_INFORMATION11 in VARCHAR2
,P_ABS_INFORMATION12 in VARCHAR2
,P_ABS_INFORMATION13 in VARCHAR2
,P_ABS_INFORMATION14 in VARCHAR2
,P_ABS_INFORMATION15 in VARCHAR2
,P_ABS_INFORMATION16 in VARCHAR2
,P_ABS_INFORMATION17 in VARCHAR2
,P_ABS_INFORMATION18 in VARCHAR2
,P_ABS_INFORMATION19 in VARCHAR2
,P_ABS_INFORMATION20 in VARCHAR2
,P_ABS_INFORMATION21 in VARCHAR2
,P_ABS_INFORMATION22 in VARCHAR2
,P_ABS_INFORMATION23 in VARCHAR2
,P_ABS_INFORMATION24 in VARCHAR2
,P_ABS_INFORMATION25 in VARCHAR2
,P_ABS_INFORMATION26 in VARCHAR2
,P_ABS_INFORMATION27 in VARCHAR2
,P_ABS_INFORMATION28 in VARCHAR2
,P_ABS_INFORMATION29 in VARCHAR2
,P_ABS_INFORMATION30 in VARCHAR2
,P_ABSENCE_CASE_ID in NUMBER
,P_ABSENCE_ATTENDANCE_ID in NUMBER
,P_OBJECT_VERSION_NUMBER in NUMBER
,P_DUR_DYS_LESS_WARNING in BOOLEAN
,P_DUR_HRS_LESS_WARNING in BOOLEAN
,P_EXCEEDS_PTO_ENTIT_WARNING in BOOLEAN
,P_EXCEEDS_RUN_TOTAL_WARNING in BOOLEAN
,P_ABS_OVERLAP_WARNING in BOOLEAN
,P_ABS_DAY_AFTER_WARNING in BOOLEAN
,P_DUR_OVERWRITTEN_WARNING in BOOLEAN
)is
l_commit_unit_number number;
l_legislation_code varchar2(30);
begin
hr_utility.set_location('Entering: HR_PERSON_ABSENCE_BK1.CREATE_PERSON_ABSENCE_A', 10);
l_commit_unit_number := hr_api.return_commit_unit;
if hr_api.call_cus_hooks then
pfc_absence_check.PFC_ABSENCE_OVERLAP
(P_PERSON_ID => P_PERSON_ID,
p_date_start =>p_date_start,
p_date_end =>p_date_end);
);
if hr_api.call_cus_hooks then
PFCPER_LEAVE_VALIDATION_PKG.CHECK_DOCUMENT
(P_PERSON_ID => P_PERSON_ID
,P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_ABSENCE_ATTENDANCE_TYPE_ID => P_ABSENCE_ATTENDANCE_TYPE_ID
,P_ABSENCE_DAYS => P_ABSENCE_DAYS
);
end if;
if hr_api.call_app_hooks then
hr_person_absence_be1.CREATE_PERSON_ABSENCE_A
(P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_PERSON_ID => P_PERSON_ID
,P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABSENCE_ATTENDANCE_TYPE_ID => P_ABSENCE_ATTENDANCE_TYPE_ID
,P_ABS_ATTENDANCE_REASON_ID => P_ABS_ATTENDANCE_REASON_ID
,P_COMMENTS => P_COMMENTS
,P_DATE_NOTIFICATION => P_DATE_NOTIFICATION
,P_DATE_PROJECTED_START => P_DATE_PROJECTED_START
,P_TIME_PROJECTED_START => P_TIME_PROJECTED_START
,P_DATE_PROJECTED_END => P_DATE_PROJECTED_END
,P_TIME_PROJECTED_END => P_TIME_PROJECTED_END
,P_DATE_START => P_DATE_START
,P_TIME_START => P_TIME_START
,P_DATE_END => P_DATE_END
,P_TIME_END => P_TIME_END
,P_ABSENCE_DAYS => P_ABSENCE_DAYS
,P_ABSENCE_HOURS => P_ABSENCE_HOURS
,P_AUTHORISING_PERSON_ID => P_AUTHORISING_PERSON_ID
,P_REPLACEMENT_PERSON_ID => P_REPLACEMENT_PERSON_ID
,P_ATTRIBUTE_CATEGORY => P_ATTRIBUTE_CATEGORY
,P_ATTRIBUTE1 => P_ATTRIBUTE1
,P_ATTRIBUTE2 => P_ATTRIBUTE2
,P_ATTRIBUTE3 => P_ATTRIBUTE3
,P_ATTRIBUTE4 => P_ATTRIBUTE4
,P_ATTRIBUTE5 => P_ATTRIBUTE5
,P_ATTRIBUTE6 => P_ATTRIBUTE6
,P_ATTRIBUTE7 => P_ATTRIBUTE7
,P_ATTRIBUTE8 => P_ATTRIBUTE8
,P_ATTRIBUTE9 => P_ATTRIBUTE9
,P_ATTRIBUTE10 => P_ATTRIBUTE10
,P_ATTRIBUTE11 => P_ATTRIBUTE11
,P_ATTRIBUTE12 => P_ATTRIBUTE12
,P_ATTRIBUTE13 => P_ATTRIBUTE13
,P_ATTRIBUTE14 => P_ATTRIBUTE14
,P_ATTRIBUTE15 => P_ATTRIBUTE15
,P_ATTRIBUTE16 => P_ATTRIBUTE16
,P_ATTRIBUTE17 => P_ATTRIBUTE17
,P_ATTRIBUTE18 => P_ATTRIBUTE18
,P_ATTRIBUTE19 => P_ATTRIBUTE19
,P_ATTRIBUTE20 => P_ATTRIBUTE20
,P_OCCURRENCE => P_OCCURRENCE
,P_PERIOD_OF_INCAPACITY_ID => P_PERIOD_OF_INCAPACITY_ID
,P_SSP1_ISSUED => P_SSP1_ISSUED
,P_MATERNITY_ID => P_MATERNITY_ID
,P_SICKNESS_START_DATE => P_SICKNESS_START_DATE
,P_SICKNESS_END_DATE => P_SICKNESS_END_DATE
,P_PREGNANCY_RELATED_ILLNESS => P_PREGNANCY_RELATED_ILLNESS
,P_REASON_FOR_NOTIFICATION_DELA => P_REASON_FOR_NOTIFICATION_DELA
,P_ACCEPT_LATE_NOTIFICATION_FLA => P_ACCEPT_LATE_NOTIFICATION_FLA
,P_LINKED_ABSENCE_ID => P_LINKED_ABSENCE_ID
,P_BATCH_ID => P_BATCH_ID
,P_CREATE_ELEMENT_ENTRY => P_CREATE_ELEMENT_ENTRY
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION2 => P_ABS_INFORMATION2
,P_ABS_INFORMATION3 => P_ABS_INFORMATION3
,P_ABS_INFORMATION4 => P_ABS_INFORMATION4
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION7 => P_ABS_INFORMATION7
,P_ABS_INFORMATION8 => P_ABS_INFORMATION8
,P_ABS_INFORMATION9 => P_ABS_INFORMATION9
,P_ABS_INFORMATION10 => P_ABS_INFORMATION10
,P_ABS_INFORMATION11 => P_ABS_INFORMATION11
,P_ABS_INFORMATION12 => P_ABS_INFORMATION12
,P_ABS_INFORMATION13 => P_ABS_INFORMATION13
,P_ABS_INFORMATION14 => P_ABS_INFORMATION14
,P_ABS_INFORMATION15 => P_ABS_INFORMATION15
,P_ABS_INFORMATION16 => P_ABS_INFORMATION16
,P_ABS_INFORMATION17 => P_ABS_INFORMATION17
,P_ABS_INFORMATION18 => P_ABS_INFORMATION18
,P_ABS_INFORMATION19 => P_ABS_INFORMATION19
,P_ABS_INFORMATION20 => P_ABS_INFORMATION20
,P_ABS_INFORMATION21 => P_ABS_INFORMATION21
,P_ABS_INFORMATION22 => P_ABS_INFORMATION22
,P_ABS_INFORMATION23 => P_ABS_INFORMATION23
,P_ABS_INFORMATION24 => P_ABS_INFORMATION24
,P_ABS_INFORMATION25 => P_ABS_INFORMATION25
,P_ABS_INFORMATION26 => P_ABS_INFORMATION26
,P_ABS_INFORMATION27 => P_ABS_INFORMATION27
,P_ABS_INFORMATION28 => P_ABS_INFORMATION28
,P_ABS_INFORMATION29 => P_ABS_INFORMATION29
,P_ABS_INFORMATION30 => P_ABS_INFORMATION30
,P_ABSENCE_CASE_ID => P_ABSENCE_CASE_ID
,P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_OBJECT_VERSION_NUMBER => P_OBJECT_VERSION_NUMBER
,P_DUR_DYS_LESS_WARNING => P_DUR_DYS_LESS_WARNING
,P_DUR_HRS_LESS_WARNING => P_DUR_HRS_LESS_WARNING
,P_EXCEEDS_PTO_ENTIT_WARNING => P_EXCEEDS_PTO_ENTIT_WARNING
,P_EXCEEDS_RUN_TOTAL_WARNING => P_EXCEEDS_RUN_TOTAL_WARNING
,P_ABS_OVERLAP_WARNING => P_ABS_OVERLAP_WARNING
,P_ABS_DAY_AFTER_WARNING => P_ABS_DAY_AFTER_WARNING
,P_DUR_OVERWRITTEN_WARNING => P_DUR_OVERWRITTEN_WARNING
);
end if;
if hr_api.call_leg_hooks then
l_legislation_code := PER_PER_BUS.return_legislation_code(P_PERSON_ID => P_PERSON_ID
);
if l_legislation_code = 'DK' then
hr_loc_absence.create_absence
(P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
);
elsif l_legislation_code = 'ES' then
PER_ES_ABSENCE.PERSON_ENTRY_CREATE
(P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION2 => P_ABS_INFORMATION2
,P_ABS_INFORMATION3 => P_ABS_INFORMATION3
,P_ABS_INFORMATION4 => P_ABS_INFORMATION4
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION7 => P_ABS_INFORMATION7
,P_ABS_INFORMATION8 => P_ABS_INFORMATION8
,P_ABS_INFORMATION9 => P_ABS_INFORMATION9
,P_ABS_INFORMATION10 => P_ABS_INFORMATION10
);
elsif l_legislation_code = 'FI' then
hr_loc_absence.create_absence
(P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
);
elsif l_legislation_code = 'FR' then
PAY_FR_SICKNESS_ABSENCE.PERSON_ENTRY_CREATE
(P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_DATE_START => P_DATE_START
);
elsif l_legislation_code = 'GB' then
PER_GB_ABSENCE_RULES.SICKNESS_DATE_UPDATE
(P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
);
PQP_GB_OSP_FUNCTIONS.ABS_PENSION_DATE_CHK
(P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
,P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_ABS_INFORMATION4 => P_ABS_INFORMATION4
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
);
elsif l_legislation_code = 'NL' then
HR_NL_DAILY_SICK_AND_RECOVERY.INSERT_PERSON_ABSENCE_CHANGES
(P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_PERSON_ID => P_PERSON_ID
,P_DATE_PROJECTED_START => P_DATE_PROJECTED_START
,P_DATE_START => P_DATE_START
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_DATE_PROJECTED_END => P_DATE_PROJECTED_END
,P_DATE_END => P_DATE_END
);
elsif l_legislation_code = 'NO' then
hr_loc_absence.create_absence
(P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
);
elsif l_legislation_code = 'SE' then
hr_loc_absence.create_absence
(P_ABSENCE_ATTENDANCE_ID => P_ABSENCE_ATTENDANCE_ID
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
);
end if;
end if;
hr_multi_message.end_validation_set;
hr_api.validate_commit_unit(l_commit_unit_number, 'CREATE_PERSON_ABSENCE', 'AP');
hr_utility.set_location(' Leaving: HR_PERSON_ABSENCE_BK1.CREATE_PERSON_ABSENCE_A', 20);
end CREATE_PERSON_ABSENCE_A;
procedure CREATE_PERSON_ABSENCE_B
(P_EFFECTIVE_DATE in DATE
,P_PERSON_ID in NUMBER
,P_BUSINESS_GROUP_ID in NUMBER
,P_ABSENCE_ATTENDANCE_TYPE_ID in NUMBER
,P_ABS_ATTENDANCE_REASON_ID in NUMBER
,P_COMMENTS in LONG
,P_DATE_NOTIFICATION in DATE
,P_DATE_PROJECTED_START in DATE
,P_TIME_PROJECTED_START in VARCHAR2
,P_DATE_PROJECTED_END in DATE
,P_TIME_PROJECTED_END in VARCHAR2
,P_DATE_START in DATE
,P_TIME_START in VARCHAR2
,P_DATE_END in DATE
,P_TIME_END in VARCHAR2
,P_ABSENCE_DAYS in NUMBER
,P_ABSENCE_HOURS in NUMBER
,P_AUTHORISING_PERSON_ID in NUMBER
,P_REPLACEMENT_PERSON_ID in NUMBER
,P_ATTRIBUTE_CATEGORY in VARCHAR2
,P_ATTRIBUTE1 in VARCHAR2
,P_ATTRIBUTE2 in VARCHAR2
,P_ATTRIBUTE3 in VARCHAR2
,P_ATTRIBUTE4 in VARCHAR2
,P_ATTRIBUTE5 in VARCHAR2
,P_ATTRIBUTE6 in VARCHAR2
,P_ATTRIBUTE7 in VARCHAR2
,P_ATTRIBUTE8 in VARCHAR2
,P_ATTRIBUTE9 in VARCHAR2
,P_ATTRIBUTE10 in VARCHAR2
,P_ATTRIBUTE11 in VARCHAR2
,P_ATTRIBUTE12 in VARCHAR2
,P_ATTRIBUTE13 in VARCHAR2
,P_ATTRIBUTE14 in VARCHAR2
,P_ATTRIBUTE15 in VARCHAR2
,P_ATTRIBUTE16 in VARCHAR2
,P_ATTRIBUTE17 in VARCHAR2
,P_ATTRIBUTE18 in VARCHAR2
,P_ATTRIBUTE19 in VARCHAR2
,P_ATTRIBUTE20 in VARCHAR2
,P_PERIOD_OF_INCAPACITY_ID in NUMBER
,P_SSP1_ISSUED in VARCHAR2
,P_MATERNITY_ID in NUMBER
,P_SICKNESS_START_DATE in DATE
,P_SICKNESS_END_DATE in DATE
,P_PREGNANCY_RELATED_ILLNESS in VARCHAR2
,P_REASON_FOR_NOTIFICATION_DELA in VARCHAR2
,P_ACCEPT_LATE_NOTIFICATION_FLA in VARCHAR2
,P_LINKED_ABSENCE_ID in NUMBER
,P_BATCH_ID in NUMBER
,P_CREATE_ELEMENT_ENTRY in BOOLEAN
,P_ABS_INFORMATION_CATEGORY in VARCHAR2
,P_ABS_INFORMATION1 in VARCHAR2
,P_ABS_INFORMATION2 in VARCHAR2
,P_ABS_INFORMATION3 in VARCHAR2
,P_ABS_INFORMATION4 in VARCHAR2
,P_ABS_INFORMATION5 in VARCHAR2
,P_ABS_INFORMATION6 in VARCHAR2
,P_ABS_INFORMATION7 in VARCHAR2
,P_ABS_INFORMATION8 in VARCHAR2
,P_ABS_INFORMATION9 in VARCHAR2
,P_ABS_INFORMATION10 in VARCHAR2
,P_ABS_INFORMATION11 in VARCHAR2
,P_ABS_INFORMATION12 in VARCHAR2
,P_ABS_INFORMATION13 in VARCHAR2
,P_ABS_INFORMATION14 in VARCHAR2
,P_ABS_INFORMATION15 in VARCHAR2
,P_ABS_INFORMATION16 in VARCHAR2
,P_ABS_INFORMATION17 in VARCHAR2
,P_ABS_INFORMATION18 in VARCHAR2
,P_ABS_INFORMATION19 in VARCHAR2
,P_ABS_INFORMATION20 in VARCHAR2
,P_ABS_INFORMATION21 in VARCHAR2
,P_ABS_INFORMATION22 in VARCHAR2
,P_ABS_INFORMATION23 in VARCHAR2
,P_ABS_INFORMATION24 in VARCHAR2
,P_ABS_INFORMATION25 in VARCHAR2
,P_ABS_INFORMATION26 in VARCHAR2
,P_ABS_INFORMATION27 in VARCHAR2
,P_ABS_INFORMATION28 in VARCHAR2
,P_ABS_INFORMATION29 in VARCHAR2
,P_ABS_INFORMATION30 in VARCHAR2
,P_ABSENCE_CASE_ID in NUMBER
)is
l_commit_unit_number number;
l_legislation_code varchar2(30);
begin
hr_utility.set_location('Entering: HR_PERSON_ABSENCE_BK1.CREATE_PERSON_ABSENCE_B', 10);
l_commit_unit_number := hr_api.return_commit_unit;
if hr_api.call_cus_hooks then
PFCPER_LEAVE_VALIDATION_PKG.LEAVE_VALIDATION
(P_PERSON_ID => P_PERSON_ID
,P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABSENCE_ATTENDANCE_TYPE_ID => P_ABSENCE_ATTENDANCE_TYPE_ID
,P_ABS_ATTENDANCE_REASON_ID => P_ABS_ATTENDANCE_REASON_ID
,P_ABSENCE_DAYS => P_ABSENCE_DAYS
,P_ABSENCE_HOURS => P_ABSENCE_HOURS
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
);
end if;
if hr_api.call_leg_hooks then
l_legislation_code := PER_PER_BUS.return_legislation_code(P_PERSON_ID => P_PERSON_ID
);
if l_legislation_code = 'ES' then
PER_ES_ABSENCE.VALIDATE_ABS_CREATE
(P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_PERSON_ID => P_PERSON_ID
,P_ABSENCE_ATTENDANCE_TYPE_ID => P_ABSENCE_ATTENDANCE_TYPE_ID
,P_DATE_START => P_DATE_START
,P_TIME_START => P_TIME_START
,P_DATE_END => P_DATE_END
,P_TIME_END => P_TIME_END
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION2 => P_ABS_INFORMATION2
,P_ABS_INFORMATION3 => P_ABS_INFORMATION3
,P_ABS_INFORMATION4 => P_ABS_INFORMATION4
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION7 => P_ABS_INFORMATION7
,P_ABS_INFORMATION8 => P_ABS_INFORMATION8
,P_ABS_INFORMATION9 => P_ABS_INFORMATION9
,P_ABS_INFORMATION10 => P_ABS_INFORMATION10
);
elsif l_legislation_code = 'FI' then
HR_FI_VALIDATE_PKG.PERSON_ABSENCE_CREATE
(P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_PERSON_ID => P_PERSON_ID
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION2 => P_ABS_INFORMATION2
,P_ABS_INFORMATION3 => P_ABS_INFORMATION3
,P_ABS_INFORMATION4 => P_ABS_INFORMATION4
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
);
elsif l_legislation_code = 'FR' then
PAY_FR_SICKNESS_ABSENCE.CHECK_ADD_ABS_ENT_CREATE
(P_ABSENCE_DAYS => P_ABSENCE_DAYS
,P_ABSENCE_ATTENDANCE_TYPE_ID => P_ABSENCE_ATTENDANCE_TYPE_ID
,P_DATE_START => P_DATE_START
,P_PERSON_ID => P_PERSON_ID
);
PAY_FR_SICKNESS_ABSENCE.CHK_TRG_CATG_HRS
(P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION7 => P_ABS_INFORMATION7
,P_ABS_INFORMATION8 => P_ABS_INFORMATION8
,P_ABS_INFORMATION9 => P_ABS_INFORMATION9
,P_ABS_INFORMATION10 => P_ABS_INFORMATION10
,P_ABS_INFORMATION11 => P_ABS_INFORMATION11
,P_ABS_INFORMATION12 => P_ABS_INFORMATION12
,P_ABS_INFORMATION13 => P_ABS_INFORMATION13
,P_ABS_INFORMATION14 => P_ABS_INFORMATION14
,P_ABS_INFORMATION15 => P_ABS_INFORMATION15
,P_ABS_INFORMATION16 => P_ABS_INFORMATION16
,P_ABS_INFORMATION18 => P_ABS_INFORMATION18
,P_ABS_INFORMATION19 => P_ABS_INFORMATION19
,P_ABS_INFORMATION20 => P_ABS_INFORMATION20
,P_ABS_INFORMATION21 => P_ABS_INFORMATION21
,P_ABS_INFORMATION22 => P_ABS_INFORMATION22
,P_DATE_START => P_DATE_START
);
PAY_FR_SICKNESS_ABSENCE.PERSON_ABSENCE_CREATE
(P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_PERSON_ID => P_PERSON_ID
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION4 => P_ABS_INFORMATION4
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION7 => P_ABS_INFORMATION7
,P_ABS_INFORMATION8 => P_ABS_INFORMATION8
,P_ABS_INFORMATION9 => P_ABS_INFORMATION9
,P_ABS_INFORMATION10 => P_ABS_INFORMATION10
,P_ABS_INFORMATION11 => P_ABS_INFORMATION11
,P_ABS_INFORMATION12 => P_ABS_INFORMATION12
);
elsif l_legislation_code = 'GB' then
PER_GB_ABSENCE_RULES.VALIDATE_ABS_CREATE
(P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_PERSON_ID => P_PERSON_ID
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
,P_TIME_START => P_TIME_START
,P_TIME_END => P_TIME_END
,P_ABSENCE_ATTENDANCE_TYPE_ID => P_ABSENCE_ATTENDANCE_TYPE_ID
);
elsif l_legislation_code = 'NO' then
PAY_NO_ABS_VALIDATION.CREATE_ABS_VALIDATION
(P_ABS_INFORMATION_CATEGORY => P_ABS_INFORMATION_CATEGORY
,P_PERSON_ID => P_PERSON_ID
,P_EFFECTIVE_DATE => P_EFFECTIVE_DATE
,P_ABS_INFORMATION1 => P_ABS_INFORMATION1
,P_ABS_INFORMATION2 => P_ABS_INFORMATION2
,P_ABS_INFORMATION3 => P_ABS_INFORMATION3
,P_ABS_INFORMATION5 => P_ABS_INFORMATION5
,P_ABS_INFORMATION6 => P_ABS_INFORMATION6
,P_ABS_INFORMATION15 => P_ABS_INFORMATION15
,P_ABS_INFORMATION16 => P_ABS_INFORMATION16
,P_DATE_START => P_DATE_START
,P_DATE_END => P_DATE_END
,P_DATE_PROJECTED_START => P_DATE_PROJECTED_START
,P_DATE_PROJECTED_END => P_DATE_PROJECTED_END
,P_ABS_ATTENDANCE_REASON_ID => P_ABS_ATTENDANCE_REASON_ID
);
end if;
end if;
hr_api.validate_commit_unit(l_commit_unit_number, 'CREATE_PERSON_ABSENCE', 'BP');
hr_utility.set_location(' Leaving: HR_PERSON_ABSENCE_BK1.CREATE_PERSON_ABSENCE_B', 20);
end CREATE_PERSON_ABSENCE_B;
end HR_PERSON_ABSENCE_BK1;
/
No comments:
Post a Comment