diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 50c3b7f3f..991f1c4ba 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -668,6 +668,21 @@ Partial Class Compras_eFacturas End Property + + Private Property ComprasEnComplemento As Integer + Get + If ViewState("ComprasEnComplemento") Is Nothing Then + Return -1 + Else + Return ViewState("ComprasEnComplemento").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("ComprasEnComplemento") = value + End Set + End Property + + #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load @@ -2748,6 +2763,7 @@ Partial Class Compras_eFacturas DTGVPagosVinculacion = New DataTable MontoPago = 0D + ComprasEnComplemento = 0 XMLNodosPagosModalCount = 0 @@ -2914,6 +2930,11 @@ Partial Class Compras_eFacturas DTGVPagosVinculacion = DTDocumentosRelacionados + ComprasEnComplemento = DTGVPagosVinculacion.COUNT("CveCompra", " CveCompra > 0") + + + + If DTDocumentosRelacionados.MAX("CveCompra").ToString.ToEntero > 0 Then TieneCompras = True Else @@ -3402,7 +3423,9 @@ Partial Class Compras_eFacturas End If Next - If XMLNodosPagosModalCount = Vinculados Then + + 'If XMLNodosPagosModalCount = Vinculados Then + If ComprasEnComplemento = Vinculados Then ' TodoVinculado = True End If @@ -3493,18 +3516,20 @@ Partial Class Compras_eFacturas e.Row.Cells(4).ForeColor = Drawing.Color.Green - e.Row.Cells(6).Controls.Clear() - Dim LiteralVincular As New Literal + If e.Row.DataKey("CveIE").ToEntero <= 0 Or Boolean.Parse(e.Row.DataKey("Manual")) = True Then + + e.Row.Cells(6).Controls.Clear() + Dim LiteralVincular As New Literal + If UsuarioActual.TienePermisoProceso(286) Then ' permiso vinculación manual + LiteralVincular.Text = $"" + Else + LiteralVincular.Text = "-" + End If + e.Row.Cells(6).Controls.Add(LiteralVincular) - If UsuarioActual.TienePermisoProceso(286) Then ' permiso vinculación manual - LiteralVincular.Text = $"" - Else - LiteralVincular.Text = "-" End If - e.Row.Cells(6).Controls.Add(LiteralVincular) - Else e.Row.Cells(4).Text = "" e.Row.ToolTip = "Factura recibida sin registrar"