!!TimeSheetTimeGenerator
!TimeSheetTimeGenerator is called by
*UEGTS
*PTSE processLeaveLineChangeEvent 
!Logic
;1. PTSE records created before the PTS.START_DATE:Keep manually entered PTSE records created before the PTS.START_DATE\\Delete any generated PTSE records generated before the PTS.START_DATE 
*business example: UPTRA generated PTSE (UPTRA Apply Time Rules For Prior Periods) 

;2. PTSE records created after the PTS.END_DATE:Delete any PTSE records generated after the PTS.END_DATE 
*business example:  PTS changed the time frame from PP to weekly  or EE termination

;3. Determine the last “Manual” changed PTSE:Any PTSE record with “Manual” TIME_SHEET_ENTRY_SOURCE\\“Manual” = MANUAL, MANUAL_BY_TTX, LOADED , MANUAL_BY_PAYROLL\\Any PTSE with “GENERATED_SCHEDULED_HOURS” TIME_SHEET_ENTRY_SOURCE where MANUAL_CHANGE_USER is not null

;4. Determine if there are leaves with status “1-Requested” before the last manual change

;5. Determine dates to be reprocessed:Dates too be reprocessed = any dates after last manual (#3) + any dates for “1-Requested” leave before the last manual change (#4)

;6. For dates to be reprocessed - delete any PTSE records that are not manual:Attention if we do not have any leaves with status “1-Requested” leave before the last manual change, there will be no need to check for manual PTSE because they will not exist for the reprocess dates

;7. Rebuild PTSE for reprocess dates
*Holiday generation for Hours, Shift Calendar, Shift Pattern & Event scheduled  
**Determine the holiday date (reusable WorkTimeProjector logic)
**Generate holiday PTSE records
*Work /Leave Time generation
**Hours PTS
***Determine the work day (reusable WorkTimeProjector logic)
***Create work PTSE conform with the work calendar/assignment/ work rule setup
***Create leave PTSE For “1-Requested”, “2-Request Processed” approved/not required approval 
***Note: On PTSE insert the  “3-In Payroll” AAL will be created(LeaveRequestProcessor logic)
****ZERO  amount “3-In Payroll” AAL  indicator
****When a leave PTSE is delete (IPTS…) a ZERO “3-In Payroll” AAL is created. 
****If this logic is rerun, this indicator will instruct the system to do not regenerate “3-In Payroll” AAL for that d
****Create time sheet replacement if need it  
****Removes the TRs records, perform auto balancing, calculate Givens and apply TRs (reusable RemoveOffsetRecordsBalacingCalculateGivensAndApplyRulesByTimeSheet logic)
**Shift Calendar PTS
***Create TSH 
***Call BuildScheduleAndProcessExceptions form the last manual date to the end date
***Call BuildScheduleAndProcessExceptions for leave dates before last manual date
**Shift Patter PTS
***TSH should be already generated (by running UTTP before UEGTS)
***Call BuildScheduleAndProcessExceptions form the last manual date to the end date
***Call BuildScheduleAndProcessExceptions for leave dates before last manual date



----
![Notes|Edit:Internal.TimeSheetTimeGenerator] 	
[{InsertPage page='Internal.TimeSheetTimeGenerator' default='Click to create a new notes page'}]