Foxtable(狐表)用户栏目专家坐堂 → [求助]先进的先出


  共有5049人关注过本帖平板打印复制链接

主题:[求助]先进的先出

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


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/6/25 14:21:00 [只看该作者]

那就改下查询条件

Select Case e.DataCol.name
    Case "SN"
        
        If Not e.DataRow.IsNull("SN")  Then
            Dim drs As List(Of DataRow) = DataTables("库存明细表").Select(CExp("SN='{0}' and 订单号='{1}' and 物料编码='{2}' and 状态='入库完成'", e.NewValue,e.DataRow("订单号") ,e.DataRow("物料编码")),"在库生命周期 desc")
            If drs.Count > 0 Then
                Dim count As Integer = e.DataTable.Compute("count(sn)","订单号='" & e.DataRow("订单号") & "' and 物料编码='" & e.DataRow("物料编码") & "' and SN is not null")
                Dim dr As DataRow = DataTables("销售出库单").find("订单号='" & e.DataRow("订单号") & "' and 物料编码='" & e.DataRow("物料编码") & "'")
                If dr IsNot Nothing Then
                    If count >= dr("预发货数量") Then
                        dr("配货状态") = True
                        Return
                    End If
                    Dim fdr As DataRow
                    For i As Integer = 0 To drs.Count-1
                        fdr = drs(i)
                        fdr("状态") = "出库"
                        count += fdr("数量")
                        If count >= dr("预发货数量") Then
                            dr("配货状态") = True
                            Return
                        End If
                    Next
                End If
                
            End If
        End If
End Select

 回到顶部
总数 47 1 2 3 4 5 下一页