diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index f733f1889..4415487d8 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -9476,6 +9476,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Transportes/ListadoContratos.aspx".ToUpper(), 598)
PaginaDict.Add("/Transportes/ListadoViajes.aspx".ToUpper(), 598)
PaginaDict.Add("/Transportes/Boletos.aspx".ToUpper(), 598)
+ PaginaDict.Add("/Transportes/ListadoBoletos.aspx".ToUpper(), 598)
#End Region
'Antes de aquí.
diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx
index 2101a511f..60aba9788 100644
--- a/OS/OrdenesServicios.aspx
+++ b/OS/OrdenesServicios.aspx
@@ -1304,20 +1304,31 @@
{SbErroresDev.ToString}", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
+ 'If SbErroresDev.ToString.Length > 0 Then
+ ' Alert($"Se encontraron los siguientes errores:
{SbErroresDev.ToString}", TipoMensaje.MsgAdvertencia)
+ ' Exit Sub
+ 'End If
Dim ProcesoOK As Boolean = True
Dim ObjV As New ClsVentas
@@ -3157,11 +3164,23 @@ Partial Class OS_OrdenesServicios
Next
End If
+
+ Dim Respuesta = New RespuestaFacturacion()
+
+ If PropcesoOK Then
+
+ Respuesta = GeneraRemision(CveVentaPedido, ObjV.IniciaTransacSQL())
+ If Not Respuesta.CveVenta > 0 Then
+ PropcesoOK = False
+ End If
+
+ End If
+
If ProcesoOK Then
Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL())
- Dim CveMovimiento As Integer = ObjInventario.AddMovimiento(CveAlmacenActual, 8, CveMoneda, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaPedido, CveSubProyectoPedido, -1, CveOS:=CveOS, CveAlmacenDestino:=CveAlmacenDestino)
+ Dim CveMovimiento As Integer = ObjInventario.AddMovimiento(CveAlmacenActual, 8, CveMoneda, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Respuesta.CveVenta, CveSubProyectoPedido, -1, CveOS:=CveOS, CveAlmacenDestino:=CveAlmacenDestino)
Dim Folio As Integer = ObjInventario.Folio
If CveMovimiento > 0 Then
@@ -3191,7 +3210,7 @@ Partial Class OS_OrdenesServicios
If ProcesoOK Then
- Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, CveMoneda, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaPedido, CveSubProyectoPedido, -1, CveOS:=CveOS, CveMovimientoRelacionado:=CveMovimiento)
+ Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, CveMoneda, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Respuesta.CveVenta, CveSubProyectoPedido, -1, CveOS:=CveOS, CveMovimientoRelacionado:=CveMovimiento)
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
@@ -3231,11 +3250,11 @@ Partial Class OS_OrdenesServicios
End If
End If
- If ProcesoOK Then
- 'ObjV.RollBack()
+
+ If PropcesoOK Then
ObjV.Commit()
Alert("El material utilizado se guardó correctamente")
- RegistraScript("$('#DivModalMaterialUtilizado').modal('hide');")
+ RegistraScript("$('#DVModalSolicitarDevolucion').modal('hide');")
Else
ObjV.RollBack()
End If
@@ -3244,4 +3263,92 @@ Partial Class OS_OrdenesServicios
End Sub
+ Private Function GeneraRemision(CveVentaPedido As Integer, ByRef TransaccionSQL As SqlTransaction) As RespuestaFacturacion
+
+ Dim Respuesta = New RespuestaFacturacion()
+
+ Dim CveRemiocionGenerada As Integer = -1
+
+ Dim ObjVentas As New ClsVentas(TransaccionSQL)
+ Dim ProcesoOK As Boolean = True
+
+ Dim CveSubProyectoPedido As Integer = -1
+ Dim CveMoneda As Integer = -1
+
+ If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
+ Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Copy().Rows(0)
+ CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero
+ CveSubProyectoPedido = DbRowVenta("CveSubProyecto").ToString().ToEntero()
+ End If
+
+ Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyectoPedido, CveCliente, CveMoneda, "Ped")
+
+ If ObjFactura IsNot Nothing Then
+
+ If ProcesoOK Then
+
+ For Each GvRow As GridViewRow In GvSolicitarDevolucion.Rows
+
+ Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
+ Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
+ Dim CantidadDev As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal
+ Dim CantidadRegistro = Cantidad - CantidadDev
+ Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
+ Dim Descuento As Decimal = GvRow.DataKey("Descuento").ToDecimal
+ Dim Obs As String = GvRow.DataKey("Observaciones")
+
+ If Not ObjFactura.AgregarPS(CvePS, CantidadRegistro, PU, Descuento, Obs, CveSubProyecto:=CveSubProyectoPedido) Then
+ Alert("Error al agregar producto", TipoMensaje.MsgAdvertencia)
+ ProcesoOK = False
+ Exit For
+ End If
+
+ Next
+
+ If ProcesoOK Then
+ ObjFactura.CalculaTotales()
+
+
+ Dim Resp As New Modelos.Factura.MMensajeFactura
+ Resp = ObjFactura.EmitirFactura(False, Transac:=TransaccionSQL)
+
+ If Resp.CveVenta > 0 Then
+ Respuesta.CveVenta = Resp.CveVenta
+ Respuesta.SerieFolio = Resp.SerieFolio
+ Else
+ ProcesoOK = False
+ End If
+
+ End If
+
+
+ End If
+
+ Else
+ ProcesoOK = False
+ End If
+
+ Return Respuesta
+
+ End Function
+
+
+
+
+
+
+
+ Friend Class RespuestaFacturacion
+ Public Property CveVenta As Integer = -1
+ Public Property SerieFolio As String = "-1"
+ Public Sub New()
+
+ End Sub
+ End Class
+
+
+
+
+
+
End Class
\ No newline at end of file
diff --git a/Transportes/Boletos.aspx b/Transportes/Boletos.aspx
index 85959c08e..dd12a91c2 100644
--- a/Transportes/Boletos.aspx
+++ b/Transportes/Boletos.aspx
@@ -37,7 +37,7 @@
display: inline-block;
width: 45px;
height: 45px;
- background-color: #E7505A;
+ background-color: #F3565D;
border-radius: 10px !important;
margin: 5px;
cursor: pointer;
@@ -217,60 +217,7 @@
-