-- cambios Series,Lote,Caducidad
This commit is contained in:
@@ -200,7 +200,7 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
dt.Columns.Add("PS")
|
||||
dt.Columns.Add("Estatus")
|
||||
dt.Columns.Add("Codigo")
|
||||
dt.Columns.Add("SerieLote")
|
||||
dt.Columns.Add("Serie")
|
||||
dt.Columns.Add("Observaciones")
|
||||
dt.Columns.Add("CvePersonal", Type.GetType("System.Int32"))
|
||||
dt.Columns.Add("Checado", Type.GetType("System.Boolean"))
|
||||
@@ -347,12 +347,12 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
Private Sub VerificaProducto()
|
||||
If DdlProducto2.SelectedValue.ToEntero > 0 Then
|
||||
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltraParametros("Inv_CveMetodoInventario = 5", "PS").Rows.Count > 0 Then
|
||||
ThSerieLote.Visible = True
|
||||
TrSerieLote.Visible = True
|
||||
TxtnSerieLote.Visible = True
|
||||
ThSerie.Visible = True
|
||||
TrSerie.Visible = True
|
||||
TxtnSerie.Visible = True
|
||||
GvM.Columns(4).Visible = True
|
||||
Else
|
||||
TxtnSerieLote.Visible = False
|
||||
TxtnSerie.Visible = False
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -380,9 +380,9 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
|
||||
|
||||
#Region " EISTENCIAS "
|
||||
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional SerieLote As String = "-1") As Double
|
||||
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional Serie As String = "-1") As Double
|
||||
Dim Inv As New ClsInventarios
|
||||
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=SerieLote)
|
||||
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie)
|
||||
Inv.Dispose()
|
||||
Return Existencia
|
||||
End Function
|
||||
@@ -398,15 +398,15 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
Dim PSSelected As Integer = DdlProducto2.SelectedValue.ToEntero
|
||||
If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgInformacion) : Exit Sub
|
||||
If PSSelected > 0 Then
|
||||
If TxtnSerieLote.Visible Then
|
||||
If TxtnSerieLote.Text = "" Then
|
||||
If TxtnSerie.Visible Then
|
||||
If TxtnSerie.Text = "" Then
|
||||
Alert("Serie-Lote es necesario", TipoMensaje.MsgAdvertencia)
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
Dim Valido As Boolean = True
|
||||
Dim cantidadd As Double = txtCantidad.Text.ToDouble
|
||||
Dim Existencia As Double = GetExistencias(PSSelected, DdlUnidad.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, If(TxtnSerieLote.Visible, TxtnSerieLote.Text, "-1").ToString)
|
||||
Dim Existencia As Double = GetExistencias(PSSelected, DdlUnidad.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, If(TxtnSerie.Visible, TxtnSerie.Text, "-1").ToString)
|
||||
If Existencia - txtCantidad.Text.ToDouble < 0 Then
|
||||
If Existencia <= 0 Then
|
||||
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
|
||||
@@ -431,7 +431,7 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
registro.Item("CvePS") = PSSelected
|
||||
registro.Item("PS") = DdlProducto2.SelectedText
|
||||
registro.Item("Estatus") = ""
|
||||
registro.Item("SerieLote") = TxtnSerieLote.Text
|
||||
registro.Item("Serie") = TxtnSerie.Text
|
||||
registro.Item("Observaciones") = TxtObservacionesdetalle.Text
|
||||
DtMovimientos.Rows.Add(registro)
|
||||
CargaGvM()
|
||||
@@ -453,14 +453,14 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
#Region " GvM "
|
||||
Private Sub CargaGvM()
|
||||
|
||||
ThSerieLote.Visible = False
|
||||
TrSerieLote.Visible = False
|
||||
TxtnSerieLote.Visible = False
|
||||
ThSerie.Visible = False
|
||||
TrSerie.Visible = False
|
||||
TxtnSerie.Visible = False
|
||||
GvM.Columns(4).Visible = False
|
||||
For Each Dr As DataRow In DtMovimientos.Rows
|
||||
If Dr("SerieLote").ToString <> "" Then
|
||||
ThSerieLote.Visible = True
|
||||
TrSerieLote.Visible = True
|
||||
If Dr("Serie").ToString <> "" Then
|
||||
ThSerie.Visible = True
|
||||
TrSerie.Visible = True
|
||||
GvM.Columns(4).Visible = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -670,8 +670,8 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
Dim Existencia As Double
|
||||
TextoExistencia.Append("Los siguiente productos se ajustaron por falta de exitencia:<br/>")
|
||||
For Each dr As DataRow In DtMovimientos.Rows
|
||||
Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), SerieLote:=If(dr("SerieLote").ToString = "", "-1", dr("SerieLote").ToString))
|
||||
Existencia -= DtMovimientos.SUM("Cantidad", $"CvePS = {dr("CvePS").ToString.ToEntero} AND CveUM = {dr("CveUM").ToString.ToEntero} {If(dr("SerieLote").ToString <> "-1", $" AND SerieLote = '{dr("SerieLote").ToString}'", "")}")
|
||||
Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), Serie:=If(dr("Serie").ToString = "", "-1", dr("Serie").ToString))
|
||||
Existencia -= DtMovimientos.SUM("Cantidad", $"CvePS = {dr("CvePS").ToString.ToEntero} AND CveUM = {dr("CveUM").ToString.ToEntero} {If(dr("Serie").ToString <> "-1", $" AND Serie = '{dr("Serie").ToString}'", "")}")
|
||||
|
||||
If Existencia < 0 Then
|
||||
ErrorExistencia = True
|
||||
|
||||
Reference in New Issue
Block a user