From bdd3c15b50c7e6101fa7e8de000116bc1eab05d0 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 12 Feb 2024 23:16:41 -0700 Subject: [PATCH 1/6] - --- App_Code/ClsNominas.vb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index db7ea6e92..587854f03 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -2763,9 +2763,11 @@ Public Class ClsNominas End Try Return retorno End Function + Public Function GetNominaEmpleado(CveProyecto As Integer, CveSubProyecto As Integer, CveTurno As Integer, CvePeriodo As Integer, CveEmpresa As Integer, Agrupador As Integer, Optional RegimenContratacion As Integer = 1, Optional CvePersonal As Integer = -1, Optional NetoxSalario As Decimal = 0, Optional Neto As Decimal = 0, - Optional CveTipoTrabajador As Integer = -1) As Boolean + Optional CveTipoTrabajador As Integer = -1, Optional EsSimulador As Boolean = False, Optional TipoPeriodo As Integer = -1, Optional AreaGeografica As String = "A", + Optional EjercicioSimula As Integer = -1, Optional FactorISimula As Decimal = 1.0493150684931D) As Boolean Dim retorno As Boolean = False Try DTSet = New DataSet() @@ -2782,6 +2784,11 @@ Public Class ClsNominas .Add("@NetoxSalario", SqlDbType.Decimal).Value = NetoxSalario .Add("@Neto", SqlDbType.Decimal).Value = Neto .Add("@CveTipoTrabajador", SqlDbType.Decimal).Value = CveTipoTrabajador + .Add("@EsSimulador", SqlDbType.Bit).Value = EsSimulador + .Add("@TipoPeriodo", SqlDbType.Int).Value = TipoPeriodo + .Add("@AreaGeografica", SqlDbType.VarChar).Value = AreaGeografica.ToUpper() + .Add("@EjercicioSimula", SqlDbType.Int).Value = EjercicioSimula + .Add("@FactorISimula", SqlDbType.Decimal).Value = FactorISimula End With From 36c9a26be83578edb0fb9fabf49cef11fc7dbe47 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 13 Feb 2024 09:48:49 -0700 Subject: [PATCH 2/6] -- mejora --- Ashx/E119.ashx | 56 ++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/Ashx/E119.ashx b/Ashx/E119.ashx index f0370597d..cb056f393 100644 --- a/Ashx/E119.ashx +++ b/Ashx/E119.ashx @@ -420,11 +420,17 @@ Public Class E119 : Implements IHttpHandler Return JsonConvert.SerializeObject(Respuesta) End If + Dim bill As JToken = Nothing If JsonRequest("billing") IsNot Nothing AndAlso JsonRequest("rfc_info") IsNot Nothing AndAlso JsonRequest("rfc_info").Count > 0 Then - RFC = JsonRequest("rfc_info")(0)("rfc_client").ToString() - RegimenCliente = JsonRequest("rfc_info")(0)("regimen_client").ToString() - UsoCFDI = JsonRequest("rfc_info")(0)("cfdi").ToString() - NombreCliente = JsonRequest("billing")(0)("first_name").ToString() & " " & JsonRequest("billing")(0)("last_name").ToString() + Dim billrfc As JToken + + If JsonRequest("rfc_info").Type = JTokenType.Array Then billrfc = JsonRequest("rfc_info").First Else billrfc = JsonRequest("rfc_info") + If JsonRequest("billing").Type = JTokenType.Array Then bill = JsonRequest("billing").First Else bill = JsonRequest("billing") + + RFC = billrfc("rfc_client").ToString() + RegimenCliente = billrfc("regimen_client").ToString() + UsoCFDI = billrfc("cfdi").ToString() + NombreCliente = bill("first_name").ToString() & " " & bill("last_name").ToString() 'si vienen vacío toman datos predeterminados If RFC = "" Then RFC = "XAXX010101000" If RegimenCliente = "" Then RegimenCliente = "616" @@ -439,7 +445,6 @@ Public Class E119 : Implements IHttpHandler End If If Not TieneError Then - 'BUSCAR SI ESTÁ REGISTRADO EL CLIENTE If ObjClientes.GetClientes(-1, "-1", "-1", "-1", RFC, "-1", "-1", -1, CveEmpresa, 1, TipoCliente:=-1, TopSelect:=1) Then If ObjClientes.DtResultados.Rows.Count > 0 Then @@ -453,20 +458,20 @@ Public Class E119 : Implements IHttpHandler If CveCliente = 0 Then ' 'DATOS DE BILLING MsgLog.AppendLine("1.5 crear cliente") - If JsonRequest("billing") IsNot Nothing Then + If bill IsNot Nothing Then Dim CveEstado As Integer = -1 Dim CveRegimenFiscal As Integer = -1 - Dim Direccion As String = If(JsonRequest("billing")("address_1") Is Nothing, "", JsonRequest("billing")("address_1").ToString()) + Dim Direccion As String = If(bill("address_1") Is Nothing, "", bill("address_1").ToString()) Dim NumExt As String = "" Dim NumInt As String = "" Dim Colonia As String = "" - Dim Ciudad As String = If(JsonRequest("billing")("city") Is Nothing, "", JsonRequest("billing")("city").ToString()) - Dim Localidad As String = If(JsonRequest("billing")("city") Is Nothing, "", JsonRequest("billing")("city").ToString()) - Dim CP As String = If(JsonRequest("billing")("postcode") Is Nothing, "", JsonRequest("billing")("postcode").ToString()) - Dim Telefono As String = If(JsonRequest("billing")("phone") Is Nothing, "", JsonRequest("billing")("phone").ToString()) - Dim Correo As String = If(JsonRequest("billing")("email") Is Nothing, "", JsonRequest("billing")("email").ToString()) - Dim Estado As String = If(JsonRequest("billing")("state") Is Nothing, "", JsonRequest("billing")("state").ToString()) + Dim Ciudad As String = If(bill("city") Is Nothing, "", bill("city").ToString()) + Dim Localidad As String = If(bill("city") Is Nothing, "", bill("city").ToString()) + Dim CP As String = If(bill("postcode") Is Nothing, "", bill("postcode").ToString()) + Dim Telefono As String = If(bill("phone") Is Nothing, "", bill("phone").ToString()) + Dim Correo As String = If(bill("email") Is Nothing, "", bill("email").ToString()) + Dim Estado As String = If(bill("state") Is Nothing, "", bill("state").ToString()) If Not String.IsNullOrEmpty(Estado) Then CveEstado = ClsPaginas.GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado.Trim}'").ToEntero() If CveEstado <= 0 Then 'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA @@ -493,17 +498,19 @@ Public Class E119 : Implements IHttpHandler End If If JsonRequest("shipping") IsNot Nothing AndAlso Not TieneError Then + Dim jship As JToken + If JsonRequest("shipping").Type = JTokenType.Array Then jship = JsonRequest("shipping").First Else jship = JsonRequest("shipping") Dim CveEstado As Integer = -1 - Dim Direccion As String = If(JsonRequest("shipping")(0)("address_1") Is Nothing, "", JsonRequest("shipping")(0)("address_1").ToString()) + Dim Direccion As String = If(jship("address_1") Is Nothing, "", jship("address_1").ToString()) Dim NumExt As String = "" Dim NumInt As String = "" Dim Colonia As String = "" - Dim Ciudad As String = If(JsonRequest("shipping")(0)("city") Is Nothing, "", JsonRequest("shipping")(0)("city").ToString()) - Dim Localidad As String = If(JsonRequest("shipping")(0)("city") Is Nothing, "", JsonRequest("shipping")(0)("city").ToString()) - Dim CP As String = If(JsonRequest("shipping")(0)("postcode") Is Nothing, "", JsonRequest("shipping")(0)("postcode").ToString()) - Dim Telefono As String = If(JsonRequest("shipping")(0)("phone") Is Nothing, "", JsonRequest("shipping")(0)("phone").ToString()) - Dim Correo As String = If(JsonRequest("shipping")(0)("email") Is Nothing, "", JsonRequest("shipping")(0)("email").ToString()) - Dim Estado As String = If(JsonRequest("shipping")(0)("state") Is Nothing, "", JsonRequest("shipping")(0)("state").ToString()) + Dim Ciudad As String = If(jship("city") Is Nothing, "", jship("city").ToString()) + Dim Localidad As String = If(jship("city") Is Nothing, "", jship("city").ToString()) + Dim CP As String = If(jship("postcode") Is Nothing, "", jship("postcode").ToString()) + Dim Telefono As String = If(jship("phone") Is Nothing, "", jship("phone").ToString()) + Dim Correo As String = If(jship("email") Is Nothing, "", jship("email").ToString()) + Dim Estado As String = If(jship("state") Is Nothing, "", jship("state").ToString()) If Not String.IsNullOrEmpty(Estado) Then CveEstado = ClsPaginas.GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado.Trim}'").ToEntero() If CveEstado <= 0 Then 'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA @@ -524,7 +531,6 @@ Public Class E119 : Implements IHttpHandler CveDireccionEnvio = ObjClientes.DireccionEnvioAdd(CveCliente, Direccion, NumExt, NumInt, Colonia, Ciudad, Estado, CP, "", 100, 1) End If End If - Else MsgLog.AppendLine("1.5.9 sin datos cliente") TieneError = True @@ -536,10 +542,12 @@ Public Class E119 : Implements IHttpHandler ObjFactura.AtencionA = NombreCliente MsgLog.AppendFormat("1.6.0 objeto creado {0}", If(ObjFactura IsNot Nothing, "si", "no")) - If JsonRequest("shiping_lines") IsNot Nothing Then - ' shiping + If JsonRequest("shipping_lines") IsNot Nothing Then + Dim jshiplines As JToken + If JsonRequest("shipping_lines").Type = JTokenType.Array Then jshiplines = JsonRequest("shipping_lines").First Else jshiplines = JsonRequest("shipping_lines") + 'shiping_lines/ method_id: free_shipping/local_pickup - Dim Entrega As String = If(JsonRequest("shiping_lines")("method_id") Is Nothing, "", JsonRequest("shiping_lines")("method_id").ToString()) + Dim Entrega As String = If(jshiplines("method_id") Is Nothing, "", jshiplines("method_id").ToString()) ObjFactura.Alfa1 = Entrega End If From 8b4a2190a3088528181a2565dbbec66414d4aabf Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 13 Feb 2024 11:02:56 -0700 Subject: [PATCH 3/6] -- manejo de fcaducidad, para que se cargue --- Inventarios/EntregaAlmacen.aspx | 2 +- Inventarios/EntregaAlmacen.aspx.vb | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Inventarios/EntregaAlmacen.aspx b/Inventarios/EntregaAlmacen.aspx index 6155e8cd8..ab17fcfb1 100644 --- a/Inventarios/EntregaAlmacen.aspx +++ b/Inventarios/EntregaAlmacen.aspx @@ -597,7 +597,7 @@
- + diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 524ed2d63..d7e800585 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -869,12 +869,6 @@ Partial Class Inventarios_EntregaAlmacen If CveAlmacen <= 0 Then CargaGvDatos() - - - - - - End Sub Private Sub CargaTraspasoPorSurtir(CveTraspaso As Integer) LbSurtida.Visible = False From cc3a64d18e9a49fde10ea16841aeaadd9d1e1f92 Mon Sep 17 00:00:00 2001 From: AbrahamCastilloV Date: Tue, 13 Feb 2024 13:39:16 -0700 Subject: [PATCH 4/6] =?UTF-8?q?--Se=20pasa=20calendarios=20y=20repcontrato?= =?UTF-8?q?s=20a=20s=C3=B3lo=20la=20clase=20de=20ClsContratos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/CalendarEvent.vb | 9 +- App_Code/ClsPaginas.vb | 2 +- Ashx/CargaEventos.ashx | 9 +- Transportes/RepContratoDetalle.aspx | 24 ++ Transportes/RepContratoDetalle.aspx.vb | 9 + Transportes/RepContratos - Copy.aspx | 361 --------------------- Transportes/RepContratos - Copy.aspx.vb | 159 --------- Transportes/RepContratos.aspx | 2 +- Transportes/RepContratos.aspx.vb | 18 +- Transportes/RepContratosCalendario.aspx | 87 ++--- Transportes/RepContratosCalendario.aspx.vb | 48 ++- Transportes/RepViajes.aspx.vb | 1 - 12 files changed, 141 insertions(+), 588 deletions(-) create mode 100644 Transportes/RepContratoDetalle.aspx create mode 100644 Transportes/RepContratoDetalle.aspx.vb delete mode 100644 Transportes/RepContratos - Copy.aspx delete mode 100644 Transportes/RepContratos - Copy.aspx.vb diff --git a/App_Code/CalendarEvent.vb b/App_Code/CalendarEvent.vb index 35dfa7999..f5f94aaee 100644 --- a/App_Code/CalendarEvent.vb +++ b/App_Code/CalendarEvent.vb @@ -34,22 +34,19 @@ Public Class CalendarEvent Public Property NomprePersonal As String Public Property NombreAcercamiento As String Public Property CvePersonal As Integer + Public Property CvePersonal2 As Integer Public Property CveCliente As Integer Public Property CveProveedor As Integer Public Property CveOS As Integer Public Property CveOSDetalle As Integer Public Property CveUsuarioAtendio As Integer - Public Property CveSubProyectoUsuarioAtendio As Integer - Public Property CveCompra As Integer Public Property SerieFolioCompra As String - Public Property CveVenta As Integer Public Property SerieFolioVenta As String Public Property CveActivoFijo As Integer Public Property AFCodigo As String - Public Property CveMovimiento As Integer Public Property MovimientoFolio As String Public Property CveIE As Integer @@ -57,7 +54,7 @@ Public Class CalendarEvent Public Property Pesos As Double Public Property Dolares As Double Public Property Anticipo As Double - - + Public Property CantidadPasajeros As String + Public Property NumeroContrato As String End Class diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 365eecdb7..9874e1c47 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -10812,7 +10812,7 @@ Public Class ClsPaginas #Region "Transportes" PaginaDict.Add("/Transportes/RepContratos.aspx".ToUpper(), 598) - PaginaDict.Add("/Transportes/RepContratosDetalles.aspx".ToUpper(), 598) + PaginaDict.Add("/Transportes/RepContratoDetalle.aspx".ToUpper(), 598) PaginaDict.Add("/Transportes/RepViajes.aspx".ToUpper(), 599) PaginaDict.Add("/Transportes/Boletos.aspx".ToUpper(), 600) PaginaDict.Add("/Transportes/RepBoletos.aspx".ToUpper(), 601) diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index 84be4f7ec..0513bd853 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -449,7 +449,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState - If ObjContratos.GetContratos(-1, usuarioActual_.CveEmpresa, TipoContrato:=2) Then + If ObjContratos.GetContratos(-1, usuarioActual_.CveEmpresa, TipoContrato:=34) Then If ObjContratos.DtResultados.Rows.Count > 0 Then @@ -465,14 +465,15 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState cevent.NombreAcercamiento = dr("Ubicacion").ToString cevent.CveCliente = dr("CveCliente").ToString.ToEntero cevent.CvePersonal = dr("CveChofer").ToString.ToEntero + cevent.CvePersonal2 = dr("CveChofer2").ToString.ToEntero + cevent.CveEventoEstatus = dr("CveContratosEstatus").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 cevent.backgroundColor = dr("BackgroundColor").ToString - - - + cevent.CantidadPasajeros = dr("CantidadPasajeros").ToString + cevent.NumeroContrato = dr("NumeroContrato").ToString If Not cevent.recurrenciatipo > 0 Then diff --git a/Transportes/RepContratoDetalle.aspx b/Transportes/RepContratoDetalle.aspx new file mode 100644 index 000000000..c88825dd2 --- /dev/null +++ b/Transportes/RepContratoDetalle.aspx @@ -0,0 +1,24 @@ +<%@ Page Language="VB" AutoEventWireup="true" Title="Transportes V&A - Detalles del Contrato" + MasterPageFile="~/Site.master" + CodeFile="RepContratoDetalle.aspx.vb" + Inherits="RepContratoDetalle" %> + + + Detalles del Contratos + + + + + + + + + + + + + + + + diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb new file mode 100644 index 000000000..57204ff36 --- /dev/null +++ b/Transportes/RepContratoDetalle.aspx.vb @@ -0,0 +1,9 @@ +Option Explicit On +Option Strict On + +Partial Class RepContratoDetalle + Inherits ClsPaginas + +End Class + + diff --git a/Transportes/RepContratos - Copy.aspx b/Transportes/RepContratos - Copy.aspx deleted file mode 100644 index b89700e5b..000000000 --- a/Transportes/RepContratos - Copy.aspx +++ /dev/null @@ -1,361 +0,0 @@ -<%@ Page Language="VB" AutoEventWireup="true" Title="Transportes V&A - Contratos" - MasterPageFile="~/Site.master" - CodeFile="RepContratos - Copy.aspx.vb" - Inherits="ListadoContratos" %> - - - Listado de Contratos - - - - - - - - - -
  • - Agregar Contrato -
  • -
  • - Generar Excel -
  • -
    - - - -
    -
    - - - - -
    -
    - - - - -
    - -
    - - - - -
    - -
    - - -
    - -
    - -
    - - -
    -
    - - -
    -
    -
    - - - - - - - - - - - - - - Fecha
    - Salida -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - Fecha
    - Regreso -
    - - - -
    - - - - - - - -
    -
    -
    -
    - - - -
    - - diff --git a/Transportes/RepContratos - Copy.aspx.vb b/Transportes/RepContratos - Copy.aspx.vb deleted file mode 100644 index 57ecfc736..000000000 --- a/Transportes/RepContratos - Copy.aspx.vb +++ /dev/null @@ -1,159 +0,0 @@ -Option Explicit On -Option Strict On -Imports System.Data.SqlClient -Imports Extensiones -Imports Extensiones.ModExtensiones - -Partial Class ListadoContratos - Inherits ClsPaginas - - Private Property CveContrato As Integer - Get - Return ViewState("CveContrato").ToString().ToEntero - End Get - Set(value As Integer) - ViewState("CveContrato") = value - End Set - End Property - Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - txtFechaI.Text = DateTime.Now.AddMonths(-1).ToString("MM/dd/yyyy").Replace(" ", "T") - txtFechaF.Text = DateTime.Now.AddDays(7).ToString("MM/dd/yyyy").Replace(" ", "T") - - If Not IsPostBack Then - ViewState("CveContrato") = 0 - InicializaCombos() - CargaDatos() - End If - End Sub - Private Sub InicializaCombos() - 'Lista Tipo AF - DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa) - DdlTipoAF.DataBind() - DdlTipoAF.Items.Insert(0, New ListItem("-", "")) - 'Lista Chofer' - DdlChofer.DataSource = GlobalDTRHPersonal(185) - DdlChofer.DataBind() - DdlChofer.Items.Insert(0, New ListItem("-", "")) - UpModal.Update() - End Sub - Private Sub CargaDatos() - Dim ObjContratos As New ClsContratos - If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then - GvContratos.DataSource = ObjContratos.DtResultados - GvContratos.DataBind() - End If - If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then - DdlEstatusConsulta.DataSource = ObjContratos.DtResultados - DdlEstatusConsulta.DataBind() - DdlEstatusConsulta.Items.Insert(0, New ListItem("-", "")) - - End If - 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 - TxtUbicacion.Text = Ubicacion - DdlTipoAF.SelectedValue = Transporte - DdlClientes.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial") - DdlClientes.SelectedValue = CveCliente.ToString - DdlChofer.SelectedValue = Chofer - TxtObservaciones.Text = Observaciones - TxtDolares.Text = Math.Round(Dolares.ToDecimal, 2).ToString - TxtPesos.Text = Math.Round(Pesos.ToDecimal, 2).ToString - TxtAnticipo.Text = Math.Round(Anticipo.ToDecimal * 100, 2).ToString - BtnGuardar.Text = Boton - myModalLabel.InnerHtml = $"{Boton} Contrato" - UpModal.Update() - RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar")) - End Sub - Private Sub LBAgregarContrato_Click(sender As Object, e As EventArgs) Handles LBAgregarContrato.Click - MostrarModal() - End Sub - Protected Sub AddContrato(sender As Object, e As EventArgs) - - If DdlClientes.SelectedValue = "" Then - Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - Dim ObjContratos As New ClsContratos - ObjContratos.IniciaTransacSQL() - - - 'Agregar contrato - If BtnGuardar.Text = "Guardar" Then - If 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:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero) > 0 Then - ObjContratos.Commit() - Alert("Agregado Correctamente.") - End If - End If - - 'Actualizar contrato - If BtnGuardar.Text = "Editar" Then - If 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) Then - - ObjContratos.Commit() - Alert("Actualizado Correctamente.") - End If - End If - - TxtDescripcion.Text = "" - TxtFechaSalida.Text = "" - TxtFechaRegreso.Text = "" - TxtObservaciones.Text = "" - TxtUbicacion.Text = "" - DdlClientes.SelectedText = "" - DdlTipoAF.SelectedValue = "" - DdlChofer.SelectedValue = "" - TxtDolares.Text = "" - TxtPesos.Text = "" - TxtAnticipo.Text = "" - BtnGuardar.Text = "Guardar" - - ObjContratos.Dispose() - CargaDatos() - - End Sub - - Protected Sub LBExcel_Click(sender As Object, e As EventArgs) Handles LBExcel.Click - GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString) - End Sub - - Protected Sub Consultar(sender As Object, e As EventArgs) - Dim fechaInicial As String = txtFechaI.Text - Dim fechaFinal As String = txtFechaF.Text - - Dim cliente As String = If(DdlClientesConsulta.SelectedValue = "", "", $"C.CveCliente = {DdlClientesConsulta.SelectedValue} AND") - Dim estatus As String = "" - Dim nombreEstatus As String = "" - Dim innerEstatus As String = "" - If (DdlEstatusConsulta.SelectedValue <> "") Then - estatus = $"C.CveContratosEstatus = {DdlEstatusConsulta.SelectedValue} AND" - nombreEstatus = ", CE.ContratoEstatus As ContratoEstatus1" - innerEstatus = "INNER JOIN Con_ContratosEstatus CE with(nolock) ON CE.CveContratoEstatus = C.CveContratosEstatus -" - End If - Dim intervalo As String = If(DdlEstatusConsulta.SelectedValue = "" And DdlClientesConsulta.SelectedValue = "", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'") - - - Dim query As String = $"SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreComercial {nombreEstatus} FROM Con_Contratos C LEFT JOIN Clientes Cli with(nolock) ON Cli.CveCliente = C.CveCliente {innerEstatus} WHERE {cliente} {estatus} {intervalo}" - - Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString) - Using command As New SqlCommand(query, connection) - 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/RepContratos.aspx b/Transportes/RepContratos.aspx index 146ab1b88..bea5d7eca 100644 --- a/Transportes/RepContratos.aspx +++ b/Transportes/RepContratos.aspx @@ -149,7 +149,7 @@ - + diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb index 0064bb3e2..33482ca77 100644 --- a/Transportes/RepContratos.aspx.vb +++ b/Transportes/RepContratos.aspx.vb @@ -81,14 +81,23 @@ Partial Class ListadoContratos Exit Sub End If + 'Aumentamos Folio + Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero + Dim ObjFolios As New ClsGralFolios + If ObjFolios.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then + ObjFolios.Dispose() + End If + + 'Agregamos Contrato Dim ObjContratos As New ClsContratos ObjContratos.IniciaTransacSQL() - If ObjContratos.AddContratos(LbFolio.Text, 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:=34, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text) > 0 Then ObjContratos.Commit() Alert("Agregado Correctamente.") End If + ObjContratos.Dispose() + 'Reiniciamos modal TxtDescripcion.Text = "" TxtFechaSalida.Text = "" TxtFechaRegreso.Text = "" @@ -101,7 +110,6 @@ Partial Class ListadoContratos TxtAnticipo.Text = "" TxtCantidadPasajeros.Text = "" - ObjContratos.Dispose() UpModal.Update() CargaDatos() @@ -192,4 +200,10 @@ Partial Class ListadoContratos End If End Sub + + Protected Sub GoContratoDetalle(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim CveContrato As String = GvRow.DataKey("CveContrato") + Response.Redirect(String.Format("~/Transportes/RepContratoDetalle.aspx?CveContrato={0}", CveContrato)) + End Sub End Class diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx index ddd19f296..271280696 100644 --- a/Transportes/RepContratosCalendario.aspx +++ b/Transportes/RepContratosCalendario.aspx @@ -151,6 +151,7 @@
    +
    @@ -198,20 +199,20 @@
    - + <%-- Contratos --%> + data-sort="true" DataKeyNames="CveContrato, NumeroContrato, DescripcionContrato, Ubicacion, FechaInicial, FechaFinal, CveCliente,NombreComercial, CveTipoAF, Importe, ImporteMin, ImporteMax, Observaciones, CveAF, CveChofer, CveChofer2, CveContratosEstatus, CantidadPasajeros"> - - + + Fecha
    @@ -221,6 +222,7 @@
    + @@ -235,11 +237,10 @@ - + - @@ -248,9 +249,10 @@ - + + Fecha
    @@ -275,7 +277,6 @@
    - @@ -284,13 +285,12 @@ - + <%-- Modal --%>