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

This commit is contained in:
rakcsle
2021-08-04 18:03:52 -07:00
parent c16a1049a0
commit 33bff2cb77

View File

@@ -1109,22 +1109,7 @@ Partial Class Compras_Compras
End Set End Set
End Property 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 Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
@@ -18099,6 +18084,12 @@ Partial Class Compras_Compras
TxtRetISRModal.Text = FormatoNumero(ViewState("RetISR").ToString().ToDouble * 100, 0) 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() UpIVA.Update()
If PS("CveClasificacion").ToString IsNot Nothing Then If PS("CveClasificacion").ToString IsNot Nothing Then
@@ -18479,11 +18470,10 @@ Partial Class Compras_Compras
End If 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("IEPSPS") = 0
Row("IEPSPSPorcentaje") = 0 Row("IEPSPSPorcentaje") = 0
End If End If
@@ -18615,11 +18605,11 @@ Partial Class Compras_Compras
DrPS("IEPSPSIVA") = IEPSPSIVA * Total DrPS("IEPSPSIVA") = IEPSPSIVA * Total
DrPS("IEPSPSIVAPorcentaje") = IEPSPSIVA 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("IEPSPS") = 0
DrPS("IEPSPSPorcentaje") = 0 DrPS("IEPSPSPorcentaje") = 0
End If End If
@@ -19833,7 +19823,7 @@ Partial Class Compras_Compras
Dim CvePS As Integer = DdlConceptoIEPS.SelectedValue.ToEntero Dim CvePS As Integer = DdlConceptoIEPS.SelectedValue.ToEntero
' If CvePS = -1 Then CvePS = UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero ' If CvePS = -1 Then CvePS = UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero
AgregarConceptoIEPS(TrasladoIEPS, CvePS) AgregarConceptoIEPS(TrasladoIEPS, CvePS)
SeAgregoconceptoIEPS = True
TrasladoIEPS = 0 TrasladoIEPS = 0
TxtIEPS.Text = 0.ToString.FormatoNumero TxtIEPS.Text = 0.ToString.FormatoNumero
TrIEPS.Visible = False TrIEPS.Visible = False
@@ -19848,7 +19838,7 @@ Partial Class Compras_Compras
Dim CvePS As Integer = DdlConceptoOI.SelectedValue.ToEntero Dim CvePS As Integer = DdlConceptoOI.SelectedValue.ToEntero
'If CvePS = -1 Then CvePS = UsuarioActual.Empresa.Funcionalidad(305).ToString.ToEntero 'If CvePS = -1 Then CvePS = UsuarioActual.Empresa.Funcionalidad(305).ToString.ToEntero
AgregarConceptoIEPS(OtrosImpuestos, CvePS) AgregarConceptoIEPS(OtrosImpuestos, CvePS)
SeAgregoconceptoIEPS = True
OtrosImpuestos = 0 OtrosImpuestos = 0
TxtOtrosImpuestos.Text = 0.ToString.FormatoNumero TxtOtrosImpuestos.Text = 0.ToString.FormatoNumero
TrOtrosImpuestos.Visible = False TrOtrosImpuestos.Visible = False
@@ -19863,7 +19853,7 @@ Partial Class Compras_Compras
MostrarOcultarColumnaIEPS() MostrarOcultarColumnaIEPS()
AddPS2()
End Sub End Sub
#End Region #End Region