SMS 2024-04-25
This commit is contained in:
@@ -1851,6 +1851,9 @@ Partial Class OS_OrdenesServicios
|
||||
GvEB.DataSource = Nothing
|
||||
End If
|
||||
GvEB.DataBind()
|
||||
|
||||
UPEventoBitacora.Update()
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
@@ -3062,11 +3065,24 @@ Partial Class OS_OrdenesServicios
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim TieneArchivos As Boolean = False
|
||||
Dim Filesgral As List(Of Archivo) = AnexoManerialUtilizado.getfiles().Archivos
|
||||
For Each fileItem As Archivo In Filesgral
|
||||
TieneArchivos = True
|
||||
Exit For
|
||||
Next
|
||||
If Not TieneArchivos Then
|
||||
Alert("Debe de Agregar Un Documento de Confirmación (hasta 5 maximo).")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
Dim CveAlmacenActual As Integer = DTSolicitudDev.FiltroPrimeroValor("CveAlmacenActual").ToEntero
|
||||
Dim CveMoneda As Integer = DTSolicitudDev.FiltroPrimeroValor("CveMoneda").ToEntero
|
||||
Dim CveSubProyectoPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveSubProyecto").ToEntero
|
||||
Dim CveVentaPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveVenta").ToEntero
|
||||
Dim CveAlmacenDestino As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 10).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {CveSubProyectoPedido}").ToEntero
|
||||
Dim CveVentaRemisionGenerada As Integer = -1
|
||||
|
||||
If DdlTipoVenta.SelectedValue.ToEntero = 5 Then
|
||||
Dim TotalSeleccionado As Decimal = 0
|
||||
@@ -3193,6 +3209,8 @@ Partial Class OS_OrdenesServicios
|
||||
Respuesta = GeneraRemision(CveVentaPedido, ObjV.IniciaTransacSQL())
|
||||
|
||||
If Respuesta.CveVenta > 0 Then
|
||||
|
||||
CveVentaRemisionGenerada = Respuesta.CveVenta
|
||||
If ObjV.GetVentaDetalle(Respuesta.CveVenta) Then
|
||||
Dim dtClon As DataTable = ObjV.DtResultados.Copy
|
||||
dtClon.DefaultView.Sort = "CveVentaDetalle ASC"
|
||||
@@ -3328,7 +3346,7 @@ Partial Class OS_OrdenesServicios
|
||||
End If
|
||||
|
||||
If ProcesoOK Then
|
||||
ProcesoOK = GuardarArchivoConfirmacion(ObjV.IniciaTransacSQL, CveOS)
|
||||
ProcesoOK = GuardarArchivoConfirmacion(ObjV.IniciaTransacSQL, CveOS, CveVentaRemisionGenerada)
|
||||
End If
|
||||
|
||||
If ProcesoOK Then
|
||||
@@ -3357,7 +3375,7 @@ Partial Class OS_OrdenesServicios
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function GuardarArchivoConfirmacion(ByRef transaccion As SqlTransaction, CveOSActual As Integer) As Boolean
|
||||
Private Function GuardarArchivoConfirmacion(ByRef transaccion As SqlTransaction, CveOSActual As Integer, CveVentaRemisionGenerada As Integer) As Boolean
|
||||
Dim respuesta As Boolean = False
|
||||
|
||||
|
||||
@@ -3366,33 +3384,55 @@ Partial Class OS_OrdenesServicios
|
||||
Dim FileExtension As String = "-1"
|
||||
Dim Filesgral As List(Of Archivo) = AnexoManerialUtilizado.getfiles().Archivos
|
||||
Dim Filename As String = ""
|
||||
'Dim ProcesoOK As Boolean = True
|
||||
|
||||
|
||||
For Each fileItem As Archivo In Filesgral
|
||||
|
||||
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
||||
Filename = fileItem.filename
|
||||
Next
|
||||
|
||||
If Filename = String.Empty Then
|
||||
respuesta = False
|
||||
Alert("Error al agregar Documento de Confirmación")
|
||||
Exit For
|
||||
Else
|
||||
|
||||
If Filename = String.Empty Then
|
||||
respuesta = True
|
||||
Else
|
||||
If ObjEventoBitacora.AddEventoBitacora("Documento de Confirmación", String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveOS:=CveOSActual) Then
|
||||
If Filename <> "" Then
|
||||
If CveVentaRemisionGenerada > 0 Then
|
||||
If ObjEventoBitacora.AddEventoBitacora("Documento de Confirmación", String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVentaRemisionGenerada) Then
|
||||
|
||||
Try
|
||||
Filename.FilesCopy(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
|
||||
Catch ex As Exception
|
||||
Alert("Error al mover archivo de confirmación", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
End Try
|
||||
|
||||
Else
|
||||
respuesta = False
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjEventoBitacora.AddEventoBitacora("Documento de Confirmación", String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveOS:=CveOSActual) Then
|
||||
Try
|
||||
Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
|
||||
respuesta = True
|
||||
Catch ex As Exception
|
||||
Alert("Error al mover archivo de confirmación", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
End Try
|
||||
|
||||
|
||||
Else
|
||||
respuesta = False
|
||||
Exit For
|
||||
End If
|
||||
AnexoManerialUtilizado.Text = "[]"
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
AnexoManerialUtilizado.Text = "[]"
|
||||
|
||||
Return respuesta
|
||||
|
||||
|
||||
Reference in New Issue
Block a user