diff --git a/Inventarios/EntregaAlmacen.aspx b/Inventarios/EntregaAlmacen.aspx index d23155cc2..4a3ee93ec 100644 --- a/Inventarios/EntregaAlmacen.aspx +++ b/Inventarios/EntregaAlmacen.aspx @@ -48,6 +48,14 @@ Entrega Almacén (Surtir Mercancia) + + +
  • + Cargar Bitácora +
  • +
    +
    +
  • diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index ef402e041..bbe6bc894 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -268,7 +268,30 @@ Partial Class Inventarios_EntregaAlmacen ViewState("FormaPaqueteria") = value End Set End Property - + 'Private Property IndexSeccionAlmacen As Integer + ' Get + ' Return CType(ViewState("IndexSeccionAlmacen"), Integer) + ' End Get + ' Set(value As Integer) + ' ViewState("IndexSeccionAlmacen") = value + ' End Set + 'End Property + Private Property ArchivoBitacora As String + Get + Return CType(ViewState("ArchivoBitacora"), String) + End Get + Set(value As String) + ViewState("ArchivoBitacora") = value + End Set + End Property + Private Property ArchivoBitacoraDetalle As String + Get + Return CType(ViewState("ArchivoBitacoraDetalle"), String) + End Get + Set(value As String) + ViewState("ArchivoBitacoraDetalle") = value + End Set + End Property #End Region @@ -318,7 +341,10 @@ Partial Class Inventarios_EntregaAlmacen DdlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1")) DdlAlmacen.SelectedValue = "-1" DdlAlmacen.DataBind() - DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen) + If UsuarioActual.CveAlmacen > 0 Then + DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen) + RecargaporAlmacenes() + End If DdlAlmacenTransitorio.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 3) DdlAlmacenTransitorio.DataBind() @@ -551,6 +577,15 @@ Partial Class Inventarios_EntregaAlmacen If ObjInventario.EntregaAlmacenGet(CveVenta, CveAlmacen) Then If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then + ArchivoBitacora = String.Format("{0}Temp\EntregaDT_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, CveVenta) + ArchivoBitacoraDetalle = String.Format("{0}Temp\EntregaDTD_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, CveVenta) + If ArchivoBitacora <> "" Then + Dim Archivo = New System.IO.FileInfo(ArchivoBitacora) + If Archivo.Exists() Then + HplCargaBitacora.Visible = True + uppCargaBitacora.Update() + End If + End If DtDatos = ObjInventario.DtResultados If Not DtDatos.Columns.Contains("Consec") Then DtDatos.Columns.Add("Consec", GetType(Integer)) @@ -1280,6 +1315,7 @@ Partial Class Inventarios_EntregaAlmacen Row("FechaCaducidad") = If(AplicaCaducidad, TxtFechaCaducidad.Text, MinFecha.ToShortDateString) DtDatosDetalle.Rows.Add(Row) + ActualizaBitacora() RegistraScript("playsonidito('beep-07.wav')", "Sonidito") If Tipo = 1 Then @@ -1307,11 +1343,44 @@ Partial Class Inventarios_EntregaAlmacen End Try DtDatosDetalle.AcceptChanges() + ActualizaBitacora() CargaSerie() End Sub #End Region +#Region "Bitacora" + Private Sub ActualizaBitacora(Optional Eliminar As Boolean = False) + If Not Eliminar Then + DtDatos.TableName = "DtDatos" + DtDatosDetalle.TableName = "DtDatosDetalle" + DtDatos.WriteXml(ArchivoBitacora, XmlWriteMode.WriteSchema) + DtDatosDetalle.WriteXml(ArchivoBitacoraDetalle, XmlWriteMode.WriteSchema) + Else + File.Delete(ArchivoBitacora) + End If + End Sub + + Protected Sub HplCargaBitacora_Click(sender As Object, e As EventArgs) + + If IO.File.Exists(ArchivoBitacora) Then + 'DtInv.Clear() + 'DtDatosDetalle.Clear() + 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() + + Else + Alert("No hay bitácora para recuperar.", TipoMensaje.ToastInformacion) + End If + + End Sub +#End Region #Region " AGREGA CON LOTE BATCH " Private Sub CreaDtDetalleLote() @@ -3894,7 +3963,11 @@ Partial Class Inventarios_EntregaAlmacen RegistraScript("$('#ModalVerSugerencias').modal('hide')") End Sub - Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacen.SelectedIndexChanged + Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs) 'Handles DdlAlmacen.SelectedIndexChanged + RecargaporAlmacenes() + End Sub + + Private Sub RecargaporAlmacenes() If DdlAlmacen.SelectedValue <> "-1" Then CargaGvDatos(DdlAlmacen.SelectedValue.ToEntero) End If diff --git a/Inventarios/RecepcionAlmacen.aspx b/Inventarios/RecepcionAlmacen.aspx index bdd49fea6..35fdb222e 100644 --- a/Inventarios/RecepcionAlmacen.aspx +++ b/Inventarios/RecepcionAlmacen.aspx @@ -17,13 +17,15 @@
  • Cargar Excel
  • - - -
  • - Cargar Bitácora + + + +
  • + Cargar Bitácora
  • -
    - + + +
    Recepción Almacén