Run payroll for an employer with this experience: view and update any inputs, review the calculated results, and then submit the payroll run to confirm it.
This employer facing experience provides an employer user with the ability to view, update, and confirm an existing payroll run. See the Payroll Run API documentation for more information on how you can retrieve existing or create new payroll runs. In addition, this experience can also be used to view the details of a payroll run that is already confirmed as well.
Embedded usage
Element name: run-payroll
Refer to the guide on how to embed an Element with Salsa.js for more detailed instructions.
Options
Name | Type | Description |
---|---|---|
userToken | String | Required. A User Token with EMPLOYER_ADMIN access role for the specified Employer. |
payrollRunId | String | Required. The id of the Payroll Run. |
readOnly | Object | Options for customizing what payroll elements should be shown as read only. See the following properties table. |
hide | Object | Options for customizing which elements of the view should be hidden. See the following properties table. |
options.readOnly
properties:
options.readOnly
properties:Name | Type | Description |
---|---|---|
pay | Boolean | InputReadOnlyOptions | ElementReadOnlyOptions[] | Specifies the rules for which pay types should be shown as read only. To set all pay types as read only, pass a true or InputReadOnlyOptions object value.To set only a specific subset of pay types as read only, pass an array of ElementReadOnlyOptions objects value. |
deductions | Boolean | Specifies if all deductions should be shown as read only. |
timeWorked | Boolean | InputReadOnlyOptions | Specifies if all time worked should be shown as read only. |
compensations | Boolean | Deprecated, use pay instead. Specifies if all compensations should be shown as read only. |
InputReadOnlyOptions
properties:
InputReadOnlyOptions
properties:Name | Type | Description |
---|---|---|
message | String | The message to be displayed on the read only input(s). This message should convey to the user why the input is read only, and/or how they can go about editing the value elsewhe |
ElementReadOnlyOptions
properties:
ElementReadOnlyOptions
properties:Name | Type | Description |
---|---|---|
referenceId | String | Required. The referenceId of the Partner Pay Type that should be read only. |
message | String | The message to be displayed on the read only input(s). This message should convey to the user why the input is read only, and/or how they can go about editing the value elsewhere. |
options.hide
properties:
options.hide
properties:Name | Type | Description |
---|---|---|
title | Boolean | Hide the topmost title of the view. |
stepper | Boolean | Hide the stepper component, which displays the steps of the workflow. |
stepTitle | Boolean | Hide the title of the current step, which is displayed below the stepper and above the rest of the content. |
Refer to the reference on creating elements for the additional options that are available to all elements.
Example
salsa.elements.create('run-payroll', {
userToken: 'eyJhbGciO...ajs0Wqw',
payrollRunId: 'payrun_e8343fc7-9d63-4cc5-81ed-c573fc666d37'
});
Events
Refer to the documentation on Element events for more information about events and instructions on how to consume them.
complete
event
complete
eventThe complete
event is triggered when the user completes the run payroll workflow by confirming ("submitting") the payroll run.
Event object properties
Name | Type | Description |
---|---|---|
elementType | String | 'run-payroll' |
payrollRunId | String | The id of the Run Payroll. |