Verificar existencias al agregar series

This commit is contained in:
2023-07-10 16:53:59 -07:00
parent 09dff8f1f2
commit c93fa4f73d

View File

@@ -1307,26 +1307,26 @@ Partial Class Inventarios_EntregaAlmacen
'Valida Existencia
'If TipoMovimiento = 1 Then
' Dim ObjInventarios As New ClsInventarios
' Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero(), FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=If(TipoEntrega = 2, 1, -1))
' If Existencia < 1 Then
' Alert($"No hay existencia suficiente del producto <b>""{PSSerie}""</b> con la Serie definida <b>""{Serie}""</b>. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia, If(Tipo = 2, "window.setTimeout(Focus,200);", ""))
' RegistraScript("playsonidito('142608__autistic-lucario__error.wav')", "Error2")
' ObjInventarios.Dispose()
' Exit Sub
' End If
' ObjInventarios.Dispose()
'Else
' If DtExistencias IsNot Nothing Then
' Dim Existencia = DtExistencias.SUM("Cantidad", $"CvePS = {CvePSSerie} AND CveUM = {CveUMSerie} AND Serie = '{Serie}'")
' If Existencia < 1 Then
' Alert($"No hay existencia suficiente del producto <b>""{PSSerie}""</b> con la Serie definida <b>""{Serie}""</b>. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia, If(Tipo = 2, "window.setTimeout(Focus,200);", ""))
' RegistraScript("playsonidito('142608__autistic-lucario__error.wav')", "Error3")
' Exit Sub
' End If
' End If
'End If
If TipoMovimiento = 1 Then
Dim ObjInventarios As New ClsInventarios
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero(), FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=If(TipoEntrega = 2, 1, -1))
If Existencia < 1 Then
Alert($"No hay existencia suficiente del producto <b>""{PSSerie}""</b> con la Serie definida <b>""{Serie}""</b>. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia, If(Tipo = 2, "window.setTimeout(Focus,200);", ""))
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')", "Error2")
ObjInventarios.Dispose()
Exit Sub
End If
ObjInventarios.Dispose()
Else
If DtExistencias IsNot Nothing Then
Dim Existencia = DtExistencias.SUM("Cantidad", $"CvePS = {CvePSSerie} AND CveUM = {CveUMSerie} AND Serie = '{Serie}'")
If Existencia < 1 Then
Alert($"No hay existencia suficiente del producto <b>""{PSSerie}""</b> con la Serie definida <b>""{Serie}""</b>. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia, If(Tipo = 2, "window.setTimeout(Focus,200);", ""))
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')", "Error3")
Exit Sub
End If
End If
End If
Dim Row = DtDatosDetalle.NewRow