From 0af171c165f11fa3aa845814d4ac2ca5e9f360c3 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 31 Jan 2020 10:20:50 -0700 Subject: [PATCH 01/22] No guardar estimaciones cuando es NC de Amortizacion --- App_Code/Modelos.vb | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 2091e565f..447ab3844 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -1439,10 +1439,11 @@ Namespace Modelos End If 'Contratos - If factura.CveContrato > 0 AndAlso TipoDocto.Contiene("Ing") Then - GuardarContratoAvanceEstimaciones(ObjContr, ErrorList, 1) - ElseIf factura.CveContrato > 0 AndAlso factura.TipoDocto.Contiene("Egs", "Dev") Then - GuardarContratoAvanceEstimaciones(ObjContr, ErrorList, -1) + If factura.CveContrato > 0 AndAlso factura.TipoDocto.Contiene("Ing") Then + GuardarContratoAvanceEstimaciones(factura, ObjContr, ErrorList, 1) + 'CUANDO ES NOTA DE CRÉDITO, NO DEBE DE CONSIDERAR AVANCE, CUANDO ES NOTA DE CRÉDITO POR AMORTIZACIÓN + ElseIf factura.CveContrato > 0 AndAlso factura.TipoDocto.Contiene("Egs", "Dev") AndAlso Not factura.EsNCAmortizacion Then + GuardarContratoAvanceEstimaciones(factura, ObjContr, ErrorList, -1) End If 'Impuestos Locales @@ -1781,18 +1782,18 @@ Namespace Modelos Return True End Function - Private Sub GuardarContratoAvanceEstimaciones(ObjContrato As ClsContratos, ErrorList As List(Of String), Multiplicador As Integer, Optional CrearAvance As Boolean = False) + Private Sub GuardarContratoAvanceEstimaciones(ObjFactura As Modelos.Factura, ObjContrato As ClsContratos, ErrorList As List(Of String), Multiplicador As Integer, Optional CrearAvance As Boolean = False) - If Me.CveContrato > 0 Then + If ObjFactura.CveContrato > 0 Then Dim CveEstimacion As Integer = -1 - If ObjContrato.AddEstimaciones(Me.CveContrato, Me.Fecha, -1, Me.CveVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If ObjContrato.AddEstimaciones(ObjFactura.CveContrato, ObjFactura.Fecha, -1, ObjFactura.CveVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then CveEstimacion = ObjContrato.DtResultados(0)("CveEstimacion").ToString.ToEntero - For Each row As DataRow In DtDetalle.Rows + For Each row As DataRow In ObjFactura.DtDetalle.Rows If row("CveContratoDetalle").ToString.ToEntero > 0 Then - If Not ObjContrato.AddContratosAvance(row("CveContratoDetalle").ToString.ToEntero, row("Cantidad").ToString.ToEntero * Multiplicador, Me.Fecha, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then + If Not ObjContrato.AddContratosAvance(row("CveContratoDetalle").ToString.ToEntero, row("Cantidad").ToString.ToEntero * Multiplicador, ObjFactura.Fecha, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then ErrorList.Add("Ocurrió un error al agregar los avances") End If End If @@ -4464,13 +4465,13 @@ Namespace Modelos 'CANCELA CONTRATOS If Not ErrorCancelar Then If ObjFactura.CveContrato > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") Then - ObjFactura.GuardarContratoAvanceEstimaciones(ObjContrato, ErrorList, -1, True) + ObjFactura.GuardarContratoAvanceEstimaciones(ObjFactura, ObjContrato, ErrorList, -1, True) If ErrorList.Count > 0 Then ErrorCancelar = True MensajeError = "Ocurrió un error al cancelar las estimaciones del contrato." End If ElseIf ObjFactura.CveContrato > 0 AndAlso ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then - ObjFactura.GuardarContratoAvanceEstimaciones(ObjContrato, ErrorList, 1, True) + ObjFactura.GuardarContratoAvanceEstimaciones(ObjFactura, ObjContrato, ErrorList, 1, True) If ErrorList.Count > 0 Then ErrorCancelar = True MensajeError = "Ocurrió un error al cancelar los avances del contrato." From cf76e49af44dd5edfb0667a6bbed9034b0b2f59d Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 31 Jan 2020 10:27:50 -0700 Subject: [PATCH 02/22] Mostar Retenciones de IVA --- Ventas/Ventas.aspx.vb | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 091460f02..8f8f11141 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3826,6 +3826,18 @@ Partial Class Ventas TxtSubTotal2.Text = (TxtSubTotal.Text.Replace(",", "").Trim.Trim.ToDouble - LblDescuentos.Text.Replace(",", "").Trim.Trim.ToDouble - LblAmortizacion.Text.Replace(",", "").Trim.Trim.ToDouble).FormatoNumero(2) TxtIVA.Text = DbRowVenta("IVA").ToString.FormatoNumero(2) TxtRetIVA.Text = DbRowVenta("RetIVA").ToString.FormatoNumero(2) + If TxtRetIVA.Text.ToDecimal() > 0 Then + TrRetIVA.Style.Add("display", "") + UsuarioActual.Empresa.MostrarRetIVA = True + If DdlTipoRetencion.SelectedValue.ToEntero() > 0 Then + DdlTipoRetencion.Visible = True + End If + If TmpDT IsNot Nothing Then + Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) + LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2) + End If + + End If TxtRetISR.Text = DbRowVenta("RetISR").ToString.FormatoNumero(2) TxtIEPS.Text = DbRowVenta("IEPS").ToString.FormatoNumero(2) TrIEPS.Visible = TxtIEPS.Text.ToDouble > 0 @@ -4398,6 +4410,10 @@ Partial Class Ventas TxtSubTotal2.Text = (TxtSubTotal.Text.Replace(",", "").Trim.Trim.ToDouble - LblDescuentos.Text.Replace(",", "").Trim.Trim.ToDouble - LblAmortizacion.Text.Replace(",", "").Trim.Trim.ToDouble).FormatoNumero(2) TxtIVA.Text = drv("IVA").ToString.FormatoNumero(2) TxtRetIVA.Text = drv("RetIVA").ToString.FormatoNumero(2) + If TxtRetIVA.Text.ToDecimal() > 0 Then + TrRetIVA.Style.Add("display", "") + UsuarioActual.Empresa.MostrarRetIVA = True + End If TxtRetISR.Text = drv("RetISR").ToString.FormatoNumero(2) TxtTotal.Text = drv("Total").ToString.FormatoNumero(2) TotalOriginal = Math.Round(drv("Total").ToString.ToDouble, 2) @@ -4720,15 +4736,18 @@ Partial Class Ventas DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString) DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty) - ViewState("RetIVAFletes") = ObjCliente.RetieneIVAFletes - If ObjCliente.RetieneIVAFletes Then - TrRetIVA.Style.Add("display", "") - UsuarioActual.Empresa.MostrarRetIVA = True + If CveVenta <= 0 Then + ViewState("RetIVAFletes") = ObjCliente.RetieneIVAFletes + If ObjCliente.RetieneIVAFletes Then + TrRetIVA.Style.Add("display", "") + UsuarioActual.Empresa.MostrarRetIVA = True + End If End If + ViewState("Vendedor") = ObjCliente.Vendedor ViewState("CtaContable") = ObjCliente.CuentaContable ViewState("IdCtaContClientes") = ObjCliente.IdCtaContClientes @@ -24205,18 +24224,20 @@ Partial Class Ventas Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2) If PorcentajeRetIVA > 0 Then + TrRetIVA.Style.Add("display", "") + UsuarioActual.Empresa.MostrarRetIVA = True DdlTipoRetencion.Visible = True End If GvPS.DataSource = TmpDT GvPS.DataBind() - UpPS.Update() + End If End If End If - + UpPS.Update() End Sub From 8bb64b71c9ff4ccff6fbb8924965ab80939161ce Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 31 Jan 2020 10:28:22 -0700 Subject: [PATCH 03/22] Limpiar recepcion de usados --- Inventarios/RecepcionUsados.aspx.vb | 166 +++++++++++++--------------- 1 file changed, 79 insertions(+), 87 deletions(-) diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index 5c4248dfb..d2cabcd67 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -322,82 +322,80 @@ Partial Class Inventarios_RecepcionUsados Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then - - - CveMovimiento = -1 - CveMovimientoRelacionado = -1 - TieneRelacionado = -1 - TieneSalida = False - EstatusAlmacenCompra = -1 - EsConsumoInterno = False - Correo = "" - FolioCorreo = "" - - If IfNull(Request("Opc"), "").ToString = "S" Then - RBLOpcion.SelectedValue = "3" - DivCliente.Visible = False - End If - - CreaDT() - CargaCombos() - TxtFecha.Text = Now.ToShortDateString - TxtFechaPendientes.Text = Now.ToShortDateString - RVFecha.MaximumValue = Now.ToShortDateString - InicializaClientes() - - 'si viene una parámetro para cargar un movimiento lo hacemos dentro del procedimiento cargadatos - Select Case UsuarioActual.Empresa.Funcionalidad(103) - Case "1" - - Case "2" - divMonedaSeccion.Visible = True - divGuia.Visible = True - End Select - - - - 'AsignacionOpcion() - SiguienteFolio() - - - 'SI YA ES MOVIMIENTO REGISTRADO NO ESCONDE COLUMNA AF - If CveMovimiento > 0 Then - BloqueaEdicionEncabezado() - If UsuarioActual.CveEmpresa.Contiene(66, 13) Then - TrSubProyectoActivoFijo.Visible = True - VisualizaAF(True) - CargaSubProyectos() - End If - End If - - CargaSubProyectosUsados() - InicializaBitacoraTemporal() - - If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then - DivCodigoSeriePS.Visible = True - End If - - 'If IfNull(Request("CI"), -1).ToString.ToEntero > 0 Then - ' ActivaConsumoInterno() - 'End If - - 'BLOQUEA PERMISOS - BtnGuardar.Enabled = PermiteGuardar() - BtnEliminar.Enabled = PermiteEliminar() - BtnContabilizar.Enabled = PermiteContabilizar() - BtnNuevo.Enabled = PermiteCrearNuevo() - - ActivaPermisoSeccionAlmacen() - If CveMovimiento > 0 Then - PermisoVerImportes() - End If - - CargaTamaños() - 'DdlProducto2.setEsWebService(True) - 'DdlProducto2.Attributes.Add("data-metodo", "getpsusados") + CargaInicial() End If End Sub + Private Sub CargaInicial() + CveMovimiento = -1 + CveMovimientoRelacionado = -1 + TieneRelacionado = -1 + TieneSalida = False + EstatusAlmacenCompra = -1 + EsConsumoInterno = False + Correo = "" + FolioCorreo = "" + + If IfNull(Request("Opc"), "").ToString = "S" Then + RBLOpcion.SelectedValue = "3" + DivCliente.Visible = False + End If + + CreaDT() + CargaCombos() + TxtFecha.Text = Now.ToShortDateString + TxtFechaPendientes.Text = Now.ToShortDateString + RVFecha.MaximumValue = Now.ToShortDateString + InicializaClientes() + + 'si viene una parámetro para cargar un movimiento lo hacemos dentro del procedimiento cargadatos + Select Case UsuarioActual.Empresa.Funcionalidad(103) + Case "1" + + Case "2" + divMonedaSeccion.Visible = True + divGuia.Visible = True + End Select + + 'AsignacionOpcion() + SiguienteFolio() + + 'SI YA ES MOVIMIENTO REGISTRADO NO ESCONDE COLUMNA AF + If CveMovimiento > 0 Then + BloqueaEdicionEncabezado() + If UsuarioActual.CveEmpresa.Contiene(66, 13) Then + TrSubProyectoActivoFijo.Visible = True + VisualizaAF(True) + CargaSubProyectos() + End If + End If + + CargaSubProyectosUsados() + InicializaBitacoraTemporal() + + If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then + DivCodigoSeriePS.Visible = True + End If + + 'If IfNull(Request("CI"), -1).ToString.ToEntero > 0 Then + ' ActivaConsumoInterno() + 'End If + + 'BLOQUEA PERMISOS + BtnGuardar.Enabled = PermiteGuardar() + BtnEliminar.Enabled = PermiteEliminar() + BtnContabilizar.Enabled = PermiteContabilizar() + BtnNuevo.Enabled = PermiteCrearNuevo() + + ActivaPermisoSeccionAlmacen() + If CveMovimiento > 0 Then + PermisoVerImportes() + End If + + CargaTamaños() + 'DdlProducto2.setEsWebService(True) + 'DdlProducto2.Attributes.Add("data-metodo", "getpsusados") + End Sub @@ -630,6 +628,7 @@ Partial Class Inventarios_RecepcionUsados CveRemisionRecibida = -1 EsDistribuidor = False DdlClientes.SelectedValueExist("-1") + DdlClientes_SelectedIndexChanged(DdlClientes, EventArgs.Empty) SiguienteFolio() @@ -654,6 +653,7 @@ Partial Class Inventarios_RecepcionUsados If Not DdlAlmacen.Items.Contains(New ListItem("Seleccione", "-1")) Then DdlAlmacen.Items.Add(New ListItem("Seleccione", "-1")) End If + DdlAlmacen.SelectedValue = "-1" If Not EsConsumoInterno Then DdlAlmacen_SelectedIndexChanged(DdlAlmacen, EventArgs.Empty) @@ -680,6 +680,8 @@ Partial Class Inventarios_RecepcionUsados TxtRemision.Text = "" DivRemision.Visible = False + 'CargaInicial() + UpRegistroTipoCambio.Update() UPDatos.Update() End Sub @@ -2046,22 +2048,12 @@ Partial Class Inventarios_RecepcionUsados 'End Sub Private Sub CreaRemisionNC(CveCliente As Integer, CveSubProyecto As Integer, CveMoneda As Integer) + If ObjRemisionNC IsNot Nothing Then + ObjRemisionNC.Dispose() + ObjRemisionNC = Nothing + End If Me.ObjRemisionNC = New Modelos.Factura(UsuarioActual) - 'Dim Folio As String = "" - 'Dim Serie As String = "" - - 'Dim ObjFolios As New ClsGralFolios() - 'If ObjFolios.GetFolios("RNC", UsuarioActual.CveEmpresa) Then - ' Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" Estado = 'Activo' AND CveSubProyecto = {0}", CveSubProyecto)) - ' If DT.Rows.Count > 0 Then - ' Serie = DT.Rows(0)("Serie").ToString() - ' Folio = DT.Rows(0)("FActual").ToString() - ' End If - ' DT.Dispose() - 'End If - 'ObjFolios.Dispose() - Me.ObjRemisionNC.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.HTML Me.ObjRemisionNC.Serie = "-1" Me.ObjRemisionNC.Folio = -1 'Folio.ToEntero() From 23d2497aba9bafe7b73d39700c0b43b3e4bc5036 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 31 Jan 2020 13:13:43 -0700 Subject: [PATCH 04/22] Promociones aplicadas para grupos de productos en Clasificaciones --- App_Code/ClsVentas.vb | 12 ++++++++++-- Ventas/Promociones.aspx | 1 + Ventas/Promociones.aspx.vb | 13 +++++++------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 9a0fd3c83..6ac45f7a1 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1991,7 +1991,10 @@ Public Class ClsVentas Return Retorno End Function - Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1) As Boolean + Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, + AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, + AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1, + Optional CveClasificacion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PromocionesDetalleAdd") @@ -2014,6 +2017,7 @@ Public Class ClsVentas .Add("@HoraInicio", SqlDbType.DateTime).Value = HoraInicio .Add("@HoraFin", SqlDbType.DateTime).Value = HoraFin .Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion End With Try @@ -2025,7 +2029,10 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdatePromocionesDetalle(CvePromocionDetalle As Integer, CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1) As Boolean + Public Function UpdatePromocionesDetalle(CvePromocionDetalle As Integer, CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, + PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, + AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, + Optional CantidadMinima As Integer = 1, Optional CveClasificacion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PromocionesDetalleUpdate") @@ -2049,6 +2056,7 @@ Public Class ClsVentas .Add("@HoraFin", SqlDbType.DateTime).Value = HoraFin .Add("@CvePromocionDetalle", SqlDbType.Int).Value = CvePromocionDetalle .Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion End With Try diff --git a/Ventas/Promociones.aspx b/Ventas/Promociones.aspx index 6ed0aabef..4a4d6b944 100644 --- a/Ventas/Promociones.aspx +++ b/Ventas/Promociones.aspx @@ -180,6 +180,7 @@ + diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb index abb594cff..1d9f1a6b6 100644 --- a/Ventas/Promociones.aspx.vb +++ b/Ventas/Promociones.aspx.vb @@ -219,8 +219,8 @@ Partial Class Ventas_Promociones Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs) - If DdlPS.SelectedValue.ToEntero <= 0 Then - Alert("Debe seleccionar un Producto/Servicio.", TipoMensaje.MsgAdvertencia) + If DdlClasificacion.SelectedValue.ToEntero <= 0 Then + Alert("Debe seleccionar una clasificacion", TipoMensaje.MsgAdvertencia) Exit Sub End If @@ -242,7 +242,7 @@ Partial Class Ventas_Promociones Dr("Clasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimeroValor("Clasificacion") End If - Dr("CvePS") = DdlPS.SelectedValue + Dr("CvePS") = If(DdlPS.SelectedValue = "", "-1", DdlPS.SelectedValue) Dr("CodigoPS") = DdlPS.SelectedText Dr("PUAnterior") = LbPUActual.Text.ToDecimal @@ -388,7 +388,8 @@ Partial Class Ventas_Promociones For Each Dr As DataRow In TempDT.Rows If Not ObjVentas.AddPromocionesDetalle(CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble, CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")), - Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero) Then + Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero, + CveClasificacion:=If(Dr("CvePS").ToString = "", 20, Dr("CveClasificacion").ToString.ToEntero)) Then TieneError = True Exit For End If @@ -417,7 +418,7 @@ Partial Class Ventas_Promociones For Each Dr As DataRow In TempDT.FiltraParametros("Estatus = 0").Rows If Not ObjVentas.AddPromocionesDetalle(CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble, CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")), - Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero) Then + Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero, CveClasificacion:=If(Dr("CvePS").ToString = "-1", Dr("CveClasificacion").ToString.ToEntero, -1)) Then TieneError = True Exit For End If @@ -427,7 +428,7 @@ Partial Class Ventas_Promociones For Each Dr As DataRow In TempDT.FiltraParametros("Estatus = 1").Rows If Not ObjVentas.UpdatePromocionesDetalle(Dr("CvePromocionDetalle").ToString.ToEntero, CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble, CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")), - Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero) Then + Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero, CveClasificacion:=If(Dr("CvePS").ToString = "-1", Dr("CveClasificacion").ToString.ToEntero, -1)) Then TieneError = True Exit For End If From 80ab86114698b1134081e6a1c0ed4720555acf94 Mon Sep 17 00:00:00 2001 From: Rene Molina Date: Fri, 31 Jan 2020 13:26:15 -0700 Subject: [PATCH 05/22] - ventas relacionadas --- App_Code/ClsVentas.vb | 40 ++++++++++++++++++++++++++++- Contratos/Contrato.aspx | 1 + Inicio.aspx | 2 ++ Inicio.aspx.vb | 10 +++++--- Inventarios/RecepcionUsados.aspx.vb | 2 +- 5 files changed, 50 insertions(+), 5 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 9a0fd3c83..0d8ac4700 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -2262,6 +2262,43 @@ Public Class ClsVentas #End Region + + +#Region "Firmas" + + Public Function GetVentasRelacionadas(CveVenta As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentasRelacionadasGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las ventas relacionadas. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + Public Function AddVentasRelacionadas(CveVenta As Integer, CveVentaRelacionada As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentasRelacionadasAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveVentaRelacionada", SqlDbType.Int).Value = CveVentaRelacionada + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar las ventas relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function +#End Region + #Region " I M P U E S T O S L O C A L E S" Public Function AddImpuestosLocales(ImpuestoLocal As String, Porcentaje As Double, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, IdCtaContable As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -4233,7 +4270,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdateVentaUsadoRecibido(CveVenta As Integer, CvePS As Integer, Recibido As Boolean) As Boolean + Public Function UpdateVentaUsadoRecibido(CveVenta As Integer, CvePS As Integer, Recibido As Boolean, CveMovimiento As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUsadosRecibidoUpdate", CommandType.StoredProcedure) @@ -4242,6 +4279,7 @@ Public Class ClsVentas .Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@Recibido", SqlDbType.Bit).Value = Recibido + .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento End With Try diff --git a/Contratos/Contrato.aspx b/Contratos/Contrato.aspx index dbe3e9d5b..c75733b7f 100644 --- a/Contratos/Contrato.aspx +++ b/Contratos/Contrato.aspx @@ -2247,6 +2247,7 @@ + diff --git a/Inicio.aspx b/Inicio.aspx index f2f896e76..6ccfe6a7b 100644 --- a/Inicio.aspx +++ b/Inicio.aspx @@ -604,6 +604,7 @@