如果没有黄色代码显示是正常的喔!我只不过是调用了其他表的金额自动填写上去了
Dim str1 As String = e.sender.Value
Dim str As String = str1.SubString(0,2)
Dim drs As List (of DataRow) = DataTables("常用凭证").Select("编号 = '"& str & "'")
For y As Integer = 0 To drs.Count - 1
Dim t As Table = Tables("凭证.凭证明细")
Dim nma() As String = {"摘要","科目代码","借方金额","贷方金额","现金流科目"} 'A-常用凭证 表数据来源列
Dim nmb() As String = {"摘要","科目代码","借方金额","贷方金额","现金流科目"} 'B- 凭证.凭证明细 表数据接收列
Dim r As Row = t.AddNew
For i As Integer = 0 To nma.Length - 1
r(nmb(i)) = drs(y)(nma(i))
Next
If e.sender.Value = "01 缴纳税金" Then
Dim dr1 As DataRow = DataTables("会计科目").find("科目代码 = '"& r("科目代码") & "' ")
If r("科目代码") <> "1002001" And dr1("期末余额") > 0 Then
r("借方金额") = dr1("期末余额")
Else
r("贷方金额") = t.Compute("sum(借方金额)")
End If
ElseIf e.sender.Value = "02 结转未交增值税" Then
Dim pr As Row = Tables("凭证").Current
Dim dr As DataRow = DataTables("税金统计").find("年份= '"& pr("年份") & "'and 月份= '"& pr("月份") & "' ")
If dr IsNot Nothing Then
t.rows(0)("借方金额") = dr("销项_税额") - dr("进项_税额")
t.rows(1)("贷方金额") = dr("销项_税额") - dr("进项_税额")
End If
End If
Next
[此贴子已经被作者于2019/2/11 15:13:44编辑过]