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.
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 identifiersid
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.
?status=1,2
for simplicity sake):
2. Deny timesheets pending approval
First, isolate timesheets that are pending approval (iestatus == 1
).
And forge the following request (see API reference):
3. Invalidate approved timesheets
Then, isolate timesheets that are pending approval (iestatus == 2
).
And forge the following request (see API reference):