If zdc.Checked Then
zd=DataTables("转仓单明细").Find("款号='" & drs("款号") & "' And 花色='" & drs("花色") & "' and 尺码 = '" & drs("尺码") & "' and 仓库='" & ck & "'and 调入仓库='总部仓库'","日期")
If zd Is Nothing Then
If drts.Text.Length>0 Then
dr=DataTables("转仓单明细").Find("款号='" & drs("款号") & "' And 花色='" & drs("花色") & "' and 尺码 = '" & drs("尺码") & "' and 仓库='" & ck & "'","日期")
dc=DataTables("转仓单明细").Find("款号='" & drs("款号") & "' And 花色='" & drs("花色") & "' and 尺码 = '" & drs("尺码") & "' and 调出仓库='" & ck & "'","日期")
If dc IsNot Nothing And dr IsNot Nothing Then
Dim t1 As TimeSpan = dc("日期") - dr("日期")
If t1.TotalDays<drts.Text
If cnt > 0 Then
drs(ck) = 1
cnt = cnt - 1
Else
drs(ck) = Nothing
End If
End If
End If
Else
If cnt > 0 Then
drs(ck) = 1
cnt = cnt - 1
Else
drs(ck) = Nothing
End If
End If
End If
End If
Else
If drts.Text.Length>0 Then
dr=DataTables("转仓单明细").Find("款号='" & drs("款号") & "' And 花色='" & drs("花色") & "' and 尺码 = '" & drs("尺码") & "' and 仓库='" & ck & "'","日期")
dc=DataTables("转仓单明细").Find("款号='" & drs("款号") & "' And 花色='" & drs("花色") & "' and 尺码 = '" & drs("尺码") & "' and 调出仓库='" & ck & "'","日期")
If dc IsNot Nothing And dr IsNot Nothing Then
Dim t1 As TimeSpan = dc("日期") - dr("日期")
If t1.TotalDays<drts.Text
If cnt > 0 Then
drs(ck) = 1
cnt = cnt - 1
Else
drs(ck) = Nothing
End If
End If
End If
Else
If cnt > 0 Then
drs(ck) = 1
cnt = cnt - 1
Else
drs(ck) = Nothing
End If
End If
End If