No usar complementaria 13,83

This commit is contained in:
Oscar Irigoyen
2023-02-07 17:36:15 -07:00
parent 445b76e50b
commit 4aeca5afb6
6 changed files with 99 additions and 35 deletions

View File

@@ -293,6 +293,24 @@ Partial Class Inventarios_EntregaAlmacen
End Set
End Property
Private Property CargaBitacora As Boolean
Get
If ViewState("CargaBitacora") Is Nothing Then
ViewState("CargaBitacora") = False
End If
Return Boolean.Parse(ViewState("CargaBitacora").ToString)
End Get
Set(value As Boolean)
ViewState("CargaBitacora") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -932,7 +950,11 @@ Partial Class Inventarios_EntregaAlmacen
'SugerirFecha()
If DdlAlmacen.SelectedValue.ToEntero > 0 And CveVentaSurtir > 0 Then
CargaVentaPorSurtir(CveVentaSurtir, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero)
' SugiereLoteCaducidad(DdlAlmacen.SelectedValue.ToEntero)
If CargaBitacora Then
CargaBitacoraSerie()
End If
End If
End If
GvDatos.DataSource = DtDatos
@@ -1283,26 +1305,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
@@ -1364,23 +1386,35 @@ Partial Class Inventarios_EntregaAlmacen
Protected Sub HplCargaBitacora_Click(sender As Object, e As EventArgs)
CargaBitacora = False
If IO.File.Exists(ArchivoBitacora) Then
'DtInv.Clear()
'DtDatosDetalle.Clear()
CargaBitacoraSerie()
CargaGvDatos()
CargaBitacora = True
Else
Alert("No hay bitácora para recuperar.", TipoMensaje.ToastInformacion)
End If
End Sub
Private Sub CargaBitacoraSerie()
If IO.File.Exists(ArchivoBitacora) Then
DtDatos.ReadXml(ArchivoBitacora)
If IO.File.Exists(ArchivoBitacoraDetalle) Then
Dim dtt As New DataTable
dtt.ReadXml(ArchivoBitacoraDetalle)
DtDatosDetalle = dtt
Alert("Registro(s) Recuperados", TipoMensaje.ToastInformacion)
End If
CargaGvDatos()
End If
Else
Alert("No hay bitácora para recuperar.", TipoMensaje.ToastInformacion)
End If
End Sub
#End Region
#Region " AGREGA CON LOTE BATCH "
@@ -3020,6 +3054,10 @@ Partial Class Inventarios_EntregaAlmacen
Limpia()
CargaPendientes()
LimpiaCampos()
CargaBitacora = False
Else
ObjInventario.RollBack()
Alert(TextoError.ToString(), TipoMensaje.MsgError)
@@ -3452,6 +3490,9 @@ Partial Class Inventarios_EntregaAlmacen
Limpia()
LimpiaCampos()
CargaPendientes()
CargaBitacora = False
Else
Alert(TextoError, TipoMensaje.MsgError)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")