diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 7fca6c177..95d767d6f 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1744,7 +1744,7 @@ Public Class ClsVentas 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) As Boolean + 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 CveTipoVenta As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasGetRep") @@ -1777,6 +1777,7 @@ Public Class ClsVentas .Add("@ServicioDomicilio", SqlDbType.Int).Value = ServicioDomicilio .Add("@EsFacturaGlobal", SqlDbType.Int).Value = EsFacturaGlobal .Add("@EsFilial", SqlDbType.Int).Value = EsFilial + .Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta End With Try @@ -1923,7 +1924,7 @@ Public Class ClsVentas CveSubProyectoEjecucion As Integer, CveEmpresa As Integer, FechaIEjec As Date, FechaFEjec As Date, Optional CveProyecto As Integer = -1, Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveMoneda As Integer = -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) As Boolean + 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 CveTipoVenta As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasGetRepDetalle") @@ -1961,6 +1962,7 @@ Public Class ClsVentas .Add("@ServicioDomicilio", SqlDbType.Int).Value = ServicioDomicilio .Add("@EsFacturaGlobal", SqlDbType.Int).Value = EsFacturaGlobal .Add("@EsFilial", SqlDbType.Int).Value = EsFilial + .Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta End With Try diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 973191626..28c42cb46 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -1662,6 +1662,7 @@ Partial Class Ventas_ClientesAbonar DtVentasNC.AcceptChanges() ObjFacturaDevolucion.DtVentasNC = DtVentasNC + ObjFacturaDevolucion.CveTipoVenta = 8 'PRONTO PAGO ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion, ListaVentasGenerarNC) diff --git a/Ventas/RepVentas.aspx b/Ventas/RepVentas.aspx index 1f5ed3205..61dcdd7b3 100644 --- a/Ventas/RepVentas.aspx +++ b/Ventas/RepVentas.aspx @@ -368,6 +368,11 @@ + +
+ + +
diff --git a/Ventas/RepVentas.aspx.vb b/Ventas/RepVentas.aspx.vb index 92752ed76..eb0c42851 100644 --- a/Ventas/RepVentas.aspx.vb +++ b/Ventas/RepVentas.aspx.vb @@ -215,7 +215,15 @@ Partial Class Ventas_RepVentas ChkIEPS.Checked = UsuarioActual.Empresa.Funcionalidad(713) = "1" 'empresa deduce IEPS End Sub - Private Sub CargaCombos() + Private Sub CargaCombos() + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + LblTipoVenta.Visible = True + DivTipoVenta.Visible = True + + DdlTipoVenta.DataSource = GlobalDTTipoVenta(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' AND TipoDocto = 'Egs' ") + DdlTipoVenta.DataBind() + DdlTipoVenta.Items.Insert(0, New ListItem("Todos", "-1")) + End If CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto, VisualizacionReporte:=1) @@ -265,8 +273,8 @@ Partial Class Ventas_RepVentas TxtFechaISabana.Text = NowADS().FirstDayOfMonth.ToShortDateString TxtFechaFSabana.Text = NowADS().ToShortDateString - End Sub - + End Sub + #End Region @@ -310,7 +318,7 @@ Partial Class Ventas_RepVentas If ObjVentas.GetRepVentas(FechaI, FechaF, FechaIEjec, FechaFEjec, CveCliente, DdlSubProyectoEjecucion.SelectedValue.ToEntero, Vendedores, DdlUsuario.SelectedValue.ToEntero, Estatus, "-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, TipoComprobante, DdlProyecto.SelectedValue.ToEntero, Sucursales, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=ModalidadContable, - EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero(), ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero) Then + EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero(), ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero()) Then GvDatos.DataSource = ObjVentas.DtResultados DtVentas = ObjVentas.DtResultados Else @@ -531,7 +539,7 @@ Partial Class Ventas_RepVentas 'LIGA A DETALLE - Dim Liga As String = $"/Ventas/RepVentasDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&AnioEjec={e.Row.DBCampo("AnioEjec")}&MesEjec={e.Row.DBCampo("MesEjec")}&AnioMesEjec={e.Row.DBCampo("AnioMesEjec")}&FechaEjec={e.Row.DBCampo("FechaEjec")}&CveCliente={e.Row.DBCampo("CveCliente")}&CveVendedor={ e.Row.DBCampo("CveVendedor")}&CveUsuario={e.Row.DBCampo("CveUsuario")}&CveEstatusFactura={e.Row.DBCampo("CveEstatusFactura")}&FechaI={FechaInicial}&FechaF={FechaFinal}&FechaIEjec={FechaIEjec}&FechaFEjec={FechaFEjec}&IVA={e.Row.DBCampo("GPO_IVA")}&CveCorte={ e.Row.DBCampo("CveCorte")}&TipoDocto={ DdlTipoComprobante.GetSelectedValuesM}&CveSubProyectoEjecucion={e.Row.DBCampo("CveSubProyectoEjecucion")}&CveSubProyecto={CveSubProyecto}&CveProyecto={CveProyecto}&TipoCambio={TipoCambio}&TCEspecifico={TCEspecifico}&CveMoneda={CveMoneda}&CveClienteClasificacion={e.Row.DBCampo("CveClienteClasificacion")}&CveCondicionesPago={DdlCondicionesPago.SelectedValue}&TipoCliente={ If(DdlGrupo.SelectedValue.ToEntero = 20, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue)}&ModalidadContable={If(ChkLecturaAdmin.Checked, 0, 1)}&CveTipoRelacion={DdlTipoRelacion.SelectedValue}&ServicioDomicilio={DdlServicioDomicilio.SelectedValue}&EsFacturaGlobal={DdlFacturaGlobal.SelectedValue}&EsFilial={e.Row.DBCampo("EsFilial")}" + Dim Liga As String = $"/Ventas/RepVentasDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&AnioEjec={e.Row.DBCampo("AnioEjec")}&MesEjec={e.Row.DBCampo("MesEjec")}&AnioMesEjec={e.Row.DBCampo("AnioMesEjec")}&FechaEjec={e.Row.DBCampo("FechaEjec")}&CveCliente={e.Row.DBCampo("CveCliente")}&CveVendedor={ e.Row.DBCampo("CveVendedor")}&CveUsuario={e.Row.DBCampo("CveUsuario")}&CveEstatusFactura={e.Row.DBCampo("CveEstatusFactura")}&FechaI={FechaInicial}&FechaF={FechaFinal}&FechaIEjec={FechaIEjec}&FechaFEjec={FechaFEjec}&IVA={e.Row.DBCampo("GPO_IVA")}&CveCorte={ e.Row.DBCampo("CveCorte")}&TipoDocto={ DdlTipoComprobante.GetSelectedValuesM}&CveSubProyectoEjecucion={e.Row.DBCampo("CveSubProyectoEjecucion")}&CveSubProyecto={CveSubProyecto}&CveProyecto={CveProyecto}&TipoCambio={TipoCambio}&TCEspecifico={TCEspecifico}&CveMoneda={CveMoneda}&CveClienteClasificacion={e.Row.DBCampo("CveClienteClasificacion")}&CveCondicionesPago={DdlCondicionesPago.SelectedValue}&TipoCliente={ If(DdlGrupo.SelectedValue.ToEntero = 20, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue)}&ModalidadContable={If(ChkLecturaAdmin.Checked, 0, 1)}&CveTipoRelacion={DdlTipoRelacion.SelectedValue}&ServicioDomicilio={DdlServicioDomicilio.SelectedValue}&EsFacturaGlobal={DdlFacturaGlobal.SelectedValue}&EsFilial={e.Row.DBCampo("EsFilial")}&CveTipoVenta={e.Row.DBCampo("CveTipoVenta")}" e.Row.FCLiteral("LtlGrupo").Text = "" & e.Row.FCLiteral("LtlGrupo").Text & "" diff --git a/Ventas/RepVentasDetalle.aspx b/Ventas/RepVentasDetalle.aspx index 16de624de..64b7ea27c 100644 --- a/Ventas/RepVentasDetalle.aspx +++ b/Ventas/RepVentasDetalle.aspx @@ -331,14 +331,20 @@ Factura Global: -
- - Todos - Solo Globales - Sin Globales - -
- +
+ + Todos + Solo Globales + Sin Globales + +
+ +
+ +
+ + +
@@ -346,7 +352,7 @@ - <%-- 0--%> @@ -607,11 +613,11 @@ - - - - - + + + + + <%-- 42--%> @@ -814,7 +820,8 @@ - + + diff --git a/Ventas/RepVentasDetalle.aspx.vb b/Ventas/RepVentasDetalle.aspx.vb index ab3168e0b..0f8eec6f0 100644 --- a/Ventas/RepVentasDetalle.aspx.vb +++ b/Ventas/RepVentasDetalle.aspx.vb @@ -186,6 +186,8 @@ Partial Class RepVentasDetalle TipoCliente = If(Request("TipoCliente") IsNot Nothing, Request("TipoCliente").ToString.ToEntero, -1).ToString.ToEntero CveTipoRelacion = If(Request("CveTipoRelacion") IsNot Nothing, Request("CveTipoRelacion").ToString, "-1").ToString + Dim CveTipoVenta = If(Request("CveTipoVenta") IsNot Nothing, Request("CveTipoVenta").ToString.ToEntero, -1).ToString.ToEntero + DdlTipoVenta.SelectedValueExist(CveTipoVenta) DdlTipoCliente.SelectedValueExist(TipoCliente) @@ -318,6 +320,15 @@ Partial Class RepVentasDetalle End Sub Private Sub CargaCombos() + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + LblTipoVenta.Visible = True + DivTipoVenta.Visible = True + + DdlTipoVenta.DataSource = GlobalDTTipoVenta(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' AND TipoDocto = 'Egs'") + DdlTipoVenta.DataBind() + DdlTipoVenta.Items.Insert(0, New ListItem("Todos", "-1")) + End If + CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto, VisualizacionReporte:=1) CargaClientes() @@ -457,7 +468,7 @@ Partial Class RepVentasDetalle CveCorte.ToEntero, TipoComprobante, DdlSubProyectoEjecucion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaIEjec, FechaFEjec, CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveCondicionesPago:=CveCondicionesPago, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=Not ChkLecturaAdmin.Checked, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero(), - ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero) Then + ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero()) Then DtVentas = AddRows(ObjVentas.DtResultados) ImgImprimir.Enabled = True GvDatos.DataSource = AddRows(ObjVentas.DtResultados) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index c5874f90b..dfd33cfbd 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -12424,6 +12424,9 @@ Partial Class Ventas End If End If + + ObjFacturaBonificacion.CveTipoVenta = 7 'PRONTO PAGO + End Sub @@ -14638,6 +14641,31 @@ Partial Class Ventas End If End If + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso factura.TipoDocto = "Egs" AndAlso Not factura.EsGarantia Then + CveTipoVentaGuardar = -1 + + If NCDescuento Then + If ListaNCDescuento IsNot Nothing AndAlso ListaNCDescuento.Count > 0 Then + 'VERIFICA SI BONIFICACION + If ListaNCDescuento.Any(Function(RNC) (RNC.Num1 = 2)) Then + CveTipoVentaGuardar = 7 ' BONIFICACION + ElseIf ListaNCDescuento.Any(Function(RNC) (Not RNC.Num1 = 2)) Then + CveTipoVentaGuardar = 9 ' CANCELACION DE USADOS + End If + End If + Else + If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then + 'VERIFICA SI BONIFICACION + If ListaRemisionesNC.Any(Function(RNC) (RNC.Num1 = 2)) Then + CveTipoVentaGuardar = 7 ' BONIFICACION + ElseIf ListaRemisionesNC.Any(Function(RNC) (Not RNC.Num1 = 2)) Then + CveTipoVentaGuardar = 9 ' CANCELACION DE USADOS + End If + End If + + End If + End If + If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC, factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC, factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, 0, factura.FechaPago, factura.Fecha, factura.MotivoDescuento,