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


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

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

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/6/28 15:21:00 [只看该作者]

最简单,按照顺序出货,先理解这个,再去做根据天数的。

 

Select Case e.DataCol.name
    Case "SN"
        If Not e.DataRow.IsNull("SN")  Then
            Dim dr As Row = Tables("销售出库单").current
            Dim drs As List(Of DataRow) = DataTables("库存明细表").Select(CExp("订单号='{0}' and 物料编码='{1}' and 状态='入库完成'", dr("订单号") ,dr("物料编码")),"在库生命周期 desc")
            If dr IsNot Nothing Then
                Dim count As Integer = e.DataTable.Compute("count(sn)","订单号='" & dr("订单号") & "' and 物料编码='" & dr("物料编码") & "' and SN is not null")
               
                If count >= dr("预发货数量") Then
                    dr("配货状态") = True
                    msgbox("已经扫描完")
                    Return
                End If
               
                For Each fdr As DataRow In drs
                    If fdr("SN") = e.DataRow("SN") Then
                        fdr("状态") = "出库"
                        e.DataRow("订单号") = fdr("订单号")
                        e.DataRow("物料编码") = fdr("物料编码")
                        msgbox("SN可以出货")
                        Return
                    End If
                    count += fdr("数量")
                    If count >= dr("预发货数量") Then
                        msgbox("SN不能出货")
                        Return
                    End If
                Next
            End If
        End If
End Select


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