此主题相关图片如下:qq截图20170928103523.jpg
此主题相关图片如下:qq截图20170928103750.jpg
DataColChanged代码如下:
Select e.DataCol.name
Case "合同金额","申请金额","企业所得税基数","企业所得税率","个人所得税基数","个人所得税率","计费基数","管理费费率","应缴增值税基数"
If e.DataRow.IsNull("企业所得税基数") OrElse e.DataRow.IsNull("企业所得税率")Then '为空
e.DataRow("企业所得税") = Nothing
ElseIf e.DataRow("企业所得税基数") ="合同金额" Then
e.DataRow("企业所得税") = e.DataRow("合同金额") * e.DataRow("企业所得税率") / 100
ElseIf e.DataRow("企业所得税基数") ="申请金额" Then
e.DataRow("企业所得税") = e.DataRow("申请金额") * e.DataRow("企业所得税率") / 100
End If
If e.DataRow.IsNull("个人所得税基数") OrElse e.DataRow.IsNull("个人所得税率") Then '为空
e.DataRow("个人所得税") = Nothing
ElseIf e.DataRow("个人所得税基数") ="合同金额" Then
e.DataRow("个人所得税") = e.DataRow("合同金额") * e.DataRow("个人所得税率") / 100
ElseIf e.DataRow("个人所得税基数") ="申请金额" Then
e.DataRow("个人所得税") = e.DataRow("申请金额") * e.DataRow("个人所得税率") / 100
End If
If e.DataRow.IsNull("计费基数") OrElse e.DataRow.IsNull("管理费费率")Then '为空
e.DataRow("管理费") = Nothing
ElseIf e.DataRow("计费基数") ="合同金额" Then
e.DataRow("管理费") = e.DataRow("合同金额") * e.DataRow("管理费费率") / 100
ElseIf e.DataRow("计费基数") ="申请金额" Then
e.DataRow("管理费") = e.DataRow("申请金额") * e.DataRow("管理费费率") / 100
End If
If e.DataRow.IsNull("应缴增值税基数") Then '为空
e.DataRow("应缴增值税") = Nothing
ElseIf e.DataRow("应缴增值税基数") ="合同金额" Then
e.DataRow("应缴增值税") = e.DataRow("合同金额") / 1.11 * 0.11
ElseIf e.DataRow("应缴增值税基数") ="fa piao金额" Then
e.DataRow("应缴增值税") = e.DataRow("fa piao金额") / 1.11 * 0.11
ElseIf e.DataRow("应缴增值税基数") ="申请金额" Then
e.DataRow("应缴增值税") = e.DataRow("申请金额") / 1.11 * 0.11
End If
End Select
Select Case e.DataCol.Name
Case "项目编码","申请金额","本期_累计扣款","企业所得税率","个人所得税基数","个人所得税率","管理费费率","手续费","安全保证金","质量保证金","应急保证金","资料保证金","fa piao金额","到账金额","成本fa piao","人工工资","其他费用","抵扣增值税","现金补税","预交增值税","应补增值税","管理费","应扣费用明细_小计","本期_累计扣款","成本差额税率","成本差额税","扣税明细_小计","成本差额"
Dim dr As DataRow
Dim mr As DataRow = e.DataRow
Dim drs As List(of DataRow)
dr = e.DataTable.Find("[计量期数] < " & mr("计量期数") & " And [项目编码] = '" & mr("项目编码") & "'", "[计量期数] Desc")
If dr Is Nothing Then
mr("累计_计量金额") = mr("申请金额")
mr("累计_扣款金额") = mr("本期_累计扣款")
mr("累计_支付金额") = mr("实际支付金额") '("申请金额") - mr("本期_累计扣款")
dr = mr
End If
MessageBox.Show(2)
drs = e.DataTable.Select("[计量期数] >= " & dr("计量期数") & " And [项目编码] = '" & dr("项目编码") & "'", "[计量期数]")
For i As Integer = 1 To drs.Count - 1
drs(i)("累计_计量金额") = drs(i-1)("累计_计量金额") + drs(i)("申请金额")
drs(i)("累计_扣款金额") = drs(i-1)("累计_扣款金额") + drs(i)("本期_累计扣款") '+ drs(i)("申请金额") - drs(i)("本期_累计扣款")
drs(i)("累计_支付金额") = drs(i-1)("累计_支付金额") + drs(i)("实际支付金额")
Next
If e.DataCol.Name = "项目编码" AndAlso e.OldValue IsNot Nothing AndAlso e.OldValue <> e.NewValue Then
dr = e.DataTable.Find("[计量期数] < " & mr("计量期数") & " And [项目编码] = '" & e.OldValue & "'", "[计量期数] Desc")
If dr Is Nothing Then
dr = e.DataTable.Find("[项目编码] = '" & e.OldValue & "'", "[计量期数]")
If dr IsNot Nothing Then
dr("累计_计量金额") = dr("申请金额")
dr("累计_扣款金额") = dr("本期_累计扣款")
dr("累计_支付金额") = dr("实际支付金额")
End If
End If
MessageBox.Show(3)
If dr IsNot Nothing Then
drs = e.DataTable.Select("[计量期数] >= " & dr("计量期数") & " And [项目编码] = '" & dr("项目编码") & "'", "[计量期数]")
For i As Integer = 1 To drs.Count - 1
drs(i)("累计_计量金额") = drs(i-1)("累计_计量金额") + drs(i)("申请金额")
drs(i)("累计_扣款金额") = drs(i-1)("累计_扣款金额") + drs(i)("本期_累计扣款")
drs(i)("累计_支付金额") = drs(i-1)("累计_支付金额") + drs(i)("实际支付金额")
Next
End If
End If
End Select
MessageBox.Show(4)
Select Case e.DataCol.name
Case "项目编码","申请金额","本期_累计扣款","实际支付金额","企业所得税率","个人所得税基数","个人所得税率","管理费费率" , "手续费","安全保证金","质量保证金","应急保证金","资料保证金","fa piao金额","到账金额","成本fa piao","人工工资","其他费用","抵扣增值税","现金补税","预交增值税","应补增值税","管理费","应扣费用明细_小计","本期_累计扣款","成本差额税率","成本差额税","扣税明细_小计","成本差额"
Dim fdr As DataRow = DataTables("工程款申请").sqlFind("_Identify = " & e.DataRow("临时列"))
If fdr IsNot Nothing Then
fdr("实际支付金额") = e.DataRow("实际支付金额")
End If
End Select
[此贴子已经被作者于2017/9/28 10:41:40编辑过]