From a241dca5b116d332ec99b958ec7f4472f5adcf28 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Thu, 12 Nov 2020 15:26:37 -0700 Subject: [PATCH] eFacturas, mensajes vinculacion complemento --- Compras/eFacturas.aspx.vb | 44 ++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 6282a37cd..58e9dd59c 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -2639,6 +2639,7 @@ Partial Class Compras_eFacturas Protected Sub LnkAgregarPago_Click(sender As Object, e As EventArgs) Dim sbSinIE As New StringBuilder + Dim TieneCompras As Boolean = False HdnCveIE.Value = "" MSGComplemento = "" @@ -2841,6 +2842,15 @@ Partial Class Compras_eFacturas GVPDocumentosRelacionadosPagos.DataBind() + + If DTDocumentosRelacionados.MAX("CveCompra").ToString.ToEntero > 0 Then + TieneCompras = True + Else + TieneCompras = False + End If + + + For Each dRow2 As DataRow In DTDocumentosRelacionados.Rows If dRow2("CveMetodoPago").ToString.ToEntero > 0 Then If dRow2("CveMetodoPago").ToString.ToEntero = 1 Then @@ -2947,27 +2957,41 @@ Partial Class Compras_eFacturas ObjCompras.Dispose() - If Math.Abs(DiferenciaImportes) > 5 Then - TextoDiferenciaImporte = $"  -   IE ${ImporteIES.FormatoNumero}
Diferencia { DiferenciaImportes.FormatoNumero() }
" - BtnVincularPago.Visible = False - MSGComplemento = MSGComplemento & $" Existe una diferencia mayor a $5.00 ({Math.Abs(DiferenciaImportes)})" + If TieneCompras Then + If ImporteIES > 0 Then + If Math.Abs(DiferenciaImportes) > 5 Then + TextoDiferenciaImporte = $"  -   IE ${ImporteIES.FormatoNumero}
Diferencia { DiferenciaImportes.FormatoNumero() }
" + BtnVincularPago.Visible = False + MSGComplemento = MSGComplemento & $" Existe una diferencia mayor a $5.00 ({Math.Abs(DiferenciaImportes)})" - If TieneRegistros AndAlso UsuarioActual.TienePermisoProceso(286) Then - DivVincularPagoManualmente.Visible = True + If TieneRegistros AndAlso UsuarioActual.TienePermisoProceso(286) Then + DivVincularPagoManualmente.Visible = True + End If + End If + Else + TextoDiferenciaImporte = $"No se encontraron pagos " + BtnVincularPago.Visible = False + MSGComplemento = MSGComplemento & $" No se encontraron pagos " + If TieneRegistros AndAlso UsuarioActual.TienePermisoProceso(286) Then + DivVincularPagoManualmente.Visible = True + End If End If - Else - 'BtnVincularPago.Visible = True - 'TextoDiferenciaImporte = "" + BtnVincularPago.Visible = False + MSGComplemento = MSGComplemento & $"No se encontraron compras relacionadas" + DivVincularPagoManualmente.Visible = False End If + + + LblSerieFolioPago.Text = $"{SeriePago}-{FolioPago}" LblImportePago.Text = Monto.ToString("###,###,###.00") 'ImportePago.FormatoNumero LblPagosCantidad.Text = PagosCantidad.ToString LblImporteIE.Text = ImporteIES.FormatoNumero - LblDiferencia.Text = If(DiferenciaImportes <> 0, DiferenciaImportes.FormatoNumero, "") + LblDiferencia.Text = If(DiferenciaImportes <> 0 And ImporteIES > 0, DiferenciaImportes.FormatoNumero, "") If MSGComplemento.Trim.Length > 0 And CveComplementoPagoCompra <= 0 Then