diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index b81b0efbe..b518789fa 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -1736,20 +1736,13 @@ Partial Class PopUpVerFactura
Dim OpcionDetallado As Integer = 1
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa.Contiene(197, 189) Then OpcionDetallado = 2
- Dim ConsultaPorSucursal As Boolean = UsuarioActual.Empresa.Funcionalidad(382) = "1"
-
- If ConsultaPorSucursal Then
- 'SI NO TIENE ESTOS VALORES, SARCALOS DEL CORTE
- If CveCorte > 0 AndAlso (FechaConsulta = ModExtensiones.MaxFecha OrElse CveSubProyecto <= 0) Then
- Using ObjVta As New ClsPuntoVenta
- If ObjVta.GetVta_Cortes("-1", "-1", -1, CveCorte, UsuarioActual.CveEmpresa, -1) AndAlso ObjVta.DtResultados.Rows.Count > 0 Then
- FechaConsulta = ObjVta.DtResultados.FiltroPrimeroValor("FechaInicial").ToString().ToDate().Date
- CveSubProyecto = ObjVta.DtResultados.FiltroPrimeroValor("CveSubProyecto").ToEntero()
- End If
- End Using
- End If
-
- 'CveCorte = -1
+ If CveCorte > 0 AndAlso (FechaConsulta = ModExtensiones.MaxFecha OrElse CveSubProyecto <= 0) Then
+ Using ObjVta As New ClsPuntoVenta
+ If ObjVta.GetVta_Cortes("-1", "-1", -1, CveCorte, UsuarioActual.CveEmpresa, -1) AndAlso ObjVta.DtResultados.Rows.Count > 0 Then
+ FechaConsulta = ObjVta.DtResultados.FiltroPrimeroValor("FechaInicial").ToString().ToDate().Date
+ CveSubProyecto = ObjVta.DtResultados.FiltroPrimeroValor("CveSubProyecto").ToEntero()
+ End If
+ End Using
End If
Dim ObjVenta As New ClsVentas
@@ -1774,16 +1767,9 @@ Partial Class PopUpVerFactura
End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa.Contiene(189, 197) Then
- If ConsultaPorSucursal Then
- If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, FechaConsulta, FechaConsulta, CveSubProyecto) Then
- DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("FechaInicial IS NOT NULL")
- Fecha = FechaConsulta.ToString("dd/MM/yyyy")
- End If
- Else
- If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, CveSubProyecto, CveCorte:=CveCorte) Then
- DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("CveCorte > 0")
- Fecha = DtReporteCorte.FiltroPrimeroValor("FechaInicial", "")
- End If
+ If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, FechaConsulta, FechaConsulta, CveSubProyecto) Then
+ DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("FechaInicial IS NOT NULL")
+ Fecha = FechaConsulta.ToString("dd/MM/yyyy")
End If
If ObjVenta.GetVta_MovimientosCajas(CveCorte, -1, CveSubProyecto:=CveSubProyecto, FechaConsulta:=FechaConsulta) Then
@@ -1799,7 +1785,7 @@ Partial Class PopUpVerFactura
Dim FechaCorte As String = $" Fecha fin {Fecha}"
- If ConsultaPorSucursal Then
+ If OpcionDetallado = 2 Then
FechaCorte = $" Fecha: {Fecha}"
End If