From 08da5d27e5cec57ec7bdc049b5d9feea5de7ae87 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 10 Apr 2025 07:19:37 -0700 Subject: [PATCH] - colorear celda de vencimiento, sino cuadra con el vencimiento del proveedor --- Bancos/ProveedoresAbonar.aspx.vb | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index a74d504d2..580c82fb1 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -94,6 +94,14 @@ Partial Class Bancos_ProveedoresAbonar ViewState("CveAplicaNC") = value End Set End Property + Private Property ProveedorPlazoPago As Integer + Get + Return ViewState("ProveedorPlazoPago").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("ProveedorPlazoPago") = value + End Set + End Property Private Property CveMoneda As Integer Get @@ -468,6 +476,7 @@ Partial Class Bancos_ProveedoresAbonar TxtImporte.Attributes.Add("disabled", "disabled") If DdlTipoTransaccion.SelectedValue = "1" Then RFVFolio.Enabled = True Else RFVFolio.Enabled = False TxtNotificarA.Text = $"{ObjProveedor.NotificarA.Trim}" + ProveedorPlazoPago = ObjProveedor.PlazoPago If ObjProveedor.CorreoCobranza.Trim <> "" Then TxtNotificarA.Text = $"{TxtNotificarA.Text};{ObjProveedor.CorreoCobranza.Trim}" 'Sección de pago a proveedor @@ -525,6 +534,11 @@ Partial Class Bancos_ProveedoresAbonar e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format(" RNCAutocheck = true; FnCambia({0},this,{1},1,'{2}',1);", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo")) e.Row.FCTextBox("TxtComision").Attributes.Add("onblur", String.Format(" RNCAutocheck = true;FnCambia({0},this,{1},2,'{2}',2);", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo")) End If + 'si el vencimiento es diferente al configurado en el proveedor, se pone en rojo + If DateDiff(DateInterval.Day, e.Row.DBCampo("Fecha").ToDate, e.Row.DBCampo("FechaVencimiento").ToDate) <> ProveedorPlazoPago Then + e.Row.Cells(6).ForeColor = Drawing.Color.Red + e.Row.Cells(6).ToolTip = $"Dias de Vencimiento ({DateDiff(DateInterval.Day, e.Row.DBCampo("Fecha").ToDate, e.Row.DBCampo("FechaVencimiento").ToDate)}) diferente al configurado en el proveedor ({ProveedorPlazoPago})" + End If If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(7).ForeColor = Drawing.Color.Red If e.Row.DBCampo("DiasVencidos").ToDouble > 0 AndAlso CType(sender, GridView).ID = "GvCxC" Then e.Row.Cells(4).ForeColor = Drawing.Color.Red @@ -581,15 +595,10 @@ Partial Class Bancos_ProveedoresAbonar e.Row.FCTextBox("TxtAbonar").Enabled = True End If End If - End If - - e.Row.FCLiteral("LtlAux").Text = String.Format("Ir", e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveCompra")) e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format(" RNCAutocheck = true; FnCambia({0},this,{1},1,'{2}',1);{3}", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo", FiltroInv)) - - If Not PermiteModificarImporte Then e.Row.FCTextBox("TxtAbonar").Enabled = False If e.Row.DBCampo("CveCompraNC").ToEntero > 0 Then e.Row.FCHyperLink("HplNC").Visible = True @@ -622,11 +631,9 @@ Partial Class Bancos_ProveedoresAbonar If UsuarioActual.Empresa.Funcionalidad(306) = "1" And e.Row.DBCampo("AplicaNotaCredito").ToString = "True" Then e.Row.FCCheckBox("Chk").Enabled = False End If - e.Row.FCTextBox("TxtDescuento").Attributes.Add("onkeyup", $" calculaDescuentoEscalonado({e.Row.DBCampo("Saldo")},'{e.Row.FCTextBox("TxtDescuento").ClientID}',{e.Row.FCTextBox("TxtAbonar").ClientID},{e.Row.FCCheckBox("Chk").ClientID},'El Importe no debe de exceder el saldo',1)") Else e.Row.FCTextBox("TxtDescuento").Visible = False - End If End If End Sub