以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 重置fa piao类型列差额提示调用目标发生异常,只有手动从错误fa piao类型调整到正确的才能让差额起作用,不能次重置列让所有差额自动计算 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=187633) |
-- 作者:A67 -- 发布时间:2023/7/31 17:07:00 -- 重置fa piao类型列差额提示调用目标发生异常,只有手动从错误fa piao类型调整到正确的才能让差额起作用,不能次重置列让所有差额自动计算 If e.DataCol.Name = "发票类型" Then Dim Total As Double Dim Haoma As String = e.DataRow("发票号码") Select Case e.DataRow("发票类型") Case "总包对建设" Total = DataTables("订单往来").Compute("Sum(建设到总包开票金额)","建设到总包发票号码 = \'" & Haoma & " \'") e.DataRow("差额") = e.DataRow("发票金额") - Total Case "国信对总包" Total = DataTables("订单往来").Compute("Sum(总包到分包开票金额)","总包到分包发票号码 = \'" & Haoma & " \'") e.DataRow("差额") = e.DataRow("发票金额") - Total Case "下游对国信(同步)" Total = DataTables("订单往来").Compute("Sum(国信到下游发票金额)","国信到下游发票号码 = \'" & Haoma & " \'") e.DataRow("差额") = e.DataRow("发票金额") - Total Case "下游对国信(非同步)" Total = DataTables("付款明细_非同步").Compute("Sum(发票金额)","发票号码 = \'" & Haoma & " \'") e.DataRow("差额") = e.DataRow("发票金额") - Total Case Else e.DataRow("差额") = Nothing End Select
|
-- 作者:有点蓝 -- 发布时间:2023/7/31 17:11:00 -- 看出错提示应该是这个事件其它代码的问题,不是1楼代码的问题。 |
-- 作者:A67 -- 发布时间:2023/7/31 17:52:00 -- 蓝版帮忙再看看,这个是所有代码那个事件下,过去好着突然不行了 Dim bianhao As String = e.DataRow("外经证编号") If bianhao <> Nothing Then Dim dr As DataRow = DataTables("外经证").Find("外经证编号 = \'" & bianhao & "\'") e.DataRow("发票类型") = dr("外经证类型") e.DataRow("购买方") = dr("购买方") e.DataRow("销售方") = dr("销售方") e.DataRow("税率") = dr("税率") End If If e.DataCol.Name = "发票类型" Then Dim Total As Double Dim Haoma As String = e.DataRow("发票号码") Select Case e.DataRow("发票类型") Case "总包对建设" Total = DataTables("订单往来").Compute("Sum(建设到总包开票金额)","建设到总包发票号码 = \'" & Haoma & " \'") e.DataRow("差额") = e.DataRow("发票金额") - Total Case "国信对总包" Total = DataTables("订单往来").Compute("Sum(总包到分包开票金额)","总包到分包发票号码 = \'" & Haoma & " \'") e.DataRow("差额") = e.DataRow("发票金额") - Total Case "下游对国信(同步)" Total = DataTables("订单往来").Compute("Sum(国信到下游发票金额)","国信到下游发票号码 = \'" & Haoma & " \'") e.DataRow("差额") = e.DataRow("发票金额") - Total Case "下游对国信(非同步)" Total = DataTables("付款明细_非同步").Compute("Sum(发票金额)","发票号码 = \'" & Haoma & " \'") e.DataRow("差额") = e.DataRow("发票金额") - Total Case Else e.DataRow("差额") = Nothing End Select End If
|
-- 作者:有点蓝 -- 发布时间:2023/7/31 19:51:00 -- 参考:http://www.foxtable.com/webhelp/topics/2044.htm 另外第一段代码效率有问题,甚至可能导致死循环:http://www.foxtable.com/webhelp/topics/1522.htm
[此贴子已经被作者于2023/7/31 19:52:26编辑过]
|