CS Time/TNA Documents

username password

Functions

    Table of contents
    No headers

    Note: Functions displayed in red are linked to example pages.

     

     

    Function Description
     AddClocking Parameters: (Date, Clocking Time, Clocking Line Time, Direction)
    Adds a clocking in the processing queue. Use at the "Before Daily Processing" embed point.
    Use 'I' or 'O' for the direction (including the single quotation marks).
     AddDailyHours() Adds a new daily hours record at the specified embed point for the process date and process employees. Time categories and employee categories can be set before adding the record, otherwise the existing processed values will be saved. When used at the embed point "At After Saving Daily Hours", a payroll record will be added. When used at the embed point "At After Saving Job Hours", a job record will be added.
    ClearDailyHours() Clears the values of the existing hours record ready to be written. Use at the embed point "At After Saving Daily Hours" or "At After Saving Job Hours".
    Clock Returns the current time on the PC.
    CountClockings
    Parameters :  (Site,Emp,FromDate,ToDate,FromTime,ToTime,Options,Area)
    Counts the number of clockings 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 direction;
         I for In, O for Out or B for Both
    The second character determines the clocking type;
         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 default - '   ' - (3 spaces between single quotation marks) will include all options.

    If the Area parameter is set, then only clockings going IN to that area will be counted.  

        The value to be used is the "Area Number"

        The default '   ' (3 spaces between quotation marks) will be for all areas.

    CountTime

    Parameters : (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

    Parameters : (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 5 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.
    Note that counting both TNA and Access time
        could lead to unexpected answers as the two are somewhat separate in concept. Explicitly
        using P or A is recommended.

    The fourth character determines the clocking scope;
         R for Rounding to nearest minute, space for do not round

    The fifth character determines the clocking scope;
         B for Break every day – apply in and out times to each date

    If the Area parameter is set, then only Access clockings will be used.  

        The value to be used is the "Area Number"

        The default '   ' (3 spaces between single quotation marks) will be for all areas.

    Note:       CountTime is an older function that takes only 7 parameters. It is the same as CountTimeEx with the last parameter set as -1.

    EmpInAt Parameters :  (Site, Emp, Date, Time)
    Returns 1 if the employee is clocked in at a specific date and time. Returns 0 if the employee is clocked out. Suggested variables to use include ProcessSite, ProcessEmp and ProcessDate.
    GetAverageDailyHours Parameters:(Site,Emp,FromDate,Todate,Rate,FromCat,ToCat,Step)
    Gets the average daily time worked by an employee between two dates.If Rate is set blank (ie 2 single quotes '') then all rates are included. The FromCat and ToCat parameters allow you to limit the time categories included. The Step parameter allows you to skip days. For example if Fromdate is set to a Monday, and you only want to average time worked on Mondays, then set Step to 7.
    GetAveragePayrollHours Parameters:(Site,Emp,FromDate,Todate,Rate,FromCat,ToCat)
    Gets the average weekly time worked by an employee between two dates.If Rate is set blank (ie 2 single quotes '') then all rates are included. The FromCat and ToCat parameters allow you to limit the time categories included.
    GetEmpDailyHours Parameters :  (Site, Emp, FromDate, ToDate, Rate, Category)
    Gets the number of Daily Hours earned by an employee between two dates. If Rate is set blank (ie 2 single quotes '') then all rates are included. If the Category is left blank then all time categories are included. The answer is returned in Standard Time Format. Suggest ProcessSite, ProcessEmp and ProcessDate as relevant variables. You should not include the current ProcessDate in the date range above. However you can use dates relative to the ProcessDate, for example yesterday is ProcessDate-1.
    GetEmpHoursEx

    Parameters:  (Site, Emp, FromDate, ToDate, Rate, Category, Exclude,Rate)

    Where Exclude = ProcessDate the function will only return the total of any manual hours records for the specified period. Exclude = -1 will only return the total for processed hours.

    Available from TNA 6.04k

    GetEmpDailyHoursExpected

    Parameters:  (Site, EmpNo, FromDate, ToDate, IncludeLeave,EmpOverrideDailyShiftPattern)

    Where IncludeLeave = 0, the leave hours are not included into the calculation. IncludeLeave = 1 does include the leave hours. Where EmpOverrideDailyShiftPattern = -1, the Daily shift overrides are not included. EmpOverrideDailyShiftPattern = 0 does include the Daily Shift overrides.

    GetEmpPayrollHours The same as GetEmpDailyHours, but gets time from the Payroll Hours.
    GetExpectedHours Parameters :(Site, Employee, Date, StandardHours)
    Returns the Expected Hours for that employee for that week. If a specific record for an employee exists then that is used, if not the the shift setting is used. If the shift setting is "Use Standard Hours" then the parameter StandardHours, as passed in, is passed back to you.
    GetHolidayHours

    Parameters: (LeaveType, Rate, Category, TimeSlotCode)
    Returns the holiday hours for a specific leave type, rate, time category and timeslotcode.
    If the TimeSlotCode is blank (or 0) then it will use the TimeSlotCode currently used during processing.  Suggested use is afer the "At After Selecting Shift" embed point.
    If no record exists for the specified LeaveType on this TimeSlotCode, it will return the value for  "All Others"  (i.e. 0).

    Available from TNA 6.04h.

    IsOnLeave Parameters : (Site, Employee, Date)
    Returns the Leave Type if the Employee is on leave on the date. Returns 0 otherwise. Suggest ProcessSite and ProcessEmp for the employee currently being processed. Suggest ProcessDate for the date currently being processed.
    IsPublicHoliday Parameters : (Date, State)
    Returns a 1 if the date is a Public Holiday. Returns 0 otherwise. Suggest ProcessDate and emp:state for the employee currently being processed.
    LineUsed Parameters : (Date)
    Returns the Line used for processing, for the same employee on a different day. If you need the line currently being used on this Process Day then use UseLine.
    ProcessDay Parameters : (From,To, Site, Employee)
    Schedules a day, or range of days, for daily processing. Note that it only SCHEDULES the processing, it doesn't do the processing. Be careful with this that you don't cause an endless loop.
    ProcessWeek Parameters : (From,To, Site, Employee)
    Schedules a week, or range of weeks, for payroll processing. Note that it only SCHEDULES the processing, it doesn't do the processing. Be careful with this that you don't cause an endless loop.
    Today Returns the current date on the PC. Use ProcessDate if you need the date currently being processed.
    WeekEndDate

    Parameters: (TimelineCode, Date)
    Returns the payroll period end date for the specified date.

    WriteError Parameters : (Code, Description, Time, Type)
    Allows you to write an entry to the
    Errors file. You can write your own error by setting the code to a number between 100 and 255. The Type should be set to 'D' for a daily error, and 'W' for a payroll shift error. The Description, and Time are available for anything you want.
    WriteWarning Parameters : (Code, Description, Time, Type)
    Allows you to write an entry to the
    Warnings file. You can write your own warning by setting the code to a number between 100 and 255. The Type should be set to 'D' for a daily shift warning, and 'W' for a payroll shift warning. The Description, and Time are available for anything you want.

     

    Permalink: http://tinyurl.com/3gwccek

    Page last modified 10:42, 8 Mar 2018 by Admin CS Time/TNA Documents > Macro Scripts > Functions

    Comments0

    You must login to post a comment.
    Attach file

    Files0

     
    Powered by MindTouch Core