Foxtable(狐表)用户栏目专家坐堂 → 库存统计疑问


  共有2443人关注过本帖树形打印复制链接

主题:库存统计疑问

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/9/5 18:03:00 [显示全部帖子]

Select Case e.DataCol.name
    Case "货号", "颜色", "仓库"
        Dim filter As String = "货号='" & e.DataRow("货号") & "' and 颜色='" & e.DataRow("颜色") & "' and 仓库='" & e.DataRow("仓库") & "'"
        For Each dc As DataCol In e.DataTable.DataCols
            If dc.name.StartsWith("尺码_") Then
                Dim sum1 = DataTables("入库明细").Compute("sum(" & dc.name & ")", filter)
                Dim sum2 = DataTables("出库明细").Compute("sum(" & dc.name & ")", filter)
                Dim sum3 = DataTables("销售明细").Compute("sum(" & dc.name & ")", filter)
                e.DataRow(dc.name) = sum1-sum2-sum3
            End If
        Next
End Select

 回到顶部