From c16a1049a0c57a6f9003fd9a5aa3a1644b7dfd16 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 3 Aug 2021 13:18:40 -0700 Subject: [PATCH 1/2] Valida no agregar IEPS si ya se agrego el concepto IEPS. --- Compras/Compras.aspx.vb | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 4995b7418..734482ff3 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1109,6 +1109,23 @@ Partial Class Compras_Compras End Set End Property + ' + Private Property SeAgregoconceptoIEPS As Boolean + Get + + If ViewState("SeAgregoconceptoIEPS") Is Nothing Then + Return False + Else + Return Boolean.Parse(ViewState("SeAgregoconceptoIEPS").ToString) + End If + + + End Get + Set(value As Boolean) + ViewState("SeAgregoconceptoIEPS") = value + End Set + End Property + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then 'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip") @@ -4385,6 +4402,8 @@ Partial Class Compras_Compras Exit Sub End If + + '------------------TERMINA VALIDACIONES------------------ 'si hay necesidad de actualizar el globaldtps @@ -8652,7 +8671,7 @@ Partial Class Compras_Compras IndiceContador = IndiceContador + 1 Next - If DiferenciaIEPSPS <> 0 Then + If DiferenciaIEPSPS.RoundAD(2) <> 0 Then If DTConsultaIEPSPS.Rows.Count > 0 Then 'Ajusta IPES en primer registro que aplique IEPS @@ -18460,6 +18479,14 @@ Partial Class Compras_Compras End If + If SeAgregoconceptoIEPS Then + + Row("IEPSPS") = 0 + Row("IEPSPSPorcentaje") = 0 + + End If + + TmpDT.Rows.Add(Row) TmpDT.Rows.IndexOf(Row) @@ -18588,6 +18615,13 @@ Partial Class Compras_Compras DrPS("IEPSPSIVA") = IEPSPSIVA * Total DrPS("IEPSPSIVAPorcentaje") = IEPSPSIVA + If SeAgregoconceptoIEPS Then + + DrPS("IEPSPS") = 0 + DrPS("IEPSPSPorcentaje") = 0 + + End If + AplicaCalculaTotales = True 'End If @@ -19799,6 +19833,7 @@ Partial Class Compras_Compras Dim CvePS As Integer = DdlConceptoIEPS.SelectedValue.ToEntero ' If CvePS = -1 Then CvePS = UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero AgregarConceptoIEPS(TrasladoIEPS, CvePS) + SeAgregoconceptoIEPS = True TrasladoIEPS = 0 TxtIEPS.Text = 0.ToString.FormatoNumero TrIEPS.Visible = False @@ -19813,6 +19848,7 @@ Partial Class Compras_Compras Dim CvePS As Integer = DdlConceptoOI.SelectedValue.ToEntero 'If CvePS = -1 Then CvePS = UsuarioActual.Empresa.Funcionalidad(305).ToString.ToEntero AgregarConceptoIEPS(OtrosImpuestos, CvePS) + SeAgregoconceptoIEPS = True OtrosImpuestos = 0 TxtOtrosImpuestos.Text = 0.ToString.FormatoNumero TrOtrosImpuestos.Visible = False From 33bff2cb7749cfda20a7169aa5134b49f262cc5a Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 4 Aug 2021 18:03:52 -0700 Subject: [PATCH 2/2] Compras correcion IEPS, limpiar correctamente IPES cuando se se aplica como concepto y no permiter modificar ieps una vez que se agregue el concepto, muestra mensaje cada vez que se cambia ps con IEPS --- Compras/Compras.aspx.vb | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 734482ff3..3cd036bad 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1109,22 +1109,7 @@ Partial Class Compras_Compras End Set End Property - ' - Private Property SeAgregoconceptoIEPS As Boolean - Get - If ViewState("SeAgregoconceptoIEPS") Is Nothing Then - Return False - Else - Return Boolean.Parse(ViewState("SeAgregoconceptoIEPS").ToString) - End If - - - End Get - Set(value As Boolean) - ViewState("SeAgregoconceptoIEPS") = value - End Set - End Property Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then @@ -18099,6 +18084,12 @@ Partial Class Compras_Compras TxtRetISRModal.Text = FormatoNumero(ViewState("RetISR").ToString().ToDouble * 100, 0) + If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 And PS("IEPSPorcentaje").ToString.ToDecimal > 0 Then + TxtIEPSModal.Text = "0" + Alert("El producto seleccionado contiene IEPS, pero el acumulado de la factura no contiene IEPS, por lo que no se agregara el impuesto.", TipoMensaje.MsgAdvertencia) + End If + + UpIVA.Update() If PS("CveClasificacion").ToString IsNot Nothing Then @@ -18479,11 +18470,10 @@ Partial Class Compras_Compras End If - If SeAgregoconceptoIEPS Then - + 'Esta parte es para validar cuando la factura tenga ieps en o se asignara el ieps como una partida ya no se considere + If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 Then Row("IEPSPS") = 0 Row("IEPSPSPorcentaje") = 0 - End If @@ -18615,11 +18605,11 @@ Partial Class Compras_Compras DrPS("IEPSPSIVA") = IEPSPSIVA * Total DrPS("IEPSPSIVAPorcentaje") = IEPSPSIVA - If SeAgregoconceptoIEPS Then + 'Esta parte es para validar cuando la factura tenga ieps en o se asignara el ieps como una partida ya no se considere + If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 Then DrPS("IEPSPS") = 0 DrPS("IEPSPSPorcentaje") = 0 - End If @@ -19833,7 +19823,7 @@ Partial Class Compras_Compras Dim CvePS As Integer = DdlConceptoIEPS.SelectedValue.ToEntero ' If CvePS = -1 Then CvePS = UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero AgregarConceptoIEPS(TrasladoIEPS, CvePS) - SeAgregoconceptoIEPS = True + TrasladoIEPS = 0 TxtIEPS.Text = 0.ToString.FormatoNumero TrIEPS.Visible = False @@ -19848,7 +19838,7 @@ Partial Class Compras_Compras Dim CvePS As Integer = DdlConceptoOI.SelectedValue.ToEntero 'If CvePS = -1 Then CvePS = UsuarioActual.Empresa.Funcionalidad(305).ToString.ToEntero AgregarConceptoIEPS(OtrosImpuestos, CvePS) - SeAgregoconceptoIEPS = True + OtrosImpuestos = 0 TxtOtrosImpuestos.Text = 0.ToString.FormatoNumero TrOtrosImpuestos.Visible = False @@ -19863,7 +19853,7 @@ Partial Class Compras_Compras MostrarOcultarColumnaIEPS() - + AddPS2() End Sub #End Region