CalcDBAAvailHrsGenTERec

Calculate DBA Available Hours and Generate Time-Entry Record

Major Business Rule

Object Name: N0500037

Parent DLL: CFND

Location: Client/Server

Language: NER

(Note: Make this window as wide as possible to clearly view the Parameter table)

Business Function Specification


Source Name:N0500037


Data Structure:D0500037A


Function Name:Calculate DBA Available Hours and Generate Time-Entry Record


System Code: 05A


Designer:David Scott


Programmer:Falah Thamir


Function Category


Function Use


Revisions Log 

Date:21 May, 1998

Modifications by:Falah Thamir

SAR Number:1958608

Description:Creation



1.Functional Description


1.1Purpose


This function will return SVH beginning balance, time added, time taken, and

time accrued but not yet available, all in hours, during the requested calendar

year under the requested PDBA. If requested, a Time-Entry record will be created

in F06116.


1.2Setup Notes and Prerequisites


It is assumed that the DBA passed to this function is set-up in F069116 and

has flag Available Carryover (ACO) = "Y".


When the generation of Time-Entry records is desired (cGenerateTimeEntryFlag = 1),it is recommended 

that this function be called twice, once with this flag = "0",and if no errors are detected 

(mnErrorCodeReturned = 0), then call it again

with cGenerateTimeEntryFlag = "1". This is because only information from

error-free records will be entered in F06116, and if errors are detected in

other records, the error-free records are not flagged to avoid re-entering them 

in F06116 when this function is re-called after the errors are corrected.


1.3Special Logic



2.Technical Specifications


2.1Parameters:


Data ItemData Structure DescriptionI/ORequiredNote

-------------------------------------------------------------------

AN8mnAddressNumberIxAddress Book Number


PDBAmnPDBACodeIxPDBA Code


DTjdDateIxDate of inquiry


EV01cCalendar_Fiscal

AnniversaryFlag01Ix0 = Calendar year 

accrual

1 =Fiscal/Anniversary

year accrual

Note: Fiscal/Anniversary accrual is not currently implemented; only 

Calendar accruals are returned.


EV01cGenerateTimeEntryFlag01Ix0 = Do not generate 

Time-entry

1 = Generate Time 

Entry records in 

F06116


PIDszProgramIDIxProgram ID of calling 

program.

Required if cGenerateTimeEntryFlag01 = "1".

Used when records are written to F06116


MATH06mnErrorCodeReturnedOx


Error Code:

0 = no errors

1 = date not entered

2 = an accrual or a pay type PDBA

record in F069036 does not exist in F069116

3 = no Pay Types found in F069036 for PDBA = mnPDBACode

11 = Fiscal/Anniversary retrieval not yet implemented

21 = error from B0500002, Begin Document

31 = error from B0500002, Edit Line

41 = error from B0500002, End Document


EV01cMultiplePayTypeFlag01Ox0 = one Pay Type 

found in F069036

referenced by any PDBA

1 = more than one Pay

Type referenced by a PDBA

in F069036

BHBBmnHoursAvailableOxHours available

BHBBmnHoursBeginningBalanceOxHours, beginning balance

BHBBmnHoursAddedThisYearOxHours added this year

BHBBmnHoursTakenThisYearOxHours taken this year.

BHBBmnHoursAccruedNotAvailOxHours accrued but not 

yet available.

MATH06mnWarningCodeReturnedOx

Warning code:

1 = no records found in F06146 with PDBA = mnPDBACode

2 = warning from B0500002, Begin Document

4 = warning from B0500002, Edit Line

8 = warning from B0500002, End Document

Note: The warning codes are added;

for example, code 6 means there was a

warning from both B0500002, Begin Document

and Edit Line



2.2Related Tables 

Table Table Description

-------------------------------------------

F06146Employee Transaction History Summary

F069116Payroll Transaction Constants

F069036Payroll Transaction Cross Reference


2.3Related Business Functions

Source NameFunction Name

------------------------

B0500002Time Entry



Processing 


1. If date is not entered, stop processing.


2. Get the two-digit year from the date passed through the data structure. This is

the DTEY key to F06146. 


3. Retrieve beginning balance and time added from all records in F06146 based

on AN8 = mnAddressNumber, PDBA = mnPDBACode, DTEY = value calculated in step 1,

and DISO = "A" (accrual type); add beginning balance and time added from all records.

If no records are found, then issue a warning.


4. Select records in F069036 based on PDBA = mnPDBACode and XTYP = "R" to get PPYT

which includes Pay Types (PDBA < 1000) which has time taken, and accrual-type DBA

(PDBA > 999) which has time accrued but not yet available. Check if PDBA exists

in F069116. If it does not exist, stop processing and return. If it exists, then

for each PDBA value retrieved from F069036, retrieve BH01 - BH12 from all records

in F06146 based on AN8 = mnAddressNumber, PDBA = PPYT, DTEY = value calculated

in step 1. Add BH01 - BH12 to calculate total time per record. Add values from all

records to get a grand total. If no records are found in F069036 then set an error.


5. Calculate time available = beginning balance + time added - time taken


6. If Time-Entry is desired (cGenerateTimeEntryFlag01 = 1) and no errors are detected,

then call B0500002, Time Entry by Individual, and report available time under last

Pay Type found in F06146. If no Pay Type records are found in F06146, then use the

last pay type found in F069036 referenced by mnPDBACode . Choosing the last Pay Type

is arbitrary; however, it is as good as choosing any other one. The

flag "cMultiplePayTypeFlag01" will be set to "1" if more than one Pay Type record

is found in F06146 that is referenced by one PDBA.



Notes:


1. Fiscal/Anniversary accrual is not yet set-up in OneWorld. Therefore, this version

will only handle calendar year accruals [F. Thamir, 13 March, 1998]


2. DBA codes are setup as follows: Codes 001 - 999 are Pay Types; codes 1000 - 9999

include accrual types


3. There may be multiple entries in F06146 per AN8 per Accrual or Pay Type per year

from different HMCO's. Note: If records are not rolled-over correctly between

different HMCO's, i.e. balances are not zeroed in the old records, then the

calculated time from this function will be wrong.


4. Multiple Pay Types may be referenced by one PDBA which is set-up in F069036 with XTYP = "R".


5. A record does not have to pre-exist in F06146. It is supposed to exist only when

there are entries (hours). For example, Pay Type records may not exist until "Time Taken" is entered.


Data Structure

D0500037A - Calculate DBA Available Hours and Generate Time-Entry Record

Parameter NameData ItemData TypeReq/OptI/O/Both
mnAddressNumberAN8MATH_NUMERICREQINPUT

A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
location.

mnPDBACodePDBAMATH_NUMERICREQINPUT

A code that defines the type of pay, deduction, benefit, or accrual. Pay types are numbered from 1 to 999. Deductions and benefits are 
numbered from 1000 to 9999.

jdDateOfInquiryDTJDEDATEREQINPUT

The date that the employee was terminated, if applicable.

cCalendarFiscalAnnivFlag01EV01charREQINPUT

An option that specifies the type of processing for an event.

cGenerateTimeEntryFlag01EV01charREQINPUT

An option that specifies the type of processing for an event.

szProgramIdofCallingProgramPIDcharREQINPUT

The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
interactive program is P4210, and the number of the Print Invoices batch process report is R42565. The program ID is a variable length value. 
It is assigned according to a structured syntax in the form TSSXXX, where: T The first character of the number is alphabetic and identifies the 
type, such as P for Program, R for Report, and so on. For example, the value P in the number P4210 indicates that the object is a 
program. SS The second and third characters of the number are numeric and identify the system code. For example, the value 42 in the number P4210 
indicates that this program belongs to system 42, which is the Sales Order Processing system. XXX The remaining characters of the numer are 
numeric and identify a unique program or report. For example, the value 10 in the number P4210 indicates that this is the Sales Order Entry 
program.

mnErrorCodeReturnedMATH06MATH_NUMERICREQOUTPUT

Event point for Math Numeric.

cMultiplePayTypeFlag01EV01charREQOUTPUT

An option that specifies the type of processing for an event.

mnHoursAvailableBHBBMATH_NUMERICREQOUTPUT

The balance at the beginning of the year for the number of hours associated with a PDBA.

mnHoursBeginningBalanceBHBBMATH_NUMERICREQOUTPUT

The balance at the beginning of the year for the number of hours associated with a PDBA.

mnHoursAddedThisYearBHBBMATH_NUMERICREQOUTPUT

The balance at the beginning of the year for the number of hours associated with a PDBA.

mnHoursTakenThisYearBHBBMATH_NUMERICREQOUTPUT

The balance at the beginning of the year for the number of hours associated with a PDBA.

mnHoursAccruedNotAvailBHBBMATH_NUMERICREQOUTPUT

The balance at the beginning of the year for the number of hours associated with a PDBA.

mnWarningCodeReturnedMATH06MATH_NUMERICREQOUTPUT

Event point for Math Numeric.

mnDollarsAvailable_BW01BW01MATH_NUMERICOPTOUTPUT

The gross amount of the transaction. The specific meaning, depending on the type of transaction, is as follows:    A  Pay types: The total 
amount of earnings related to the type of pay.    B  DBAs: The total amount of the deduction, benefit, or accrual.    C  Payroll taxes: The total 
amount of gross wages, before exclusions and paid-in-excess amounts. This amount represents the total for the first month of either the payroll 
year or the calendar year, depending on the review form that you are using. Payroll-month totals are stored in the Employee Transaction History 
Summary table (F06146). Calendar-month totals are stored in the Calendar Month DBA Summary History table (F06145).

mnDollarsBeginBalance_BW01BW01MATH_NUMERICOPTOUTPUT

The gross amount of the transaction. The specific meaning, depending on the type of transaction, is as follows:    A  Pay types: The total 
amount of earnings related to the type of pay.    B  DBAs: The total amount of the deduction, benefit, or accrual.    C  Payroll taxes: The total 
amount of gross wages, before exclusions and paid-in-excess amounts. This amount represents the total for the first month of either the payroll 
year or the calendar year, depending on the review form that you are using. Payroll-month totals are stored in the Employee Transaction History 
Summary table (F06146). Calendar-month totals are stored in the Calendar Month DBA Summary History table (F06145).

mnDollarsTaken_BW01BW01MATH_NUMERICOPTOUTPUT

The gross amount of the transaction. The specific meaning, depending on the type of transaction, is as follows:    A  Pay types: The total 
amount of earnings related to the type of pay.    B  DBAs: The total amount of the deduction, benefit, or accrual.    C  Payroll taxes: The total 
amount of gross wages, before exclusions and paid-in-excess amounts. This amount represents the total for the first month of either the payroll 
year or the calendar year, depending on the review form that you are using. Payroll-month totals are stored in the Employee Transaction History 
Summary table (F06146). Calendar-month totals are stored in the Calendar Month DBA Summary History table (F06145).

mnDollarsAccruedNotAvail_BW01BW01MATH_NUMERICOPTOUTPUT

The gross amount of the transaction. The specific meaning, depending on the type of transaction, is as follows:    A  Pay types: The total 
amount of earnings related to the type of pay.    B  DBAs: The total amount of the deduction, benefit, or accrual.    C  Payroll taxes: The total 
amount of gross wages, before exclusions and paid-in-excess amounts. This amount represents the total for the first month of either the payroll 
year or the calendar year, depending on the review form that you are using. Payroll-month totals are stored in the Employee Transaction History 
Summary table (F06146). Calendar-month totals are stored in the Calendar Month DBA Summary History table (F06145).

mnDollarsAdded_BW01BW01MATH_NUMERICOPTOUTPUT

The gross amount of the transaction. The specific meaning, depending on the type of transaction, is as follows:    A  Pay types: The total 
amount of earnings related to the type of pay.    B  DBAs: The total amount of the deduction, benefit, or accrual.    C  Payroll taxes: The total 
amount of gross wages, before exclusions and paid-in-excess amounts. This amount represents the total for the first month of either the payroll 
year or the calendar year, depending on the review form that you are using. Payroll-month totals are stored in the Employee Transaction History 
Summary table (F06146). Calendar-month totals are stored in the Calendar Month DBA Summary History table (F06145).

szFromCompany_COCOcharOPTINPUT

A code that identifies a specific organization, fund, or other reporting entity. The company code must already exist in the Company 
Constants table (F0010) and must identify a reporting entity that has a complete balance sheet. At this level, you can have intercompany 
transactions. Note: You can use company 00000 for default values such as dates and automatic accounting instructions. You cannot use company 00000 
for transaction entries.

szThruCompany_COCOcharOPTINPUT

A code that identifies a specific organization, fund, or other reporting entity. The company code must already exist in the Company 
Constants table (F0010) and must identify a reporting entity that has a complete balance sheet. At this level, you can have intercompany 
transactions. Note: You can use company 00000 for default values such as dates and automatic accounting instructions. You cannot use company 00000 
for transaction entries.

Related Functions

None

Related Tables

None