diff --git a/App_Code/ClsTransportes.vb b/App_Code/ClsTransportes.vb index 13189b553..979375c2e 100644 --- a/App_Code/ClsTransportes.vb +++ b/App_Code/ClsTransportes.vb @@ -184,6 +184,7 @@ Public Class ClsTransportes CveMasivo = Data.Rows(0)("CveMasivo").ToString.ToEntero Fecha = Data.Rows(0)("Fecha").ToString.ToDate Ruta = Data.Rows(0)("Ruta").ToString + Me.CveViaje = Data.Rows(0)("CveViaje").ToString.ToEntero End If Retorno = True Catch ex As Exception @@ -273,20 +274,15 @@ Public Class ClsTransportes Return Retorno End Function - Public Function GetViajesPasajeros(CveViaje As Integer, Optional CveViajePasajero As Integer = 0, Optional Estatus As Boolean = False) As Boolean + Public Function GetViajesPasajeros(CveViaje As Integer, Optional CveViajePasajero As Integer = -1, Optional Estatus As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Trans_ViajesPasajerosGet") - If Estatus = True Then - With SqlAdapter.SelectCommand.Parameters - .Add("@CveViaje", SqlDbType.Int).Value = CveViaje - .Add("@Estatus", SqlDbType.Bit).Value = Estatus - End With - Else - With SqlAdapter.SelectCommand.Parameters - .Add("@CveViaje", SqlDbType.Int).Value = CveViaje - End With - End If + With SqlAdapter.SelectCommand.Parameters + .Add("@CveViaje", SqlDbType.Int).Value = CveViaje + .Add("@CveViajePasajero", SqlDbType.Int).Value = CveViajePasajero + .Add("@Estatus", SqlDbType.Int).Value = Estatus + End With Try SqlAdapter.Fill(Data) diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index d6d20549f..d907fcd2b 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -4,8 +4,7 @@ Option Explicit On Imports System.Data Imports System.Data.SqlClient Imports System.IO -Imports Extensiones -Imports Microsoft.Owin.Security.Provider +Imports Extensiones Imports Microsoft.Reporting.WebForms Partial Class Inventarios_EntregaAlmacen @@ -342,7 +341,7 @@ Partial Class Inventarios_EntregaAlmacen InicializaValores() CargaParametrosAD() - If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 146, 119) Then DdlAlmacen.AutoPostBack = True + If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 146, 119, 186) Then DdlAlmacen.AutoPostBack = True If UsuarioActual.Empresa.Funcionalidad(281).ToEntero() = 1 Then @@ -521,9 +520,7 @@ Partial Class Inventarios_EntregaAlmacen If DtPendientes IsNot Nothing Then GVPendientes.DataSource = DtPendientes - End If - LtActualizado.Text = String.Format("Actualizado: {0}", NowADS().ToString("H:mm")) GVPendientes.DataBind() @@ -613,8 +610,6 @@ Partial Class Inventarios_EntregaAlmacen TipoEntrega = 1 BtnGuardar.Visible = True - - Dim StrAlmacenes As String = "CveTipoAlmacen IN (1,2,26)" If UsuarioActual.CveSubProyecto = 8804 Then diff --git a/OS/RepOSMedicas.aspx.vb b/OS/RepOSMedicas.aspx.vb index a561100f0..f1fd8baca 100644 --- a/OS/RepOSMedicas.aspx.vb +++ b/OS/RepOSMedicas.aspx.vb @@ -72,7 +72,7 @@ Partial Class OS_RepOSMedicas End If txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString - txtFechaF.Text = NowADS().ToShortDateString + txtFechaF.Text = NowADS().AddDays(2).ToShortDateString DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ") DdlMedico.DataBind() diff --git a/Scripts/custom.js b/Scripts/custom.js index d14dfa838..fd6e9cf3d 100644 --- a/Scripts/custom.js +++ b/Scripts/custom.js @@ -1667,6 +1667,22 @@ function loadsortadscroll() { var index = tthis.index(); var multiplicador = -1; var tipodato = tthis.closest('tr').find('th').data('tipodato') + if(1==1){ + + var table = $(tthis.closest('.ADScroller').find('.ADScroller-body > table ')[0]); + var tabletr = table.find('> tr:not(.trnopadding.ADtr),> tbody > tr:not(.trnopadding.ADtr),> thead > tr:not(.trnopadding.ADtr)'); + if (tabletr.length > 0) { + + el = $(tabletr[0]); + var tdtexto = el.find("> td"); + texto = $(tdtexto[index]).data('order'); + if (texto) { + tipodato = 'dataorder'; + } + + } + } + //console.log({ tipodato }) tthis.closest('tr').addClass('tsorterblock'); setTimeout( function () { @@ -1867,6 +1883,35 @@ function loadsortadscroll() { table.append(this.obj); }); } + + function reordenarcinco() { + var re = new RegExp(",", 'g'); + var table = $(tthis.closest('.ADScroller').find('.ADScroller-body > table ')[0]); + var tabletr = table.find('> tr:not(.trnopadding.ADtr),> tbody > tr:not(.trnopadding.ADtr),> thead > tr:not(.trnopadding.ADtr)'); + tipostring = 0; + tiponumeric = 0; + tipodate = 0; + var mapped = tabletr.map(function (i, el) { + el = $(el); + var tdtexto = el.find("> td"); + var texto = null; + var texton = 0; + if (tdtexto && tdtexto.length > index) { + texton = Number($(tdtexto[index]).data('order')); + + } else { + texto = null; + } + return { index: i, value: texton, obj: el }; + }); + //console.log(mapped) + mapped.sort(function (a, b) { + return (+(a.value > b.value) || +(a.value === b.value) - 1) * multiplicador; + }); + mapped.each(function (i, el) { + table.append(this.obj); + }); + } switch (tipodato) { case 'string': reordenardos(); @@ -1877,6 +1922,9 @@ function loadsortadscroll() { case 'numeric': reordenarcuatro(); break; + case 'dataorder': + reordenarcinco(); + break; default: reordenaruno(); } diff --git a/Transportes/Boletos.aspx b/Transportes/Boletos.aspx index a7201422a..e8c33e9fc 100644 --- a/Transportes/Boletos.aspx +++ b/Transportes/Boletos.aspx @@ -1,5 +1,5 @@ <%@ Page Language="VB" Title="Transportes V&A - Comprar Boleto" AutoEventWireup="false" MasterPageFile="~/Site.master" CodeFile="Boletos.aspx.vb" - Inherits="Boletos" EnableEventValidation="true" %> + Inherits="Boletos" %> Comprar Boleto @@ -67,155 +67,146 @@ -<%-- - -
  • - Viajes -
  • -
    -
    --%> + + + - -
    -
    -
    -
    - - Datos del Cliente + + +
    +
    +
    +
    +
    + + Datos del Cliente +
    +
    +
    +
    +
    -
    -
    +
    + +
    + + + + +
    + +
    +
    +
    + + +
    +
    + +
    +
    +
    +
    + + + + + + +
    +
    +
    +
    + + + +
    +
    +
    + +
    + + + +
    + +
    +
    + +
    +
    +
    + + Datos del Viaje +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    + + + + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    + + + + +
    +
    + +
    + +
    + +
    +
    + +
    +
    + + +
    -
    -
    - - - - -
    - -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    - - - - - - -
    -
    -
    -
    - - - -
    -
    -
    - -
    - - - -
    - -
    -
    - -
    -
    -
    - - Datos del Viaje -
    -
    - -
    - - -
    -
    -
    - - -
    -
    -
    -
    - - - - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - -
    - - - - -
    -
    - -
    - - -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    - -
    +
    @@ -226,6 +217,7 @@ + @@ -474,6 +466,9 @@
    +
    + + diff --git a/Transportes/Boletos.aspx.vb b/Transportes/Boletos.aspx.vb index 62774dc29..8af8af748 100644 --- a/Transportes/Boletos.aspx.vb +++ b/Transportes/Boletos.aspx.vb @@ -59,13 +59,16 @@ Partial Class Boletos 'Datos Viaje Dim ObjViaje As New ClsTransportes Dim retornoViaje As Boolean = ObjViaje.GetViajes(CveViaje, UsuarioActual.CveEmpresa) - ViewState("CveRuta") = ObjViaje.CveRuta - If retornoViaje Then + + If retornoViaje AndAlso ObjViaje.CveViaje > 0 Then + CveRuta = ObjViaje.CveRuta TxtRuta.Text = ObjViaje.Ruta TxtFecha.Text = ObjViaje.Fecha.ToShortDateString + CargaDestinos() 'Boletos Vendidos Dim dt As DataTable - If ObjViaje.GetViajesPasajeros(CveViaje, Estatus:=True) Then 'Poner párametro para estatus y cancelado de viajes + If ObjViaje.GetViajesPasajeros(CveViaje, Estatus:=1) Then 'Poner párametro para estatus y cancelado de viajes + dt = ObjViaje.DtResultados dt = ObjViaje.DtResultados Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder) For Each dr As DataRow In dt.Rows @@ -75,7 +78,6 @@ Partial Class Boletos lnk.CssClass = "nodisponible" lnk.ToolTip = dr("Nombre").ToString End If - Next End If End If @@ -85,6 +87,10 @@ Partial Class Boletos Protected Sub InicializaCombos() 'Lista Destinos''carga específicos + + End Sub + + Private Sub CargaDestinos() Dim ObjDestinos As New ClsTransportes() If ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then @@ -102,20 +108,18 @@ Partial Class Boletos End If ObjDestinos.Dispose() End Sub - - Protected Sub CotizarTarifa(sender As Object, e As EventArgs) + Private Sub CotizarTarifa() If DdlDestino.SelectedValue <> "" And DdlPartida.SelectedValue <> "" Then Dim ObjDestinos As New ClsTransportes() Dim retorno As Boolean = ObjDestinos.GetDestinosTarifas(DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero) - Dim ImporteR As Decimal = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal + Dim ImporteR As Decimal = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL ObjDestinos.Dispose() If retorno Then If ImporteR > 0 Then - Dim redondeado As String = CStr(Math.Round(ImporteR, 2)) - ViewState("Importe") = redondeado - TxtCosto.Text = $"El precio de su boleto es ${Importe}" + ViewState("Importe") = ImporteR + TxtCosto.Text = $"El precio de su boleto es ${ImporteR.FormatoNumero}" BtnGuardar.Visible = True upPanel.Visible = True Else @@ -175,4 +179,12 @@ Partial Class Boletos End Sub + + Protected Sub DdlPartida_SelectedIndexChanged(sender As Object, e As EventArgs) + CotizarTarifa() + End Sub + + Protected Sub DdlDestino_SelectedIndexChanged(sender As Object, e As EventArgs) + CotizarTarifa() + End Sub End Class diff --git a/Transportes/RepBoletos.aspx b/Transportes/RepBoletos.aspx index 27869d3d3..b0c7b381e 100644 --- a/Transportes/RepBoletos.aspx +++ b/Transportes/RepBoletos.aspx @@ -14,9 +14,9 @@ -<%-- + ---%> +
    @@ -27,11 +27,13 @@
    + + -
    +
    + data-sort="true" DataKeyNames="CveViajePasajero,Asiento,Nombre, Visa,Celular,Sexo,Estatus,Partida,Destino, Importe,FechaIng, Agencia, TelefonoAgencia"> @@ -93,10 +95,10 @@ - + data-btn-ok-label="si" OnClick="BtnCancelar_Click" /> @@ -107,6 +109,8 @@
    + + diff --git a/Transportes/RepBoletos.aspx.vb b/Transportes/RepBoletos.aspx.vb index 55a6df615..f85fe63e8 100644 --- a/Transportes/RepBoletos.aspx.vb +++ b/Transportes/RepBoletos.aspx.vb @@ -31,7 +31,7 @@ Partial Class ListadoBoletos Response.Redirect("/Transportes/RepViajes.aspx") End If CveViaje = Request.QueryString("CveViaje").ToEntero - Ruta = Request.QueryString("Ruta") + Ruta = IfNull(Request("Ruta"), "").ToString Prueba.Text = Ruta @@ -46,43 +46,11 @@ Partial Class ListadoBoletos Private Sub CargaDatos() Dim ObjTransportes As New ClsTransportes - If ObjTransportes.GetViajesPasajeros(CveViaje) Then - GvBoletos.DataSource = ObjTransportes.DtResultados - ObjTransportes.Dispose() - GvBoletos.DataBind() End If - End Sub - - Protected Sub ToggleViajesPasajeros(sender As Object, e As EventArgs) - Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - Dim CveViajePasajero As String = GvRow.DataKey("CveViajePasajero") - Dim Estatus As String = GvRow.DataKey("Estatus") - Dim cambiarEstatus As Boolean = Not Estatus.ToBool - Dim ObjTransportes As New ClsTransportes - - Try - ObjTransportes.IniciaTransacSQL() - If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero.ToEntero, Activar:=True, Estatus:=cambiarEstatus) Then - - If cambiarEstatus Then - Alert($"El boleto ha sido cancelado correctamente.") - Else - Alert($"El boleto ha sido reactivado correctamente.") - - End If - End If - ObjTransportes.Commit() - - Catch ex As Exception - ObjTransportes.RollBack() - Alert($"No se pudo cambiar el estatus del boleto {ex}", TipoMensaje.MsgError) - Finally - ObjTransportes.Dispose() - CargaDatos() - End Try - + ObjTransportes.Dispose() + GvBoletos.DataBind() End Sub Protected Sub ImprimirBoleto(sender As Object, e As EventArgs) @@ -113,4 +81,29 @@ Partial Class ListadoBoletos End Sub + + Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim CveViajePasajero As String = GvRow.DataKey("CveViajePasajero") + Dim Estatus As String = GvRow.DataKey("Estatus") + Dim cambiarEstatus As Boolean = Not Estatus.ToBool + Dim ObjTransportes As New ClsTransportes + ObjTransportes.IniciaTransacSQL() + Try + If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero.ToEntero, Activar:=cambiarEstatus, Estatus:=cambiarEstatus) Then + If Not cambiarEstatus Then + Alert($"El boleto ha sido cancelado correctamente.") + Else + Alert($"El boleto ha sido reactivado correctamente.") + End If + End If + ObjTransportes.Commit() + Catch ex As Exception + ObjTransportes.RollBack() + Alert($"No se pudo cambiar el estatus del boleto {ex}", TipoMensaje.MsgError) + Finally + ObjTransportes.Dispose() + CargaDatos() + End Try + End Sub End Class \ No newline at end of file diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb index 91d82696c..21fce0286 100644 --- a/Ventas/Promociones.aspx.vb +++ b/Ventas/Promociones.aspx.vb @@ -164,11 +164,12 @@ Partial Class Ventas_Promociones If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then GvDatos.Columns(8).Visible = True DivRin.Visible = True - Dim ObjGral As New ClsGenerales - If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then - DdlRin.DataSource = ObjGral.DtResultados - End If - ObjGral.Dispose() + 'Dim ObjGral As New ClsGenerales + 'If ObjGral.GetRinTamanios(UsuarioActual.CveEmpresa) Then + ' DdlRin.DataSource = ObjGral.DtResultados + 'End If + 'ObjGral.Dispose() + DdlRin.DataSource = GlobalDTPSRinTamaños(UsuarioActual.CveEmpresa) DdlRin.DataBind() DdlRin.Items.Insert(0, New ListItem("Todos", "-1")) End If @@ -1073,12 +1074,12 @@ Partial Class Ventas_Promociones ObjPS.Dispose() - Dim ObjGral As New ClsGenerales - If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then - DTRines = ObjGral.DtResultados - End If - ObjGral.Dispose() - + 'Dim ObjGral As New ClsGenerales + 'If ObjGral.GetRinTamanios(UsuarioActual.CveEmpresa) Then + ' DTRines = ObjGral.DtResultados + 'End If + 'ObjGral.Dispose() + DTRines = GlobalDTPSRinTamaños(UsuarioActual.CveEmpresa) Dim RegistroActual As Integer = 1 For Each dRow As DataRow In DTPlantilla.Rows diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index bf9246d46..f8293738d 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -5368,7 +5368,7 @@ + DataKeyNames="CveVenta, CveVentaDetalle, PU, Total, Cantidad, CveContrato,Surtido,Medico,Procedimiento" AllowPaging="False">