From acdffa4946dfb6514e5e54a116c8dcc2c7e96845 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 26 Feb 2025 00:24:24 -0700 Subject: [PATCH] --Rep Ventas Periodo --- App_Code/ClsVentas.vb | 212 +++++++++++++-------------- Ventas/RepVentasPeriodo.aspx | 244 +++++++++++++++++++++----------- Ventas/RepVentasPeriodo.aspx.vb | 194 +++++++++++++++---------- 3 files changed, 394 insertions(+), 256 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 6f3d45107..c456d2ffa 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -4,6 +4,7 @@ Option Strict On Imports System.Data Imports System.Data.SqlClient Imports Extensiones +Imports Profact.TimbraCFDI40 Public Class ClsVentas Implements IDisposable @@ -1826,6 +1827,7 @@ Public Class ClsVentas Try SqlAdapter.Fill(Data) Retorno = True + Retorno = True Catch ex As Exception OnError("Ocurrió un error al obtener los datos del reporte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try @@ -1856,38 +1858,53 @@ Public Class ClsVentas 'Reporte de Ventas por Período + 'Public Function GetRepVentasPeriodos(FechaI As Date, FechaF As Date, FechaIEjec As Date, FechaFEjec As Date, CveCliente As Integer, CveSubProyectoEjecucion As Integer, + ' CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1", + ' Optional CveProyecto As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveUsuarioConsulta As Integer = -1, Optional VerEn As Integer = -1, + ' Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False) As Boolean + + Public Function GetRepVentasPeriodos(FechaI As Date, FechaF As Date, FechaIEjec As Date, FechaFEjec As Date, CveCliente As Integer, CveSubProyectoEjecucion As Integer, - CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1", - Optional CveProyecto As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveUsuarioConsulta As Integer = -1, Optional VerEn As Integer = -1, - Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False) As Boolean + CveVendedor As String, CveUsuario As Integer, CveEstatus As String, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1", + Optional CveProyecto As Integer = -1, Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveUsuarioConsulta As Integer = -1, + Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False, + Optional EsDistribuidor As Integer = -1, Optional CveTipoRelacion As Integer = -1, Optional ServicioDomicilio As Integer = -1, Optional EsFacturaGlobal As Integer = -1, Optional EsFilial As Integer = -1, + Optional VerEn As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasGetRepPeriodo") With SqlAdapter.SelectCommand.Parameters - '.Add("@CveVenta", SqlDbType.Int).Value = CveVenta + 'PARAMETROS BASE .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@FechaIEjec", SqlDbType.Date).Value = FechaIEjec .Add("@FechaFEjec", SqlDbType.Date).Value = FechaFEjec .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveSubProyectoEjecucion", SqlDbType.Int).Value = CveSubProyectoEjecucion - .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + .Add("@CveEstatus", SqlDbType.VarChar).Value = CveEstatus .Add("@IVA", SqlDbType.VarChar).Value = IVA .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@GPO", SqlDbType.Int).Value = Gpo .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto .Add("@TipoCambio", SqlDbType.Int).Value = TipoCambio .Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta - .Add("@VerEn", SqlDbType.Int).Value = VerEn .Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion + .Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente + .Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor .Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable + .Add("@CveTipoRelacion", SqlDbType.Int).Value = CveTipoRelacion + .Add("@ServicioDomicilio", SqlDbType.Int).Value = ServicioDomicilio + .Add("@EsFacturaGlobal", SqlDbType.Int).Value = EsFacturaGlobal + .Add("@EsFilial", SqlDbType.Int).Value = EsFilial + 'PARAMETROS EXTRA + .Add("@VerEn", SqlDbType.Int).Value = VerEn End With Try @@ -2485,33 +2502,29 @@ Public Class ClsVentas Public Function GetPromociones(CvePromocion As Integer, Fecha As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Optional CveMarca As Integer = -1, Optional CveUsuario As Integer = -1, Optional CvePS As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_PromocionesGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario + .Add("@CvePS", SqlDbType.Int).Value = CvePS + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Promociones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_PromocionesGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@Estatus", SqlDbType.Int).Value = Estatus - .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveMarca", SqlDbType.Int).Value = CveMarca - .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario - .Add("@CvePS", SqlDbType.Int).Value = CvePS - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las Promociones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoAplicacion As String, Optional CveMarca As Integer = -1, Optional EsDistribuidor As Integer = -1, Optional ReqAutorizacion As Boolean = False) As Integer @@ -2613,30 +2626,27 @@ Public Class ClsVentas Return Retorno End Function - - - Public Function UpdatePromocionEstatus(CvePromocion As Integer, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_PromocionEstatusUpdate") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePromocion", SqlDbType.Float).Value = CvePromocion - .Add("@Estatus", SqlDbType.Bit).Value = 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 estatus la Promoción.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try + Public Function UpdatePromocionEstatus(CvePromocion As Integer, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_PromocionEstatusUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePromocion", SqlDbType.Float).Value = CvePromocion + .Add("@Estatus", SqlDbType.Bit).Value = 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 estatus la Promoción.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + - Return Retorno - End Function - - Public Function RemovePromociones(CvePromocion As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -3294,36 +3304,33 @@ Public Class ClsVentas Return Retorno End Function - + Public Function GetRepRemisionesSinFacturar(FechaI As String, FechaF As String, FechaV As String, CveSubProyecto As String, CveCliente As Integer, CveContrato As Integer, CveVendedor As String, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional ConsultaInventario As Boolean = False, Optional PrimerProducto As Boolean = False) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_RepRemisionesGet") + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_RepRemisionesGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaI", SqlDbType.VarChar).Value = FechaI + .Add("@FechaF", SqlDbType.VarChar).Value = FechaF + .Add("@FechaV", SqlDbType.VarChar).Value = FechaV + .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@ConsultaInventario", SqlDbType.Bit).Value = ConsultaInventario + .Add("@PrimerProducto", SqlDbType.Bit).Value = PrimerProducto + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las remisiones sin facturar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function - With SqlAdapter.SelectCommand.Parameters - .Add("@FechaI", SqlDbType.VarChar).Value = FechaI - .Add("@FechaF", SqlDbType.VarChar).Value = FechaF - .Add("@FechaV", SqlDbType.VarChar).Value = FechaV - .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@CveContrato", SqlDbType.Int).Value = CveContrato - .Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta - .Add("@ConsultaInventario", SqlDbType.Bit).Value = ConsultaInventario - .Add("@PrimerProducto", SqlDbType.Bit).Value = PrimerProducto - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las remisiones sin facturar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function GetRepRemisionesSinFacturarDetalle(FechaI As String, FechaF As String, FechaV As String, CveCliente As Integer, CveContrato As Integer, CveVenta As Integer, CveEmpresa As Integer, CveSubProyecto As String, Optional CveUsuarioConsulta As Integer = -1, Optional ConsultaInventario As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepRemisionesDetalleGet") @@ -7614,29 +7621,26 @@ Public Class ClsVentas Return Retorno End Function - - Public Function GetSabanaE189(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, CveProveedor As Integer, CodigoPSInicio As String, CodigoPSFin As String) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_VentasSabanaDatos") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio - .Add("@FechaFin", SqlDbType.Date).Value = FechaFin - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@CodigoProductoI", SqlDbType.VarChar).Value = CodigoPSInicio - .Add("@CodigoProductoF", SqlDbType.VarChar).Value = CodigoPSFin - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los datos de la Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function + Public Function GetSabanaE189(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, CveProveedor As Integer, CodigoPSInicio As String, CodigoPSFin As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentasSabanaDatos") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CodigoProductoI", SqlDbType.VarChar).Value = CodigoPSInicio + .Add("@CodigoProductoF", SqlDbType.VarChar).Value = CodigoPSFin + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los datos de la Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function #Region "IDisposable Support" diff --git a/Ventas/RepVentasPeriodo.aspx b/Ventas/RepVentasPeriodo.aspx index 15e46ca00..47b26fde0 100644 --- a/Ventas/RepVentasPeriodo.aspx +++ b/Ventas/RepVentasPeriodo.aspx @@ -15,6 +15,39 @@ color: #FFF; font-weight: bold; } + + .select2 .select2-selection__rendered { + line-height: 1; + color: #111; + } + + .select2 .select2-selection--multiple { + box-sizing: border-box; + cursor: pointer; + display: block; + min-height: 20px; + user-select: none; + -webkit-user-select: none; + } + + .select2-container--default .select2-selection--multiple .select2-selection__choice { + margin-top: 10px; + } + + .select2-selection__rendered { + margin-top: 0px; + height: 25px; + } + + .select2-selection { + margin-top: 0px; + height: 31px; + } + + .select2-container--default.select2-container--focus .select2-selection--multiple { + border: none; + outline: 0; + } @@ -67,18 +100,17 @@ -
+
-
+
- - + @@ -86,16 +118,54 @@ - + + <%-- + + + + + + + + + --%>
- - -
- - - +
+ Fecha Inicio: + +
+
+
+ + + + +
+ + + + + + +
+
+ Fecha Fin: + +
+
+
+ + + + +
+ + + + + +
-
@@ -120,67 +190,52 @@
- - - -
-
-
+