From fd413d7f0659138e103503b5d45d91356e3055bf Mon Sep 17 00:00:00 2001 From: HECTOR RODRIGUEZ Date: Tue, 29 Jun 2021 14:15:23 -0700 Subject: [PATCH 1/6] --- AC/RepPresupuestoEgresos.aspx | 2 +- Contabilidad/RegPrePoliza.aspx.vb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AC/RepPresupuestoEgresos.aspx b/AC/RepPresupuestoEgresos.aspx index 587751c16..ba0579ec6 100644 --- a/AC/RepPresupuestoEgresos.aspx +++ b/AC/RepPresupuestoEgresos.aspx @@ -300,7 +300,7 @@ --%> - + diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index cf3304a90..6fd47f81b 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -1945,7 +1945,7 @@ Partial Class ContabilidadC_RegPrePoliza 'If ObjPoliza.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjPoliza.DtResultados.Rows.Count > 0 Then - If ObjConta.GetPrePolizasDetalle(CvePrePoliza) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then + If ObjConta.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Dim dtVC As DataTable Dim dr As DataRow dtVC = ObjConta.DtResultados From c0814fb6de8381e3cb1cff6ea6060100095faeea Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 30 Jun 2021 10:17:57 -0700 Subject: [PATCH 2/6] Procesos 324,325,326 --- Ventas/Ventas.aspx.vb | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 86c648da4..20efb5a60 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -4911,11 +4911,11 @@ Partial Class Ventas 'ACTIVA CONVERSION DE MONEDA If DdlMoneda.SelectedValue.ToEntero() = 1 Then TrConversionDolares.Visible = True - ChkConvertirDolares.Enabled = True + ChkConvertirDolares.Enabled = Not UsuarioActual.TienePermisoProceso(324) TxtTipoCambioDlls.Enabled = True Else TrConversionTipoCambio.Visible = True - ChkConvertirDoctoPesos.Enabled = True + ChkConvertirDoctoPesos.Enabled = Not UsuarioActual.TienePermisoProceso(324) TxtTipoCambio.Enabled = True End If End If @@ -5308,9 +5308,15 @@ Partial Class Ventas 'FACTURACION 3.3 - DdlMetodoPago33.DataSource = GlobalDTVtaMetodoPago + 'No puede asignar PUE como método de pago + If UsuarioActual.TienePermisoProceso(326) Then + DdlMetodoPago33.DataSource = GlobalDTVtaMetodoPago.FiltraParametros("CveMetodoPago <> 1") + Else + DdlMetodoPago33.DataSource = GlobalDTVtaMetodoPago + End If + DdlMetodoPago33.DataBind() - DdlMetodoPago33.SelectedValue = "3" + DdlMetodoPago33.SelectedValueExist("3") CargaFormaPago(DdlMetodoPago33.SelectedValue.ToEntero()) @@ -6163,7 +6169,9 @@ Partial Class Ventas 'si llegó por la opción de cotización no debe de restringuir If IfNull(Request("Op"), "").ToString() = "Cot" Then DdlTipoComprobante.SelectedValue = "Cot" DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing")) - DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) + If Not UsuarioActual.TienePermisoProceso(325) Then + DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) + End If DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem")) LnkPedido2SinFacturar.Visible = False LnkCotizaciones.Visible = False @@ -6202,7 +6210,9 @@ Partial Class Ventas If IfNull(Request("Op"), "").ToString() = "Cot" Then DdlTipoComprobante.SelectedValue = "Cot" 'quito remisión y factura DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing")) - DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) + If Not UsuarioActual.TienePermisoProceso(325) Then + DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) + End If DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem")) If Opcion = 1 Then BtnEmitirImprimir.Visible = False @@ -6261,7 +6271,9 @@ Partial Class Ventas 'si llegó por la opción de cotización no debe de restringuir If IfNull(Request("Op"), "").ToString() = "Cot" Then DdlTipoComprobante.SelectedValue = "Cot" DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing")) - DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) + If Not UsuarioActual.TienePermisoProceso(325) Then + DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) + End If DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem")) BtnsFacturar.Visible = False LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274) @@ -6298,7 +6310,9 @@ Partial Class Ventas Exit Sub ElseIf DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso EsCreaApartirDe Then DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing")) - DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) + If Not UsuarioActual.TienePermisoProceso(325) Then + DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) + End If DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem")) DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Pd2")) DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Egs")) @@ -20442,10 +20456,12 @@ Partial Class Ventas TxtTipoCambio.Text = "1" TxtTipoCambioDlls.Text = GlobalTipoCambio(TxtFecha.Text.ToDate).ToString() TrConversionDolares.Visible = True + ChkConvertirDolares.Enabled = Not UsuarioActual.TienePermisoProceso(324) Case "2" TxtTipoCambioDlls.Text = "1" TxtTipoCambio.Text = GlobalTipoCambio(TxtFecha.Text.ToDate).ToString() TrConversionTipoCambio.Visible = True + ChkConvertirDoctoPesos.Enabled = Not UsuarioActual.TienePermisoProceso(324) Case Else TxtTipoCambio.Text = GlobalTipoCambio(TxtFecha.Text.ToDate).ToString() TrConversionTipoCambio.Visible = True @@ -27588,7 +27604,7 @@ Partial Class Ventas If DdlMoneda.SelectedValue = "2" Then TrConversionTipoCambio.Visible = True End If - ChkConvertirDoctoPesos.Enabled = True + ChkConvertirDoctoPesos.Enabled = Not UsuarioActual.TienePermisoProceso(324) TxtTipoCambio.Enabled = True TxtTotal.ReadOnly = False TxtTotal.Attributes("readonly") = "readonly" @@ -28778,11 +28794,11 @@ Partial Class Ventas If DdlMoneda.SelectedValue.ToEntero() = 1 Then TrConversionDolares.Visible = True - ChkConvertirDolares.Enabled = True + ChkConvertirDolares.Enabled = Not UsuarioActual.TienePermisoProceso(324) TxtTipoCambioDlls.Enabled = True Else TrConversionTipoCambio.Visible = True - ChkConvertirDoctoPesos.Enabled = True + ChkConvertirDoctoPesos.Enabled = Not UsuarioActual.TienePermisoProceso(324) TxtTipoCambio.Enabled = True End If @@ -29287,7 +29303,7 @@ Partial Class Ventas 'Sección Detalle DdlMoneda.Enabled = True - ChkConvertirDoctoPesos.Enabled = True + ChkConvertirDoctoPesos.Enabled = Not UsuarioActual.TienePermisoProceso(324) TxtTipoCambio.Enabled = True TxtFechaEjecucion.ReadOnly = False TxtFechaEjecucion.Text = Now.ToShortDateString From 1fba1062eade2067ccac7c3aeccc451816417467 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 30 Jun 2021 10:18:26 -0700 Subject: [PATCH 3/6] Eliminar registro de detalle al cancelar NC con RNC relacionada --- App_Code/ClsVentas.vb | 18 ++++++++++++++++++ App_Code/Modelos.vb | 7 ++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index d79c9bae5..d2d08206d 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -5038,6 +5038,24 @@ Public Class ClsVentas Return Retorno End Function + Public Function RemoveRNCFacturada(CveVentaNC As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_RNCRelacionadasRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVentaNC", SqlDbType.Int).Value = CveVentaNC + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar las RNC Relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + #End Region #Region "P O R C E N T A J E - C O M I S I O N E S" diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index ec641de26..afc155043 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2963,7 +2963,7 @@ Namespace Modelos Next End If - If UsuarioActual.Empresa.Funcionalidad(344) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(344) = "1" AndAlso ObjFactura.TipoDocto = "Egs" Then Dim ListaNC As List(Of Modelos.Factura) = New List(Of Factura) Dim DtRNCRelacionas As DataTable = Nothing @@ -3034,6 +3034,11 @@ Namespace Modelos importeMovimiento = 0 End If Next + + If Not ObjVentas.RemoveRNCFacturada(CveVenta) Then + ErrorPrepoliza = True + End If + End If End If Else From d04808e4a7037086a66639b2b1f18da6fc460d9e Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 30 Jun 2021 10:22:31 -0700 Subject: [PATCH 4/6] Fecha de vencimiento segun los datos del cliente --- Contratos/FacturacionMasiva.aspx.vb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Contratos/FacturacionMasiva.aspx.vb b/Contratos/FacturacionMasiva.aspx.vb index 17d923bba..64a944f22 100644 --- a/Contratos/FacturacionMasiva.aspx.vb +++ b/Contratos/FacturacionMasiva.aspx.vb @@ -433,11 +433,12 @@ Partial Class Contratos_FacturacionMasiva ObjFactura.Folio = -1 ObjFactura.Serie = "-1" ObjFactura.CveMesa = -1 - ObjFactura.Fecha = DR("FechaVenc").ToString.ToDate 'If(DR("FechaVenc").ToString.ToDate > Now, Now, DR("FechaVenc").ToString.ToDate) + ObjFactura.Fecha = If(DR("FechaVenc").ToString.ToDate > Now, Now, DR("FechaVenc").ToString.ToDate) + ObjFactura.CvePrePoliza = -1 ObjFactura.CveMetodoPago = 1 - ObjFactura.MetodoPago = "Efectivo" - ObjFactura.FechaPago = DateTime.Today + ObjFactura.MetodoPago = "Efectivo" + ObjFactura.MotivoDescuento = "" ObjFactura.Observaciones = If(String.IsNullOrEmpty(TxtObservaciones.Text), "", TxtObservaciones.Text + " ") + DR("Observaciones").ToString ObjFactura.FechaEjecucion = DateTime.Today @@ -567,6 +568,13 @@ Partial Class Contratos_FacturacionMasiva ViewState("CveCuentaRetIVA") = ObjCliente.CveCuentaRetIVA ViewState("IdCtaContRetISR") = ObjCliente.IdCtaContRetISR ViewState("CveCuentaRetISR") = ObjCliente.CveCuentaRetISR + + 'AGREGAR LOS PLAZOS PARA EL PAGO DEL CLIENTE + Dim FechaPago As DateTime = ObjFactura.Fecha.AddDays(ObjCliente.PlazoCobranza) + ObjFactura.FechaVencimiento = FechaPago + ObjFactura.Vigencia = FechaPago + ObjFactura.FechaPago = FechaPago + End If End If ObjCliente.Dispose() From f40d6397f86dba78f0115c09132e2ff9eacf7460 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 30 Jun 2021 10:27:43 -0700 Subject: [PATCH 5/6] Correcion de IVA en reembolsos comprobaciones --- Compras/ReembolsosComprobaciones.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index 220803b63..2a62a241d 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -799,7 +799,7 @@ Partial Class Compras_ReembolsosComprobaciones End If Else 'Agrego el IVA - If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago) * tipoCambio, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then MsgError = "Detalle" End If 'Agrego el IVA @@ -1129,7 +1129,7 @@ Partial Class Compras_ReembolsosComprobaciones End If Else 'Agrego el IVA - If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEExcedente, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago) * tipoCambio, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEExcedente, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then MsgError = "Detalle" End If From 8e525c514fa00ef408da45c5c8c83ccb190b14aa Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 30 Jun 2021 18:54:20 -0700 Subject: [PATCH 6/6] Cantidad minima en cada tipo de promocion --- Ventas/Promociones.aspx | 8 ++++---- Ventas/Promociones.aspx.vb | 31 ++++++++++++++++--------------- Ventas/Ventas.aspx.vb | 4 ++-- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Ventas/Promociones.aspx b/Ventas/Promociones.aspx index b0f322748..581e8f021 100644 --- a/Ventas/Promociones.aspx +++ b/Ventas/Promociones.aspx @@ -254,7 +254,7 @@
- + @@ -272,7 +272,7 @@
-
+
@@ -287,9 +287,9 @@
- + - +
diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb index c3a6844b2..5b7812691 100644 --- a/Ventas/Promociones.aspx.vb +++ b/Ventas/Promociones.aspx.vb @@ -104,7 +104,7 @@ Partial Class Ventas_Promociones DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then - GvDatos.Columns(7).Visible = True + GvDatos.Columns(8).Visible = True DivRin.Visible = True Dim ObjGral As New ClsGenerales If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then @@ -235,7 +235,7 @@ Partial Class Ventas_Promociones LbPUActual.Text = "" DdlTipoPromocion.SelectedValue = "-1" TxtPromocionConcepto.Text = "" - TxtCantMinima.Text = "" + TxtCantMinima.Text = "1" ChkRestricciones.Checked = False 'DivRestricciones.Visible = False @@ -259,6 +259,11 @@ Partial Class Ventas_Promociones Exit Sub End If + If TxtCantMinima.Text.ToEntero <= 0 Then + Alert("La cantidad minima debe ser de 1", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Dim Dr As DataRow = Nothing If CveConsecutivo >= 0 Then @@ -291,11 +296,7 @@ Partial Class Ventas_Promociones Dr("PUPromocion") = LbPUActual.Text.ToDecimal - (LbPUActual.Text.ToDecimal * TxtPromocionConcepto.Text.ToDecimal / 100) End If - If DdlTipoPromocion.SelectedValue.ToEntero = 3 Then - Dr("CantidadMinima") = TxtCantMinima.Text.ToEntero - Else - Dr("CantidadMinima") = 1 - End If + Dr("CantidadMinima") = TxtCantMinima.Text.ToEntero If ChkRestricciones.Checked Then Dr("AplicaRestriccionTexto") = "Si" @@ -369,7 +370,7 @@ Partial Class Ventas_Promociones LbPUActual.Text = Gvr.DataKey("PUAnterior").FormatoNumero DdlTipoPromocion.SelectedValue = Gvr.DataKey("CveTipoPromocion") - DdlTipoPromocion_SelectedIndexChanged(sender, Nothing) + 'DdlTipoPromocion_SelectedIndexChanged(sender, Nothing) TxtPromocionConcepto.Text = Gvr.DataKey("Promocion").FormatoNumero(4) TxtCantMinima.Text = Gvr.DataKey("CantidadMinima") @@ -533,11 +534,11 @@ Partial Class Ventas_Promociones End Sub #End Region - Protected Sub DdlTipoPromocion_SelectedIndexChanged(sender As Object, e As EventArgs) - If DdlTipoPromocion.SelectedValue = "3" Then - DivCantMinima.Visible = True - Else - DivCantMinima.Visible = False - End If - End Sub + 'Protected Sub DdlTipoPromocion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoPromocion.SelectedIndexChanged + ' If DdlTipoPromocion.SelectedValue = "3" Then + ' DivCantMinima.Visible = True + ' Else + ' DivCantMinima.Visible = False + ' End If + 'End Sub End Class \ No newline at end of file diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 084f5c6ab..aef867548 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -16743,11 +16743,11 @@ Partial Class Ventas Dim dr As DataRow = Nothing If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then - dr = DtPromociones.FiltroPrimero(String.Format("CvePS = {0} AND (CveSubProyecto = {1} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {2} OR CveRinTamaño IS NULL) AND (TipoPromocion <> 3 OR (TipoPromocion = 3 AND CantidadMinima <= {3} ))", CvePS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc ") + dr = DtPromociones.FiltroPrimero(String.Format("CvePS = {0} AND (CveSubProyecto = {1} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {2} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {3} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {3} ))", CvePS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc ") If dr Is Nothing Then 'verifica marca, si tiene asignada la promocion - dr = DtPromociones.FiltroPrimero(String.Format("CvePS IS NULL AND CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND (TipoPromocion <> 3 OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc") + dr = DtPromociones.FiltroPrimero(String.Format("CvePS IS NULL AND CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {4} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc") End If End If