diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index b0e61381a..f6c248137 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1109,6 +1109,8 @@ Partial Class Compras_Compras 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") @@ -4389,6 +4391,8 @@ Partial Class Compras_Compras Exit Sub End If + + '------------------TERMINA VALIDACIONES------------------ 'si hay necesidad de actualizar el globaldtps @@ -8641,7 +8645,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 @@ -17928,6 +17932,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 @@ -18308,6 +18318,13 @@ Partial Class Compras_Compras End If + '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 + + TmpDT.Rows.Add(Row) TmpDT.Rows.IndexOf(Row) @@ -18437,6 +18454,13 @@ Partial Class Compras_Compras DrPS("IEPSPSIVAPorcentaje") = IEPSPSIVA + '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 + + AplicaCalculaTotales = True 'End If @@ -19647,6 +19671,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) + TrasladoIEPS = 0 TxtIEPS.Text = 0.ToString.FormatoNumero TrIEPS.Visible = False @@ -19661,6 +19686,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) + OtrosImpuestos = 0 TxtOtrosImpuestos.Text = 0.ToString.FormatoNumero TrOtrosImpuestos.Visible = False @@ -19675,7 +19701,7 @@ Partial Class Compras_Compras MostrarOcultarColumnaIEPS() - + AddPS2() End Sub #End Region