以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]计算  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=114091)

--  作者:江南小镇
--  发布时间:2018/1/28 19:50:00
--  [求助]计算

老师好

 


图片点击可在新窗口打开查看此主题相关图片如下:图像 1.png
图片点击可在新窗口打开查看


--  作者:有点甜
--  发布时间:2018/1/28 23:31:00
--  

直接复制,粘贴,修改列名,就可以的啊。有什么问题?


--  作者:江南小镇
--  发布时间:2018/1/29 10:24:00
--  

老师,我想通过已知的金额、单价计算出数量列的数据。

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:计算.table


--  作者:有点甜
--  发布时间:2018/1/29 11:21:00
--  
Select Case e.DataCol.Name
    Case "数量"
        SystemReady = False
        If e.DataRow.isnull("数量") = False Then
            If e.DataRow.IsNull("金额") Then
                e.DataRow("金额") = e.DataRow("单价") * e.DataRow("数量")
            ElseIf e.DataRow.isnull("单价") Then
                e.DataRow("单价") = e.DataRow("金额") / e.DataRow("数量")
            Else
                e.DataRow("金额") = e.DataRow("单价") * e.DataRow("数量")
               
            End If
        End If
        SystemReady = True
    Case "单价"
        SystemReady = False
        If e.DataRow.isnull("单价") = False Then
            If e.DataRow.IsNull("金额") Then
                e.DataRow("金额") = e.DataRow("单价") * e.DataRow("数量")
            ElseIf e.DataRow.isnull("数量") Then
                e.DataRow("数量") = e.DataRow("金额") / e.DataRow("单价")
            Else
                e.DataRow("金额") = e.DataRow("单价") * e.DataRow("数量")
            End If
        End If
        SystemReady = True
    Case "金额"
        SystemReady = False
        If e.DataRow.isnull("金额") = False Then
            If e.DataRow.IsNull("单价") Then
                If e.DataRow.IsNull("数量") = False Then
                    e.DataRow("单价") = e.DataRow("金额") / e.DataRow("数量")
                End If
            ElseIf e.DataRow.isnull("数量") Then
                If e.DataRow.IsNull("单价") = False Then
                    e.DataRow("数量") = e.DataRow("金额") / e.DataRow("单价")
                End If
            Else
                If e.DataRow.IsNull("数量") = False Then
                    e.DataRow("单价") = e.DataRow("金额") / e.DataRow("数量")
                End If
               
            End If
        End If
        SystemReady = True
       
End Select

--  作者:江南小镇
--  发布时间:2018/1/29 11:28:00
--  
谢谢老师
--  作者:江南小镇
--  发布时间:2018/1/29 22:45:00
--  

老师好

      我想在原来已知的计算代码中继续添加自动互算代码。即输入税率能计
算出金额和税金的值。输入金额能计算出税率和税金、输入税金能计算出税率和
金额。

 

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:计算.table


--  作者:有点蓝
--  发布时间:2018/1/29 23:03:00
--  
用法和4楼的完全一样,研究一下代码自己学着写一下
--  作者:江南小镇
--  发布时间:2018/1/29 23:05:00
--  
谢谢老师,好的。
--  作者:江南小镇
--  发布时间:2018/1/30 10:39:00
--  
以下是引用江南小镇在2018/1/29 22:45:00的发言:

老师好

      我想在原来已知的计算代码中继续添加自动互算代码。即输入税率能计
算出金额和税金的值。输入金额能计算出税率和税金、输入税金能计算出税率和
金额。

 

 

 下载信息  [文件大小:364.0 KB  下载次数:1]
图片点击可在新窗口打开查看点击浏览该文件:计算.table


老师,我搞了好长时间搞不好。还是恳请老师帮忙。


--  作者:有点甜
--  发布时间:2018/1/30 11:19:00
--  

Select Case e.DataCol.Name
    Case "数量"
        SystemReady = False
        If e.DataRow.isnull("数量") = False Then
            If e.DataRow.IsNull("价税合计") Then
                e.DataRow("价税合计") = e.DataRow("单价") * e.DataRow("数量")
            ElseIf e.DataRow.isnull("单价") Then
                e.DataRow("单价") = e.DataRow("价税合计") / e.DataRow("数量")
            Else
                e.DataRow("价税合计") = e.DataRow("单价") * e.DataRow("数量")
               
            End If
        End If
        SystemReady = True
    Case "单价"
        SystemReady = False
        If e.DataRow.isnull("单价") = False Then
            If e.DataRow.IsNull("价税合计") Then
                e.DataRow("价税合计") = e.DataRow("单价") * e.DataRow("数量")
            ElseIf e.DataRow.isnull("数量") Then
                e.DataRow("数量") = e.DataRow("价税合计") / e.DataRow("单价")
            Else
                e.DataRow("价税合计") = e.DataRow("单价") * e.DataRow("数量")
            End If
        End If
        SystemReady = True
    Case "价税合计"
        SystemReady = False
        If e.DataRow.isnull("价税合计") = False Then
            If e.DataRow.IsNull("单价") Then
                If e.DataRow.IsNull("数量") = False Then
                    e.DataRow("单价") = e.DataRow("价税合计") / e.DataRow("数量")
                End If
            ElseIf e.DataRow.isnull("数量") Then
                If e.DataRow.IsNull("单价") = False Then
                    e.DataRow("数量") = e.DataRow("价税合计") / e.DataRow("单价")
                End If
            Else
                If e.DataRow.IsNull("数量") = False Then
                    e.DataRow("单价") = e.DataRow("价税合计") / e.DataRow("数量")
                End If
               
            End If
        End If
        SystemReady = True
End Select

Select Case e.DataCol.Name
    Case "税率"
        SystemReady = False
        If e.DataRow.isnull("税率") = False Then
            If e.DataRow.IsNull("金额") Then
                e.DataRow("金额") = e.DataRow("税金") / (e.DataRow("税率")-1)
            ElseIf e.DataRow.isnull("税金") Then
                e.DataRow("税金") = e.DataRow("金额") * (e.DataRow("税率")-1)
            Else
                e.DataRow("税金") = e.DataRow("金额") * (e.DataRow("税率")-1)
            End If
        End If
        SystemReady = True
    Case "税金"
        SystemReady = False
        If e.DataRow.isnull("税金") = False Then
            If e.DataRow.IsNull("金额") Then
                If e.DataRow.isnull("税率") = False Then
                    e.DataRow("金额") = e.DataRow("税金") / (e.DataRow("税率")-1)
                End If
            ElseIf e.DataRow.isnull("税率") Then
                If e.DataRow.isnull("金额") = False Then
                    e.DataRow("税率") = e.DataRow("税金") / e.DataRow("金额") + 1
                End If
            Else
                If e.DataRow.isnull("税率") = False Then
                    e.DataRow("金额") = e.DataRow("税金") / (e.DataRow("税率")-1)
                End If
            End If
        End If
        SystemReady = True
    Case "金额"
        SystemReady = False
        If e.DataRow.isnull("金额") = False Then
            If e.DataRow.IsNull("税金") Then
                If e.DataRow.isnull("税率") = False Then
                    e.DataRow("税金") = e.DataRow("金额") * (e.DataRow("税率")-1)
                End If
            ElseIf e.DataRow.isnull("税率") Then
                e.DataRow("税率") = e.DataRow("税金") / e.DataRow("金额") + 1
            Else
                If e.DataRow.isnull("税率") = False Then
                    e.DataRow("税金") = e.DataRow("金额") * (e.DataRow("税率")-1)
                End If
            End If
        End If
        SystemReady = True
       
End Select