Dim tb As Table =Tables("资产负债表")
tb.DataTable.RejectChanges
Dim tb2 As Table = Tables("总分类账")
Dim qj As String = Vars("会计期间")
Dim n,n1,n2,n3,n4,n5,n6,n7 As Double
Dim lst,lst1,lst2,lst3 As List(of String)
'计算期末数
' 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Dim strs() As String = "{"货币资金","货币资金","应收piao据","应收piao据","应收账款","应收账款","预付款项","预付款项","其他应收款","其他应收款","库存","库存","工程施工","工程施工","工程结算","工程结算"}
Dim aa() As String = {"应收账款","预付款项"}
Dim aaa As New List(of String)
aaa.AddRange(aa)
Dim strsx() As String = {" 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额" }
' 0 1 2 3 4 5 6 7 8 9
Dim x() As String = {"1","1","3","3","4","4","5","5","8","8","9","9"}
Dim y() As String = {"6","7","6","7","6","7","6","7","6","7","6","7","6","7","6","7","6","7","6","7"}
Dim Ns As New List(Of Double)
'会计科目中提取'货币资金'的科目代码
For i As Integer = 0 To strs.Length-1
' lst= DataTables("会计科目").GetValues("科目代码","资产负债表 like '" & strs1(i) & "%' or 资产负债表 like '%" & strs1(i) & " '")
lst= DataTables("会计科目").GetValues("科目代码","资产负债表 = '" & strs(i) & "' or 资产负债表 like '" & strs(i) & "," & "%' or 资产负债表 like '%" & "," & strs(i) & "'")
If lst.Count > 0 Then
Dim str As String
For Each ids As String In lst
str & = ids & ","
Next
str = str.Trim(",")
If aaa.IndexOf(strs(i)) <> -1 Then
n= tb2.DataTable.sqlCompute("sum(余额)","科目代码 in (" & str & ") And 摘要 = '" & strsx(i) & "' And 会计期间 = '" & Vars("会计期间") & "' ")
Else
n = tb2.DataTable.sqlCompute("sum(余额)","借或贷 = '借' And 科目代码 In (" & str & ") And 摘要 = '" & strsx(i) & "' and 会计期间 = '" & Vars("会计期间") & "' ")
End If
str = ""
ns.Add(n)
End If
Next
output.show(ns(1))
''修正存货-(工程施工与工程结算的差额)
If ns(12) > ns(14) Then
output.show(ns(13))
ns(10) = ns(10) +(ns(12)- ns(14))
End If