我做的工资计算项目,其他应扣列有部分行不可以输入1960,项目代码如下:
工资_DataColChanged
Dim dr As DataRow
= e.DataRow
If e.DataCol.Name
= "员工id" Then
Dim nms() As String = {"姓名","奖金率","公司","日工资","早餐标准","加班标准","值班标准","工龄工资","高温补标准","应扣保险","职务标识","月工资"}
If e.NewValue Is
Nothing Then
For Each nm As String In nms
e.DataRow(nm) = Nothing
Next
Else
Dim pr As DataRow
pr = DataTables("基础").Find("[员工id] = '" & e.NewValue &
"'")
If pr IsNot Nothing
For Each nm As String In nms
e.DataRow(nm) = pr(nm)
Next
End If
End If
End If
Select Case e.DataCol.name
Case "金额","奖金率","出勤天数","职务标识" ,"休假天数"
If dr.isnull("金额") OrElse dr.isnull("奖金率") OrElse
dr.isnull("出勤天数")
OrElse dr("职务标识") =
2 OrElse dr("休假天数") > 8 Then
dr("销售工资") =
Nothing
Else If dr("休假天数") > 4 AndAlso DR("休假天数") <= 5 Then
dr("销售工资") =
dr("金额") *
dr("奖金率") *
0.75
Else If dr("休假天数") > 5 AndAlso DR("休假天数") <= 6 Then
dr("销售工资") =
dr("金额") *
dr("奖金率") *
0.7
Else If dr("休假天数") > 6 AndAlso DR("休假天数") <= 7 Then
dr("销售工资") = dr("金额")
* dr("奖金率") * 0.65
Else If dr("休假天数") > 7
AndAlso DR("休假天数") <= 8 Then
dr("销售工资") = dr("金额")
* dr("奖金率") * 0.6
Else
dr("销售工资") = dr("金额")
* dr("奖金率")
End If
End Select
If dr("休假天数")
= 0 Then
dr("奖励天数") = 4
Else If dr("休假天数") > 15 OrElse
dr("职务标识") = 5 Then
dr("奖励天数") = 0
Else
dr("奖励天数") = 2
End If
Select Case
e.DataCol.name
Case "早餐天数","早餐标准"
If dr.isnull("早餐天数") OrElse
dr.isnull("早餐标准") OrElse
dr("职务标识") = 2 Then
dr("早餐") = Nothing
Else
dr("早餐") = dr("早餐天数")
* dr("早餐标准")
End If
Case "值班天数","值班标准"
If dr.isnull("值班天数") OrElse
dr.isnull("值班标准") OrElse
dr("职务标识") = 2 Then
dr("值班") = Nothing
Else
dr("值班") = dr("值班天数")
* dr("值班标准")
End If
Case "加班天数","加班标准"
If dr.isnull("加班天数") OrElse
dr.isnull("加班标准") OrElse
dr("职务标识") = 2 Then
dr("加班") = Nothing
Else
dr("加班") = dr("加班天数")
* dr("加班标准")
End If
Case "出勤天数","日工资"
If dr.isnull("出勤天数") OrElse
dr.isnull("日工资") OrElse
dr("职务标识") = 2 Then
dr("工资") = Nothing
Else
dr("工资") = dr("出勤天数")
* dr("日工资")
End If
Case "出勤天数","高温补标准"
If dr.isnull("出勤天数") OrElse
dr.isnull("高温补标准") Then
dr("高温补") = Nothing
Else
dr("高温补") = dr("出勤天数")
* dr("高温补标准")
End If
Case "奖励天数","日工资"
If dr.isnull("奖励天数") OrElse
dr.isnull("日工资") Then
dr("奖励工资") = Nothing
Else
dr("奖励工资") = dr("奖励天数")
* dr("日工资")
End If
End Select
If e.DataCol.Name
<> "所得税" AndAlso e.DataCol.IsNumeric Then
e.DataRow("所得税") =
InTax(e.DataRow("应税工资"))
End If
Select Case
e.DataCol.name
Case "工资","奖励工资","月工资","里程工资","业务奖","销售工资","早餐","值班","加班","高温补","工龄工资","其他应扣","上月调增"
dr("应发工资A") = dr("工资")
+ dr("奖励工资") + dr("月工资") + dr("里程工资") + dr("业务奖")
+ dr("销售工资") + dr("早餐") + dr("值班") + dr("加班")
+ dr("高温补") + dr("工龄工资") - dr("其他应扣") + dr("上月调增")
End Select
Select Case e.DataCol.name
Case "里程工资","业务奖","销售工资","其他应扣"
dr("奖金") = dr("里程工资") +
dr("业务奖") + dr("销售工资") - dr("其他应扣")
End Select
Select Case e.DataCol.name
Case "应扣保险","所得税A","其他应扣"
dr("应扣项") = dr("应扣保险")
+ dr("所得税A") + dr("其他应扣")
End Select
If dr("应发工资A")
<= dr("应扣项") Then
dr("应发工资") = Nothing
dr("应扣保险") = Nothing
End If
If dr("应发工资A")
>= 7000 Then
dr("应税工资") = 3500 - dr("应扣保险")
dr("现金发放") = dr("应发工资A")
- 7000
dr("实发工资") = 7000 - dr("应扣保险")
- dr("所得税")
dr("应发工资") = 7000
dr("奖金A") = dr("奖金")
- dr("应发工资A") + 7000
ElseIf dr("应发工资A") >=3500 Then
dr("应税工资") = dr("应发工资A")
- dr("应扣保险") - 3500
dr("应发工资") = dr("应发工资A")
dr("实发工资") = dr("应发工资")
- dr("应扣保险") - dr("所得税")
dr("现金发放") = Nothing
dr("奖金A") = dr("奖金")
ElseIf dr("应发工资A") <3500 Then
dr("应税工资") = Nothing
dr("应发工资") = dr("应发工资A")
dr("实发工资") = dr("应发工资A")
- dr("应扣保险")
dr("现金发放") = Nothing
dr("奖金A") = dr("奖金")
End If
If dr.isnull("出勤天数") Then
dr("工龄工资") = Nothing
End If
If dr("姓名")
= "王青" Then
dr("所得税A") = dr("所得税")/2
Else dr("所得税A") = dr("所得税")
End If
工资_DataColChanging
If
e.DataCol.IsNumeric Then
If e.NewValue <= 0
Then
e.NewValue = Nothing
End If
End If
窗口表事件
窗口与控件事件
刷新_Button1_Click
DataTables("工资").DataCols("员工id").RaiseDataColChanged()
DataTables("工资").DataCols("出勤天数").RaiseDataColChanged()
DataTables("工资").DataCols("早餐天数").RaiseDataColChanged()
DataTables("工资").DataCols("加班天数").RaiseDataColChanged()
DataTables("工资").DataCols("值班天数").RaiseDataColChanged()
DataTables("工资").DataCols("休假天数").RaiseDataColChanged()
DataTables("工资").DataCols("金额").RaiseDataColChanged()
DataTables("工资").DataCols("里程工资").RaiseDataColChanged()
DataTables("工资").DataCols("销售工资").RaiseDataColChanged()
DataTables("工资").DataCols("业务奖").RaiseDataColChanged()
DataTables("工资").DataCols("应发工资A").RaiseDataColChanged()
DataTables("工资").DataCols("上月调增").RaiseDataColChanged()
DataTables("工资").DataCols("其他应扣").RaiseDataColChanged()
DataTables("工资").DataCols("奖励天数").RaiseDataColChanged()
DataTables("工资").DataCols("日工资").RaiseDataColChanged()