--SMS. solo sugerir datos de venta en dev.

This commit is contained in:
2024-05-15 19:30:10 -07:00
parent ee5eac9ebf
commit 2565cc23e7

View File

@@ -1250,10 +1250,12 @@ Partial Class Inventarios_EntregaAlmacen
If Boolean.Parse(e.Row.DataKey("AplicaLote")) Or Boolean.Parse(e.Row.DataKey("AplicaCaducidad")) Then
Dim ValorAsignado As String = ""
Dim DtDatosDevolucion As DataTable = Nothing
If GvDatos.Columns(8).Visible AndAlso EsDevolucionVenta = 1 Then
ValorAsignado = $"{e.Row.DBCampo("Lote").ToString}|{e.Row.DBCampo("FechaCaducidad").ToDate.ToString("dd/MM/yyyy")}"
DtDatosDevolucion = DtDatos.Copy()
End If
CargarCaducidadProducto(e.Row.DataKey("CvePS").ToEntero, e.Row.FCDropDownList("DdlCaducidadProducto"), ValorAsignado)
CargarCaducidadProducto(e.Row.DataKey("CvePS").ToEntero, e.Row.FCDropDownList("DdlCaducidadProducto"), ValorAsignado, DtDatosDevolucion)
End If
@@ -1286,7 +1288,7 @@ Partial Class Inventarios_EntregaAlmacen
End Sub
Private Sub CargarCaducidadProducto(CvePS As Integer, ByRef DdlLoteFechaCaducidad As DropDownList, ValorAsignado As String)
Private Sub CargarCaducidadProducto(CvePS As Integer, ByRef DdlLoteFechaCaducidad As DropDownList, ValorAsignado As String, DtDatosDevolucion As DataTable)
DdlLoteFechaCaducidad.Items.Clear()
DdlLoteFechaCaducidad.Items.Add(New ListItem("-", "|"))
@@ -1295,13 +1297,20 @@ Partial Class Inventarios_EntregaAlmacen
almacenes = "-1"
End If
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
For Each dr As DataRow In ObjInventarios.DtResultados.FiltraParametros("", DistinctColumns:={"Lote", "FechaCaducidad"}).Rows
If DtDatosDevolucion IsNot Nothing Then
For Each dr As DataRow In DtDatosDevolucion.FiltraParametros($"CvePS = {CvePS}", DistinctColumns:={"Lote", "FechaCaducidad"}).Rows
DdlLoteFechaCaducidad.Items.Add(New ListItem($"Lote: {dr("Lote").ToString} - Cad: {dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}", $"{dr("Lote").ToString}|{dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"))
Next
Else
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
For Each dr As DataRow In ObjInventarios.DtResultados.FiltraParametros("", DistinctColumns:={"Lote", "FechaCaducidad"}).Rows
DdlLoteFechaCaducidad.Items.Add(New ListItem($"Lote: {dr("Lote").ToString} - Cad: {dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}", $"{dr("Lote").ToString}|{dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"))
Next
End If
ObjInventarios.Dispose()
End If
ObjInventarios.Dispose()
If Not String.IsNullOrEmpty(ValorAsignado) Then
DdlLoteFechaCaducidad.SelectedValueExist(ValorAsignado)