How to Reject Timesheets
Introduction
There can be many reasons to reject a large set of timesheets, on top of them are mistakes in pay elements calculi.
The goal of this guide is to help you:
- Identify timesheets that need to be rejected.
- Reject them in order to have users submit them again.
Please, note that the action to be done depends on the actual status of the timesheets. Timesheets pending approval will have to be denied, whereas approved timesheets must be invalidated. You can learn more about the approval workflow in Timmi Timesheet here.
Prerequisites
You will need:
- (required) Your domain name
{yourDomain}
, eg: “https://myawesomecompany.ilucca.net”. - (required) An API key
{apiKey}
that has timesheet approbation and invalidation rights for the given users.
Guide
1. Retrieve the timesheets to reject
You will need to get your hands on the unique identifiers id
of the timesheets that need to be rejected. This is achieved via a filtered request on the /api/v3/timmitimesheets
endpoint.
Most common filters for this kind of requests are:
?statuteId=1,2,...
: filter on a list of time regulations by their unique identifiers.?status=1,2
: filter on the status of the timesheets. Here, you will most often need to retrieve timesheets with1: PendingApproval
or2: Approved
statuses.?startsOn=since,2022-01-01
: filter on timesheets that start after the given date (here, January, 1st 2022).?ownerId=1,2,...
: filter on a list of users’ unique identifiers.
Retrieve both statuses separately. You can make your life easier by making two requests: the first to retrieve timesheets pending approval, and a second one to retrieve approved timesheets.
Please page your request. Requests aimed at retrieving a large set of resources should be paged. You can read more about paging here.
Request should look like this (here both statuses are retrieved at the same time ?status=1,2
for simplicity sake):
2. Deny timesheets pending approval
First, isolate timesheets that are pending approval (ie status == 1
).
And forge the following request (see API reference):
Please use the “comment” to explain the cause of this rejection. It will be shown to the user on the timesheet.
The users will be sent an email notifying them of their timesheet(s) rejection.
3. Invalidate approved timesheets
Then, isolate timesheets that are pending approval (ie status == 2
).
And forge the following request (see API reference):
Please use the “comment” to explain the cause of this rejection. It will be shown to the user on the timesheet.
The users will be sent an email notifying them of their timesheet(s) rejection.
Was this page helpful?