-- validación de AF.

This commit is contained in:
2024-04-25 13:56:55 -07:00
parent 6fbfaa61d4
commit 8ffe137e16

View File

@@ -981,7 +981,7 @@ Partial Class OC_OC
Dim Total As Decimal = 0
For Each Dr As DataRow In DtDetalle.Rows
Dim DrPS As DataRow = GlobalDTPS(CveEmpresaActual, CvePS:=Dr("CvePS").ToString.ToEntero).FiltroPrimero("")
Dim DrPS As DataRow = GlobalDTPSSimplificado(CveEmpresaActual, CvePS:=Dr("CvePS").ToString.ToEntero).FiltroPrimero("")
If DrPS IsNot Nothing AndAlso DrPS("IVA").ToString.ToEntero = -1 Then
Total += Dr("Total").ToString.ToDecimal
End If
@@ -990,7 +990,7 @@ Partial Class OC_OC
Dim Porcentaje As Decimal = TxtIVA.Text.ToDecimal / Total
Dim LastDr As DataRow = Nothing
For Each Dr As DataRow In DtDetalle.Rows
Dim DrPS As DataRow = GlobalDTPS(CveEmpresaActual, CvePS:=Dr("CvePS").ToString.ToEntero).FiltroPrimero("")
Dim DrPS As DataRow = GlobalDTPSSimplificado(CveEmpresaActual, CvePS:=Dr("CvePS").ToString.ToEntero).FiltroPrimero("")
If DrPS IsNot Nothing AndAlso DrPS("IVA").ToString.ToEntero = -1 Then
Dr("IVA") = Math.Round(Dr("Total").ToString.ToDecimal * Porcentaje, 6)
Dr("IVAPorcentaje") = If(Math.Round(Porcentaje, 2) > 0.14, 0.16, Math.Round(Porcentaje, 2))
@@ -5013,13 +5013,30 @@ Partial Class OC_OC
If ObjAF.GetActivosFijos(-1, CveEmpresaActual, LblCodigo.Text, "-1", -1, -1, "-1", -1, -1, -1, -1, -1, "", -1, UsuarioActual.CveEmpresa) Then
If ObjAF.DtResultados.Rows.Count = 1 Then
HdnCodigoAF.Value = ObjAF.DtResultados.Rows(0)("Codigo").ToString
HdnCveActivoFijo.Value = ObjAF.DtResultados.Rows(0)("CveActivoFijo").ToString
Dim drr As DataRow = ObjAF.DtResultados.Rows(0)
HdnCodigoAF.Value = drr("Codigo").ToString
HdnCveActivoFijo.Value = drr("CveActivoFijo").ToString
Alert(drr("Codigo").ToString & " - " & drr("Descripcion").ToString, TipoMensaje.ToastInformacion)
Else
HdnCodigoAF.Value = "-1"
HdnCveActivoFijo.Value = "-1"
LblCodigo.Text = ""
Alert("No se encontró un Activo Fijo con el código proporcionado.", TipoMensaje.MsgAdvertencia)
If ObjAF.DtResultados.Rows.Count > 1 Then
Dim drr As DataRow = ObjAF.DtResultados.FiltroPrimero($"Codigo ='{LblCodigo.Text.Trim}'")
If drr IsNot Nothing Then
HdnCodigoAF.Value = drr("Codigo").ToString
HdnCveActivoFijo.Value = drr("CveActivoFijo").ToString
Alert(drr("Codigo").ToString & " - " & drr("Descripcion").ToString, TipoMensaje.ToastInformacion)
Else
HdnCodigoAF.Value = "-1"
HdnCveActivoFijo.Value = "-1"
LblCodigo.Text = ""
Alert("No se encontró un Activo Fijo con el código proporcionado.", TipoMensaje.MsgAdvertencia)
End If
Else
HdnCodigoAF.Value = "-1"
HdnCveActivoFijo.Value = "-1"
LblCodigo.Text = ""
Alert("No se encontró un Activo Fijo con el código proporcionado.", TipoMensaje.MsgAdvertencia)
End If
End If
End If