Cambios pendientes por liberar
This commit is contained in:
@@ -2695,12 +2695,16 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
If TipoMovimiento = 1 Then
|
||||
CveConceptoMovimientoVirtual = 37
|
||||
|
||||
ElseIf TipoMovimiento = 2 Then
|
||||
ValidaVirtual = True
|
||||
CveConceptoMovimientoVirtual = 36
|
||||
End If
|
||||
|
||||
'SI NO TIENE ALMACEN VIRTUAL ASIGNADO NO GENERA EL MOVIMIENTO VIRTUAL
|
||||
If CveAlmacenVirtual <= 0 Then
|
||||
ValidaVirtual = False
|
||||
End If
|
||||
|
||||
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
||||
Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveMovimientoRelacionado:=CveMovimientoRelacionadoVirtual, Modulo:="RE/G6")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -403,6 +403,15 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
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
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
@@ -967,10 +976,12 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
CargaSoloUsados = True
|
||||
SumarImporteUsados = True
|
||||
DtRecepcion = ObjInventario.DtResultados.Copy()
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
CargaAlmacenes(-1, "22", CveTipoCompra)
|
||||
Else
|
||||
CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra)
|
||||
If TipoMovimiento <> 3 Then 'sino es devolucion/NC
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
CargaAlmacenes(-1, "22", CveTipoCompra)
|
||||
Else
|
||||
CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
DtRecepcion = ObjInventario.DtResultados.Copy()
|
||||
@@ -1007,6 +1018,10 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
DivTraspasoDevolucion.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(594) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(314) Then
|
||||
DivDocumentos.Visible = True
|
||||
End If
|
||||
|
||||
DtDatosDetalle = Nothing
|
||||
CreaDtDetalle()
|
||||
DtDatosLoteDetalle = Nothing
|
||||
@@ -1124,6 +1139,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
ObjInventario.Dispose()
|
||||
|
||||
CargaGVInv()
|
||||
|
||||
UpDocumentos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaImportacionSurtir(pCveImportacion As Integer)
|
||||
@@ -2177,6 +2194,14 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(594) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(314) Then
|
||||
Dim Filesgral As List(Of Archivo) = TxtDocumento.getfiles().Archivos
|
||||
If Filesgral Is Nothing OrElse Filesgral.Count = 0 Then
|
||||
Alert("Es necesario agregar un documento.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||
@@ -2755,41 +2780,45 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
tCveAlmacen = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen").ToEntero()
|
||||
End If
|
||||
|
||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
DtPSVirtual = ObjInventario.DtResultados
|
||||
End If
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=tCveAlmacen).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
|
||||
|
||||
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then
|
||||
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero()
|
||||
|
||||
Dim CveTipoAlmacenFiltro As Integer = If(CveTipoCompra = 9, 25, 24)
|
||||
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=tCveAlmacen).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
|
||||
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G4")
|
||||
FolioVirtual = ObjInventario.Folio
|
||||
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If SumarImporteUsados Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
|
||||
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
|
||||
End If
|
||||
'VERIFICA SI TIENE ALMACEN VIRTUAL
|
||||
If CveAlmacenVirtual > 0 Then
|
||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
DtPSVirtual = ObjInventario.DtResultados
|
||||
End If
|
||||
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then
|
||||
|
||||
Dim CveTipoAlmacenFiltro As Integer = If(CveTipoCompra = 9, 25, 24)
|
||||
|
||||
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G4")
|
||||
FolioVirtual = ObjInventario.Folio
|
||||
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If SumarImporteUsados Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
|
||||
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'DEVENGAR AC
|
||||
@@ -3449,6 +3478,15 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'DOCUMENTOS RELACIONADOS AL MOVIMIENTO
|
||||
If Not ErrorMovInv AndAlso UsuarioActual.Empresa.Funcionalidad(594) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(314) Then
|
||||
If Not ErrorMovInv AndAlso Not GuardaDocumentoBitacora(ObjBitacora, CveMovimiento) Then
|
||||
ErrorMovInv = True
|
||||
Alert("Ocurrió un error al guardar los datos adjuntos de la bitácora", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al guardar RA.", ex)
|
||||
ErrorMovInv = True
|
||||
@@ -3862,6 +3900,18 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
HLFolio.NavigateUrl = "#"
|
||||
LbProveedor.Text = ""
|
||||
LbDescripcionCompra.Text = ""
|
||||
DivDocumentos.Visible = False
|
||||
|
||||
'If DtDocumentos IsNot Nothing Then
|
||||
' DtDocumentos.Clear()
|
||||
' TxtDocumento.Text = ""
|
||||
|
||||
' 'GvDocumentos.DataSource = DtDocumentos
|
||||
' 'GvDocumentos.DataBind()
|
||||
'End If
|
||||
|
||||
UpDocumentos.Update()
|
||||
|
||||
UpDatosCompra.Update()
|
||||
CargaPendientes()
|
||||
|
||||
@@ -4518,6 +4568,131 @@ 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
|
||||
|
||||
Dim Filesgral As List(Of Archivo) = TxtDocumento.getfiles().Archivos
|
||||
|
||||
Dim archivoOriginal = Filesgral.FirstOrDefault()
|
||||
Dim Bitacora As String = ""
|
||||
|
||||
If Not String.IsNullOrEmpty(TxtObservaciones.Text) Then
|
||||
Bitacora = TxtObservaciones.Text
|
||||
Else
|
||||
Bitacora = "Documento Relacionado"
|
||||
End If
|
||||
|
||||
If ObjEventoBitacora.AddEventoBitacora(Bitacora, String.Format(".{0}", archivoOriginal.Extencion), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveMovimientoAlmacen:=CveMovimiento) Then
|
||||
Try
|
||||
If archivoOriginal.filename <> "" Then
|
||||
Archivo = New System.IO.FileInfo(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, archivoOriginal.filename))
|
||||
If Archivo.Exists() Then
|
||||
File.Move(Archivo.ToString, String.Format("{0}OI\OI{1}{2}", UsuarioActual.Empresa.Ruta, ObjEventoBitacora.CveEvento.ToString, Archivo.Extension))
|
||||
Else
|
||||
Retorno = False
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Retorno = False
|
||||
End Try
|
||||
Else
|
||||
Retorno = False
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
'Private Function GuardaDocumentoBitacora(ObjEventoBitacora As ClsOIEventos, CveMovimiento As Integer) As Boolean
|
||||
' Dim Retorno = True
|
||||
' Dim Archivo As System.IO.FileInfo = Nothing
|
||||
|
||||
' For Each Dr As DataRow In DtDocumentos.Rows
|
||||
' If ObjEventoBitacora.AddEventoBitacora("Documento Relacionado", Dr("FileExtension").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveMovimientoAlmacen:=CveMovimiento) Then
|
||||
' Try
|
||||
' If Dr("Documento").ToString <> "" Then
|
||||
' Archivo = New System.IO.FileInfo(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, Dr("Documento").ToString))
|
||||
' If Archivo.Exists() Then
|
||||
' File.Move(Archivo.ToString, String.Format("{0}OI\OI{1}{2}", UsuarioActual.Empresa.Ruta, ObjEventoBitacora.CveEvento.ToString, Archivo.Extension))
|
||||
' Else
|
||||
' Retorno = False
|
||||
' End If
|
||||
' End If
|
||||
' Catch ex As Exception
|
||||
' Retorno = False
|
||||
' Exit For
|
||||
' End Try
|
||||
' Else
|
||||
' Retorno = False
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' Return Retorno
|
||||
'End Function
|
||||
|
||||
End Class
|
||||
|
||||
Public Class MMovimientoAlmacen
|
||||
|
||||
@@ -867,7 +867,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
|
||||
'VIRTUAL SALIDA
|
||||
If RealizarMovimientoVirtual Then
|
||||
If RealizarMovimientoVirtual AndAlso CveAlmacenVirtualSalida > 0 Then
|
||||
|
||||
'If TipoAlmacenOrigen = 27 Then
|
||||
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 25).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
|
||||
@@ -1702,6 +1702,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
'End If
|
||||
|
||||
'VERIFICA SI TIENE ALMACEN VIRTUAL ASIGNADA
|
||||
If CveAlmacenVirtual > 0 Then
|
||||
|
||||
Dim dtvirtual As DataTable = Nothing
|
||||
@@ -1729,9 +1730,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
TextoError = "No se pudo registrar el movimiento virtual"
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Else
|
||||
TextoError = "La Sucursal no tiene creado un almacen virtual"
|
||||
ErrorMovInv = True
|
||||
'Else
|
||||
' TextoError = "La Sucursal no tiene creado un almacen virtual"
|
||||
' ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -1964,9 +1965,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
TextoError = "No se pudo registrar el movimiento virtual"
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Else
|
||||
TextoError = "La Sucursal no tiene creado un almacen virtual"
|
||||
ErrorMovInv = True
|
||||
'Else
|
||||
' TextoError = "La Sucursal no tiene creado un almacen virtual"
|
||||
' ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user