Correcion de filtro por Año/Mes

This commit is contained in:
2021-03-11 16:22:20 -07:00
parent a96cbd51f7
commit 6e58da32af

View File

@@ -341,11 +341,39 @@ Partial Class Ventas_RepProductosServiciosDetalle
If AnioMes.Trim.Length = 7 Then
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
FechaFtemporal = $"01/{AnioMes.Substring(5, 2).PadLeft(2, "0"c)}/{AnioMes.Substring(0, 4)}"
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
If FechaF = "-1" Then
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
Else
Dim FechaFRef As DateTime = FechaF.ToDateTime
Dim FechaFMonth As DateTime = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day).ToDate()
If FechaFRef > FechaFMonth Then
txtFechaF.Text = FechaFMonth.ToString("dd/MM/yyyy")
Else
txtFechaF.Text = FechaFRef.ToString("dd/MM/yyyy")
End If
End If
Else
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
FechaFtemporal = $"01/{AnioMes.Substring(5, 1).PadLeft(2, "0"c)}/{AnioMes.Substring(0, 4)}"
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
If FechaF = "-1" Then
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
Else
Dim FechaFRef As DateTime = FechaF.ToDateTime
Dim FechaFMonth As DateTime = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day).ToDate
If FechaFRef > FechaFMonth Then
txtFechaF.Text = FechaFMonth.ToString("dd/MM/yyyy")
Else
txtFechaF.Text = FechaFRef.ToString("dd/MM/yyyy")
End If
End If
End If
End If