This commit is contained in:
jiangyong27 2024-03-01 18:35:03 +08:00
parent 46196d16a8
commit b63564f917
1 changed files with 7 additions and 2 deletions

View File

@ -153,7 +153,7 @@ func (s *StaffSalary) Summary(month string, ctx *gin.Context) {
panic(config.ErrDb.New().Append(err))
}
header := []string{"姓名", "身份证号", "入职日期", "转正日期", "基本工资", "出勤工资", "奖金", "社保扣除", "个税扣除", "应出勤天数", "实际出勤天数", "补卡天数", "请假天数", "实发工资"}
header := []string{"姓名", "身份证号", "入职日期", "转正日期", "基本工资", "出勤工资", "奖金", "社保扣除", "个税扣除", "应出勤天数", "实际出勤天数", "补卡天数", "请假天数", "实发工资", "状态"}
datas := make([][]string, 0)
summary := new(model.StaffSalary)
for _, staff := range staffSalarys {
@ -182,6 +182,11 @@ func (s *StaffSalary) Summary(month string, ctx *gin.Context) {
item = append(item, cast.ToString(extra["approvalCheckinDay"]))
item = append(item, cast.ToString(staff.Holiday))
item = append(item, cast.ToString(butil.FloatCut(staff.RealSalary+staff.AwardSalary-staff.SocialInsurence-staff.PersonalTax)))
if staff.TotalDay != cast.ToFloat64(staff.RealDay)+cast.ToFloat64(staff.Holiday) {
item = append(item, "【异常】")
} else {
item = append(item, "")
}
datas = append(datas, item)
summary.BaseSalary += staff.BaseSalary
@ -200,7 +205,7 @@ func (s *StaffSalary) Summary(month string, ctx *gin.Context) {
datas = append(datas, []string{"合计", "-", "-", "-",
cast.ToString(summary.BaseSalary), cast.ToString(summary.RealSalary), cast.ToString(summary.AwardSalary), cast.ToString(summary.SocialInsurence),
cast.ToString(summary.PersonalTax), "-", "-", "-", cast.ToString(summary.Holiday),
cast.ToString(butil.FloatCut(summary.RealSalary + summary.AwardSalary - summary.SocialInsurence - summary.PersonalTax))})
cast.ToString(butil.FloatCut(summary.RealSalary + summary.AwardSalary - summary.SocialInsurence - summary.PersonalTax)), "-"})
if xls != "" {
filename := fmt.Sprintf("summary_%s.xlsx", time.Now().Format("20060102_150405"))