Verificar existencias al agregar series
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user