If e.DataCol.Name = "项目" Then
If e.NewValue Is Nothing Then
e.DataRow("A00") = Nothing
e.DataRow("C00") = Nothing
e.DataRow("合计") = Nothing
Else
e.DataRow("A00") = Nothing
e.DataRow("C00") = Nothing
e.DataRow("合计") = Nothing
Dim dr As DataRow
dr = DataTables("用友项目表").Find("[项目编码] = '" & e.DataRow("A00项目编码") & "' ")
If dr IsNot Nothing And e.DataRow("A00项目编码").StartsWith("11")
e.DataRow("A00") = dr("原币金额收入")
End If
dr = DataTables("用友项目表").Find("[项目编码] = '" & e.DataRow("A00项目编码") & "' ")
If dr IsNot Nothing And e.DataRow("A00项目编码").StartsWith("12")
e.DataRow("A00") = dr("原币金额支出")
End If
dr = DataTables("用友项目表").Find("[项目编码] = '" & e.DataRow("C00项目编码") & "' ")
If dr IsNot Nothing And e.DataRow("C00项目编码").StartsWith("21")
e.DataRow("C00") = dr("原币金额收入")
End If
dr = DataTables("用友项目表").Find("[项目编码] = '" & e.DataRow("C00项目编码") & "' ")
If dr IsNot Nothing And e.DataRow("C00项目编码").StartsWith("22")
e.DataRow("C00") = dr("原币金额支出")
End If
End If
End If
If e.DataCol.Name = "日期" Then
'收入
If e.DataRow("A00项目编码") = "111" Then '销售资金收入
e.DataRow("A00") = e.DataTable.Compute("sum(A00)","A00项目编码 like '1110%' or A00项目编码 like '1111%' ")
e.DataRow("C00") = e.DataTable.Compute("sum(C00)","A00项目编码 like '1110%' or A00项目编码 like '1111%' ")
End If
If e.DataRow("A00项目编码") = "112" Then '1.2?其他资金收入
e.DataRow("A00") = e.DataTable.Compute("sum(A00)","A00项目编码 like '1120%' or A00项目编码 like '1121%' ")
e.DataRow("C00") = e.DataTable.Compute("sum(C00)","A00项目编码 like '1120%' or A00项目编码 like '1121%' ")
End If
If e.DataRow("A00项目编码") = "113" Then '2?内部往来收入
e.DataRow("A00") = e.DataTable.Compute("sum(A00)","A00项目编码 like '1130%' or A00项目编码 like '1131%' ")
e.DataRow("C00") = e.DataTable.Compute("sum(C00)","A00项目编码 like '1130%' or A00项目编码 like '1131%' ")
End If
'支出
If e.DataRow("A00项目编码") = "121" Then '1?货款支出
e.DataRow("A00") = e.DataTable.Compute("sum(A00)","A00项目编码 like '1210%' or A00项目编码 like '1211%' ")
e.DataRow("C00") = e.DataTable.Compute("sum(C00)","A00项目编码 like '1210%' or A00项目编码 like '1211%' ")
End If
If e.DataRow("A00项目编码") = "12201" Then '2.1?自营费用支出
e.DataRow("A00") = e.DataTable.Compute("sum(A00)","A00项目编码 like '122010%' or A00项目编码 like '122011%' ")
e.DataRow("C00") = e.DataTable.Compute("sum(C00)","A00项目编码 like '122010%' or A00项目编码 like '122011%' ")
End If
If e.DataRow("A00项目编码") = "12202" Then '2.2?联营费用支出
e.DataRow("A00") = e.DataTable.Compute("sum(A00)","A00项目编码 like '122020%' or A00项目编码 like '122021%' ")
e.DataRow("C00") = e.DataTable.Compute("sum(C00)","A00项目编码 like '122020%' or A00项目编码 like '122021%' ")
End If
If e.DataRow("A00项目编码") = "123" Then '其他支出
e.DataRow("A00") = e.DataTable.Compute("sum(A00)","A00项目编码 like '1230%' or A00项目编码 like '1231%' ")
e.DataRow("C00") = e.DataTable.Compute("sum(C00)","A00项目编码 like '1230%' or A00项目编码 like '1231%' ")
End If
If e.DataRow("A00项目编码") = "124" Then '内部往来支出
e.DataRow("A00") = e.DataTable.Compute("sum(A00)","A00项目编码 like '1240%' or A00项目编码 like '1241%'")
e.DataRow("C00") = e.DataTable.Compute("sum(C00)","A00项目编码 like '1240%' or A00项目编码 like '1241%'")
End If
End If
'If e.DataCol.Name = "分销商" Then
'If e.DataRow("A00项目编码") = "10" Then '1?资金总收入
'e.DataRow("A00") = e.DataTable.Compute("sum(A00)","A00项目编码 = '111' or A00项目编码 = '112' ")
'e.DataRow("C00") = e.DataTable.Compute("sum(C00)","A00项目编码 = '111' or A00项目编码 = '112' ")
'End If
'
'If e.DataRow("项目") = "收入项目金额合计" Then '1?资金总收入
'e.DataRow("A00") = e.DataTable.Compute("sum(A00)","A00项目编码 = '111' or A00项目编码 = '112' or A00项目编码 = '113' ")
'e.DataRow("C00") = e.DataTable.Compute("sum(C00)","A00项目编码 = '111' or A00项目编码 = '112' or A00项目编码 = '113' ")
'forms("资金日报填写").Controls("textbox2").value = Nothing
'forms("资金日报填写").Controls("textbox6").value = Nothing
'forms("资金日报填写").Controls("textbox2").value = e.DataRow("A00")
'forms("资金日报填写").Controls("textbox6").value = e.DataRow("C00")
'End If
'
'If e.DataRow("A00项目编码") = "122" Then '费用支出
'e.DataRow("A00") = e.DataTable.Compute("sum(A00)","A00项目编码 = '12201' or A00项目编码 = '12202' ")
'e.DataRow("C00") = e.DataTable.Compute("sum(C00)","A00项目编码 = '12201' or A00项目编码 = '12202' ")
'End If
'
'If e.DataRow("项目") = "支出项目金额合计" Then '1?资金总收入
'e.DataRow("A00") = e.DataTable.Compute("sum(A00)","A00项目编码 = '121' or A00项目编码 = '12201' or A00项目编码 = '12202' or A00项目编码 = '123' or A00项目编码 = '124' ")
'e.DataRow("C00") = e.DataTable.Compute("sum(C00)","A00项目编码 = '121' or A00项目编码 = '12201' or A00项目编码 = '12202' or A00项目编码 = '123' or A00项目编码 = '124' ")
'forms("资金日报填写").Controls("textbox4").value = Nothing
'forms("资金日报填写").Controls("textbox8").value = Nothing
'forms("资金日报填写").Controls("textbox4").value = e.DataRow("A00")
'forms("资金日报填写").Controls("textbox8").value = e.DataRow("C00")
'End If
'
'e.DataRow("合计") = e.DataRow("A00") + e.DataRow("C00")
'
'If e.DataRow("合计") = 0 Then
'e.DataRow("合计") = Nothing
'End If
'End If