-- validación de AF.
This commit is contained in:
@@ -981,7 +981,7 @@ Partial Class OC_OC
|
|||||||
|
|
||||||
Dim Total As Decimal = 0
|
Dim Total As Decimal = 0
|
||||||
For Each Dr As DataRow In DtDetalle.Rows
|
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
|
If DrPS IsNot Nothing AndAlso DrPS("IVA").ToString.ToEntero = -1 Then
|
||||||
Total += Dr("Total").ToString.ToDecimal
|
Total += Dr("Total").ToString.ToDecimal
|
||||||
End If
|
End If
|
||||||
@@ -990,7 +990,7 @@ Partial Class OC_OC
|
|||||||
Dim Porcentaje As Decimal = TxtIVA.Text.ToDecimal / Total
|
Dim Porcentaje As Decimal = TxtIVA.Text.ToDecimal / Total
|
||||||
Dim LastDr As DataRow = Nothing
|
Dim LastDr As DataRow = Nothing
|
||||||
For Each Dr As DataRow In DtDetalle.Rows
|
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
|
If DrPS IsNot Nothing AndAlso DrPS("IVA").ToString.ToEntero = -1 Then
|
||||||
Dr("IVA") = Math.Round(Dr("Total").ToString.ToDecimal * Porcentaje, 6)
|
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))
|
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.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
|
If ObjAF.DtResultados.Rows.Count = 1 Then
|
||||||
HdnCodigoAF.Value = ObjAF.DtResultados.Rows(0)("Codigo").ToString
|
Dim drr As DataRow = ObjAF.DtResultados.Rows(0)
|
||||||
HdnCveActivoFijo.Value = ObjAF.DtResultados.Rows(0)("CveActivoFijo").ToString
|
HdnCodigoAF.Value = drr("Codigo").ToString
|
||||||
|
HdnCveActivoFijo.Value = drr("CveActivoFijo").ToString
|
||||||
|
Alert(drr("Codigo").ToString & " - " & drr("Descripcion").ToString, TipoMensaje.ToastInformacion)
|
||||||
Else
|
Else
|
||||||
HdnCodigoAF.Value = "-1"
|
If ObjAF.DtResultados.Rows.Count > 1 Then
|
||||||
HdnCveActivoFijo.Value = "-1"
|
Dim drr As DataRow = ObjAF.DtResultados.FiltroPrimero($"Codigo ='{LblCodigo.Text.Trim}'")
|
||||||
LblCodigo.Text = ""
|
If drr IsNot Nothing Then
|
||||||
Alert("No se encontró un Activo Fijo con el código proporcionado.", TipoMensaje.MsgAdvertencia)
|
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
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user