vacation
This commit is contained in:
parent
745b87acba
commit
0b8e8991a1
|
@ -217,7 +217,16 @@ func (s *Staff) SyncStaffSalary(month string) {
|
|||
holiday := float64(0)
|
||||
surplusHoliday := float64(0)
|
||||
for _, vac := range approveVacations {
|
||||
holiday += vac.VacationDuration
|
||||
startTime, _ := time.ParseInLocation(vac.VacationStartTime, "2006-01-02 15:04:05", time.Local)
|
||||
endTime, _ := time.ParseInLocation(vac.VacationStartTime, "2006-01-02 15:04:05", time.Local)
|
||||
|
||||
//同一天请假时长大于8小时算一天
|
||||
if startTime.Format("2006-01-02") == endTime.Format("2006-01-02") && vac.VacationDuration > 1 {
|
||||
holiday += vac.VacationDuration
|
||||
} else {
|
||||
holiday += vac.VacationDuration
|
||||
}
|
||||
|
||||
surplusHoliday += goutil.If(vac.VacationDuration < 1, 1-vac.VacationDuration, 0)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue