Timesheeting Definition

From 3B Knowledge
Jump to navigation Jump to search

The timesheet management system consists of two components - Timesheet Submission and Timesheet Approval. Timesheet management depends on a schema, much similar to that of the scheduler.

For timesheet management, you need to set up a Component Configuration records as well as  Component Loaders.

Identifying User

The timesheeting components auto-identify the logged in user from the context community user if the components are embedded in a digital experience. Alternatively, you can pass a contactId or sessionKey url parameter to identify the logged in user.

Submission Component Configuration

Similar to the Scheduler Configuration, a Component Configuration has schedulables - a shift and an expense in this case.

Shift Schedulable

This is the footprint of the Shift Schedulable:

  • objectType - default is b3s__Shift__c
  • startFieldPath
  • endFieldPath
  • selectionClause - SOQL query to load shift records. You can filter by contactUserId/userId global variable
  • totalHoursFieldPath - must be a numeric field - a formula on the shift that calculates the shift length. Used when calculating weekly totals
  • title - an array accepting field paths to display on the shift box
  • canEdit - accepts a condition select object - when true, the “edit” button will be available
  • canDelete - accepts a condition select object - when true, the “delete” button will be available
  • canApprove - accepts a condition select object - will show/hide the approval button
  • canReject - accepts a condition select object - will show/hide the rejection button
  • recordFormFields - array of fields to be displayed when editing the record
  • recordFormFieldsApproval  - array of fields to be displayed when approving the record
  • recordFormFieldsRejection  - array of fields to be displayed when rejecting the record
  • Decorations - array of decorators to display on the record
{
    isSeparator: true,
    label: 'Times',
},
{
    field: 'b3s__Scheduled_Start_Time__c:b3s__Scheduled_End_Time__c',
    props: {
        hideDate: true,
    },
    labelOverride: 'Scheduled Times',
    type: 'field-time-range-selector',
    required: false,
    disabled: true,
},
{
    field: 'b3s__Actual_Start_Time__c:b3s__Actual_End_Time__c',
    props: {
        hideDate: false,
    },
    labelOverride: 'Actual Times',
    type: 'field-time-range-selector',
    required: true,
    disabled: false,
}

Expense Schedulable

All of the same configuration as the Shift Schedulable.

Record Title Customization

To customize the shift/expence layout, simply pass an array of titles. You can also add a “formatter” as date, dateTime, time.

title: [
                { label: 'Date', fieldPath: 'b3s__Absolute_Start_Time__c', formatter: 'dateTime', hideIfNull: false },
                { label: 'Approval', fieldPath: 'b3s__Approval_Status__c', hideIfNull: false },
                { label: 'Contact', fieldPath: 'b3s__Contact__r.Name', hideIfNull: false },
                { label: 'Job', fieldPath: 'b3s__Job__r.Name', hideIfNull: false },
                { label: 'Site', fieldPath: 'b3s__Site__r.Name', hideIfNull: false },
                { label: 'Comments', fieldPath: 'b3s__Comments__c', hideIfNull: false },
                { label: 'Length', fieldPath: 'b3s__Absolute_Length__c', hideIfNull: false },
            ],

Accessing Timesheeting Components

The visualforce pages TimesheetSubmission and TimesheetApproval are made available to allow you to embed in communities and/or send as individual links. You can also embed the components within a 3B Portal setting.