Employee Management System
Tags: azuretrialhack
Published: 2022-03-07 23:13:21



```
Employee Leave Management system
```


### Overview of My Submission

This is a leave management system for employees. Which is a process within an organization that determines how leave is requested by employees and approve by managers, as well as how it tracked for payroll balance, and other purposes.

First employee can select their leave type as sick leave,vacation, floating holiday, jury duty likewise. 
Then can select the date range of the leave and fill the reasons detail wise and should click the submit button.

In the home screen all the leaves applied by the employee is listed down. As well as Pending requests, Approved requests, declined are listed seperately.

And there is a another screen that shows holidays.

On the manager login side, manager can view all the leave requests of the employee. Then he can see the details and consider that approve or decline the request.As well , there is another screen in the manager side that, manager can send an email to the employee via the system.

These are the main functions of the system.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e4yje0vqwjmefnt0jl8e.PNG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9gyj68u03w9vidwfmef9.PNG)

Below are few code lines in employee management part.

```
Set(_selectedLeaveItem, ThisItem);

If(_managerView, 
    //If manager view, get user's leave balance record and determine any overlaps this request has from other people I manage
    Set(_requesterBalanceRecord, LookUp(Balance, Year = Text(Year(Now())) && EmployeeEmail = ThisItem.Requester));
    ClearCollect(RequestOverlaps, Filter(Leave, EndDate >= _selectedLeaveItem.StartDate && StartDate <= _selectedLeaveItem.EndDate 
    && Requester <>_selectedLeaveItem.Requester));
    
    If(CountRows(RequestOverlaps) > 0, Set(_requestOverlapMessage, Concat(Distinct(RequestOverlaps, Requester), Result, ", ")))
);

Concurrent(
    //gather requester or approver info depending on view
    If(_managerView, 
        Set(_requester, Office365Users.UserProfile(ThisItem.Requester)), 
        Set(_selectedApprover, Office365Users.UserProfile(ThisItem.Approver)); If(Office365Users.UserPhotoMetadata(_selectedApprover.Id).HasPhoto, Set(_selectedApproverPhoto, Office365Users.UserPhoto(_selectedApprover.Id)))),
    //**** CALCULATION USED TO DETERMINE TOTAL WORK DAYS REQUESTED ****
     Set(_inclusiveTotalDaysRequested, DateDiff(ThisItem.StartDate, ThisItem.EndDate, Days) + 1);
        Set(_numFullWeeks, RoundDown(_inclusiveTotalDaysRequested / 7, 0));
        Set(_numFullDaysPartialWeek, _inclusiveTotalDaysRequested - _numFullWeeks * 7);
        Set(_startWeekday, Weekday(ThisItem.StartDate)); 
        Set(_endWeekday, Weekday(ThisItem.EndDate));


       //calculates the number of business days in the partial week left over after whole weeks are subtracted out of total days requested
    If(_numFullDaysPartialWeek = 6, 
        If(_startWeekday <= 2, Set(_numPartialWeekdays, 5), Set(_numPartialWeekdays, 4)
        ),
      _numFullDaysPartialWeek = 5,
        If(_startWeekday = 2, Set(_numPartialWeekdays, 5), _startWeekday = 1 || _startWeekday = 3 || _startWeekday = 4, Set(_numPartialWeekdays, 4), Set(_numPartialWeekdays, 3)
        ),
      _numFullDaysPartialWeek = 4,
        If(_startWeekday = 2 || _startWeekday = 3, Set(_numPartialWeekdays, 4), _startWeekday = 1 || _startWeekday = 4, Set(_numPartialWeekdays, 3), Set(_numPartialWeekdays, 2)
        ),
      _numFullDaysPartialWeek = 3,
        If(_startWeekday = 6 || _startWeekday = 7, Set(_numPartialWeekdays, 1), _startWeekday = 1 || _startWeekday = 5, Set(_numPartialWeekdays, 2), Set(_numPartialWeekdays, 3)
        ),
      _numFullDaysPartialWeek = 2,
        If(_startWeekday = 7, Set(_numPartialWeekdays, 0), _startWeekday = 1 || _startWeekday = 6, Set(_numPartialWeekdays, 1), Set(_numPartialWeekdays, 2)),
      _numFullDaysPartialWeek = 1,
        If(_startWeekday = 1 || _startWeekday = 7, Set(_numPartialWeekdays, 0), Set(_numPartialWeekdays, 1)
        ),
      _numFullDaysPartialWeek = 0, Set(_numPartialWeekdays, 0)
    );
      Set(_workDaysInRequest, _numFullWeeks * 5 + _numPartialWeekdays),
      Set(_holidaysInRequest, CountIf(Holidays, StartDate >= ThisItem.StartDate, StartDate <= ThisItem.EndDate))
);
Set(_requestedDays, _workDaysInRequest - _holidaysInRequest);
//**** END CALCULATION ****
Set(_showDetails, true);

```

### Submission Category: 

Low-Code Legends

### Link to Code on GitHub

{% embed https://github.com/kithminiii/EmployeeLeavesManagmentSystem %}

Link to the system:

https://apps.powerapps.com/play/41b5329c-2c1b-4c74-91bf-30156794f6b9?tenantId=44e3cf94-19c9-4e32-96c3-14f5bf01391a

Demo Video of the System:

https://drive.google.com/file/d/1-4YefJUhL1tUjZ6vnBQvRCX8ZxGilwOe/view?usp=sharing

### Additional Resources / Info

Thre are 10 interfaces I used to create the system.

1.Login Screen

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vwotsjgmxhj526oay8mk.PNG)

2.Home Screen


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bvqsii93mtsqhog2nedj.PNG)

3.New Request Screen


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nr9mw9sknxk1thjgbas7.PNG)

4.Company Holidays Screen


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qqzadu82ew06xxqvzckl.PNG)

5.Leave Balance Screen


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cldkvo428k33i6gyarik.PNG)

6.Confirmation Screen


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/04zi9bbehue589w9wd1f.PNG)

7.Change Approver Screen


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wd1wd5wu4nlti7twxzky.PNG)

8.Manager Change Request Screen


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yok94qzr4u1e0mo3g5rd.PNG)

9.Manager Send Email Screen


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bua99mwuhv6gt6ad84pr.PNG)

10.About Screen


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dwvkt2idnxl439kj3alc.PNG)