diff --git a/CGame/OrdenProduccion.aspx.vb b/CGame/OrdenProduccion.aspx.vb index 15c4bd98d..f3f5fe229 100644 --- a/CGame/OrdenProduccion.aspx.vb +++ b/CGame/OrdenProduccion.aspx.vb @@ -314,8 +314,11 @@ Partial Class CGame_OrdenProduccion If ObjCGame.GetOrdenProduccionDetalle(CveOrdenProduccion, UsuarioActual.CveEmpresa) Then DtDetalle = ObjCGame.DtResultados GvOP.DataSource = DtDetalle - Tipo = DtDetalle.Rows(0)("Tipo").ToString.ToEntero - If Tipo = 2 Then GvLiquidacion.Columns(6).Visible = True : GvLiquidacion.Columns(7).Visible = True : DivPesoPagado.Visible = True : GvLiquidacionModal.Columns(2).Visible = True : RFVPesoPagado.Enabled = True + If DtDetalle IsNot Nothing AndAlso DtDetalle.Rows.Count > 0 Then + Tipo = DtDetalle.Rows(0)("Tipo").ToString.ToEntero + If Tipo = 2 Then GvLiquidacion.Columns(6).Visible = True : GvLiquidacion.Columns(7).Visible = True : DivPesoPagado.Visible = True : GvLiquidacionModal.Columns(2).Visible = True : RFVPesoPagado.Enabled = True + End If + End If End Sub