eFacturas, mensajes vinculacion complemento

This commit is contained in:
Rakcsle Supertramp
2020-11-12 15:26:37 -07:00
parent 60ec06edc1
commit a241dca5b1

View File

@@ -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 = $"<b>&nbsp;&nbsp;-&nbsp;&nbsp; IE ${ImporteIES.FormatoNumero}</b> <div style='color:red'><strong>Diferencia { DiferenciaImportes.FormatoNumero() }</strong></div>"
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 = $"<b>&nbsp;&nbsp;-&nbsp;&nbsp; IE ${ImporteIES.FormatoNumero}</b> <div style='color:red'><strong>Diferencia { DiferenciaImportes.FormatoNumero() }</strong></div>"
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