5 Fecha de pago: Aumentar días, en: ProveedoresAbonar, PopUpIE, ExC, Deudores, Acreedores, transferencias entre cuentas, - Pendiente fechas anteriores-

This commit is contained in:
rakcsle
2025-01-21 15:31:02 -07:00
parent 580d61a2f8
commit bff89fa84c
8 changed files with 333 additions and 75 deletions

View File

@@ -56,6 +56,9 @@ public partial class Bancos_PagoDeudor : ClsPaginas
TxtImporte.Attributes.Add("disabled", "disabled");
CargarCentrosDeCosto(null, null, null, LblSubProyecto);
LblSubProyecto2.Text = LblSubProyecto.Text;
ValidaFechaDocumentoDiasPosterioresPrestamo();
ValidaFechaDocumentoDiasPosteriores();
}
}
@@ -372,6 +375,48 @@ public partial class Bancos_PagoDeudor : ClsPaginas
if (ObjComp != null)
ObjComp.Dispose();
}
protected void DdlTipoTransaccionPrestamo_SelectedIndexChanged(object sender, EventArgs e)
{
ValidaFechaDocumentoDiasPosterioresPrestamo();
}
protected void RVTxtFechaPrestamo_Init(object sender, EventArgs e)
{
RVTxtFechaPrestamo.MaximumValue = NowADS().AddDays(2).ToShortDateString();
RVTxtFechaPrestamo.MinimumValue = NowADS().AddMonths(-38).ToShortDateString();
CalendarioPrestamo.EndDate = NowADS().AddDays(2);
}
private void ValidaFechaDocumentoDiasPosterioresPrestamo()
{
RVTxtFechaPrestamo.MaximumValue = NowADS().AddDays(3).ToShortDateString();
RVTxtFechaPrestamo.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a 3 días de la fecha actual";
CalendarioPrestamo.EndDate = NowADS().AddDays(3);
// Equivalente a: If DdlTipoMovto.SelectedValue.Contiene("1", "16") Then
// Suponiendo que "Contiene" verifique si SelectedValue es "1" o "16"
if (DdlTipoTransaccionPrestamo.SelectedValue == "1" || DdlTipoTransaccionPrestamo.SelectedValue == "16")
{
// cheques, 3 meses
RVTxtFechaPrestamo.MaximumValue = NowADS().AddMonths(3).ToShortDateString();
RVTxtFechaPrestamo.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a 3 meses de la fecha actual";
CalendarioPrestamo.EndDate = NowADS().AddMonths(3);
}
// transfer, 3 semanas
if (DdlTipoTransaccionPrestamo.SelectedValue == "2")
{
RVTxtFechaPrestamo.MaximumValue = NowADS().AddDays(21).ToShortDateString();
RVTxtFechaPrestamo.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a 3 semanas de la fecha actual";
CalendarioPrestamo.EndDate = NowADS().AddDays(21);
}
UpPrestamo.Update();
//UpGuardar.Update();
}
#endregion
#region "PAGO DEUDORES"
@@ -830,4 +875,52 @@ public partial class Bancos_PagoDeudor : ClsPaginas
TxtFechaDocumento.Attributes.Remove("onchange");
DivImporteME.Visible = false;
}
protected void DdlTipoTransaccion_SelectedIndexChanged(object sender, EventArgs e)
{
ValidaFechaDocumentoDiasPosteriores();
}
protected void RVTxtFechaDocumento_Init(object sender, EventArgs e)
{
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(2).ToShortDateString();
RVTxtFechaDocumento.MinimumValue = NowADS().AddMonths(-38).ToShortDateString();
Calendario.EndDate = NowADS().AddDays(2);
}
private void ValidaFechaDocumentoDiasPosteriores()
{
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(3).ToShortDateString();
RVTxtFechaDocumento.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a 3 días de la fecha actual";
Calendario.EndDate = NowADS().AddDays(3);
// Equivalente a: If DdlTipoMovto.SelectedValue.Contiene("1", "16") Then
// Suponiendo que "Contiene" verifique si SelectedValue es "1" o "16"
if (DdlTipoTransaccion.SelectedValue == "1" || DdlTipoTransaccion.SelectedValue == "16")
{
// cheques, 3 meses
RVTxtFechaDocumento.MaximumValue = NowADS().AddMonths(3).ToShortDateString();
RVTxtFechaDocumento.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a 3 meses de la fecha actual";
Calendario.EndDate = NowADS().AddMonths(3);
}
// transfer, 3 semanas
if (DdlTipoTransaccion.SelectedValue == "2")
{
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(21).ToShortDateString();
RVTxtFechaDocumento.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a 3 semanas de la fecha actual";
Calendario.EndDate = NowADS().AddDays(21);
}
UpMovDeudor.Update();
//UpGuardar.Update();
}
}