index

Package np_job_earnings

This package provides the common business interface for the Job Earnings BPI(NP_JOB_EARNINGS).

This BPI creates, deletes, and updates Default Earnings records for a job.
It also takes care of different scenarios related to ending an earning.
When a job is created by the Jobs business process level API, a Default Earnings record is created automatically.

This BPI also tests the user's appropriate HR security.



Program units
f_api_version   Returns the BPI version number.
f_exists   Checks if a record exists.
f_isequal   Compares two records for equality.
f_query_all   Selects all records for the entity.
f_query_one   Selects one record using key.
f_query_by_rowid   Selects one record using ROWID.
f_query_one_lock   Selects one record and locks it.
p_create   Creates a record.
p_delete   Deletes a record.
p_lock   Locks a record.
p_update   Updates a record.
f_unspecified_earnings_table   Returns a null Job Earnings PL/SQL table.

Types
job_earnings_rec   Business Entity record type
job_earnings_ref   Entity cursor variable type
job_earnings_tab   Entity table type


job_earnings_rec

TYPE job_earnings_rec IS RECORD (
  r_pidm                    nbrearn.nbrearn_pidm%TYPE,
  r_posn                    nbrearn.nbrearn_posn%TYPE,
  r_suff                    nbrearn.nbrearn_suff%TYPE,
  r_effective_date          nbrearn.nbrearn_effective_date%TYPE,
  r_earn_code               nbrearn.nbrearn_earn_code%TYPE,
  r_active_ind              nbrearn.nbrearn_active_ind%TYPE,
  r_hrs                     nbrearn.nbrearn_hrs%TYPE,
  r_special_rate            nbrearn.nbrearn_special_rate%TYPE,
  r_shift                   nbrearn.nbrearn_shift%TYPE,
  r_deemed_hrs              nbrearn.nbrearn_deemed_hrs%TYPE,
  r_user_id                 nbrearn.nbrearn_user_id%TYPE,
  r_data_origin             nbrearn.nbrearn_data_origin%TYPE,
  r_internal_record_id      gb_common.internal_record_id_type);

Business Entity record type


job_earnings_ref

TYPE job_earnings_ref IS REF CURSOR RETURN job_earnings_rec;

Entity cursor variable type


job_earnings_tab

TYPE job_earnings_tab IS TABLE OF job_earnings_rec INDEX BY BINARY_INTEGER;

Entity table type


f_api_version

Function f_api_version RETURN PLS_INTEGER

Returns the BPI version number.

Returns
Version of the BPI signature. Changes only when the signature changes.


f_exists

Function f_exists(p_pidm           nbrearn.nbrearn_pidm%TYPE,
                  p_posn           nbrearn.nbrearn_posn%TYPE,
                  p_suff           nbrearn.nbrearn_suff%TYPE,
                  p_effective_date nbrearn.nbrearn_effective_date%TYPE,
                  p_earn_code      nbrearn.nbrearn_earn_code%TYPE,
                  p_active_ind     nbrearn.nbrearn_active_ind%TYPE,
                  p_rowid          gb_common.internal_record_id_type DEFAULT NULL)
  RETURN VARCHAR2

Checks if a record exists.

Parameters
p_pidm   Internal identification number of the employee. NUMBER(8) Required Key.
p_posn   Position to which a job is attached. VARCHAR2(6) Required Key.
p_suff   Unique identifier that helps create and maintain multiple jobs for the same position, for the same employee. VARCHAR2(2) Required Key.
p_effective_date   Date that the Earnings Code record becomes effective. DATE Required Key.
p_earn_code   The default earnings code attached to a job and used on the time sheet. VARCHAR2(3) Required Key.
p_active_ind   Indicates whether the earnings code is active. VARCHAR2(1) Required Key.
p_rowid   Database ROWID of the record to be selected. VARCHAR2(18).

Returns
Y if found, otherwise N.


f_isequal

Function f_isequal(rec_one nb_job_earnings.job_earnings_rec,
                   rec_two nb_job_earnings.job_earnings_rec)
  RETURN VARCHAR2

Compares two records for equality.
Tests each field of rec_one against the corresponding field of rec_two. Two null values are considered equal.

Parameters
rec_one   The first record to compare. Type earnings_rec Required.
rec_two   The second record to compare. Type earnings_rec Required.

Returns
Y if all values in records are equal, otherwise N. Nulls match Nulls.


f_query_all

Function f_query_all(p_pidm           nbrearn.nbrearn_pidm%TYPE,
                     p_posn           nbrearn.nbrearn_posn%TYPE,
                     p_suff           nbrearn.nbrearn_suff%TYPE,
                     p_effective_date nbrearn.nbrearn_effective_date%TYPE,
                     p_earn_code      nbrearn.nbrearn_earn_code%TYPE,
                     p_active_ind     nbrearn.nbrearn_active_ind%TYPE)
  RETURN nb_job_earnings.job_earnings_ref

Selects all records for the entity.

Parameters
p_pidm   Internal identification number of the employee. NUMBER(8) Required Key.
p_posn   Position to which a job is attached. VARCHAR2(6) Required Key.
p_suff   Unique identifier that helps create and maintain multiple jobs for the same position, for the same employee. VARCHAR2(2) Required Key.
p_effective_date   Date that the Earnings Code record becomes effective. DATE Required Key.
p_earn_code   The default earnings code attached to a job and used on the time sheet. VARCHAR2(3) Required Key.
p_active_ind   Indicates whether the earnings code is active. VARCHAR2(1) Required Key.

Returns
A cursor variable that will fetch a set of records.


f_query_one

Function f_query_one(p_pidm           nbrearn.nbrearn_pidm%TYPE,
                     p_posn           nbrearn.nbrearn_posn%TYPE,
                     p_suff           nbrearn.nbrearn_suff%TYPE,
                     p_effective_date nbrearn.nbrearn_effective_date%TYPE,
                     p_earn_code      nbrearn.nbrearn_earn_code%TYPE,
                     p_active_ind     nbrearn.nbrearn_active_ind%TYPE)
  RETURN nb_job_earnings.job_earnings_ref

Selects one record using key.

Parameters
p_pidm   Internal identification number of the employee. NUMBER(8) Required Key.
p_posn   Position to which a job is attached. VARCHAR2(6) Required Key.
p_suff   Unique identifier that helps create and maintain multiple jobs for the same position, for the same employee. VARCHAR2(2) Required Key.
p_effective_date   Date that the Earnings Code record becomes effective. DATE Required Key.
p_earn_code   The default earnings code attached to a job and used on the time sheet. VARCHAR2(3) Required Key.
p_active_ind   Indicates whether the earnings code is active. VARCHAR2(1) Required Key.

Returns
A cursor variable that will fetch exactly one record.


f_query_by_rowid

Function f_query_by_rowid(p_rowid gb_common.internal_record_id_type)
  RETURN nb_job_earnings.job_earnings_ref

Selects one record using ROWID.

Parameters
p_rowid   Database ROWID of the record to be selected. VARCHAR2(18) Required.

Returns
A cursor variable that will fetch exactly one record.


f_query_one_lock

Function f_query_one_lock(p_pidm           nbrearn.nbrearn_pidm%TYPE,
                          p_posn           nbrearn.nbrearn_posn%TYPE,
                          p_suff           nbrearn.nbrearn_suff%TYPE,
                          p_effective_date nbrearn.nbrearn_effective_date%TYPE,
                          p_earn_code      nbrearn.nbrearn_earn_code%TYPE,
                          p_active_ind     nbrearn.nbrearn_active_ind%TYPE,
                          p_rowid          gb_common.internal_record_id_type DEFAULT NULL)
  RETURN nb_job_earnings.job_earnings_ref

Selects one record and locks it.

Parameters
p_pidm   Internal identification number of the employee. NUMBER(8) Required Key.
p_posn   Position to which a job is attached. VARCHAR2(6) Required Key.
p_suff   Unique identifier that helps create and maintain multiple jobs for the same position, for the same employee. VARCHAR2(2) Required Key.
p_effective_date   Date that the Earnings Code record becomes effective. DATE Required Key.
p_earn_code   The default earnings code attached to a job and used on the time sheet. VARCHAR2(3) Required Key.
p_active_ind   Indicates whether the earnings code is active. VARCHAR2(1) Required Key.
p_rowid   Database ROWID of the record to be selected. VARCHAR2(18).

Returns
A cursor variable for one record, locking the record.


p_create

Procedure p_create(p_pidm           nbrearn.nbrearn_pidm%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_posn           nbrearn.nbrearn_posn%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_suff           nbrearn.nbrearn_suff%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_effective_date nbrearn.nbrearn_effective_date%TYPE DEFAULT dml_common.f_unspecified_date,
                   p_earn_code      nbrearn.nbrearn_earn_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_active_ind     nbrearn.nbrearn_active_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_hrs            nbrearn.nbrearn_hrs%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_special_rate   nbrearn.nbrearn_special_rate%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_shift          nbrearn.nbrearn_shift%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_deemed_hrs     nbrearn.nbrearn_deemed_hrs%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_cancel_date    nbrearn.nbrearn_effective_date%TYPE DEFAULT NULL,
                   p_user_id        nbrearn.nbrearn_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_data_origin    nbrearn.nbrearn_data_origin%TYPE DEFAULT NULL,
                   p_rowid_out      OUT gb_common.internal_record_id_type)

Creates a record.

Parameters
p_pidm   Internal identification number of the employee. NUMBER(8) Required Key.
p_posn   Position to which a job is attached. VARCHAR2(6) Required Key.
p_suff   Unique identifier that helps create and maintain multiple jobs for the same position, for the same employee. VARCHAR2(2) Required Key.
p_effective_date   Date that the Earnings Code record becomes effective. DATE Required Key.
p_earn_code   The default earnings code attached to a job and used on the time sheet. VARCHAR2(3) Required Key.
p_active_ind   Indicates whether the earnings code is active. VARCHAR2(1) Required Key.
p_hrs   Hours or units defaulted onto time sheets for the earn code. NUMBER(6,2).
p_special_rate   Special rate defaulted onto time sheets for the earn code. NUMBER(12,6).
p_shift   Shift code defaulted onto timesheets for the earn code. VARCHAR2(1) Required.
p_deemed_hrs   Reportable hours for Canadian Employment Insurance. NUMBER(6,2).
p_cancel_date   Earnings end date. DATE.
p_user_id   The Oracle ID of the user who changed the record. VARCHAR2(30).
p_data_origin   Source system that created or updated the row. VARCHAR2(30).
p_rowid_out   Database ROWID of the record to be created. VARCHAR2(18) Required.


p_delete

Procedure p_delete(p_pidm           nbrearn.nbrearn_pidm%TYPE,
                   p_posn           nbrearn.nbrearn_posn%TYPE,
                   p_suff           nbrearn.nbrearn_suff%TYPE,
                   p_effective_date nbrearn.nbrearn_effective_date%TYPE,
                   p_earn_code      nbrearn.nbrearn_earn_code%TYPE,
                   p_active_ind     nbrearn.nbrearn_active_ind%TYPE,
                   p_cancel_date    nbrearn.nbrearn_effective_date%TYPE DEFAULT dml_common.f_unspecified_date,
                   p_rowid          gb_common.internal_record_id_type DEFAULT NULL)

Deletes a record.

Parameters
p_pidm   Internal identification number of the employee. NUMBER(8) Required Key.
p_posn   Position to which a job is attached. VARCHAR2(6) Required Key.
p_suff   Unique identifier that helps create and maintain multiple jobs for the same position, for the same employee. VARCHAR2(2) Required Key.
p_effective_date   Date that the Earnings Code record becomes effective. DATE Required Key.
p_earn_code   The default earnings code attached to a job and used on the time sheet. VARCHAR2(3) Required Key.
p_active_ind   Indicates whether the earnings code is active. VARCHAR2(1) Required Key.
p_cancel_date   Earnings end date. DATE.
p_rowid   Database ROWID of the record to be deleted. VARCHAR2(18).


p_lock

Procedure p_lock(p_pidm           nbrearn.nbrearn_pidm%TYPE,
                 p_posn           nbrearn.nbrearn_posn%TYPE,
                 p_suff           nbrearn.nbrearn_suff%TYPE,
                 p_effective_date nbrearn.nbrearn_effective_date%TYPE,
                 p_earn_code      nbrearn.nbrearn_earn_code%TYPE,
                 p_active_ind     nbrearn.nbrearn_active_ind%TYPE,
                 p_rowid_inout    IN OUT gb_common.internal_record_id_type)

Locks a record.
If ROWID is not passed in, the record is located using the key values and the ROWID of the locked row is passed in p_rowid_inout.

Parameters
p_pidm   Internal identification number of the employee. NUMBER(8) Required Key.
p_posn   Position to which a job is attached. VARCHAR2(6) Required Key.
p_suff   Unique identifier that helps create and maintain multiple jobs for the same position, for the same employee. VARCHAR2(2) Required Key.
p_effective_date   Date that the Earnings Code record becomes effective. DATE Required Key.
p_earn_code   The default earnings code attached to a job and used on the time sheet. VARCHAR2(3) Required Key.
p_active_ind   Indicates whether the earnings code is active. VARCHAR2(1) Required Key.
p_rowid_inout   Database ROWID of the record to be locked. VARCHAR2(18) Required.


p_update

Procedure p_update(p_pidm           nbrearn.nbrearn_pidm%TYPE,
                   p_posn           nbrearn.nbrearn_posn%TYPE,
                   p_suff           nbrearn.nbrearn_suff%TYPE,
                   p_effective_date nbrearn.nbrearn_effective_date%TYPE,
                   p_earn_code      nbrearn.nbrearn_earn_code%TYPE,
                   p_active_ind     nbrearn.nbrearn_active_ind%TYPE,
                   p_hrs            nbrearn.nbrearn_hrs%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_special_rate   nbrearn.nbrearn_special_rate%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_shift          nbrearn.nbrearn_shift%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_deemed_hrs     nbrearn.nbrearn_deemed_hrs%TYPE DEFAULT dml_common.f_unspecified_number,
                   p_cancel_date    nbrearn.nbrearn_effective_date%TYPE DEFAULT dml_common.f_unspecified_date,
                   p_user_id        nbrearn.nbrearn_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_data_origin    nbrearn.nbrearn_data_origin%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_rowid          gb_common.internal_record_id_type DEFAULT NULL)

Updates a record.

Parameters
p_pidm   Internal identification number of the employee. NUMBER(8) Required Key.
p_posn   Position to which a job is attached. VARCHAR2(6) Required Key.
p_suff   Unique identifier that helps create and maintain multiple jobs for the same position, for the same employee. VARCHAR2(2) Required Key.
p_effective_date   Date that the Earnings Code record becomes effective. DATE Required Key.
p_earn_code   The default earnings code attached to a job and used on the time sheet. VARCHAR2(3) Required Key.
p_active_ind   Indicates whether the earnings code is active. VARCHAR2(1) Required Key.
p_hrs   Hours or units defaulted on timesheets for the earn code. NUMBER(6,2).
p_special_rate   Special rate defaulted onto timesheets for the earn code. NUMBER(12,6).
p_shift   Shift code defaulted onto timesheets for the earn code. VARCHAR2(1) Required.
p_deemed_hrs   Reportable hours for Canadian Employment Insurance. NUMBER(6,2).
p_cancel_date   Earnings End date. DATE.
p_user_id   The Oracle ID of the user who changed the record. VARCHAR2(30).
p_data_origin   Source system that created or updated the row. VARCHAR2(30).
p_rowid   Database ROWID of the record to be updated. VARCHAR2(18).


f_unspecified_earnings_table

Function f_unspecified_earnings_table
  RETURN np_job_earnings.job_earnings_tab

Returns a null Job Earnings PL/SQL table.