-- bitacora de carga. que se guarde en un xml, las series que se vayan registrando, y se puedan recuperar. en acciones, cargar bitácora
This commit is contained in:
@@ -17,6 +17,13 @@
|
||||
<li>
|
||||
<asp:HyperLink ID="HlAgregarExcel" NavigateUrl="#" Visible="true" data-toggle="modal" data-target="#DivCargaExcel" runat="server"><i class='fa fa-server'></i> Cargar Excel</asp:HyperLink>
|
||||
</li>
|
||||
|
||||
<asp:UpdatePanel ID="uppCargaBitacora" runat="server" UpdateMode="Conditional" RenderMode="Inline"><ContentTemplate>
|
||||
<li>
|
||||
<asp:Linkbutton ID="HplCargaBitacora" runat="server" Visible="false" OnClick="HplCargaBitacora_Click" Style="color: #686868;"><i class="fa fa-file-load-o" style="color: #686868;"></i> Cargar Bitácora</asp:Linkbutton>
|
||||
</li>
|
||||
</ContentTemplate></asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Recepción Almacén
|
||||
|
||||
@@ -144,14 +144,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
ViewState("CantidadTotal") = 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 PUSerie As Decimal
|
||||
Get
|
||||
Return CType(ViewState("PUSerie"), Decimal)
|
||||
@@ -416,15 +409,22 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
ViewState("ValidarRecepcionUsados") = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'Private Property DtDocumentos As DataTable
|
||||
' Get
|
||||
' Return CType(ViewState("DtDocumentos"), DataTable)
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' ViewState("DtDocumentos") = 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
|
||||
|
||||
@@ -480,7 +480,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
TipoMovimiento = 1
|
||||
RealizarTraspasoAlmacenDevolucion = False
|
||||
CantidadTotal = 0
|
||||
IndexSeccionAlmacen = 0
|
||||
|
||||
ddlAlmacenAdd.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen NOT IN (9)")
|
||||
ddlAlmacenAdd.DataBind()
|
||||
@@ -549,15 +548,23 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
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
|
||||
|
||||
UpGenerales.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
Recargaporalmacenes()
|
||||
End Sub
|
||||
|
||||
Private Sub RecargaporAlmacenes()
|
||||
|
||||
If DdlAlmacen.SelectedValue <> "-1" Then
|
||||
|
||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.selectedvalue.toentero).FiltroPrimeroValor("CveSubProyecto").ToEntero
|
||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToEntero
|
||||
'RMF condición temporal
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
|
||||
ValidaLoteCaducidad = True
|
||||
@@ -997,6 +1004,16 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim NumProductos = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = False").ToEntero()
|
||||
Dim CveSubProyecto As Integer
|
||||
|
||||
ArchivoBitacora = String.Format("{0}Temp\RecepcionDT_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, pCveCompra)
|
||||
ArchivoBitacoraDetalle = String.Format("{0}Temp\RecepcionDTD_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, pCveCompra)
|
||||
If ArchivoBitacora <> "" Then
|
||||
Dim Archivo = New System.IO.FileInfo(ArchivoBitacora)
|
||||
If Archivo.Exists() Then
|
||||
HplCargaBitacora.Visible = True
|
||||
uppCargaBitacora.Update()
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
'SI LA COMPRA TIENE PRODUCTOS Y USADOS SOLO MOSTRAR LOS PRODUCTOS
|
||||
If NumProductos > 0 AndAlso NumUsados > 0 Then
|
||||
@@ -1100,7 +1117,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
CveCliente = DtRecepcion.Rows(0)("CveCliente").ToString.ToEntero
|
||||
CveVendedor = DtRecepcion.Rows(0)("CveVendedor").ToString.ToEntero
|
||||
|
||||
|
||||
If DtInv.COUNT("EntregaDirecta") <> DtInv.Rows.Count Then
|
||||
Alert("Todos los conceptos deben estar facturados.", TipoMensaje.MsgAdvertencia)
|
||||
BtnGuardar.Enabled = False
|
||||
@@ -1166,8 +1182,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
DivBitacora.Visible = True
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then
|
||||
@@ -1181,7 +1195,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
BtnGuardar.Visible = False
|
||||
End If
|
||||
|
||||
|
||||
ObjCompras.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
|
||||
@@ -1392,22 +1405,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
GvInv.Columns(14).Visible = True
|
||||
End If
|
||||
|
||||
'For Each item As DataRow In DtInv.Rows
|
||||
' Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, item("CvePS").ToString.ToEntero).FiltroPrimero("")
|
||||
' If Dr IsNot Nothing Then
|
||||
' item("AplicaSeccion") = CBool(Dr("AplicaSeccion"))
|
||||
' If CBool(Dr("AplicaSeccion")) Then GvInv.Columns(10).Visible = True
|
||||
' item("AplicaSerie") = CBool(Dr("AplicaSerie"))
|
||||
' item("AplicaLote") = CBool(Dr("AplicaLote"))
|
||||
' If CBool(Dr("AplicaLote")) Then GvInv.Columns(11).Visible = True
|
||||
' item("AplicaCaducidad") = CBool(Dr("AplicaCaducidad"))
|
||||
' If CBool(Dr("AplicaCaducidad")) Then GvInv.Columns(12).Visible = True
|
||||
' If CBool(Dr("AplicaSeccion")) Or CBool(Dr("AplicaLote")) Or CBool(Dr("AplicaCaducidad")) Or CBool(Dr("AplicaSerie")) Then
|
||||
' GvInv.Columns(15).Visible = True
|
||||
' End If
|
||||
' End If
|
||||
'Next
|
||||
|
||||
GvInv.DataSource = DtInv
|
||||
GvInv.DataBind()
|
||||
UPInv.Update()
|
||||
@@ -1501,7 +1498,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
End If
|
||||
|
||||
|
||||
e.Row.FCButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtDividir").ClientID))
|
||||
e.Row.FCButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString
|
||||
e.Row.FCTextBox("TxtDividir").Attributes.Add("onkeyup", String.Format("LimitaCantidad({0},this,'{1}');", e.Row.DBCampo("CantidadF"), e.Row.FCButton("BtnDividir").ClientID))
|
||||
@@ -1694,20 +1690,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
'RegistraScript("document.getElementById(""TxtSerie"").focus();")
|
||||
RegistraScript("$('#DivSerie').modal();", "ModalLote")
|
||||
|
||||
'Dim AplicaCaducidad = False
|
||||
'If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0) IsNot Nothing Then
|
||||
' AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False)
|
||||
'End If
|
||||
|
||||
'If AplicaCaducidad Then
|
||||
' GvSerie.Columns(1).Visible = True
|
||||
' TdCaducidad1.Visible = True
|
||||
' TdCaducidad2.Visible = True
|
||||
'Else
|
||||
' GvSerie.Columns(1).Visible = False
|
||||
' TdCaducidad1.Visible = False
|
||||
' TdCaducidad2.Visible = False
|
||||
'End If
|
||||
|
||||
GvSerie.DataSource = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC")
|
||||
GvSerie.DataBind()
|
||||
@@ -1859,6 +1841,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Row("FechaCaducidad") = MinFecha.ToShortDateString
|
||||
|
||||
DtDatosDetalle.Rows.Add(Row)
|
||||
ActualizaBitacora()
|
||||
End If
|
||||
Next
|
||||
ObjInventarios.Dispose()
|
||||
@@ -1881,6 +1864,40 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "Bitacora"
|
||||
Private Sub ActualizaBitacora(Optional Eliminar As Boolean = False)
|
||||
If Not Eliminar Then
|
||||
DtInv.TableName = "DtDatos"
|
||||
DtDatosDetalle.TableName = "DtDatosDetalle"
|
||||
DtInv.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()
|
||||
DtInv.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
|
||||
CargaGVInv()
|
||||
|
||||
Else
|
||||
Alert("No hay bitácora para recuperar.", TipoMensaje.ToastInformacion)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Protected Sub GvSerie_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvSerie.RowDeleting
|
||||
Dim keySerieLote As String = e.Keys("Serie").ToString
|
||||
Try
|
||||
@@ -1894,6 +1911,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End Try
|
||||
|
||||
DtDatosDetalle.AcceptChanges()
|
||||
ActualizaBitacora()
|
||||
CargaSerie(1)
|
||||
End Sub
|
||||
|
||||
@@ -4971,68 +4989,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
#End Region
|
||||
|
||||
'Protected Sub BtnGuardarDocumento_Click(sender As Object, e As EventArgs)
|
||||
|
||||
' Dim Filesgral As List(Of Archivo) = TxtDocumento.getfiles().Archivos
|
||||
' If Filesgral Is Nothing OrElse Filesgral.Count = 0 Then
|
||||
' Alert("No se agregó ningun archivo", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' If DtDocumentos Is Nothing Then
|
||||
' DtDocumentos = New DataTable()
|
||||
|
||||
' Dim column As DataColumn = New DataColumn("No")
|
||||
' column.DataType = Type.GetType("System.Int32")
|
||||
' With column
|
||||
' .AutoIncrement = True
|
||||
' .AutoIncrementSeed = 1
|
||||
' .AutoIncrementStep = 1
|
||||
' End With
|
||||
|
||||
' DtDocumentos.Columns.Add(column)
|
||||
' DtDocumentos.Columns.Add("DocumentoOrignal", GetType(String))
|
||||
' DtDocumentos.Columns.Add("Documento", GetType(String))
|
||||
' DtDocumentos.Columns.Add("FileExtension", GetType(String))
|
||||
' End If
|
||||
|
||||
' Dim row As DataRow = DtDocumentos.NewRow()
|
||||
|
||||
' Dim archivo = Filesgral.FirstOrDefault()
|
||||
|
||||
' row("DocumentoOrignal") = archivo.filenameO
|
||||
' row("Documento") = archivo.filename
|
||||
' row("FileExtension") = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, archivo.filename))
|
||||
|
||||
' DtDocumentos.Rows.Add(row)
|
||||
|
||||
' 'GvDocumentos.DataSource = DtDocumentos
|
||||
' 'GvDocumentos.DataBind()
|
||||
|
||||
' UpDocumentos.Update()
|
||||
|
||||
' RegistraScript("$('#ModalBitacoraDoc').modal('hide');")
|
||||
'End Sub
|
||||
'Protected Sub LnkEliminarDoc_Click(sender As Object, e As EventArgs)
|
||||
' Dim lnkRemove As LinkButton = DirectCast(sender, LinkButton)
|
||||
|
||||
' If DtDocumentos.Rows.Count > 0 And lnkRemove.CommandArgument.ToString.Length > 0 Then
|
||||
' Dim i As Integer
|
||||
' i = lnkRemove.CommandArgument.ToString.ToEntero
|
||||
' Dim Drs As DataRow() = DtDocumentos.Select(String.Format("No = {0}", i))
|
||||
' If Drs.Count > 0 Then
|
||||
|
||||
' Drs(0).Delete()
|
||||
' End If
|
||||
' DtDocumentos.AcceptChanges()
|
||||
' End If
|
||||
|
||||
' 'GvDocumentos.EditIndex = -1
|
||||
|
||||
' 'GvDocumentos.DataSource = DtDocumentos
|
||||
' 'GvDocumentos.DataBind()
|
||||
'End Sub
|
||||
|
||||
Private Function GuardaDocumentoBitacora(ObjEventoBitacora As ClsOIEventos, CveMovimiento As Integer) As Boolean
|
||||
Dim Retorno = True
|
||||
Dim Archivo As System.IO.FileInfo = Nothing
|
||||
|
||||
Reference in New Issue
Block a user