2. The corresponding timestamp from when the duplicate timesheet gets created appears as in the APP log as:
WARN 2019-01-29 11:19:30,242 [http-nio-14001-exec-8] niku.union (clarity:sampleuser:10499070__5A31FD04-C8D0-4573-A131-0836E706D0B6:PPM_REST_API) java.lang.Exception: Error encountered populating timesheet from populateCreatedTimesheetWithOptionOverrides:
<message id="timeadmin.TIMESHEET_LOCK_ERROR" location="" type="error" value=""/>
2. Stock reports such as Resource Time Summary and Detail show as 'Open', which makes a timesheet submission appear as late.
The timesheet action sessions could have been duplicated if there was communication issue between the server nodes.
All Clarity versions
1) Run the following query to see for which resources a duplicate timesheet exist
select srm_resources.id as res_id, srm_resources.full_name, prtimeperiod.prstart,
from prtimesheet, prtimeperiod, srm_resources
where prtimesheet.prresourceid = srm_resources.ID
and prtimesheet.prtimeperiodid = prtimeperiod.prid
and prtimeperiod.prstart > to_date('01/01/2019','mm/dd/yyyy')
and prtimesheet.prstatus < 4
group by srm_resources.id,srm_resources.full_name,
having count(*) > 1
RES_ID = XXXXXXX
PRTIMEPERIODID = YYYYYYY
NOTE: We will not delete any timesheets that are not returned from the query.
2) Run the following query to confirm the results returned are actually duplicate timesheets
select * from prtimesheet
where prtimeperiodid = YYYYYYY
and prresourceid = XXXXXXX
The above query will return a PRID column containing the two duplicate timesheets that exist in the same time period for the same resource.
PRID = ZZZZZZZ
3) Run the below query to see if there are any time entry records associated with the duplicate timesheets
select * from prtimeentry
where prtimesheetid = ZZZZZZZ
4) Backup tables PRTIMEENTRY and PRTIMESHEET
5) Run the commands to have the duplicate timesheet deleted:
delete from PRTIMEENTRY where PRTIMESHEETID in (ZZZZZZZ);
delete from PRTIMESHEET where PRID in (ZZZZZZZ);
This should resolve the issue and remove the duplicate timesheet.