Dim v8 As Double = v1 - v6 - V5 \'累计应纳税所得额
If v8 > 0 Then
Dim drs As List (of DataRow) = DataTables("个人所得税预扣率表").Select("扣除上限 <= " & v8 & " ","扣除上限 DESC ") \'这一步没有实现
If drs.Count = 0 Then
Dim v9 As Double = v8 * 0.03 \'累计应纳税额
Dim v10 As Double = e.DataTable.Compute("sum(所得税)","证照号码 = \'"& e.DataRow("证照号码") & "\'and 月份 < \'"& e.datarow("月份") & "\' ") \'累计已交税金
If v9 - v10 > 0 Then
e.DataRow("所得税") = v9 - v10
Else
e.DataRow("所得税") = 0
End If
Else
Dim v9 As Double = v8 * drs(0)("预扣率") - drs(0)("速算扣除数") \'累计应纳税额
Dim v10 As Double = e.DataTable.Compute("sum(所得税)","证照号码 = \'"& e.DataRow("证照号码") & "\'and 月份 < \'"& e.datarow("月份") & "\' ") \'累计已交税金
If v9 - v10 > 0 Then
e.DataRow("所得税") = v9 - v10
Else
e.DataRow("所得税") = 0
End If
End If
Else
e.DataRow("所得税") = 0
End If
Else
e.DataRow("所得税") = e.DataRow("本期收入") * 0.03
End If
End If