Dim yphsl As WinForm.Button = e.Form.Controls("Button5")
Dim bfhfh As WinForm.Button = e.Form.Controls("Button6")
Dim phwc As WinForm.Button = e.Form.Controls("配货完成")
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("库存明细表").SQLSelect("订单号 = '" & dr("销售订单号") & "' and 物料编码 = '" & dr("存货编码") & "' and 状态 = '入库完成'","","在库生命周期 DESC")
If dr IsNot Nothing Then
Dim count As Integer = e.DataTable.Compute("count(sn)","订单号='" & dr("销售订单号") & "' and 物料编码='" & dr("存货编码") & "' and 状态 = '配货完成' and SN is not null")
If count >= dr("数量") Then
dr("配货状态") = True
dr.save
Tables("配货整理_table1").Filter = "发货单号 = '" & Vars("u8fhdh") & "' and 存货编码 = '" & Vars("chbm") & "'"
Return
End If
For Each fdr As DataRow In drs
msgbox(fdr("SN") & vbcrlf & e.DataRow("SN") & vbcrlf & (fdr("SN") = e.DataRow("SN")))
If fdr("SN") = e.DataRow("SN") Then
Dim mr As DataRow = DataTables("配货扫描").find("SN = '" & e.DataRow("SN") & "' And _Identify <> '" & e.DataRow("_Identify") & "'")
If mr IsNot Nothing Then
e.DataRow("状态") = "配货重复扫描"
e.DataRow("数量") = 0
e.DataRow.save
Else
fdr("状态") = "配货完成"
fdr("配货完成时间") = Date.now
fdr("U8发货单号") = Vars("u8fhdh")
fdr("业务员") = dr("业务员")
fdr("货运单号") = dr("货运单号")
fdr("发货地址") = dr("发货地址")
fdr("数量") = 0
fdr.Save
Dim nms() As String = {"生产订单号码","工单行号","物料编码","物料名称","类别说明","产品批次","订单号","订单行号","客户","备注","软件版本","MAC","HW","入库单号","库位类别","库位编码","入库完成时间","入库方式","在库生命周期"}
For Each nm As String In nms
e.DataRow(nm) = fdr(nm)
Next
e.DataRow("数量") = 1
e.DataRow("状态") = "配货完成"
e.DataRow("配货完成时间") = Date.now
e.DataRow("U8发货单号") = Vars("u8fhdh")
e.DataRow.save
Dim sum2 As Integer
sum2 = DataTables("配货扫描").SQLCompute("Sum(数量)","订单号='" & dr("销售订单号") & "' and 物料编码='" & dr("存货编码") & "' and 状态 = '配货完成'")
yphsl.text = "订单号:" & dr("销售订单号") & "+" & "物料编码:" & dr("存货编码") & "已完成配货数量" & "=" & sum2
End If
End If
Next
Dim count1 As Integer = e.DataTable.Compute("count(sn)","订单号='" & dr("销售订单号") & "' and 物料编码='" & dr("存货编码") & "' and 状态 = '配货完成' and SN is not null")
msgbox(count1)
msgbox(dr("数量"))
If count1 > dr("数量") Then
e.DataRow("数量") = 0
e.DataRow("物料编码") = dr("存货编码")
e.DataRow("订单号") = dr("销售订单号")
e.DataRow("状态") = "不符合出库条件"
e.DataRow.save
Dim count2 As Integer = e.DataTable.Compute("count(sn)","订单号='" & dr("销售订单号") & "' and 物料编码='" & dr("存货编码") & "' and 状态 = '不符合出库条件' and SN is not null")
bfhfh.text = "不符合出库SN有" & count2
Tables("配货整理_table4").Filter = "订单号='" & dr("销售订单号") & "' and 物料编码='" & dr("存货编码") & "' and 状态 = '不符合出库条件'"
Return
End If
End If
End If
End Select
Dim r As Row = Tables("销售出库单列表").Current
If r("配货状态") = False Then
phwc.Enabled = False
Else
phwc.Enabled = True
End If
msgbox(fdr("SN") & vbcrlf & e.DataRow("SN") & vbcrlf & (fdr("SN") = e.DataRow("SN")))---弹出如附件图。
fdr("SN") = 00315072808
e.datarow("SN") = 00315072808
那么fdr("SN") = e.datarow("SN") 结果为false?
此主题相关图片如下:false.png