Select e.DataCol.Name
Case "姓名"
e.DataRow("发放状态")="未发放"
Dim filter As String = "(员工 = '" & e.DataRow("姓名") & "')"
Dim y As Integer = Date.Today.Year
Dim m As Integer = Date.Today.Month -1
'MessageBox.Show(m)
Dim dt1 As New Date(y, m, 1)
Dim dt2 As New Date(y, m, Date.DaysInMonth(y,m)) '获取该月的最后一天
Dim Filterdate As String
Filterdate = "考勤日期 >= #" & dt1 & "# And 考勤日期 <= #" & dt2 & "#"
Dim dr As DataRow
dr = DataTables("员工表").Find("姓名 = '" & e.DataRow("姓名") & "'")
If dr IsNot Nothing '如果找到, 则设置各列内容
e.DataRow("部门")=dr("所属门店")
End If
e.DataRow("日期")=Date.Today
'e.DataRow("年")=Date.Today.Year
'e.DataRow("月")=Date.Today.Month -1
Dim m1 As Integer = Date.Today.Month - 1
Dim n1 As Integer = Date.Today.Year
If m1<1 Then
e.DataRow("月")= m1 +1
e.DataRow("年")=n1
Else
e.DataRow("月")= m1
e.DataRow("年")=n1
End If
Dim dr1 As DataRow
dr1 = DataTables("基础薪资").Find("姓名 = '" & e.DataRow("姓名") & "'")
If dr1 IsNot Nothing '如果找到, 则设置各列内容
e.DataRow("基础工资")=dr1("基础工资")
e.DataRow("话费补贴")=dr1("话费补贴")
e.DataRow("交通补贴")=dr1("交通补贴")
e.DataRow("工龄补贴")=dr1("工龄补贴")
e.DataRow("其他补贴")=dr1("其他补贴")
End If
Dim filter1 As String = "(考勤人员 = '" & e.DataRow("姓名") & "' and 考勤类别 = '迟到登记' )"
e.DataRow("扣款_迟到次数") = DataTables("员工考勤").compute("count(考勤编号)", filter1 & " and 考勤日期 >= #" & dt1 & "# And 考勤日期 <= #" & dt2 & "#")
If e.DataRow("扣款_迟到次数") >=1 Then
e.DataRow("奖金_满勤奖")=0
e.DataRow("扣款_迟到扣款")=e.DataRow("扣款_迟到次数") *e.DataRow("扣款_迟扣标准")
Else
e.DataRow("奖金_满勤奖")=dr1("满勤奖")
End If
Dim filter11 As String = "(考勤人员 = '" & e.DataRow("姓名") & "' and 考勤类别 = '旷工登记' )"
e.DataRow("扣款_旷工次数") = DataTables("员工考勤").compute("count(考勤编号)", filter11 & " and 考勤日期 >= #" & dt1 & "# And 考勤日期 <= #" & dt2 & "#")
If e.DataRow("扣款_旷工次数") >=1 Then
e.DataRow("奖金_满勤奖")=0
e.DataRow("扣款_旷工扣款")=e.DataRow("扣款_旷工次数") *e.DataRow("扣款_旷扣标准")
Else
e.DataRow("奖金_满勤奖")=dr1("满勤奖")
End If
Dim filter111 As String = "(考勤人员 = '" & e.DataRow("姓名") & "' and 考勤类别 = '请假登记' )"
e.DataRow("扣款_请假次数") = DataTables("员工考勤").compute("count(考勤编号)", filter111 & " and 考勤日期 >= #" & dt1 & "# And 考勤日期 <= #" & dt2 & "#")
If e.DataRow("扣款_请假次数") >=1 Then
e.DataRow("奖金_满勤奖")=0
e.DataRow("扣款_请假扣款")=e.DataRow("扣款_请假次数") *e.DataRow("扣款_请假标准")
Else
e.DataRow("奖金_满勤奖")=dr1("满勤奖")
End If
e.DataRow("扣款_任务额度") = DataTables("订单主表").compute("sum(订单总额)", filter & " And 订单日期 >= #" & dt1 & "# And 订单日期 <= #" & dt2 & "#")
e.DataRow("实发工资")=(e.DataRow("基础工资")+e.DataRow("话费补贴")+e.DataRow("交通补贴")+e.DataRow("工龄补贴")+e.DataRow("其他补贴")+e.DataRow("奖金_满勤奖")+e.DataRow("奖金_超量奖")+e.DataRow("奖金_超额奖"))-(e.DataRow("扣款_迟到扣款")+e.DataRow("扣款_旷工扣款")+e.DataRow("扣款_请假扣款")+e.DataRow("扣款_未完单扣")+e.DataRow("扣款_未达额扣")+e.DataRow("代扣_伙食")+e.DataRow("代扣_其它"))
Case "代扣_伙食","代扣_其它"
e.DataRow("实发工资")=(e.DataRow("基础工资")+e.DataRow("话费补贴")+e.DataRow("交通补贴")+e.DataRow("工龄补贴")+e.DataRow("其他补贴")+e.DataRow("奖金_满勤奖")+e.DataRow("奖金_超量奖")+e.DataRow("奖金_超额奖"))-(e.DataRow("扣款_迟到扣款")+e.DataRow("扣款_旷工扣款")+e.DataRow("扣款_请假扣款")+e.DataRow("扣款_未完单扣")+e.DataRow("扣款_未达额扣")+e.DataRow("代扣_伙食")+e.DataRow("代扣_其它"))
End Select