From 7e886ba50f8160a59c37d70860cba3deca359a76 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 14 Feb 2024 16:13:17 -0700 Subject: [PATCH 1/3] -- Correcion de formato de hora de la fecha del registro --- Inventarios/EntradasSalidas.aspx.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 3eff34079..c6108e558 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1804,7 +1804,7 @@ Partial Class Inventarios_EntradasSalidas End If Dim FechaMovimiento As DateTime = TxtFecha.Text.Replace(",", "").ToDateTime - Dim FechaMovtoStr As String = $"{FechaMovimiento.ToString("yyyy/MM/dd")} {FechaMovimiento.ToString("hh:mm:ss")}" + Dim FechaMovtoStr As String = $"{FechaMovimiento.ToString("yyyy/MM/dd")} {FechaMovimiento.ToString("HH:mm:ss")}" 'ACTUALIZAR If CveMovimiento > 0 Then @@ -1990,7 +1990,7 @@ Partial Class Inventarios_EntradasSalidas If DdlConcepto.SelectedValue.Contiene({"3", "11", "13", "21", "30", "31"}) Then For Each Dr As DataRow In DtMovimientos.Rows Dim FechaCaducidadVal As Date = If(Dr("AplicaCaducidad").ToString = "True", Dr("FechaCaducidad").ToString.ToDate, MinFecha) - Dim FechaMovtoExistenciaStr As String = $"{FechaMovimiento.ToString("yyyy/MM/dd")} {FechaMovimiento.ToString("hh:mm")}" + Dim FechaMovtoExistenciaStr As String = $"{FechaMovimiento.ToString("yyyy/MM/dd")} {FechaMovimiento.ToString("HH:mm")}" If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=FechaMovtoExistenciaStr, Serie:=If(Dr("Serie").ToString = "", "-1", Dr("Serie").ToString), Lote:=If(Dr("Lote").ToString = "", "-1", Dr("Lote").ToString), FechaCaducidad:=FechaCaducidadVal) >= Dr("Cantidad").ToString.ToDouble Then If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=FechaCaducidadVal, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveCultivoCuadroDetalle:=Dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then @@ -2332,7 +2332,7 @@ Partial Class Inventarios_EntradasSalidas ObjInventario.RollBack() 'deshace lo insertado CveMovimiento = 0 If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack() - Alert("ocurrió un Error al registrar los movimientos", TipoMensaje.MsgError) + Alert("Ocurrió un error al registrar los movimientos", TipoMensaje.MsgError) RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") End If End If From 823c0af112240a3401dd18ab88da020b09cf4fc5 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 14 Feb 2024 17:57:29 -0700 Subject: [PATCH 2/3] --FERRETERA. En ventas que al timbrar una venta no timbrada, cargue los datos de factura global --- Ventas/Ventas.aspx.vb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 8885ef445..fcf6cc18e 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -12921,6 +12921,18 @@ Partial Class Ventas Timbre.Complementos.ComercioExterior.AplicaComercioExteriorSubProyecto = False End If + If ObjFactura.CveVenta > 0 AndAlso ObjFactura.EsFacturaGlobal Then + Dim SATMes As String = ClsPaginas.GlobalDTGralSATMeses().FiltroPrimeroValor("Mes", $"CveSATMes = {ObjFactura.CveSATMes}") + Dim SATPerioricidad = ClsPaginas.GlobalDTGralSATPeriodicidad().FiltroPrimeroValor("Periodicidad", $"CveSATPeriodicidad = {ObjFactura.CveSATPeriodicidad}") + + Timbre.InformacionGlobal = New CFDIInformacionGlobal() With { + .Año = ObjFactura.SATAnio.ToString(), + .Meses = SATMes, + .Perioricidad = SATPerioricidad + } + + End If + Return Timbre End Function From c959a3d09075340a4ba6af9aa918382f53694b36 Mon Sep 17 00:00:00 2001 From: AbrahamCastilloV Date: Wed, 14 Feb 2024 19:59:36 -0700 Subject: [PATCH 3/3] =?UTF-8?q?--Se=20implement=C3=B3=20el=20enrutamiento?= =?UTF-8?q?=20hacia=20RepContratoDetalle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsContratos.vb | 9 +- Transportes/RepContratoDetalle.aspx | 174 ++++++++++++++++++++- Transportes/RepContratoDetalle.aspx.vb | 62 ++++++++ Transportes/RepContratos.aspx.vb | 3 +- Transportes/RepContratosCalendario.aspx.vb | 3 +- Transportes/RepViajes.aspx | 19 +-- Transportes/RepViajes.aspx.vb | 79 ++-------- 7 files changed, 260 insertions(+), 89 deletions(-) diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index bc3794d36..a4f9b0a36 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -272,7 +272,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 @@ -292,7 +292,7 @@ Public Class ClsContratos Me.CveSucursalCliente = Data.Rows(0)("CveSucursalCliente").ToString.ToEntero Me.CveAlmacenOrigen = Data.Rows(0)("CveAlmacenOrigen").ToString.ToEntero Me.CveAlmacen = Data.Rows(0)("CveAlmacenDestino").ToString.ToEntero - Me.TipoEstatus = Data.Rows(0)("TipoEstatus").ToString.ToEntero + 'Me.TipoEstatus = Data.Rows(0)("TipoEstatus").ToString.ToEntero Me.PorcentajeComision = Data.Rows(0)("PorcentajeComision").ToString.ToEntero Me.TipoGarantia = Data.Rows(0)("TipoGarantia").ToString.ToEntero Me.EstatusFianza = Data.Rows(0)("EstatusFianza").ToString.ToEntero @@ -554,14 +554,15 @@ Public Class ClsContratos ' CveSubProyecto As Integer, PorIVA As Double, EstatusContrato As Boolean, Archivo As String, CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveContratosEstatus As Integer, CveContratoTipo As Integer) As Boolean ' ' Return UpdateContratos(CveContrato, NumeroContrato, DescripcionContrato, CveProveedor, CveCliente, -1, FechaInicial, FechaFinal, "", "", CveSubProyecto, PorIVA, -1, -1, -1, EstatusContrato, Archivo, "", CveContratoPadre, CveUsuario, CveEmpresa, False, CveContratosEstatus, CveContratoTipo) 'End Function - Public Function RemoveContrato(CveContrato As Integer, CveEmpresa As Integer) As Boolean + Public Function RemoveContrato(CveContrato As Integer, CveEmpresa As Integer, Optional CveMasivo As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_ContratosRemove") With SqlAdapter.SelectCommand.Parameters .Add("@CveContrato", SqlDbType.Int).Value = CveContrato - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveMasivo", SqlDbType.Int).Value = CveMasivo End With Try diff --git a/Transportes/RepContratoDetalle.aspx b/Transportes/RepContratoDetalle.aspx index c88825dd2..8bf97c7b4 100644 --- a/Transportes/RepContratoDetalle.aspx +++ b/Transportes/RepContratoDetalle.aspx @@ -4,21 +4,189 @@ Inherits="RepContratoDetalle" %> - Detalles del Contratos + Detalles del Contrato - - + + + + <%-- Información General --%> + + + + <%-- Datos del Contrato --%> +
+
+
+ +
+
+ Datos del Contrato +
+
+ +
+
+ + +
+ +
+ +
+ + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+
+
+
+
+ <%-- Pre init --%> + + + + +
+
+
diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb index 57204ff36..ad154f5dc 100644 --- a/Transportes/RepContratoDetalle.aspx.vb +++ b/Transportes/RepContratoDetalle.aspx.vb @@ -1,8 +1,70 @@ Option Explicit On Option Strict On +Imports System.Data +Imports ADSNetLibrary.Helpers +Imports ADSNetLibrary.SIGAPI.Helpers +Imports Extensiones Partial Class RepContratoDetalle Inherits ClsPaginas + Private Property CveContrato As Integer + Get + Return CType(ViewState("CveContrato"), Integer) + End Get + Set(value As Integer) + ViewState("CveContrato") = value + End Set + End Property + Private Property Contrato As DataTable + Get + Return CType(ViewState("Contrato"), DataTable) + End Get + Set(value As DataTable) + ViewState("Contrato") = value + End Set + End Property + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Request("CveContrato") Is Nothing Then + Response.Redirect($"~/Transportes/RepContratos.aspx") + End If + CveContrato = Request("CveContrato").ToEntero + + If Not IsPostBack Then + 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("-", "")) + End Sub + Private Sub CargaDatos() + Dim ObjContratos As New ClsContratos + If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then + Contrato = ObjContratos.DtResultados + Else + Response.Redirect($"~/Transportes/RepContratos.aspx") + End If + + + LbFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString + DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString + DdlClientes.SelectedValue = Contrato.Rows(0)("CveCliente").ToString + TxtDescripcion.Text = Contrato.Rows(0)("DescripcionContrato").ToString + TxtObservaciones.Text = Contrato.Rows(0)("Observaciones").ToString + TxtUbicacion.Text = Contrato.Rows(0)("Ubicacion").ToString + TxtFechaSalida.Text = Contrato.Rows(0)("FechaInicial").ToString + TxtFechaRegreso.Text = Contrato.Rows(0)("FechaFinal").ToString + TxtCantidadPasajeros.Text = Contrato.Rows(0)("CantidadPasajeros").ToString + DdlTipoAF.SelectedValue = Contrato.Rows(0)("CveTipoAF").ToString + TxtDolares.Text = Contrato.Rows(0)("Importe").ToString + TxtPesos.Text = Contrato.Rows(0)("ImporteMax").ToString + TxtAnticipo.Text = Contrato.Rows(0)("ImporteMin").ToString + End Sub + + End Class diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb index 33482ca77..bf3590725 100644 --- a/Transportes/RepContratos.aspx.vb +++ b/Transportes/RepContratos.aspx.vb @@ -203,7 +203,6 @@ Partial Class ListadoContratos 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)) + Response.Redirect($"~/Transportes/RepContratoDetalle.aspx?CveContrato={GvRow.DataKey("CveContrato")}") End Sub End Class diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb index db3ce974e..3567889c7 100644 --- a/Transportes/RepContratosCalendario.aspx.vb +++ b/Transportes/RepContratosCalendario.aspx.vb @@ -228,7 +228,6 @@ Partial Class RepContratosCalendario 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)) + Response.Redirect($"~/Transportes/RepContratoDetalle.aspx?CveContrato={GvRow.DataKey("CveContrato")}") End Sub End Class diff --git a/Transportes/RepViajes.aspx b/Transportes/RepViajes.aspx index 3aea914b8..2e426a745 100644 --- a/Transportes/RepViajes.aspx +++ b/Transportes/RepViajes.aspx @@ -45,8 +45,13 @@ <%-- Listado de Viajes --%> + data-sort="true" DataKeyNames="CveContrato, NumeroContrato, CveRuta, CveDestino, CvePartida, FechaInicial, CveMasivo"> + + + + + @@ -78,18 +83,8 @@ CssClass='<%# If(Eval("Estatus").ToString = "", "", "text-success bold") %>'> - - + - - - diff --git a/Transportes/RepViajes.aspx.vb b/Transportes/RepViajes.aspx.vb index f1a0c3db7..050ad184b 100644 --- a/Transportes/RepViajes.aspx.vb +++ b/Transportes/RepViajes.aspx.vb @@ -68,6 +68,13 @@ Partial Class ListadoViajes GvContratos.DataBind() End If + End Sub + + Private Sub LBAgregarViaje_Click(sender As Object, e As EventArgs) Handles LBAgregarViaje.Click + MostrarModal() + End Sub + + Public Sub MostrarModal() 'Generar Folio Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero Dim ObjFolio As New ClsGralFolios @@ -77,13 +84,7 @@ Partial Class ListadoViajes LbFolio.Text = $"{drr("Serie").ToString}-{drr("FActual").ToString}" End If End If - End Sub - Private Sub LBAgregarViaje_Click(sender As Object, e As EventArgs) Handles LBAgregarViaje.Click - MostrarModal() - End Sub - - Public Sub MostrarModal() IsMasivo.Visible = True DdlRutas.Text = "" TxtFechaViaje.Text = "" @@ -171,85 +172,31 @@ Partial Class ListadoViajes Alert("Ocurrió un error al generar viaje", TipoMensaje.MsgError) ObjContratos.RollBack() Finally + 'Reiniciamos modal DdlRutas.Text = "" TxtFechaViaje.Text = "" DdlPartida.Text = "" DdlDestino.SelectedValue = "" + 'Actualizamos 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 - CargaDatos() + ObjContratos.Dispose() + CargaDatos() End Try End If - - - End Sub - - Protected Sub UpdateViaje(sender As Object, e As EventArgs) - IsMasivo.Visible = False - DivFechaMasivo.Visible = False - Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - - DdlRutas.SelectedValue = GvRow.DataKey("CveRuta") - DdlDestino.SelectedValue = GvRow.DataKey("CveDestino") - DdlPartida.SelectedValue = GvRow.DataKey("CvePartida") - ViewState("CveContrato") = GvRow.DataKey("CveContrato") - ViewState("Ruta") = GvRow.DataKey("Ruta") - Dim fecha As DateTime - - If DateTime.TryParse(GvRow.DataKey("Fecha").ToString, fecha) Then - TxtFechaViaje.Text = fecha.ToString("yyyy-MM-dd").Replace(" ", "T") - End If - - BtnGuardar.Text = "Actualizar" - ModalLabel.InnerHtml = "Actualizar Viaje" - - - RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar")) - - End Sub - - Protected Sub RemoveViaje(sender As Object, e As EventArgs) - 'Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - 'Dim CveMasivo As String = GvRow.DataKey("CveMasivo") - - 'Dim ObjTransportes As New ClsTransportes - - 'ObjTransportes.IniciaTransacSQL() - 'If CveMasivo = "" Then - ' Try - ' ObjTransportes.RemoveViaje(CveViaje:=GvRow.DataKey("CveViaje").ToEntero) - ' ObjTransportes.Commit() - ' Catch ex As Exception - ' Alert($"Ocurrió un error {ex}", TipoMensaje.MsgError) - ' End Try - 'Else - ' Try - ' ObjTransportes.RemoveViaje(CveMasivo:=CveMasivo.ToEntero) - ' ObjTransportes.Commit() - ' Catch ex As Exception - ' Alert($"Ocurrió un error {ex}", TipoMensaje.MsgError) - - ' End Try - 'End If - 'Alert("Viaje eliminado correctamente") - 'CargaDatos() - 'ObjTransportes.Dispose() - End Sub Protected Sub ToggleMasivo(sender As Object, e As EventArgs) DivFechaMasivo.Visible = IsMasivo.Checked RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar")) End Sub - - Protected Sub GoViaje(sender As Object, e As EventArgs) + Protected Sub GoContratoDetalle(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - Dim CveViaje As String = GvRow.DataKey("CveViaje") - Response.Redirect(String.Format("~/Transportes/Boletos.aspx?CveViaje={0}", CveViaje)) + Response.Redirect($"~/Transportes/RepContratoDetalle.aspx?CveContrato={GvRow.DataKey("CveContrato")}") End Sub Protected Sub GoBoletos(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)