Manager - Approve/Reject Timesheets
The screen below, *Review Sheet, shows the approval screen that managers use to approve or reject employee timesheets.

When the manager clicks on the link in the Employee field, the view switches to display the Timesheet View with details of the information submitted by the employee as shown below.

Back-end Changes
- When the manage approves or rejects the Timesheet of an employee for the specific time period either from the Manager Sheet View or the Timesheet View, the status of the Timesheet entity changes. The method to change the Timesheet status has been previously covered in the Submit Timesheet section and is listed below.
@RequestMapping(value = "/{id}/updateTimesheetStatus", method = RequestMethod.PUT, consumes = {"application/json"}, produces = {"application/json"})
public ResponseEntity<UpdateTimesheetOutput> updateTimesheetStatus(@PathVariable Long id, @RequestBody UpdateStatus input,HttpServletRequest request) throws Exception
NOTE: The source code for this Timesheet View is the same as that used in the Create Timesheet angular component sub-section of the *Employee - Submit Timesheet page.
- Create ManagerSheet angular component.
Create angular-component under src/app/extended/timesheet-module/. Files for this component can be found at the following locations:
(i) manager-sheet\manager-sheet.component.html
(ii) manager-sheet\manager-sheet.component.scss
(iii) manager-sheet\manager-sheet.component.ts
- Add the ManagerSheetComponent component's entry in entities array timesheet.module.ts file.
import { ManagerSheetComponent } from 'src/app/extended/timesheet-module/manager-sheet/manager-sheet.component';
const entities = [ManagerSheetComponent]
- Add the component's entry in routes array in timesheet.routing.ts file.
import { ManagerSheetComponent } from 'src/app/extended/timesheet-module/manager-sheet/manager-sheet.component';
const routes: Routes = [
{ path: "managersheet", component: ManagerSheetComponent, canActivate: [ AuthGuard ] }
];
- **Set TIMESHEETSTATUSENTITY_UPDATE permission in setPermission method in the file src/app/extended/core/main-nav/main-nav.component.ts88.
setPermissions() {
…….
this.permissions['TIMESHEETSTATUSENTITY_UPDATE'] = this.globalPermissionService.hasPermissionOnEntity('TIMESHEETSTATUS', 'update');
}
Updated about 2 years ago