diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index cd29409c4..2f7ac71dc 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -875,6 +875,23 @@ Public Class ClsAcumuladores End Try Return Retorno End Function + + Public Function UpdatePolizaVirtual(CvePolizaVirtual As Integer, CveMarca As Integer, FechaUsado As DateTime) As Boolean + Dim Retorno As Boolean = False + SqlDataAdapter("PA_Vta_PolizaVirtualUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePolizaVirtual", SqlDbType.Int).Value = CvePolizaVirtual + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@FechaUsado", SqlDbType.DateTime).Value = FechaUsado + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un al actualizar el envio de la poliza virtual. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function Public Function UpdateEnvioPolizaVirutal(CvePolizaVirtual As Integer, Envio As Boolean, FechaEnvio As DateTime, CodigoUnico As String) As Boolean Dim Retorno As Boolean = False SqlDataAdapter("PA_Vta_PolizaVirtualEnvioUpdate") diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index fa2e30bf1..308ebb7ed 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -514,6 +514,23 @@ Public Class ClsNominas Return Retorno End Function + Public Function DeleteNom_NominasDetalles(CveConcepto As Integer, CvePersonal As Integer, CvePeriodo As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Nom_NominasDetallesDelete") + SqlAdapter.SelectCommand.Parameters.Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto + SqlAdapter.SelectCommand.Parameters.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + SqlAdapter.SelectCommand.Parameters.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function Public Function RemoveNom_NominasDetalles(CveNominaDetalle As Integer) As Boolean Dim Retorno As Boolean = False @@ -2108,13 +2125,14 @@ Public Class ClsNominas Return retorno End Function - Public Function GetCalculoSBC(CveEmpresa As Integer, FechaCalculo As String) As Boolean + Public Function GetCalculoSBC(CveEmpresa As Integer, Tipo As Integer, FechaCalculo As String) As Boolean Dim retorno As Boolean = False Try DTSet = New DataSet() DataAdapter("PA_GetCalculoSBC", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = Tipo .Add("@Fecha", SqlDbType.Date).Value = FechaCalculo End With @@ -2514,6 +2532,97 @@ Public Class ClsNominas End Function #End Region + +#Region "CRUD_RH_TablasValores" + Public Function RH_TablasValoresGet(cveEmpresa As Int32, tipo As Int32) As Boolean + Dim retorno As Boolean = False + Try + DataAdapter("PA_RH_TablasValoresGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = tipo + End With + SqlAdapter.Fill(Data) + + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function RH_TablasValoresAdd(cveEmpresa As Int32, fecha As DateTime, tipo As Int32, valor As Decimal) As Boolean + Dim retorno As Boolean = False + + Try + DataAdapter("PA_RH_TablasValoresAdd", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = tipo + .Add("@fecha", SqlDbType.DateTime).Value = fecha + .Add("@valor", SqlDbType.Money).Value = valor + End With + SqlAdapter.Fill(Data) + + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function RH_TablasValoresUp(cveEmpresa As Int32, fecha As DateTime, tipo As Int32, valor As Decimal) As Boolean + Dim retorno As Boolean = False + + Try + DataAdapter("PA_RH_TablasValoresUp", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = tipo + .Add("@fecha", SqlDbType.DateTime).Value = fecha + .Add("@valor", SqlDbType.Money).Value = valor + End With + SqlAdapter.Fill(Data) + + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function RH_TablasValoresRemove(cveEmpresa As Int32, fecha As DateTime, tipo As Int32) As Boolean + Dim retorno As Boolean = False + Try + DataAdapter("PA_RH_TablasValoresRemove", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = tipo + .Add("@fecha", SqlDbType.DateTime).Value = fecha + End With + SqlAdapter.Fill(Data) + + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function +#End Region + #Region "IDisposable Support" ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 79a6ab882..a4549c442 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1268,17 +1268,19 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdateVentaDetalleRemision(CveVenta As Integer, CvePS As Integer, Cantidad As Double, PU As Double, IEPS As Double, PorcentajeIEPS As Decimal, Observaciones As String, Optional CveUsuarioModifico As Integer = -1) As Boolean + Public Function UpdateVentaDetalleRemision(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal, IEPS As Decimal, PorcentajeIEPS As Decimal, IVA As Decimal, PorcentajeIVA As Decimal, Observaciones As String, Optional CveUsuarioModifico As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasDetalleRemisionUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVenta .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@Cantidad", SqlDbType.Float).Value = Cantidad - .Add("@PU", SqlDbType.Float).Value = PU - .Add("@IEPS", SqlDbType.Float).Value = IEPS - .Add("@PorcentajeIEPS", SqlDbType.Float).Value = PorcentajeIEPS + .Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad + .Add("@PU", SqlDbType.Decimal).Value = PU + .Add("@IEPS", SqlDbType.Decimal).Value = IEPS + .Add("@PorcentajeIEPS", SqlDbType.Decimal).Value = PorcentajeIEPS + .Add("@IVA", SqlDbType.Decimal).Value = IVA + .Add("@PorcentajeIVA", SqlDbType.Decimal).Value = PorcentajeIVA .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico End With diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx index fca4a8b19..4d52b8b02 100644 --- a/Ashx/E141.ashx +++ b/Ashx/E141.ashx @@ -392,22 +392,37 @@ Public Class E141 : Implements IHttpHandler Select Case Metodo Case "CrearActualizarProductos" respuesta = CrearActualizarProductos(If(FiltrarTodos = "1", True, False)) + If respuesta Then + retorno = "True" + Else + retorno = "False" + End If + Case "CrearActualizarProductosJson" + retorno = CrearActualizarProductosJson(If(FiltrarTodos = "1", True, False)) Case "ActualizarPrecios" respuesta = ActualizarPrecios(If(FiltrarTodos = "1", True, False)) + If respuesta Then + retorno = "True" + Else + retorno = "False" + End If Case "ActualizarExistencias" respuesta = ActualizarExistencias() + If respuesta Then + retorno = "True" + Else + retorno = "False" + End If Case "ActualizarVendedores" respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False)) + If respuesta Then + retorno = "True" + Else + retorno = "False" + End If End Select - If respuesta Then - retorno = "True" - Else - retorno = "False" - End If End If - - End If context.Response.Write(retorno) @@ -1962,6 +1977,25 @@ Public Class E141 : Implements IHttpHandler Return Retorno End Function + Private Function CrearActualizarProductosJson(Todos As Boolean) As String + Dim payload = New JObject() + + Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0 + + Dim DtPS As DataTable = Nothing + Using ObjPS As New ClsProductosServicios + 'OBTERNER PRECIOS DE PUBLICO GENERAL + If ObjPS.GetProductosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then + DtPS = ObjPS.DtResultados.Copy() + End If + End Using + + If DtPS IsNot Nothing Then + payload.Add(New JProperty("products", GenerarPayloadProductos(DtPS))) + End If + + Return payload.ToString() + End Function Private Function GenerarPayloadProductos(DtPS As DataTable) As JArray Dim ArrayPS As New JArray For Each RowPS As DataRow In DtPS.Rows diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index 9b6ae3795..84d152fbc 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -718,79 +718,76 @@ Partial Class Bancos_PopIEVentas Validada = True End If - - If Validada Then - - CveCliente = dr("CveCliente").ToString.ToEntero - CveClienteOriginal = dr("CveCliente").ToString.ToEntero - HdnCveCliente.Value = CveCliente.ToString - CargaCliente(CveCliente, "-1") - CveMoneda = dr("CveMoneda").ToString.ToEntero - CveMonedaVenta = dr("CveMoneda").ToString.ToEntero - CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero - NombreCliente = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("Nombre", String.Format("CveCliente = {0}", CveCliente)) - SerieFolio = dr("SerieFolio").ToString - TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal - CveSubProyectoVenta = dr("CveSubProyecto").ToString.ToEntero - - LblMetodoPAgo.Text = $"{dr("ClaveMetodoPagoSATStr").ToString() }" + CveCliente = dr("CveCliente").ToString.ToEntero + CveClienteOriginal = dr("CveCliente").ToString.ToEntero + HdnCveCliente.Value = CveCliente.ToString + CargaCliente(CveCliente, "-1") + CveMoneda = dr("CveMoneda").ToString.ToEntero + CveMonedaVenta = dr("CveMoneda").ToString.ToEntero + CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero + NombreCliente = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("Nombre", String.Format("CveCliente = {0}", CveCliente)) + SerieFolio = dr("SerieFolio").ToString + TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal + CveSubProyectoVenta = dr("CveSubProyecto").ToString.ToEntero + + LblMetodoPAgo.Text = $"{dr("ClaveMetodoPagoSATStr").ToString() }" + + 'Configuración de Modalidad Update + + 'Dim RFCCliente As String = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RFC", $"CveCliente = {CveCliente} ") + + If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then + If dr("TipoDocto").ToString = "Rem" Then + Alert("Los documentos de tipo Remisión no se permite realizar el pago", TipoMensaje.MsgAdvertencia) + BtnGuardar.Visible = False + End If + End If - 'Configuración de Modalidad Update + MovimientoPagar = New IEMovimiento + MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal + MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal + MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal + MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal + MovimientoPagar.Total = dr("Total").ToString.ToDecimal + MovimientoPagar.Saldo = dr("Saldo").ToString.ToDecimal + MovimientoPagar.IEPS = dr("IEPS").ToString.ToDecimal + MovimientoPagar.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal - 'Dim RFCCliente As String = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RFC", $"CveCliente = {CveCliente} ") + LtlTitulo.Text = "Cuentas por Cobrar" + LtlTipo2.Text = "Folio de la Venta" + LtlTipo3.Text = "Fecha de la Venta" + LtlSaldo.Text = If(CveMoneda = 1, $"{dr("Saldo").ToString.FormatoNumero}{" MXN"}", $"{dr("Saldo").ToString.FormatoNumero}{" USD"}") + LtlFechaVenta.Text = dr("Fecha").ToString.ToDate.ToShortDateString() + LtlFolio.Text = dr("SerieFolio").ToString + + TxtFolio.Enabled = True + TxtFechaDocumento.Enabled = True + Calendario.Enabled = True + TxtPagueseA.Enabled = False + TxtImporte.Enabled = True + + DdlCuenta.Enabled = True + + DdlTipoTransaccion.Enabled = True + TxtObservaciones.Enabled = True + + RVImporte.Enabled = True + RVImporte.MaximumValue = dr("Saldo").ToString.ToDouble.ToString.FormatoNumero + TxtImporte.Text = dr("Saldo").ToString.ToDouble.FormatoNumero + + FechaVenta = dr("Fecha").ToString.ToDate + SaldoVenta = dr("Saldo").ToString.ToDouble - If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then - If dr("TipoDocto").ToString = "Rem" Then - Alert("Los documentos de tipo Remisión no se permite realizar el pago", TipoMensaje.MsgAdvertencia) - BtnGuardar.Visible = False - End If - End If + 'Cortes de Caja + If UsuarioActual.TienePermisoProceso(160) Then + CargaCorteCaja() + End If - - - MovimientoPagar = New IEMovimiento - MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal - MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal - MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal - MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal - MovimientoPagar.Total = dr("Total").ToString.ToDecimal - MovimientoPagar.Saldo = dr("Saldo").ToString.ToDecimal - MovimientoPagar.IEPS = dr("IEPS").ToString.ToDecimal - MovimientoPagar.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal - - LtlTitulo.Text = "Cuentas por Cobrar" - LtlTipo2.Text = "Folio de la Venta" - LtlTipo3.Text = "Fecha de la Venta" - LtlSaldo.Text = If(CveMoneda = 1, $"{dr("Saldo").ToString.FormatoNumero}{" MXN"}", $"{dr("Saldo").ToString.FormatoNumero}{" USD"}") - LtlFechaVenta.Text = dr("Fecha").ToString.ToDate.ToShortDateString() - LtlFolio.Text = dr("SerieFolio").ToString - - TxtFolio.Enabled = True - TxtFechaDocumento.Enabled = True - Calendario.Enabled = True - TxtPagueseA.Enabled = False - TxtImporte.Enabled = True - - DdlCuenta.Enabled = True - - DdlTipoTransaccion.Enabled = True - TxtObservaciones.Enabled = True - - RVImporte.Enabled = True - RVImporte.MaximumValue = dr("Saldo").ToString.ToDouble.ToString.FormatoNumero - TxtImporte.Text = dr("Saldo").ToString.ToDouble.FormatoNumero - - FechaVenta = dr("Fecha").ToString.ToDate - SaldoVenta = dr("Saldo").ToString.ToDouble - - - 'Cortes de Caja - If UsuarioActual.TienePermisoProceso(160) Then - CargaCorteCaja() - End If + If Not Validada Then + BtnGuardar.Visible = False End If @@ -1388,8 +1385,6 @@ Partial Class Bancos_PopIEVentas #Region "G U A R D A R" Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click - - Dim FechaFactura As Date = FechaVenta Dim FechaDocumentoPago As Date = TxtFechaDocumento.Text.ToDate diff --git a/GPS/Rastreo.aspx.vb b/GPS/Rastreo.aspx.vb index 9200f00dd..c6c79fd7c 100644 --- a/GPS/Rastreo.aspx.vb +++ b/GPS/Rastreo.aspx.vb @@ -2091,6 +2091,8 @@ Partial Class GPS_Rastreo DtDatos.Columns.Add("Evento", GetType(String)) DtDatos.Columns.Add("LatLng", GetType(String)) + Dim KMRecorridos = DtPosiciones.SUM("KMRecorridos").ToString + Try Dim Direcciones As JArray = ConsultarDirecciones(DtPosiciones) For Each row As DataRow In DtPosiciones.Rows @@ -2107,6 +2109,12 @@ Partial Class GPS_Rastreo For Each Dir As JObject In Direcciones DtDatos.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString() Next + + + DtDatos.Columns("Vehiculo").ColumnName = "Vehículo" + DtDatos.Columns("TiempoDetenido").ColumnName = "Tiempo Detenido" + DtDatos.Columns("Direccion").ColumnName = "Dirección" + Catch ex As Exception GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex)) End Try @@ -2159,15 +2167,17 @@ Partial Class GPS_Rastreo If FechaI.Length > 0 And FechaF.Length > 0 Then - Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex) - RangoFechas.Merged = True - RangoFechas.Value = $"Fechas: {FechaI} a {FechaF}" - RangoFechas.Style.Font.Size = 15 * 20 - RangoFechas.Style.Font.Name = "Calibri Light" - RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + End If + Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex) + RangoFechas.Merged = True + RangoFechas.Value = $"Distancia: {KMRecorridos:N2} KM {If(FechaI.Length > 0 And FechaF.Length > 0, $"Fechas: {FechaI} a {FechaF}", "")}" + RangoFechas.Style.Font.Size = 15 * 20 + RangoFechas.Style.Font.Name = "Calibri Light" + RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx index 0d136a0fe..6d02158f6 100644 --- a/Inventarios/RecepcionUsados.aspx +++ b/Inventarios/RecepcionUsados.aspx @@ -335,6 +335,45 @@ +