This commit is contained in:
jiangyong27 2024-11-01 13:19:45 +08:00
parent 745b87acba
commit 0b8e8991a1
1 changed files with 10 additions and 1 deletions

View File

@ -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)
}