mejoras lote/caducidad
This commit is contained in:
@@ -832,9 +832,11 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Serie = If(dr("Serie").ToString = "", "-1", dr("Serie").ToString)
|
||||
Lote = If(dr("Lote").ToString = "", "-1", dr("Lote").ToString)
|
||||
FechaCaducidad = If(dr("FechaCaducidad").ToString = "", MinFecha, dr("FechaCaducidad").ToString.ToDate)
|
||||
Dim tLote As String = If(Lote <> "-1", String.Format("AND Lote = '{0}' ", Lote), "")
|
||||
Dim tFechaCaducidad As String = If(FechaCaducidad > MinFecha, String.Format("AND FechaCaducidad = '{0}' ", FechaCaducidad), "")
|
||||
|
||||
Dim ExistenciaEspecificada As Decimal = 0
|
||||
CantidadenGrid = DtMovimientos.SUMD("Cantidad", $"CvePS = {dr("CvePS").ToString.ToEntero} AND CveUM = {dr("CveUM").ToString.ToEntero} {If(dr("Serie").ToString <> "-1", $" AND Serie = '{dr("Serie").ToString}'", "")}")
|
||||
CantidadenGrid = DtMovimientos.SUMD("Cantidad", String.Format("CvePS = {0} AND CveUM = {1} {2} {3} {4} ", dr("CvePS"), dr("CveUM"), If(Not dr("Serie").ToString.Contiene("-1", ""), $" AND Serie = '{dr("Serie")}'", ""), tLote, tFechaCaducidad))
|
||||
Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=1)
|
||||
Existencia -= CantidadenGrid
|
||||
'DtMovimientos.SUM("Cantidad", String.Format("CvePS = {0}", dr("CvePS").ToString.ToEntero))
|
||||
@@ -2798,6 +2800,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
DtExcel.Columns.Add(New DataColumn("Codigo", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("Producto", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("Serie", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("Lote", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("FechaCaducidad", GetType(Date)))
|
||||
DtExcel.Columns.Add(New DataColumn("Observaciones", GetType(String)))
|
||||
|
||||
DtExcel.TableName = "Traspaso"
|
||||
@@ -2856,7 +2860,15 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Alert("El nombre de la cuarta columna debe ser 'Serie'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(4).ColumnName = "Observaciones" Then
|
||||
If Not dt.Columns(4).ColumnName = "Lote" Then
|
||||
Alert("El nombre de la cuarta columna debe ser 'Lote'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(5).ColumnName = "FechaCaducidad" Then
|
||||
Alert("El nombre de la cuarta columna debe ser 'Fecha Caducidad'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(6).ColumnName = "Observaciones" Then
|
||||
Alert("El nombre de la quinta columna debe ser 'Observaciones'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -2879,9 +2891,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
Dim Cantidad As Double = RowExcel("Cantidad").ToString().ToDecimal()
|
||||
Dim Serie As String = RowExcel("Serie").ToString()
|
||||
Dim Lote As String = If(RowExcel("Lote").ToString() = "", "-1", RowExcel("Lote").ToString())
|
||||
Dim FechaCaducidad As Date = If(RowExcel("FechaCaducidad").ToString <> "", MinFecha, RowExcel("FechaCaducidad").ToString.ToDate)
|
||||
Dim Observaciones As String = RowExcel("Observaciones").ToString()
|
||||
Dim FechaCaducidad As Date = MinFecha
|
||||
Dim Lote As String = "-1"
|
||||
|
||||
If CveProducto > 0 Then
|
||||
|
||||
@@ -2911,7 +2923,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End If
|
||||
|
||||
If Valido Then
|
||||
AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(Not String.IsNullOrEmpty(Serie), Serie, ""), Limpia:=False)
|
||||
AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(Not String.IsNullOrEmpty(Serie), Serie, ""), Lote:=Lote, FechaCaducidad:=FechaCaducidad, Limpia:=False)
|
||||
RowsCargados = RowsCargados + 1
|
||||
Else
|
||||
RowsNoCargados = RowsNoCargados + 1
|
||||
|
||||
Reference in New Issue
Block a user