- colorear celda de vencimiento, sino cuadra con el vencimiento del proveedor

This commit is contained in:
2025-04-10 07:19:37 -07:00
parent f4ddd05b2b
commit 08da5d27e5

View File

@@ -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("<a Class=""Texto thickbox"" href=""/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=370&width=900"" />Ir</a>", 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