CS Time/TNA Documents

username password

Report Functions

    Table of contents
    No headers

    Function

    Description

    Abs(e)

    Returns the absolute value of the expression e.  This is the positive value - and minus signs are ignored.

    AccessClocking()

    Returns a 1 if it is an access clocking, else a 0.

    All(Character,Number)

    Repeats the Character, number times, and returns the result.

    BeginsWith(‘x’,’xyz’)

    If the second string (‘xyz’) begins with the first string (‘x’) then this function returns 1 otherwise it returns 0.  The function is not case sensitive.

    CalcLeaveLeft(Date,Leavetype)

    Returns the amount of leave left to an employee as at a specific date. Type is 1 (Paid) or 2 (Sick).

    Centre(Value)

    Adds spaces to the left of the value until the Value is centered in the Length.

    Changed (‘x’)

    x is any variable. If x has changed since the last call to Changed (‘x’) then this function returns 1. Otherwise it returns 0.  This is most useful in determining the conditions under which to print a detail in a report. The Changed function returns 0 the first time it’s called for a variable.  Use the Header function, which is exactly the same if you want it to return a 1 the first time it’s called for a variable.

    Chr(c)

    Returns the ASCII character of a particular number. For Example CHR(65) returns "A".

    Clip(x)

    x is a String variable. Clip shortens it, for concatenation purposes, by removing trailing spaces.

    Clock()

    Returns the current PC time. The answer is returned as a standard TNA 2000 time field, i.e. the number of 100ths of a second since midnight.  Use one of the Time pictures (@Tn) to convert it to a more readable format.

    Contains(‘x’,’abcxyz’)

    If the second string (‘abcxyz’) contains the first string (‘x’) then this function returns 1 otherwise it returns 0.  The function is not case sensitive.

    CountClockings(Site,Empno,

    Startdate,Enddate,Starttime,

    Endtime,Options,Device)

    Counts the number of clockings for an employee in a specific time period. Options are DTC where D is Direction (I,O,B) T is Type (M,B,C).  Leave it blank to count all the clockings.

    CountTime(Site,Emp,

    FromDate,ToDate,FromTime,

    ToTime,Options)

    Counts the actual amount of raw time for a single employee between a start point (fromdate, fromtime) and end point (enddate, endtime).

    The options field is a 3 character string where;
    The first character determines the time being included;
         I for time In, O for time Out.
    The second character determines the clocking to include;
         M for Manual, B for Bulk, C for Clocked, or space for all.
    The third character determines the clocking scope;
         A for Access, P for Payroll or space for both

    CountTimeEx(Site,Emp,

    FromDate,ToDate,FromTime,

    ToTime,Options,Area)

    Counts the actual amount of raw time for a single employee between a start point (fromdate, fromtime) and end point (enddate, endtime).

    The options field is a 3 character string where;
    The first character determines the time being included;
         I for time In, O for time Out.
    The second character determines the clocking to include;
         M for Manual, B for Bulk, C for Clocked, or space for all.
    The third character determines the clocking scope;
         A for Access, P for Payroll or space for both
    The fourth character determines whether you discard seconds or not;
         R for discard seconds or space for use actual time
    The fifth character will applay the in and out times to each date;
         B for break every day or space to ignore
    If the Area code is set, the time counted will be only be for the time inside or outside of that area.

    DecHours(t)

    This function takes a time (t) and returns a formatted string containing the hours in decimal format. I.e. hhhh where no decimal point is included. The last two digits are implied to be decimal. The maximum time this function can return is 9999 - which is 99.99 hours. This means a maximum value for t of 35,996,400.

    DOW(Date)

    Returns the Day of the week, where Sunday returns 1 and Saturday returns 7.

    Date(Month,Day,Year)

    Creates a standard date value from the 3 components.

    Day(Date)

    Returns the Day part of the date.

    Deformat(Value,Picture)

    Opposite of Format. Returns the Human readable form to the original form.

    EmpExpected(Site,Empno,

    Date,Time)

    Returns the code of the Daily Shift if the employee should be working at this time. Returns nothing if the time is outside the workday.


    EmployeeAbsent(Date,Time)

    This function returns a 0 if the employee was not absent at the time mentioned, or a 1 if they are absent. 

    This function will attempt to determine absenteeism, based on the employee’s current schedule.  If however the employee is on a variable shift, i.e. he can clock in for more than one shift during the day, and then this function will give the benefit of the doubt to the employee.

    EmployeeInGroup()

    If the current employee is in the group picked for this report, then this returns a ‘1' otherwise it returns a ‘0'. This is most useful when determining the range of employees to be printed. If the Employee file is the primary file in a report, then there is no need to use this function as it will be used automatically for you.

    EmployeeAreaName(Site,Empno)

    Returns the Description of the current Employee Access Area.

    EmployeeAreaStatus(Site,Empno)

    Returns the current Employee Access Area.

    EmployeeStatus(x)

    x is a variable, like Emp:EmpNumber, that contains an employee number. If the employee is currently IN then this returns an ‘I’. If the employee is currently out then this returns an ‘O’.  This function only applies to Pay clockings.

    EmployeeAccessStatus(x)

    Same as EmployeeStatus, but for Access clockings only.

    EndsWith(‘z’,’xyz’)

    If the second string (‘xyz’) ends with the first string (‘z’) then this function returns 1 otherwise it returns 0.  The function is not case sensitive.  Also trailing spaces are automatically excluded.

    ExportToPayroll(Site,Employee,Date,GUID,Type)

    Everytime an export is generated this function will write an entry to the SendToPayroll file (SENDTOPA).  If a duplicate exists in the file, the entry will not be exported, preventing duplication.  Use this function as a condition e.g.
    ExportToPayroll(emp:site,emp:empnumber,dai:date,dai:guid,'FE')=0
    dai:date will be the export date and the dai:guid is the key checked against so that it isn't exported twice.

    You can create your own type code to identify the export type e.g. 'FE' for file export or 'SCR' for screen.

    Format(Number,Picture)

    Format is used to convert a numeric, date or time value into a formatted string which is easier to read.

    GetCategory(Number)

    Returns the name of a specific Category from the number.

    Getclockings(Site,Empno,Date,

    Start from clocking,Number of clockings,

    Podo,LineUsed,Options,Device Number)

    This function returns a string containing all the clockings for an employee for a date. The list always starts with the first In clocking, if a leading Out clocking exists then it is ignored. The list always ends with a trailing Out clocking if (a) one exists, and (b) if it occurs either on the date being queried, or the following day. Clockings marked as deleted are not included.  The function returns a string of up to 255 characters long containing as many clockings as exist for the employee on that day. However this length can be shortened on a report to allow for space constraints.  This function only returns Pay clockings - for Access clockings use the GetClockingsAccess function.


    Start from & Number of clockings: 0 will include all the clockings.
    Podo: if 0, then if the clocking time is greater than the MustBeOutBy time in the daily shift, the clocking will be ignored.
    LineUsed: not used presently, reserved for later use.
    Options: 
          I will suppress the I & O characters
          M will suppress the M & B characters
          D will include the 3 character clocking device name
          J will include Job clockings
          T will suppress TNA clockings
          L will suppress leave descriptions
          H will suppress holidays descriptions

    Getclockings(site,empno,date,1,-1) will return the number of clockings for the day.

    GetclockingsAccess(Site,

    Empno,Date)

    Same as Getclockings, but for Access clockings.

    GetDeviceName(clo:device)

    Gets the device description where the clocking was made.

    GetEmpDailyShift(Site,Empno,

    Date)

    Returns the current Employee's Daily Shift.

    GetEmpDailyShiftDetails(Site,Empno,

    Date,Options)

    Returns the expected details in a string depending on the options:

    'timeslotcode'
    'starttime'
    'endtime'
    'startplusendtime'
    'starttime2'
    'endtime2'
    'startplusendtime2'
    'payrollshiftcode'
    'payrollperiodstart'
    'payrollperiodend'
    'timeslotdescription'
    'timeslotexpectedhours'

    The function takes payroll shift, shift patterns and daily shift rostering into account. Available from version 18.02.06.01.

    GetEmpJob(Site,Empno,Date,Time,parameter)

    Returns the current Employee's Job.

    In 6.03c – GetEmpJob takes an additional parameter:
    ‘a’ – all, so returns JobNo JobDate JobTime
    ‘t’ – time of job
    ‘d’ – date of job
    ‘j’ – job number (this is what is returned if no par is specified)

    Date and time parameters specify the time and date to check the job that the user was on.

    GetEmpLeave(Site,Empno,Date)

    Returns the Leave Type Number for the employee for that day. 0 if not on leave.

    GetEmpLeaveName(Site,Empno,Date,Flags)

    Returns the Leave Type Name for the employee for that day. If Flag = 1 then the PayrollName of the leavetype is returned. If not 1 then the regular leave type name is returned.

    GetEmpPayrollShift(Site,

    Empno,Date)

    Returns the current Employee's Payroll Shift.

    GetEmpRights(Site,Empno,

    Device,Flag)

    Returns the current Employee Rights. Flag : 1=Clock In?, 2=ClockOut?, 3=Lock? 4=OpenDoor? Returns 1 for Yes, 0 for No.

    GetEmpTimezone(Site,Empno,

    Controller,Device,Date)

    Returns the Time Zone code that will be applied to this employee.

    GetError(Site,Empno,Date)

    This function returns a string containing the first error found for an employee on a specific date.  Both Daily and Weekly errors are searched for, but only the first one is returned in the string.  Remember that daily hours records are not made for days containing errors, so using this function in a loop on the daily hours file would be futile.

    GetExpectedHours(Site,Empno,

    Date,Std)

    Returns the Expected Payroll Hours value for an employee. If expected is not set on the payroll shift, it will return the std value entered.

    GetHours(Site,Empno,Date,

    Category,Rate)

    Returns a summary (total) of the hours for an employee for a particular day. If Category, or Rate, are left blank then all Categories (or Rates) are included.

    GetHoursForDateRange

    (Site,Emp,FromDate,ToDate,Cat,Rate)

    Returns the total hours for the date range specified. 

    GetPayrollCode(Site,EmpNo,LeaveType,
    Category,Default)

    Returns the employee payroll code for the appropriate category and leavetype.
    Note: a code may be a blank string if no code has been filled in. In this case the Default string is returned.
    Leavetype: the leavetype code. 0 for working time.
    Category: the time category code.
    Default: a string that will be returned if the payroll code is blank for the category and leavetype.  The string must be in single quotes.

    GetRate(Number)

    Returns the name of a specific Rate from the number.

    GroupSize(Date,Time,Shift,

    Company,Branch,Department,

    Costcenter,Category,Scale,

    Type,Workgroup,Job,Area,

    Options)

    Returns the number of employees in the group selected.

    Header(‘x’)

    Same as the Changed function, but will return a 1 the first time it’s called for a variable.

    Hours()

    The reverse of the DecHours function.

    InModule(fieldname,type) This function will return a 1 if the specified field contains the type.
    The types are listed below:
    1     A - TNA
    2     B - Access
    3     C - TNA, Access
    4     D - Job
    5     E – TNA, Job
    6     F – Job, Access
    7     G – TNA, Job, Access
    8     H – Info
    9     I – Info, TNA
    10     J – Info, Access
    11     K – TNA, Info, Access
    12     L – Info, Job
    13     M – TNA, Info, Job
    14     O – TNA, Info, Job, Access

    Example:  InModule(dai:module,1) will return a 1 for all the clocking types that contains a TNA clocking, in this case where the module value is A, C, E, G, I, K, M or O.  InModule(clo:module, 7) will return a 1 where the value in the clo:module field is G or O.
    InRange(fieldname,lowest value, highest value)

    Determine whether the value of the fieldname is within range of the lowest to highest value.

    Int(e)

    Returns the integer part of the value of the expression e.  In other words any fractional part of the value is discarded.

    InterpretAudit()

    Returns a string containing the meaning of the current audit code as stored in Aud:Code.  For a list of audit log codes, click here.

    InterpretError()

    Returns a string containing the meaning of the current error code as stored in Err:Code.

    InterpretWarning()

    Returns a string containing the meaning of the current warning code as stored in War:Code.

    IsPublicHoliday(Date,State)

    Returns a 1 if the date is a public holiday, else returns 0.

    IsSupervised(SubSite,

    SubEmp,SuperSite,SuperEmp)

    Returns 1 if SubEmp is supervised by SuperEmp, else returns 0.

    IsSupervisor(SuperSite,

    Super,SubSite,Sub)

    Returns 1 if SuperEmp supervises SubEmp, else return 0.

    LeaveSpent(Site,Empno,Fromdate,

    ToDate,leavetype)

    Returns the amount of leave spent within  the specified date range when using leave cycles.

    Left(value)

    Removes leading spaces from the Value.

    LookupEmployee(Site,Empno)

    Loads an employee record.

    Month(Date)

    Returns the Month part of the date.

    PayCat(x)

    Returns the Payroll Name for the Time Category where x is the time category number.

    Right(value,length)

    Adds spaces to the left of the value until the Length is reached.

    TnaClocking()

    Returns 1 if this is a TNA (Payroll) clocking, 0 otherwise.

    Today()

    Returns the current PC date. The answer is returned as a standard Clarion date field, ie the number of days since December 28th 1800.  Use one of the Date pictures (@Dn) to convert it to a more readable format.

    TotalDailyHours(Site,Empno,

    Date,DOW,Category,Rate)

    Returns the Total hours for an employee for a particular day (as displayed in the User module.) If rate is left blank then all Rates are included. Dow (Day Of Week).

    TotalDailyJobHours(Site,Empno,Classification Number,'Costing Classification Used',From Date,To Date,Category,Rate)

    Returns the total Job hours for an employee for a specified period for a specified costing classification.
    Classification Number: the classification or job code to total for.
    Costing Classification Used: specifies filter by Company, Branch, Department, Cost Center, Category, Scale, Type, Workgroup or Job.

    Upper() Returns the value of a string in uppercase.
    WeekDayName(day of the week) Returns the week day name e.g. Monday, Tuesday, Wednesday, etc.  Use with DOW e.g. WeekDayName(DOW(<dai:date>-1)).

    Year(Date)

    Returns the Year part of the date. (4 digits).

    Permalink:  http://tinyurl.com/l965tbj

    Page last modified 13:05, 8 Jun 2018 by cay-lynne CS Time/TNA Documents > Reports > Writing Reports > Report Functions

    Comments0

    You must login to post a comment.
    Attach file

    Files0

     
    Powered by MindTouch Core