Você está na página 1de 15

Name: HR_CAGR_PYS_TEMPLATE

Type: CAGR
NAME : HR_CAGR_PYS_TEMPLATE
---------------------------------------------------------*/
DEFAULT FOR ASG_EMPLOYMENT_CATEGORY_CODE IS 'FR'
DEFAULT FOR PTU_PER_PERSON_TYPE IS
'X'
DEFAULT FOR ASG_LABOUR_UNION_MEMBER_FLAG IS 'N'
DEFAULT FOR LOC_ADR_CITY
IS 'X'
DEFAULT FOR LOC_ADR_COUNTRY
IS 'X'
DEFAULT FOR PER_AGE
IS 0
DEFAULT FOR PER_DISABLED
IS 'N'
DEFAULT FOR PER_DISABLED
IS 'N'
DEFAULT FOR PER_MARITAL_STATUS
IS 'U'
DEFAULT FOR PER_SEX
IS 'M'
VALUE
= to_text(0)
RANGE_FROM
= to_text(0)
RANGE_TO
= to_text(0)
PARENT_SPINE_ID = '0'
STEP_ID
= '0'
FROM_STEP_ID
= '0'
TO_STEP_ID
= '0'
GRADE_SPINE_ID
= '0'
If
(PTU_PER_PERSON_TYPE
LIKE 'Employee%'
AND ASG_EMPLOYMENT_CATEGORY_CODE = 'FR'
AND ASG_LABOUR_UNION_MEMBER_FLAG = 'Y'
AND LOC_ADR_COUNTRY
<> 'FRG'
AND PER_AGE
< 35
AND PER_DISABLED
= 'N'
) THEN
(
VALUE
= to_text(500)
RANGE_FROM
= to_text(500)
RANGE_TO
= to_text(500)
)
If
(PTU_PER_PERSON_TYPE
LIKE 'Employee%'
AND ASG_EMPLOYMENT_CATEGORY_CODE = 'FR'
AND ASG_LABOUR_UNION_MEMBER_FLAG = 'Y'
AND LOC_ADR_COUNTRY
= 'FRG'
AND PER_AGE
> 45
AND PER_AGE
< 50
) THEN
(
VALUE
= to_text(to_number(VALUE)+100)
RANGE_FROM
= to_text(to_number(VALUE)+100)
RANGE_TO
= to_text(to_number(VALUE)+200)
)
IF ( PER_DISABLED = 'N')

THEN
(
VALUE = to_text(to_number(VALUE)+100)
RANGE_FROM = to_text(to_number(RANGE_FROM)+200)
RANGE_TO = to_text(to_number(RANGE_TO)+300)
)
IF ( ASG_EMPLOYMENT_CATEGORY_CODE = 'FR' )
THEN
(
VALUE = to_text(to_number(VALUE)+999)
RANGE_FROM = to_text(to_number(RANGE_FROM)+444)
RANGE_TO = to_text(to_number(RANGE_TO)+333)
)
IF ( PER_AGE < 35 )
THEN
(
VALUE = to_text(to_number(VALUE)+999)
RANGE_FROM = to_text(to_number(RANGE_FROM)+444)
RANGE_TO = to_text(to_number(RANGE_TO)+333)
)
parent_spine_id = to_text(100)
return
PARENT_SPINE_ID
,
STEP_ID
,
FROM_STEP_ID
,
TO_STEP_ID
,
GRADE_SPINE_ID

/*********************************************************
Formula Name : HR_CWK_MOVE_TYPE_TEMPLATE
Description : Decides if the leaving reason is
Voluntary/Involuntary.
Inputs : leaving_reason
Change History
Author Date
Version Bug
Description
------ ---------- ------- ------- --------------ASahay 20/06/2003 115.0 N/A
Initial Version
*************************************************************/
inputs are leaving_reason(text)
default for leaving_reason is 'R'
termtype='V'
/* If leaving_reason is not entered then it is defaulted to Voluntary */
IF leaving_reason = 'NR' THEN
termtype = 'V'
IF leaving_reason = 'D' THEN
termtype = 'I'

RETURN termtype

/*********************************************************
Formula Name : HR_MOVE_TYPE_TEMPLATE
Description : Decides if the leaving reason is
Voluntary/Involuntary.
Inputs : leaving_reason
Change History
Author Date
Version Bug
Description
------ ---------- ------- ------- --------------ASahay 30/10/2000 115.0 N/A
Initial Version
*************************************************************/
inputs are leaving_reason(text)
default for leaving_reason is 'R'
termtype='V'
/* If leaving_reason is not entered then it is defaulted to Voluntary */
IF leaving_reason = 'R' THEN
termtype = 'V'
IF leaving_reason = 'RET' THEN
termtype = 'V'
IF leaving_reason = 'D' THEN
termtype = 'I'
IF leaving_reason = 'G' THEN
termtype = 'I'

RETURN termtype

/*********************************************************
Formula Name : HR_PERSON_TYPE_TEMPLATE
Description : Decides if the assignment is
Permanent/Temporary/Contract.
This is based on the Employment Category of the
Assignment and the System Person Type
Inputs
: Assignment_Id
sysdate
DBI
: ASG_EMPLOYMENT_CATEGORY_CODE
: PTU_PER_PERSON_TYPE
Change History
Author Date
Version Bug
Description
------ ---------- ------- ------- --------------ASahay 30/10/2000 115.0 N/A
Initial Version
*************************************************************/
DEFAULT FOR asg_employment_category_code IS 'X'
DEFAULT FOR ptu_per_person_type IS 'X'
/* If employment category is not entered then HeadCount cannot be calculated */
person = 'T'
IF (ptu_per_person_type LIKE 'Employee%' AND asg_employment_category_code =
'FR' ) THEN
(
person = 'P'
)
IF (ptu_per_person_type LIKE 'Employee%' AND asg_employment_category_code =
'FT' ) THEN
(
person = 'T'
)
RETURN person

/**************************************************************
Formula Name : HXC_ASG_STATUS_TYPE
Author
: Garry Payton-McDowall
Description : Implements Assignment Status Type check
Contexts : None
Explanation : The formula is passed a assignment id, submissin date,
and assignment status id and compares the value
passed from the Time Entry Rule with the assignment's
actual value. If these are different then the formula
returns TO APPROVE equal to Y which indicates the approval
process must be initiated for this rule.
****************************************************************** */
/* Change History:
Date
Author
Comments
------------ -------------- -----------------------------------29-NOV-2000 GPaytonM
Initial creation
*/
/*****************************************************************
Initialise Variables which can be null
******************************************************************/
default for assignment_id is -1
default for assignment_status_id is -1
default for submission_date is ' '
INPUTS ARE assignment_id (number),
submission_date (text),
assignment_status_id (number)
IF ( asg_status_id ( assignment_id, submission_date ) = assignment_status_id )
THEN
to_approve = 'N'
ELSE
to_approve = 'Y'
RETURN to_approve

/* ******************************************************************
Formula Name : HXC_APPROVAL_MAXIMUM
Author : Garry Payton-McDowall
Description : Implements simple hours test for approvals
Contexts
: None
Explanation : The formula is passed a resource id, period start and
period end and maximum hours. Period start and end
are the application period start and end dates.
If the maximum hours is less than the number of hours
over the period specified then the formula returns
TO APPROVE equal to Y to initiate the approval process
****************************************************************** */
/* Change History:
Date
Author
Comments
------------ -------------- -----------------------------------29-NOV-2000 GPaytonM
Initial creation
*/
/*****************************************************************
Initialise Variables which can be null
******************************************************************/
default for db_pre_period_start is ' '
default for db_pre_period_end is ' '
default for db_post_period_start is ' '
default for db_post_period_end is ' '
default for db_ref_period_start is ' '
default for db_ref_period_end is ' '
default for reference_period is 1
default for duration_in_days is 1
default for period is 1
default for timecard_hrs is 0
default for period_maximum is 0
/* ******************************************************************
READ IN INPUT VARIABLES
****************************************************************** */
INPUTS ARE resource_id
(number)
,
submission_date (text)
,
period
(number)
,
period_maximum (number)
,
reference_period (number)

,
,
,
,
,
,
,
,

db_pre_period_start (text)
db_pre_period_end (text)
db_post_period_start (text)
db_post_period_end(text)
db_ref_period_start (text)
db_ref_period_end (text)
duration_in_days (number)
timecard_hrs (number)

/* ****************************************************************
Processing
**************************************************************** */
IF ( period_max (resource_id, submission_date,
period_maximum, period, reference_period,
db_pre_period_start, db_pre_period_end,
db_post_period_start, db_post_period_end,
db_ref_period_start, db_ref_period_end,
duration_in_days, timecard_hrs ) = 1 )
THEN
to_approve = 'N'
ELSE
to_approve = 'Y'
/* ****************************************************************
RETURN VARIABLE
**************************************************************** */
RETURN to_approve

/* ******************************************************************
Formula Name : HXC_OVERRIDE_APPROVER_WF_PERSON
Author
: Garry Payton-McDowall
Description : Implement approval workflow person
Contexts : None
Explanation : Formula gets the override approver based on
the timecard id and ovn.
Change History:
Date
Author
Comments
------------ -------------- -----------------------------------06-JUN-2001 GPaytonM
Initial creation
*/
/*****************************************************************
Initialise Variables which can be null
******************************************************************/
default for formula_status is 'S'
default for formula_message is 'NO MESSAGE'
/* ******************************************************************
READ IN INPUT VARIABLES
****************************************************************** */
INPUTS ARE timecard_bb_id
(number)
,
timecard_bb_ovn
(number)
,
application_period_bb_id (number)
,
application_period_bb_ovn (number)
,
time_recipient_id
(number)
,
resource_id
(number)
,
resource_type
(text)
/* ****************************************************************
Processing
**************************************************************** */
approval_mechanism = 'PERSON'
approval_mechanism_id = get_override_approver ( timecard_bb_id, timecard_bb_ovn )
/* ****************************************************************
RETURN VARIABLE

**************************************************************** */
RETURN approval_mechanism
,
approval_mechanism_id
,
formula_status
,
formula_message

/* ******************************************************************
Formula Name : PERIOD_MAXIMUM
Author
: Garry Payton-McDowall
Description : Implement standard rule for period maximum based on
requirements from WTD
Contexts : None
Explanation : The formula is passed a resource_id, data and
period maximum values to check if the resource has
exceeded working x number of hours in a given period
****************************************************************** */
/* Change History:
Date
Author
Comments
------------ -------------- -----------------------------------29-NOV-2000 GPaytonM
Initial creation
*/
/*****************************************************************
Initialise Variables which can be null
******************************************************************/
default for db_pre_period_start is ' '
default for db_pre_period_end is ' '
default for db_post_period_start is ' '
default for db_post_period_end is ' '
default for db_ref_period_start is ' '
default for db_ref_period_end is ' '
/* ******************************************************************
READ IN INPUT VARIABLES
****************************************************************** */
INPUTS ARE resource_id
(number)
,
submission_date (text)
,
period
(number)
,
period_maximum (number)
,
reference_period (number)
,
db_pre_period_start (text)
,
db_pre_period_end (text)
,
db_post_period_start (text)
,
db_post_period_end (text)
,
db_ref_period_start (text)
,
db_ref_period_end (text)
,
duration_in_days (number)

timecard_hrs

(number)

/* ****************************************************************
Processing
**************************************************************** */
IF ( period_max (resource_id, submission_date,
period_maximum, period, reference_period,
db_pre_period_start, db_pre_period_end,
db_post_period_start, db_post_period_end,
db_ref_period_start, db_ref_period_end,
duration_in_days, timecard_hrs ) = 1 )
THEN
rule_status = 'S'
ELSE
( rule_status = 'E'
message1 = 'HXC_WTD_PERIOD_MAXIMUM' )
/* ****************************************************************
RETURN VARIABLE
**************************************************************** */
RETURN rule_status, message1

/* ******************************************************************
Formula Name : HXC_PTO_ACCRUAL_COMPARISON
Author : Garry Payton-McDowall
Description : Compares the PTO Accrual Balance with time category
hours
Contexts
: Assignemt ID
Explanation :
****************************************************************** */
/* Change History:
Date
Author
Comments
------------ -------------- -----------------------------------14-DEC-2001 GPaytonM Initial creation
*/
/*****************************************************************
Initialise Variables which can be null
******************************************************************/
default for db_pre_period_start is ' '
default for db_pre_period_end is ' '
default for db_post_period_start is ' '
default for db_post_period_end is ' '
default for db_ref_period_start is ' '
default for db_ref_period_end is ' '
default for reference_period is 1
default for operator is ' '
default for period_maximum is -1
default for accrual_offset is -1
default for rule_status is 'S'
/* ******************************************************************
READ IN INPUT VARIABLES
****************************************************************** */
INPUTS ARE resource_id
(number)
,
submission_date (text)
,
period
(number)
,
reference_period (number)
,
db_pre_period_start (text)
,
db_pre_period_end (text)
,
db_post_period_start (text)
,
db_post_period_end(text)

,
,
,
,
,
,
,
,
,

db_ref_period_start (text)
db_ref_period_end (text)
duration_in_days (number)
timecard_hrs (number)
operator
(text)
accrual_plan
(number)
period_start_date (text)
assignment_id (number)
accrual_offset (number)

/* ****************************************************************
Processing
**************************************************************** */
IF ( chk_pto_plan_enrolled ( assignment_id,
accrual_plan,
period_start_date ) = 1 )
THEN
(
calculate_date = to_date(period_start_date,'YYYY/MM/DD HH24:MI:SS')
IF( check_valid_calc_date_accrual(resource_id, calculate_date) = 'Y' )
THEN
(
calculate_date = add_days(calculate_date, -1)
period_maximum = get_hxc_net_accrual ( assignment_id, calculate_date,
accrual_plan )
)
ELSE
(
period_maximum = 0
)
IF ( accrual_offset <> -1 ) THEN
period_maximum = period_maximum + accrual_offset
IF ( period_operator_max (resource_id, submission_date,
period_maximum, period, reference_period,
db_pre_period_start, db_pre_period_end,
db_post_period_start, db_post_period_end,
db_ref_period_start, db_ref_period_end,
duration_in_days, timecard_hrs, operator ) = 1 ) THEN
rule_status = 'S'
ELSE
( rule_status = 'E'

message1 = 'HXC_TER_VIOLATION' )
)
/* ****************************************************************
RETURN VARIABLE
**************************************************************** */
RETURN rule_status, message1

Você também pode gostar