diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 53919c268..5b6c87d55 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -159,7 +159,7 @@ Public Class ClsContratos Public Property PorGarantia As Double Public Property CveContratosEstatus As Integer Public Property Estatus As Integer - 'Public Property EstatusContrato As Integer + Public Property EstatusContrato As Integer Public Property Archivo As String Public Property Geom As String Public Property FechaIng As DateTime @@ -271,7 +271,7 @@ Public Class ClsContratos Me.PorAnticipo = Data.Rows(0)("PorAnticipo").ToString.ToDouble Me.PorAmortizacionAnticipo = Data.Rows(0)("PorAmortizacionAnticipo").ToString.ToDouble Me.PorGarantia = Data.Rows(0)("PorGarantia").ToString.ToDouble - 'Me.EstatusContrato = Data.Rows(0)("EstatusContrato").ToString.ToEntero + Me.EstatusContrato = Data.Rows(0)("EstatusContrato").ToString.ToEntero Me.Archivo = Data.Rows(0)("Archivo").ToString Me.Geom = Data.Rows(0)("Geom").ToString Me.FechaIng = Data.Rows(0)("FechaIng").ToString.ToDate @@ -407,7 +407,7 @@ Public Class ClsContratos Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1.0, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1, Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1, Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False, - Optional DiaMesFacturacion As Integer = 1, Optional CvePeriodo As Integer = -1, Optional ObservacionesGenerales As String = "", Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1) As Boolean + Optional DiaMesFacturacion As Integer = 1, Optional CvePeriodo As Integer = -1, Optional ObservacionesGenerales As String = "", Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, Optional EstatusContrato As Integer = -1, Optional CveAF As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_ContratosUpdate") @@ -464,6 +464,8 @@ Public Class ClsContratos .Add("@ObservacionesGenerales", SqlDbType.VarChar).Value = ObservacionesGenerales .Add("@CveTipoAF", SqlDbType.Int).Value = CveTipoAF .Add("@CveChofer", SqlDbType.Int).Value = CveChofer + .Add("@EstatusContrato", SqlDbType.Int).Value = EstatusContrato + .Add("@CveAF", SqlDbType.Int).Value = CveAF End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 483f7c816..8aa56f21d 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -10769,6 +10769,7 @@ Public Class ClsPaginas PaginaDict.Add("/Transportes/RepBoletos.aspx".ToUpper(), 600) PaginaDict.Add("/Transportes/Boletos.aspx".ToUpper(), 601) PaginaDict.Add("/Transportes/RepContratosCalendario.aspx".ToUpper(), 603) + PaginaDict.Add("/Transportes/CatRutas.aspx".ToUpper(), 604) #End Region 'Antes de aquí. diff --git a/App_Code/ClsSisUsuarios.vb b/App_Code/ClsSisUsuarios.vb index 464fb1d6b..1c779adf5 100644 --- a/App_Code/ClsSisUsuarios.vb +++ b/App_Code/ClsSisUsuarios.vb @@ -246,6 +246,9 @@ Public Class ClsSisUsuarios Dim autoip As String = Data.Rows(0)("AutorizadoxIP").ToString().ToUpper() Retorno.AutorizadoxIP = (autoip = "1" OrElse autoip = "TRUE") + ' Esto es parta el punto de venta + Retorno.CveSucursal = Data.Rows(0)("CveSubProyecto").ToString().ToEntero + ''Toma la primer letra de cada nombre 'Dim sbr As New StringBuilder 'For Each St As String In Retorno.Nombre.Split(" "c) diff --git a/App_Code/ClsTransportes.vb b/App_Code/ClsTransportes.vb index 979375c2e..612d9f694 100644 --- a/App_Code/ClsTransportes.vb +++ b/App_Code/ClsTransportes.vb @@ -333,6 +333,68 @@ Public Class ClsTransportes Return Retorno End Function + + Public Function AddDestino(Destino As String, Estatus As String, EsNacional As String, CveUsuario As Integer, CveEmpresa As Integer) As Integer + Dim Retorno As Integer = -1 + + DataAdapter("PA_Trans_DestinosAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDestino", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@Destino", SqlDbType.VarChar).Value = Destino + .Add("@EsNacional", SqlDbType.VarChar).Value = Convert.ToBoolean(EsNacional) + .Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus) + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveDestino").Value.ToString) + Catch ex As Exception + OnError("Ocurrió un error al agregar el destino.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function UpdateDestino(CveDestino As Integer, Destino As String, Estatus As String, EsNacional As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Trans_DestinosUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDestino", SqlDbType.Int).Value = CveDestino + .Add("@Destino", SqlDbType.VarChar).Value = Destino + .Add("@EsNacional", SqlDbType.VarChar).Value = Convert.ToBoolean(EsNacional) + .Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus) + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el destino.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function RemoveDestino(CveDestino As Integer) As Boolean + Dim Retorno As Boolean = False + + + DataAdapter("PA_Trans_DestinosRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDestino", SqlDbType.Int).Value = CveDestino + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el destino.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function #End Region #Region "Rutas" @@ -351,15 +413,73 @@ Public Class ClsTransportes Try SqlAdapter.Fill(Data) Retorno = True + Catch ex As Exception OnError("Ocurrió un error al obtener las rutas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try + Return Retorno + End Function + Public Function AddRuta(Ruta As String, Estatus As String, CveUsuario As Integer, CveEmpresa As Integer) As Integer + Dim Retorno As Integer = -1 + + DataAdapter("PA_Trans_RutasAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveRuta", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@Ruta", SqlDbType.VarChar).Value = Ruta + .Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus) + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveRuta").Value.ToString) + Catch ex As Exception + OnError("Ocurrió un error al agregar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function UpdateRuta(CveRuta As Integer, Ruta As String, Estatus As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Trans_RutasUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveRuta", SqlDbType.Int).Value = CveRuta + .Add("@Ruta", SqlDbType.VarChar).Value = Ruta + .Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus) + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function RemoveRuta(CveRuta As Integer) As Boolean + Dim Retorno As Boolean = False + + + DataAdapter("PA_Trans_RutasRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveRuta", SqlDbType.Int).Value = CveRuta + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno End Function #End Region -#Region "Tarifas" +#Region "Importes" Public Function GetDestinosTarifas(CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Trans_DestinosTarifasGet") @@ -376,6 +496,63 @@ Public Class ClsTransportes Return Retorno End Function + + Public Function AddDestinosTarifas(CveRuta As String, CveDestinoOrigen As String, CveDestinoFinal As String, Importe As String) As Integer + Dim Retorno As Integer = -1 + + DataAdapter("PA_Trans_DestinosTarifasAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDestinoTarifa", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@CveRuta", SqlDbType.Int).Value = CveRuta.ToEntero + .Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen.ToEntero + .Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal.ToEntero + .Add("@Importe", SqlDbType.SmallMoney).Value = Importe.ToDecimal + End With + Try + SqlAdapter.Fill(Data) + Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveDestinoTarifa").Value.ToString) + Catch ex As Exception + OnError("Ocurrió un error al agregar el importe.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function UpdateDestinosTarifas(CveDestinoTarifa As Integer, CveRuta As String, CveDestinoOrigen As String, CveDestinoFinal As String, Importe As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Trans_DestinosTarifasUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDestinoTarifa", SqlDbType.Int).Value = CveDestinoTarifa + .Add("@CveRuta", SqlDbType.Int).Value = CveRuta.ToEntero + .Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen.ToEntero + .Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal.ToEntero + .Add("@Importe", SqlDbType.SmallMoney).Value = Importe.ToDecimal + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el importe.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function RemoveDestinosTarifas(CveDestinoTarifa As Integer) As Boolean + Dim Retorno As Boolean = False + + + DataAdapter("PA_Trans_DestinosTarifasRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDestinoTarifa", SqlDbType.Int).Value = CveDestinoTarifa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el importe.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function #End Region End Class diff --git a/App_Code/wsSIG.vb b/App_Code/wsSIG.vb index 1991e6c6b..c94a13c60 100644 --- a/App_Code/wsSIG.vb +++ b/App_Code/wsSIG.vb @@ -115,7 +115,12 @@ Public Class wsSIG Retorno.CveEmpresa = ttDato.CveEmpresa 'Retorno.Empresa = ttDato.NombreEmpresa Retorno.CveVendedor = ttDato.CveVendedor - Retorno.CveSucursal = CveSubProyecto + + If CveSubProyecto > 0 Then + Retorno.CveSucursal = CveSubProyecto + Else + Retorno.CveSucursal = ttDato.CveSucursal + End If 'Retorno.Contraseña = ttDato.Contraseña 'Retorno.IMEI = IMEI diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index 8d250faba..4e6bc3267 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -442,7 +442,6 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState Dim DT_EstatusOS As New DataTable Dim usuarioActual_ As Usuario = UsuarioActual(context) Dim ErrorEventos As Boolean = False - Dim Colores() As String = {"#006699", "#0099cc", "#0066cc", "#0033cc", "#0000ff", "#3333ff", "#3333ff", "#6600ff", "#9933ff", "#cc00ff", "#cc00cc", "#cc0099", "#cc3399", "#cc6699", "#cc0066", "#009933", "#00cc00", "#00cc66", "#009999", "#669900", "#99cc00", "#cccc00", "#cc9900", "#ff9900", "#006666", "#669999"} Dim tipoVista As String = context.Request("tipoVista") DT_SubProyectos.Columns.Add("CveSubProyecto", GetType(Integer)) DT_SubProyectos.Columns.Add("backgroundColor") @@ -458,19 +457,31 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState For Each dr As DataRow In ObjContratos.DtResultados.Rows Dim cevent As CalendarEvent = New CalendarEvent() + Dim estatus As Integer = dr("EstatusContrato").ToString.ToEntero cevent.id = dr("CveContrato").ToString.ToEntero cevent.title = dr("DescripcionContrato").ToString cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime) - cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime)) 'Agregar una hora, fecha final como default + cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime)) cevent.allDay = False cevent.NombreAcercamiento = dr("Ubicacion").ToString cevent.CveCliente = dr("CveCliente").ToString.ToEntero - cevent.CveActivoFijo = dr("CveTipoAF").ToString.ToEntero cevent.CvePersonal = dr("CveChofer").ToString.ToEntero cevent.Dolares = dr("Importe").ToString.ToDecimal cevent.Pesos = dr("ImporteMax").ToString.ToDecimal cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal + cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero + + Select Case estatus + Case 1 + cevent.backgroundColor = "#00A56A" + Case 2 + cevent.backgroundColor = "#2B4FD6" + Case 3 + cevent.backgroundColor = "#EE602E" + End Select + + If Not cevent.recurrenciatipo > 0 Then @@ -554,24 +565,9 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime) cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime)) cevent.NombreAcercamiento = dr("Ubicacion").ToString - + cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero cevent.allDay = False - 'cevent.CveEventoEstatus = dr("NumeroContrato").ToString.ToEntero - 'cevent.CveEventoEstatus = dr("CveEventoEstatus").ToString.ToEntero - 'cevent.cveagendatipo = dr("CveAgendaTipo").ToString - 'cevent.prioridad = dr("CvePrioridad").ToString.ToEntero - 'cevent.backgroundColor = dr("BackGroundColor").ToString - 'cevent.recurrenciatipo = dr("RecurrenciaTipo").ToString.ToEntero - 'cevent.frecuencia = dr("Frecuencia").ToString.ToEntero - 'cevent.diassemana = dr("DiasSemana").ToString - 'cevent.dia = dr("Dia").ToString.ToEntero - 'cevent.mes = dr("Mes").ToString.ToEntero - 'cevent.recurrenciafin = dr("RecurrenciaFin").ToString - 'cevent.CveProspecto = dr("CveProspecto").ToString.ToEntero - 'cevent.Prospecto = dr("Prospecto").ToString - - '11/05/2018 - Evento Gasto Recurrente 'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index c29799b52..1745f277d 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1254,9 +1254,10 @@ Partial Class PopUpVerFactura Dim CveAlmacenTransitorioRecepcion As Integer = If(UrlParametros("CVEALMACENTRANSITORIORECEPCION") Is Nothing, -1, (UrlParametros("CVEALMACENTRANSITORIORECEPCION").ToString.ToEntero)) Dim FolioBusquedaTrasitorio As Integer = If(UrlParametros("FOLIOBUSQUEDATRASITORIO") Is Nothing, -1, (UrlParametros("FOLIOBUSQUEDATRASITORIO").ToString.ToEntero)) + Dim Consola As String = If(UrlParametros("CVEMOVIMIENTO") IsNot Nothing, UrlParametros("CVEMOVIMIENTO").ToString.Trim, "") CargaMovimientosAlmacen(UrlParametros("CVEMOVIMIENTO").ToString.ToEntero, Resumen:=False, EsTransitorio:=EsTransitorio, CveAlmacenRecepcion:=CveAlmacenRecepcion, CveAlmacenTransitorioRecepcion:=CveAlmacenTransitorioRecepcion, - FolioBusquedaTrasitorio:=FolioBusquedaTrasitorio) + FolioBusquedaTrasitorio:=FolioBusquedaTrasitorio, Consola:=Consola) End If End If @@ -2420,7 +2421,7 @@ Partial Class PopUpVerFactura #Region " - OP = 'Alm' - REPORTE ENTRADAS ALMACEN " Private Sub CargaMovimientosAlmacen(CveMovimiento As Integer, Optional Resumen As Boolean = False, - Optional EsTransitorio As Boolean = False, Optional CveAlmacenRecepcion As Integer = -1, Optional CveAlmacenTransitorioRecepcion As Integer = -1, Optional FolioBusquedaTrasitorio As Integer = -1) + Optional EsTransitorio As Boolean = False, Optional CveAlmacenRecepcion As Integer = -1, Optional CveAlmacenTransitorioRecepcion As Integer = -1, Optional FolioBusquedaTrasitorio As Integer = -1, Optional Consola As String = "") Dim ObjInventarios As New ClsInventarios ObjInventarios.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) @@ -2656,7 +2657,7 @@ Partial Class PopUpVerFactura PuestoEnrego, RazonSocial, ResponsableCarga, ResponsableRecibio, NombreCliente, CantidadProductos:=CantidadProductos, CantidadUsados:=CantidadUsados, CveTipoAlmacen:=CveTipoAlmacen, NombreEntrego:=NombreEntrego, CveConceptoMovRelacionado:=CveConceptoMovtoRelacionado, FolioRelacionado:=FolioRelacionado, UsuarioRegistro:=UsuarioCapturo, - Ruta:=Ruta, Supervisor:=Supervisor) + Ruta:=Ruta, Supervisor:=Supervisor, Consola:=Consola) End Sub Private Sub PUanacExtr(CveMoneda As Integer) 'preciounitario a moneda nacional o extranjera @@ -2675,7 +2676,7 @@ Partial Class PopUpVerFactura EstadoDestino As String, PaisDestino As String, CPDestino As String, FechaMovimiento As Date, NombreCapturo As String, PuestoRecibio As String, PuestoEntrego As String, RazonSocial As String, ResponsableCarga As String, ResponsableRecibio As String, NombreCliente As String, Optional CantidadProductos As Decimal = 0, Optional CantidadUsados As Decimal = 0, Optional CveTipoAlmacen As Integer = -1, Optional NombreEntrego As String = "", Optional CveConceptoMovRelacionado As Integer = -1, Optional FolioRelacionado As String = "", Optional UsuarioRegistro As String = "", - Optional Ruta As String = Nothing, Optional Supervisor As String = Nothing) + Optional Ruta As String = Nothing, Optional Supervisor As String = Nothing, Optional Consola As String = "-1") Select Case CveConcepto @@ -3347,6 +3348,8 @@ Partial Class PopUpVerFactura RutaFormato = "{0}Formatos\TrasladoUsado.rdlc" End If + + params.Add(New ReportParameter("CveConcepto", "8")) 'FolioTraspaso.ToString 'params.Add(New ReportParameter("TipoTraslado", "AVISO")) 'FolioTraspaso.ToString params.Add(New ReportParameter("SubProyecto", String.Format("Traslado de: {0} A {1}", Almacen, AlmacenDestino))) 'DdlAlmacenDestino.SelectedItem.ToString @@ -3377,6 +3380,19 @@ Partial Class PopUpVerFactura CveCliente = DtMovimientos.FiltroPrimeroValor("CveCliente").ToEntero DTCliente = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros($"CveCliente = {CveCliente}") + If CveCliente = 819998 Then + RutaFormato = "{0}Formatos\TrasladoAngeles.rdlc" + + If Consola <> "-1" And Consola.Trim.Length > 0 Then + RutaFormato = "{0}Formatos\Consola.rdlc" + params.Add(New ReportParameter("Consola", Consola)) + End If + + End If + + + + Dim CveVentaConsulta As Integer = DtMovimientos.FiltroPrimeroValor("CveVenta").ToEntero params.Add(New ReportParameter("Documentacion", DTCliente.FiltroPrimeroValor("Documentacion"))) @@ -3409,9 +3425,6 @@ Partial Class PopUpVerFactura - If CveCliente = 819998 Then - RutaFormato = "{0}Formatos\TrasladoAngeles.rdlc" - End If End If If CveContrato > 0 Then diff --git a/Empresas/186/Formatos/Consola.rdlc b/Empresas/186/Formatos/Consola.rdlc new file mode 100644 index 000000000..39b8cb463 --- /dev/null +++ b/Empresas/186/Formatos/Consola.rdlc @@ -0,0 +1,3073 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 457ddefa-843b-4fae-8b02-70764606cb28 + + + + + + DsInventarios + /* Local Query */ + + + + Codigo + System.String + + + NumeroParte + System.String + + + PS + System.String + + + UnidadMedida + System.String + + + PU + System.Decimal + + + Cantidad + System.Decimal + + + Total + System.Decimal + + + Descuento + System.Decimal + + + CodigoAF + System.String + + + Almacen + System.String + + + SerieLote + System.String + + + Observaciones + System.String + + + Lote + System.String + + + FechaCaducidad + System.Date + + + PUVenta + System.Decimal + + + IVAVenta + System.Decimal + + + SubTotalVenta + System.Decimal + + + Marca + System.String + + + CodigoAlterno + System.String + + + PSAlterno + System.String + + + + DsInventarios + C:\inetpub\wwwVentas\App_Code\DsInventarios.xsd + DtMovimientos + + + + + + + + + + + + + + + 2.42399cm + + + 12.657cm + + + 5.2437cm + + + 5.43555cm + + + + + 0.43377cm + + + + + true + + + + + Cantidad + + + + + + + Textbox1 + + + + Black + + 1pt + + + Black + + 1pt + + #9cc3e5 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Descripción del Equipo + + + + + + + Textbox3 + + + + Black + + 1pt + + + Black + + 1pt + + #9cc3e5 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Serie + + + + + + + Textbox5 + + + + + + + + + #9cc3e5 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Modelo + + + + + + + Textbox7 + + + + Black + + 1pt + + + Black + + 1pt + + #9cc3e5 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + + + true + true + + + + + + + + + + + + Textbox19 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + FechaCaducidad + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox23 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox84 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + 0.49417cm + + + + + true + true + + + + + 1 + + + + + + + Textbox44 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + CONSOLA DE RADIO FRECUENCIA BONSS ORTHOPEDIC + + + + + + + Textbox45 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox46 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Parameters!Consola.Value + + + + + + + Textbox85 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + 0.44125cm + + + + + true + true + + + + + + + + + + + + Textbox51 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox52 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox53 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox86 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + 0.6cm + + + + + true + true + + + + + 1 + + + + + + + Textbox87 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + PEDALES PARA RADIO FRECUENCIA BONSS + + + + + + + Textbox88 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox89 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox90 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + 0.6cm + + + + + true + true + + + + + + + + + + + + Textbox91 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox92 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox93 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox94 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + 0.52062cm + + + + + true + true + + + + + 2 + + + + + + + Textbox95 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + CABLE DE ALIMENTACION CON ADAPTADOR + + + + + + + Textbox96 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox97 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox98 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + 0.44125cm + + + + + true + true + + + + + + + + + + + + Textbox99 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox100 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox101 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox102 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + 0.6cm + + + + + true + true + + + + + 1 + + + + + + + Textbox103 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + MALETA TRANSPORTADORA MARCA BONSS + + + + + + + Textbox104 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox105 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox106 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + 0.6cm + + + + + true + true + + + + + + + + + + + + Textbox107 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox108 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox109 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox110 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + 0.6cm + + + + + true + true + + + + + + + + + + + + Textbox111 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + EQUIOP A PRESTAMO PARA CIRUGÍA + + + + + + + Textbox112 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox113 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox114 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DsInventarios + 0.14111cm + 0.10068cm + 5.79878cm + 25.76024cm + + + + + + 2.45176in + + + + + + true + true + + + + + SMS SMART MEDICAL SOLUTIONS + + + + + + + Textbox2 + 0.07163cm + 8.55215cm + 0.38833cm + 8.54466cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SSM1908213A0 +NEBRASKA 157, Col. NAPOLES +BENITO JUAREZ + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Microsoft.VisualBasic.Interaction.iif(Parameters!CveConcepto.Value = 8, "REMISIÓN", "ENTRADA DE TRASLADO") + + + + + + + Textbox2 + 0.07163cm + 18.69141cm + 0.38833cm + 6.81397cm + 3 + + true + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + REMISION + + + + + + + Textbox12 + 1.89684cm + 21.17549cm + 0.44478cm + 4.32987cm + 4 + + + #9cc3e5 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Folio.Value + + + + + + + Textbox12 + 2.34162cm + 21.17549cm + 0.44478cm + 4.32987cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha + + + + + + + Textbox12 + 0.91315cm + 21.1755cm + 0.44478cm + 4.32987cm + 6 + + + #9cc3e5 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaImpresion.Value + + + + + + + Textbox12 + 1.35793cm + 21.17549cm + 0.44478cm + 4.32987cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Parameters!CveConcepto.Value = 8, "Carga Privada", " ") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Cliente: + + + + =Parameters!ClienteCodigo.Value + + + + - + + + + =Parameters!ClienteNombre.Value + + + + . + + + + + =IIF(LEN(Parameters!ClienteSucursal.Value)> 0,"Sucursal: ","") + + + + =IIF(LEN(Parameters!ClienteSucursal.Value)>0, Parameters!ClienteSucursal.Value & " ","") + + + + RFC: + + + + =Parameters!ClienteRFC.Value + + + + +Calle: + + + + =Parameters!ClienteCalle.Value + + + + + + + + =Parameters!ClienteNoExt.Value + + + + . Colonia: + + + + =Parameters!ClienteColonia.Value + + + + Ciudad: + + + + =Parameters!ClienteCiudad.Value + + + + . +Estado: + + + + =Parameters!ClienteEstado.Value + + + + . +Municipio y/o Delegación: + + + + =Parameters!ClienteMunicipio.Value + + + + . CP: + + + + =Parameters!ClienteCP.Value + + + + . + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 3.8269cm + true + true + + + true + true + + + + + =Parameters!ResponsableCarga.Value + + + + + + + Textbox21 + 1.37766cm + 5.68986cm + 0.50243cm + 5.79375cm + + true + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ResponsableRecibio.Value + + + + + + + Textbox21 + 1.37766cm + 14.40467cm + 0.50243cm + 5.78664cm + 1 + + true + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ___________________________ + + + + + + + + + Nombre y Firma + + + + + + + Textbox21 + 1.66375cm + 5.69781cm + 1.2cm + 5.78664cm + 2 + + true + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ___________________________ + + + + + + + + + Nombre y Firma + + + + + + + Textbox21 + 1.6632cm + 14.41177cm + 1.2cm + 5.78664cm + 3 + + true + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Envió + + + + + + + Textbox22 + 0.07331cm + 5.69781cm + 0.6cm + 5.78664cm + 4 + + true + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Accion.Value + + + + + + + Textbox22 + 0.07331cm + 14.41177cm + 0.6cm + 5.78664cm + 5 + + true + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!NombreAccion.Value = "","",Parameters!NombreAccion.Value) + + + + Textbox21 + 0.45106cm + 10.04017cm + 0.63528cm + 5.78664cm + 6 + + true + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ___________________________ + + + + + + + + + Nombre y Firma + + + + + + + Textbox21 + 1.6632cm + 10.04727cm + 1.2cm + 5.78664cm + 7 + + true + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Accion.Value + + + + + + + Textbox22 + 0.07331cm + 10.04727cm + 0.6cm + 5.78664cm + 8 + + true + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + =Parameters!FechaImpresion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 0.13678cm + 0cm + 20.28859cm + 11 + + + + + + 0.13678cm + 0cm + 25.72414cm + 12 + + + + + + 3.26597cm + 0.10068cm + 0cm + 25.76024cm + 13 + + true + + + + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox10 + 3.40709cm + 23.00537cm + 0.41981cm + 2.55292cm + 14 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 21.59cm + 27.94cm + 1cm + 1cm + 0.5cm + 0.5cm + 0.13cm + - =Fields!Codigo.Value + =Fields!NumeroParte.Value @@ -776,6 +780,7 @@ =IIf(rownumber(nothing) = 1, "2pt", "0pt") + true diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 7cd33263d..f7ff4f447 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -62,6 +62,9 @@
  • PDF Resumen
  • +
  • + PDF Consola +
  • Descargar XML SAT
  • @@ -673,7 +676,7 @@ + DataKeyNames="No,CveMovimientoDetalle,Cantidad,CvePS,CveUM,PU,Observaciones,CodigoPS,UnidadMedida,CveAF,Serie,Lote,FechaCaducidad,CveSeccionAlmacen,Codigo" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" > diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index e92fc2ad2..23e2e03a7 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -507,10 +507,55 @@ Partial Class Inventarios_EntradasSalidas 'ImgFecha.Visible = True End If + + If CveMovimiento > 0 And CveConcepto.Contiene(8) And UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + ValidaUsaConsola() + End If + End If End Sub + Property Consola As String + Get + If ViewState("Consola") Is Nothing Then + ViewState("Consola") = "" + End If + Return ViewState("Consola").ToString + End Get + Set(value As String) + ViewState("Consola") = value + End Set + End Property + + Private Function ValidaUsaConsola() As Boolean + Consola = "" + Dim Respuesta As Boolean = False + + For Each gvRow As GridViewRow In GvM.Rows + If gvRow.DataKey("Codigo").Contiene("404Q2", "404Q3", "405Q2", "405Q3", "306Q1", "306Q2") Then + Consola = "ARS600" + Respuesta = True + HplImprimirConsola.Visible = True + Exit For + End If + If gvRow.DataKey("Codigo").Contiene("106Q1A", "106Q2A", "106Q3", "106Q3WT", "106Q4", "106Q4A", "106Q5A", "106Q6A", "106Q7A") Then + Consola = "ARS800" + Respuesta = True + HplImprimirConsola.Visible = True + Exit For + End If + Next + + If Respuesta Then + HplImprimirConsola.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=Alm&CveMovimiento={0}&Consola={1}", CveMovimiento, Consola))) + End If + + Return Respuesta + + + End Function + #Region " PERMISOS PAGINAS " Private Function PermiteGuardar() As Boolean Return If(UsuarioActual.TienePermisoProceso(181) Or EsConsumoInterno, True, False) @@ -909,9 +954,12 @@ Partial Class Inventarios_EntradasSalidas HplImprimirResumen.Visible = True HplImprimirResumen.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=Almr&CveMovimiento={0}", CveMovimiento))) + CveCompra = Mov.CveCompra CveConcepto = Mov.CveConcepto + + If drM("CveEstatusTimbrado").ToString.ToEntero > 0 Then HplDescargaXml.Visible = True HplDescargaXml.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "XML", drM("TimbreSerieFolio"), drM("TimbreTipoDocto")))) diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index f0d83d50d..a0e274ecf 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -4,6 +4,7 @@ Option Explicit On Imports System.Data Imports System.Data.SqlClient Imports System.IO +Imports System.Web.Management Imports Extensiones Imports Microsoft.Reporting.WebForms @@ -1847,10 +1848,13 @@ Partial Class Inventarios_EntregaAlmacen Private Sub GuardaVenta() - - '' INICIA: VALIDACIONES - - 'Valida el estatus de la Venta, si es = 5 O DevolucionVenta = 2, NO SE SURTE! + ValidaUsaConsola() + + + + '' INICIA: VALIDACIONES + + 'Valida el estatus de la Venta, si es = 5 O DevolucionVenta = 2, NO SE SURTE! Dim ObjVentaInv As New ClsInventarios If ObjVentaInv.GetEstatusVentaPorSurtir(CveVentaSurtir) Then TipoEstatus = ObjVentaInv.TipoEstatus @@ -3112,6 +3116,9 @@ Partial Class Inventarios_EntregaAlmacen Msg.AppendFormat("Movimiento {2}: {1}", CveMovimiento, Folio, If(TipoMovimiento = 1, "Salida", "Entrada")) Msg.AppendFormat("
    Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento))) + If Consola.Trim.Length > 0 Then + Msg.AppendFormat("
    Consola ", Encripta(String.Format("OP=Alm&CveMovimiento={0}&Consola={1}", CveMovimiento, Consola))) + End If If CveMovimientoEntrada > 0 Then Msg.AppendFormat("

    Movimiento Entrada (Traspaso): {1}", CveMovimientoEntrada, FolioEntrada) @@ -3160,8 +3167,10 @@ Partial Class Inventarios_EntregaAlmacen 'SI NO ES GARANTIA MANDA A RECIBIR AL USADO If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoDocto.Contiene("Rem", "Ped") AndAlso CveMovimientoGarantia <= 0 Then Msg.AppendFormat("

    Recibir Usado: Ir a Recepción de Usados", CveVentaSurtir) - End If - + End If + + + Alert(Msg.ToString(), TipoMensaje.MsgInformacion) Limpia() @@ -4408,6 +4417,47 @@ Partial Class Inventarios_EntregaAlmacen Return Cancelar + End Function + + Property Consola As String + Get + If ViewState("Consola") Is Nothing Then + ViewState("Consola") = "" + End If + Return ViewState("Consola").ToString + End Get + Set(value As String) + ViewState("Consola") = value + End Set + End Property + + Private Function ValidaUsaConsola() As Boolean + Consola = "" + Dim Respuesta As Boolean = False + + For Each gvRow As GridViewRow In GvDatos.Rows + + If gvRow.FCCheckBox("cbInv").Checked AndAlso gvRow.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then + + If gvRow.DataKey("Codigo").Contiene("404Q2", "404Q3", "405Q2", "405Q3", "306Q1", "306Q2") Then + Consola = "ARS600" + Respuesta = True + Exit For + End If + + If gvRow.DataKey("Codigo").Contiene("106Q1A", "106Q2A", "106Q3", "106Q3WT", "106Q4", "106Q4A", "106Q5A", "106Q6A", "106Q7A") Then + Consola = "ARS800" + Respuesta = True + Exit For + End If + + End If + + Next + + Return Respuesta + + End Function End Class diff --git a/Inventarios/RepNotasSinAlmacen.aspx.vb b/Inventarios/RepNotasSinAlmacen.aspx.vb index 65770e8de..55a9eb262 100644 --- a/Inventarios/RepNotasSinAlmacen.aspx.vb +++ b/Inventarios/RepNotasSinAlmacen.aspx.vb @@ -65,13 +65,16 @@ Partial Class RepNotasSinAlmacen #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load - If Not IsPostBack Then - + If Not IsPostBack Then + CargaCombos() 'CargaDatos() CargaPermisos() End If - End Sub + End Sub + + + Private Sub CargaPermisos() Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201) Dim TienePermisoDesmarcar As Boolean = UsuarioActual.TienePermisoProceso(278) @@ -88,6 +91,9 @@ Partial Class RepNotasSinAlmacen GvVentas.Columns(8).Visible = True TxtFechaF.Text = NowADS.AddDays(3).ToShortDateString + GvVentas.Columns(4).Visible = False + GvCompras.Columns(4).Visible = False + GvVentas.Columns(0).ItemStyle.Width = Unit.Pixel(120) 'CType(GvVentas.Columns(2), Literal).DataFormatString = "{0:dd/MM/yyyy HH:mm}" 'CType(GvVentas.Columns(2), Literal).ItemStyle.Width = Unit.Pixel(120) diff --git a/OS/Asignaciones.aspx b/OS/Asignaciones.aspx index add8f193f..de229e14f 100644 --- a/OS/Asignaciones.aspx +++ b/OS/Asignaciones.aspx @@ -200,10 +200,15 @@
    + + + + + > diff --git a/OS/Asignaciones.aspx.vb b/OS/Asignaciones.aspx.vb index bbee6bbff..19d9044ad 100644 --- a/OS/Asignaciones.aspx.vb +++ b/OS/Asignaciones.aspx.vb @@ -40,16 +40,13 @@ Partial Class OS_Asignaciones #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then + GvNA_ConfiguraColumnas() CargaEstatusOS() 'CargaUsuarios() CargaClientes() CargaSubProyecto() - If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then - GvNA.Columns(2).HeaderText = "Hospital" - GvNA.Columns(7).HeaderText = "Fecha Cirugía" - GvNA.Columns(8).HeaderText = "Hora Cirugía" - End If + If UsuarioActual.TienePermisoProceso(171) Then CargaOrdenesServiciosAsignadasXPersona() @@ -75,6 +72,9 @@ Partial Class OS_Asignaciones End If ObjEstatusPermisos.Dispose() + + + End If RegistraScript(" @@ -90,6 +90,26 @@ Partial Class OS_Asignaciones ") End Sub + Private Sub GvNA_ConfiguraColumnas() + + If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + GvNA.Columns(3).Visible = False + GvNA.Columns(4).Visible = False + GvNA.Columns(5).Visible = False + GvNA.Columns(6).Visible = False + + GvNA.Columns(7).Visible = True + GvNA.Columns(8).Visible = True + + + GvNA.Columns(2).HeaderText = "Hospital" + GvNA.Columns(9).HeaderText = "Fecha Cirugía" + GvNA.Columns(10).HeaderText = "Hora Cirugía" + End If + + + End Sub + #Region "C A R G A S " Private Sub CargaSubProyecto() DdlSubProyecto.Items.Clear() @@ -184,7 +204,7 @@ Partial Class OS_Asignaciones Dim TecnicosResultado As New DataTable If ObjOS.GetSubProyectosEstatusInicial(-1, 3, UsuarioActual.CveEmpresa) Then - TecnicosSubProyectos = ObjOS.DtResultados + TecnicosSubProyectos = ObjOS.DtResultados.FiltraParametros(" Estatus = 'True' ") End If If DtOSSubProyectos IsNot Nothing Then diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx index 3a694320d..98bab92bd 100644 --- a/OS/OrdenesServicios.aspx +++ b/OS/OrdenesServicios.aspx @@ -1308,9 +1308,7 @@
    - - +
    diff --git a/Transportes/Boletos.aspx b/Transportes/Boletos.aspx index 254e8184c..011e520a4 100644 --- a/Transportes/Boletos.aspx +++ b/Transportes/Boletos.aspx @@ -33,11 +33,6 @@ color: #fff; } - { - background-color: #45b6af; - color: #fff; - } - .nodisponible { display: inline-block; width: 45px; @@ -74,8 +69,9 @@ - + + <%-- Datos de cliente y su viaje --%>
    @@ -158,6 +154,7 @@
    +
    @@ -174,6 +171,7 @@
    +
    @@ -181,8 +179,8 @@
    -
    +
    Destino:
    -
    -

    @@ -209,14 +205,10 @@ ValidationGroup="GrpGuardar">
    -
    -
    - - + - - + <%-- Asientos --%>
    @@ -468,10 +460,8 @@
    -
    -
    - +
    diff --git a/Transportes/Boletos.aspx.vb b/Transportes/Boletos.aspx.vb index 330e2cc09..10152c534 100644 --- a/Transportes/Boletos.aspx.vb +++ b/Transportes/Boletos.aspx.vb @@ -119,11 +119,11 @@ Partial Class Boletos ViewState("Importe") = ImporteR TxtCosto.Text = $"El precio de su boleto es ${ImporteR.FormatoNumero}" BtnGuardar.Visible = True - upPanel.Visible = True + UpPanel.Visible = True Else TxtCosto.Text = "" BtnGuardar.Visible = False - upPanel.Visible = False + UpPanel.Visible = False ViewState("Importe") = 0 End If End If @@ -156,9 +156,7 @@ Partial Class Boletos Try AsientoSeleccionado = AsientoSeleccionado.Replace("A", "") - Dim retorno As Integer = ObjTransporte.AddViajesPasajeros(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, AsientoSeleccionado.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - - If retorno > 1 Then + If ObjTransporte.AddViajesPasajeros(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, AsientoSeleccionado.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 1 Then Alert("Boleto generado correctamente") ObjTransporte.Commit() DdlPartida.SelectedValue = "" @@ -168,13 +166,14 @@ Partial Class Boletos TxtCelular.Text = "" TxtObservaciones.Text = "" AsientoSeleccionado = "" - upPanel.Update() End If Catch ex As Exception ObjTransporte.RollBack() Alert($"No se pudo generar el boleto {ex}", TipoMensaje.MsgError) Finally ObjTransporte.Dispose() + CargaDatos() + UpPanel.Update() End Try End Sub diff --git a/Transportes/CatRutas.aspx b/Transportes/CatRutas.aspx new file mode 100644 index 000000000..fadda2efd --- /dev/null +++ b/Transportes/CatRutas.aspx @@ -0,0 +1,404 @@ +<%@ Page Language="VB" Title="Transportes V&A - Rutas" AutoEventWireup="false" + MasterPageFile="~/Site.master" CodeFile="CatRutas.aspx.vb" + Inherits="CatRutas" EnableEventValidation="true" %> + + + Rutas y Destinos + + + + + + + + + + + <%--Calendario Tab--%> + + <%--Rutas Tab--%> + + +
    +
    + +
    +
    + " + style="display: inline-block; margin-right: -10px; width: 150px;" /> + " + style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + <%--Destinos Tab--%> + + +
    +
    + +
    +
    +
    + " + style="display: inline-block; margin-right: -10px; width: 150px;" /> + " + style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + <%--Importes Tab--%> + + +
    +
    + +
    +
    +
    + " + style="display: inline-block; margin-right: -10px; width: 150px;" /> + " + style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + + +
    + + diff --git a/Transportes/CatRutas.aspx.vb b/Transportes/CatRutas.aspx.vb new file mode 100644 index 000000000..3745008d9 --- /dev/null +++ b/Transportes/CatRutas.aspx.vb @@ -0,0 +1,291 @@ +Option Explicit On +Option Strict On +Imports ADSNetLibrary.SIGAPI.Helpers +Imports Extensiones +Imports Extensiones.ModExtensiones + +Partial Class CatRutas + Inherits ClsPaginas + + Private Property Cve As Integer + Get + Return ViewState("Cve").ToString().ToEntero + End Get + Set(value As Integer) + ViewState("Cve") = value + End Set + End Property + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not IsPostBack Then + ViewState("Cve") = 0 + InicializarCombos() + CargaDatos() + End If + + End Sub + Private Sub CargaDatos() + 'Lista Rutas' + Dim ObjRutas As New ClsTransportes() + If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then + + If ObjRutas.DtResultados.Rows.Count > 0 Then + GvRutas.DataSource = ObjRutas.DtResultados + GvRutas.DataBind() + End If + End If + 'Lista Destinos' + If ObjRutas.GetDestinos() Then + + If ObjRutas.DtResultados.Rows.Count > 0 Then + GvDestinos.DataSource = ObjRutas.DtResultados + GvDestinos.DataBind() + End If + End If + 'Lista Importes' + If ObjRutas.GetDestinosTarifas(-1, -1) Then + If ObjRutas.DtResultados.Rows.Count > 0 Then + GvImportes.DataSource = ObjRutas.DtResultados + GvImportes.DataBind() + End If + End If + + UpPanel.Update() + + End Sub + + Private Sub InicializarCombos() + Dim ObjDestinos As New ClsTransportes() + + If ObjDestinos.GetDestinos() Then + + If ObjDestinos.DtResultados.Rows.Count > 0 Then + + DdlOrigen.DataSource = ObjDestinos.DtResultados + DdlOrigen.DataBind() + DdlOrigen.Items.Insert(0, New ListItem("Seleccione Partida", "")) + + DdlFinal.DataSource = ObjDestinos.DtResultados + DdlFinal.DataBind() + DdlFinal.Items.Insert(0, New ListItem("Seleccione Destino", "")) + End If + End If + ObjDestinos.Dispose() + + + Dim ObjRutas As New ClsTransportes() + If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then + + If ObjRutas.DtResultados.Rows.Count > 0 Then + DdlRutas.DataSource = ObjRutas.DtResultados + DdlRutas.DataBind() + DdlRutas.Items.Insert(0, New ListItem("Seleccione Ruta", "")) + End If + End If + End Sub + + Protected Sub MostrarModal(sender As Object, e As EventArgs) + TxtRuta.Text = "" + DdlRutaEstatus.SelectedValue = "" + TxtDestino.Text = "" + DdlEsNacional.SelectedValue = "" + DdlDestinoEstatus.SelectedValue = "" + DdlOrigen.SelectedValue = "" + DdlFinal.SelectedValue = "" + TxtImporte.Text = "" + BtnAddRuta.Visible = False + BtnAddDestino.Visible = False + BtnAddImporte.Visible = False + PnRuta.Visible = False + PnDestino.Visible = False + PnImporte.Visible = False + Dim id As String = DirectCast(sender, LinkButton).ID + + If id.Contains("Editar") Then + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Select Case id + Case "BtnEditarRuta" + ModalLabel.Text = "Editar Ruta" + PnRuta.Visible = True + TxtRuta.Text = GvRow.DataKey("Ruta") + DdlRutaEstatus.SelectedValue = GvRow.DataKey("Estatus") + BtnAddRuta.Visible = True + BtnAddRuta.Text = "Editar" + ViewState("Cve") = GvRow.DataKey("CveRuta").ToEntero + + + Case "BtnEditarDestino" + ModalLabel.Text = "Editar Destino" + TxtDestino.Text = GvRow.DataKey("Destino") + DdlEsNacional.SelectedValue = GvRow.DataKey("EsNacional") + DdlDestinoEstatus.SelectedValue = GvRow.DataKey("Estatus") + PnDestino.Visible = True + BtnAddDestino.Visible = True + BtnAddDestino.Text = "Editar" + ViewState("Cve") = GvRow.DataKey("CveDestino").ToEntero + + + Case "BtnEditarImporte" + ModalLabel.Text = "Editar Importe" + DdlRutas.SelectedValue = GvRow.DataKey("CveRuta") + DdlOrigen.SelectedValue = GvRow.DataKey("CveDestinoOrigen") + DdlFinal.SelectedValue = GvRow.DataKey("CveDestinoFinal") + TxtImporte.Text = GvRow.DataKey("Importe") + PnImporte.Visible = True + BtnAddImporte.Visible = True + BtnAddImporte.Text = "Editar" + ViewState("Cve") = GvRow.DataKey("CveDestinoTarifa").ToEntero + + + End Select + End If + + If id.Contains("Agregar") Then + Select Case id + Case "BtnAgregarRuta" + ModalLabel.Text = "Agregar Ruta" + PnRuta.Visible = True + BtnAddRuta.Visible = True + BtnAddRuta.Text = "Guardar" + Case "BtnAgregarDestino" + ModalLabel.Text = "Agregar Destino" + PnDestino.Visible = True + BtnAddDestino.Visible = True + BtnAddDestino.Text = "Guardar" + Case "BtnAgregarImporte" + ModalLabel.Text = "Agregar Importe" + PnImporte.Visible = True + BtnAddImporte.Visible = True + BtnAddImporte.Text = "Guardar" + + End Select + End If + UpModal.Update() + RegistraScript(String.Format("$('#{0}').modal('show');", "Modal")) + End Sub + + +#Region "Rutas" + Protected Sub AddRuta(sender As Object, e As EventArgs) + + Dim ObjRuta As New ClsTransportes + ObjRuta.IniciaTransacSQL() + Try + If BtnAddRuta.Text = "Guardar" Then + If ObjRuta.AddRuta(TxtRuta.Text, DdlRutaEstatus.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 1 Then + ObjRuta.Commit() + Alert("Ruta Agregada Correctamente.") + End If + End If + + If BtnAddRuta.Text = "Editar" Then + If ObjRuta.UpdateRuta(Cve, TxtRuta.Text, DdlRutaEstatus.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + ObjRuta.Commit() + Alert("Ruta Actualizada Correctamente.") + End If + End If + Catch ex As Exception + ObjRuta.RollBack() + Finally + CargaDatos() + ObjRuta.Dispose() + End Try + + + End Sub + Protected Sub RemoveRuta(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim ObjRuta As New ClsTransportes + + If ObjRuta.RemoveRuta(GvRow.DataKey("CveRuta").ToEntero) Then + Alert("Ruta eliminada correctamente") + CargaDatos() + End If + + ObjRuta.Dispose() + End Sub +#End Region + +#Region "Destinos" + Protected Sub AddDestino(sender As Object, e As EventArgs) + + Dim ObjDestino As New ClsTransportes + ObjDestino.IniciaTransacSQL() + Try + If BtnAddDestino.Text = "Guardar" Then + If ObjDestino.AddDestino(TxtDestino.Text, DdlDestinoEstatus.SelectedValue, DdlEsNacional.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 1 Then + ObjDestino.Commit() + Alert("Destino agregado correctamente.") + End If + End If + + If BtnAddDestino.Text = "Editar" Then + If ObjDestino.UpdateDestino(Cve, TxtDestino.Text, DdlDestinoEstatus.SelectedValue, DdlEsNacional.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + ObjDestino.Commit() + Alert("Destino actualizado correctamente.") + End If + End If + Catch ex As Exception + ObjDestino.RollBack() + Finally + CargaDatos() + ObjDestino.Dispose() + End Try + + + End Sub + Protected Sub RemoveDestino(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim ObjDestino As New ClsTransportes + + If ObjDestino.RemoveDestino(GvRow.DataKey("CveDestino").ToEntero) Then + Alert("Destino eliminado correctamente") + CargaDatos() + End If + + ObjDestino.Dispose() + End Sub +#End Region + +#Region "Importes" + Protected Sub AddImporte(sender As Object, e As EventArgs) + + Dim ObjImporte As New ClsTransportes + ObjImporte.IniciaTransacSQL() + Try + If BtnAddImporte.Text = "Guardar" Then + If ObjImporte.AddDestinosTarifas(DdlRutas.SelectedValue, DdlOrigen.SelectedValue, DdlFinal.SelectedValue, TxtImporte.Text) > 1 Then + ObjImporte.Commit() + Alert("Importe agregado correctamente.") + End If + End If + + If BtnAddImporte.Text = "Editar" Then + If ObjImporte.UpdateDestinosTarifas(Cve, DdlRutas.SelectedValue, DdlOrigen.SelectedValue, DdlFinal.SelectedValue, TxtImporte.Text) Then + ObjImporte.Commit() + Alert("Importe actualizado correctamente.") + End If + End If + Catch ex As Exception + ObjImporte.RollBack() + Finally + CargaDatos() + ObjImporte.Dispose() + End Try + + + End Sub + Protected Sub RemoveImporte(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim ObjImporte As New ClsTransportes + + If ObjImporte.RemoveDestinosTarifas(GvRow.DataKey("CveDestinoTarifa").ToEntero) Then + Alert("Importe eliminada correctamente") + CargaDatos() + End If + + ObjImporte.Dispose() + End Sub +#End Region + +End Class diff --git a/Transportes/RepContratos.aspx b/Transportes/RepContratos.aspx index 043705da3..a5c307b84 100644 --- a/Transportes/RepContratos.aspx +++ b/Transportes/RepContratos.aspx @@ -3,7 +3,7 @@ CodeFile="RepContratos.aspx.vb" Inherits="ListadoContratos" %> - + Listado de Contratos @@ -30,41 +30,155 @@ .boton { background: red; } + + .consulta { + padding: 1rem 2rem; + background-color: #95A5A6; + display: flex; + justify-content: space-around; + align-items: center; + margin-bottom:1rem; + } + + .consulta_campo { + display: flex; + gap: 1rem; + align-items: center; + width:100%; + } + + .consulta_campo label { + color: white; + font-weight: bold; + } - - - + + +
  • - Agregar Contrato + Agregar Contrato
  • Generar Excel
  • -
    - - - +
    + + +
    - + + + +
    +
    + + +
    -
    - " - style="display: inline-block; margin-right: -10px; width: 150px;" /> - " - style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> - -
    - - - - - +
    + +
    + + + + + + + + + +
    +
    + +
    + +
    +
    +
    + + + + +
    + + + + + + + + + +
    +
    +
    + +
    + +
    +
    + + + + +
    + + + + + + + + + +
    +
    + + +
    +
    +
    + + + + + @@ -109,207 +223,212 @@ - - - - + + + + + - - - - + + + + + + +
    +
    + + + + - diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb index 5b7219c1e..2f4059cca 100644 --- a/Transportes/RepContratos.aspx.vb +++ b/Transportes/RepContratos.aspx.vb @@ -1,5 +1,6 @@ Option Explicit On Option Strict On +Imports System.Data.SqlClient Imports Extensiones Imports Extensiones.ModExtensiones @@ -22,15 +23,6 @@ Partial Class ListadoContratos End If End Sub Private Sub InicializaCombos() - 'Lista Activos Fijos' - 'Dim ObjAF As New ClsAF() - 'If ObjAF.GetActivosFijos(-1, UsuarioActual.CveEmpresa, "-1", "-1", -1, -1, "-1", -1, -1, -1, -1, 1, "-1", -1, -1, -1) Then - ' If ObjAF.DtResultados.Rows.Count > 0 Then - ' DdlAF.DataSource = ObjAF.DtResultados - ' DdlAF.Items.Insert(0, New ListItem("Seleccione", "")) - ' End If - 'End If - 'ObjAF.Dispose() DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa) DdlTipoAF.DataBind() DdlTipoAF.Items.Insert(0, New ListItem("Seleccione", "")) @@ -40,7 +32,6 @@ Partial Class ListadoContratos DdlChofer.DataBind() DdlChofer.Items.Insert(0, New ListItem("Seleccione", "")) - UpModal.Update() End Sub Private Sub CargaDatos() @@ -48,14 +39,15 @@ Partial Class ListadoContratos If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then GvContratos.DataSource = ObjContratos.DtResultados End If - ObjContratos.Dispose() GvContratos.DataBind() UpTitulos.Update() End Sub Protected Sub MostrarModal(Optional Descripcion As String = "", Optional FechaSalida As String = "", Optional FechaRegreso As String = "", Optional Observaciones As String = "", Optional Ubicacion As String = "", Optional Transporte As String = "", Optional CveCliente As Integer = 0, Optional Dolares As String = "", Optional Pesos As String = "", Optional Anticipo As String = "", Optional Boton As String = "Guardar", Optional Chofer As String = "") + DdlClientes.SelectedText = Cliente TxtDescripcion.Text = Descripcion + TxtUbicacion.Text = Ubicacion TxtFechaSalida.Text = FechaSalida TxtFechaRegreso.Text = FechaRegreso TxtObservaciones.Text = Observaciones @@ -64,10 +56,17 @@ Partial Class ListadoContratos DdlClientes.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial") DdlClientes.SelectedValue = CveCliente.ToString DdlChofer.SelectedValue = Chofer + TxtObservaciones.Text = Observaciones TxtDolares.Text = Dolares TxtPesos.Text = Pesos TxtAnticipo.Text = Anticipo BtnGuardar.Text = Boton + If EstatusContrato <> "" Then + LbEstatus.Visible = True + DdlEstatusContrato.Visible = True + DdlEstatusContrato.SelectedValue = EstatusContrato + End If + 'DdlEstatusContrato.Text = EstatusContrato myModalLabel.InnerHtml = $"{Boton} Contrato" UpModal.Update() RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar")) @@ -91,49 +90,54 @@ Partial Class ListadoContratos Dim retorno As Boolean = False If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then - CveEstatusInicial = ObjContratos.DtResultados.FiltroPrimeroValor("CveContratoEstatus", "TipoEstatus=1").ToEntero - End If + CveEstatusInicial = ObjContratos.DtResultados.FiltroPrimeroValor("CveContratoEstatus", "TipoEstatus=1").ToEntero + End If 'Agregar contrato If BtnGuardar.Text = "Guardar" Then - CveContratoHijo = ObjContratos.AddContratos("", TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=1, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero) + CveContratoHijo = ObjContratos.AddContratos("", TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=1, CveTipoAF:=DdlTransporte.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero) If CveContratoHijo > 0 Then ObjContratos.Commit() Alert("Agregado Correctamente.") End If - Else - 'Actualizar contrato - If BtnGuardar.Text = "Editar" Then - retorno = ObjContratos.UpdateContratos(CveContrato, "", TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=1, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero) + End If - If retorno Then - ObjContratos.Commit() - Alert("Actualizado Correctamente.") - End If - End If + 'Actualizar contrato + If BtnGuardar.Text = "Editar" Then + retorno = ObjContratos.UpdateContratos(CveContrato, "", TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=1, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveTipoAF:=DdlTransporte.SelectedValue.ToEntero) + + ObjContratos.Commit() + Alert("Actualizado Correctamente.") + End If + End If End If TxtDescripcion.Text = "" - TxtFechaSalida.Text = "" - TxtFechaRegreso.Text = "" - TxtObservaciones.Text = "" - TxtUbicacion.Text = "" - DdlClientes.SelectedText = "" - 'DdlTipoAF.SelectedValue = "-1" - 'DdlChofer.SelectedValue = "-1" + TxtFechaSalida.Text = "" + TxtFechaRegreso.Text = "" + TxtObservaciones.Text = "" + TxtUbicacion.Text = "" + DdlClientes.SelectedText = "" + DdlTransporte.SelectedValue = "" + DdlChofer.SelectedValue = "" TxtDolares.Text = "" TxtPesos.Text = "" TxtAnticipo.Text = "" BtnGuardar.Text = "Guardar" - + Catch ex As Exception + Alert($"Ocurrió un error {ex}", TipoMensaje.MsgError) + ObjContratos.RollBack() + Finally ObjContratos.Dispose() CargaDatos() + End Try + End Sub Protected Sub UpdateContrato(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) ViewState("CveContrato") = GvRow.DataKey("CveContrato") MostrarModal( - Descripcion:=GvRow.DataKey("DescripcionContrato"), FechaSalida:=GvRow.DataKey("FechaInicial").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T"), FechaRegreso:=GvRow.DataKey("FechaFinal").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T"), Observaciones:=GvRow.DataKey("DescripcionContrato"), Ubicacion:=GvRow.DataKey("Ubicacion"), Transporte:=GvRow.DataKey("CveTipoAF"), CveCliente:=GvRow.DataKey("CveCliente").ToEntero, Dolares:=GvRow.DataKey("Importe"), Pesos:=GvRow.DataKey("ImporteMax"), Anticipo:=GvRow.DataKey("ImporteMin"), Boton:="Editar", Chofer:=GvRow.DataKey("CveChofer")) + Descripcion:=GvRow.DataKey("DescripcionContrato"), FechaSalida:=GvRow.DataKey("FechaInicial").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T"), FechaRegreso:=GvRow.DataKey("FechaFinal").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T"), Observaciones:=GvRow.DataKey("DescripcionContrato"), Ubicacion:=GvRow.DataKey("Ubicacion"), Transporte:=GvRow.DataKey("CveTipoAF"), Cliente:=GvRow.DataKey("CveCliente"), Dolares:=GvRow.DataKey("Importe"), Pesos:=GvRow.DataKey("ImporteMax"), Anticipo:=GvRow.DataKey("ImporteMin"), Boton:="Editar", Chofer:=GvRow.DataKey("CveChofer")) End Sub Protected Sub RemoveContrato(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) @@ -150,4 +154,34 @@ Partial Class ListadoContratos GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString) End Sub + Protected Sub Consultar(sender As Object, e As EventArgs) + + If DdlClientesConsulta.SelectedValue = "" Then + Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim cliente As Integer = DdlClientesConsulta.SelectedValue.ToEntero + Dim estatus As Integer = DdlEstatusConsulta.SelectedValue.ToEntero + Dim fechaInicial As DateTime = txtFechaI.Text.ToDate + Dim fechaFinal As DateTime = txtFechaF.Text.ToDate + + Dim query As String = "SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreComercial FROM Con_Contratos C LEFT JOIN Clientes Cli with(nolock) ON Cli.CveCliente = C.CveCliente WHERE C.CveCliente = @Cliente AND EstatusContrato = @Estatus AND FechaInicial BETWEEN @FechaInicial AND @FechaFinal" + + Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString) + Using command As New SqlCommand(query, connection) + command.Parameters.AddWithValue("@Cliente", cliente) + command.Parameters.AddWithValue("@Estatus", estatus) + command.Parameters.AddWithValue("@FechaInicial", fechaInicial) + command.Parameters.AddWithValue("@FechaFinal", fechaFinal) + + connection.Open() + Dim reader As SqlDataReader = command.ExecuteReader() + GvContratos.DataSource = reader + GvContratos.DataBind() + End Using + End Using + + UpTitulos.Update() + End Sub End Class diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx index df09535f1..29d50dac9 100644 --- a/Transportes/RepContratosCalendario.aspx +++ b/Transportes/RepContratosCalendario.aspx @@ -10,6 +10,41 @@ align-items: center; gap: 2rem; } + + .my-1 { + margin-block: 1rem; + } + + .consulta { + padding: 1rem 2rem; + background-color: #95A5A6; + display: flex; + justify-content: space-around; + align-items: center; + margin-bottom: 1rem; + } + + .consulta_campo { + display: flex; + gap: 1rem; + align-items: center; + width: 100%; + } + + .consulta_campo label { + color: white; + font-weight: bold; + } + + .miGrid { + color: white; + text-align: center; + } + + .miGrid thead { + color: black; + text-align: center; + } @@ -20,8 +55,8 @@ - <%--Calendario Tab--%> - + <%--Calendario Tab--%> + @@ -65,15 +100,121 @@ - - - <%--Contratos Tab--%> - - - - + + + <%--Contratos Tab--%> + + + + +
    +
    + + +
    + +
    + +
    + + + + + + + + + +
    +
    + +
    + +
    +
    +
    + + + + +
    + + + + + + + + + +
    +
    +
    + +
    + +
    +
    + + + + +
    + + + + + + + + + +
    +
    + + +
    +
    +
    + + + + + @@ -95,11 +236,11 @@ - - - - - + + + + + @@ -121,106 +262,119 @@ - - - -
    -
    + + + + + + + + + + + + + + + + + + + +