From 7dcc122f15d14105fed6227cbac84b8e42674de9 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 30 Apr 2025 15:42:16 -0700 Subject: [PATCH] --FIX Impresion cortes --- Compras/PopUpVerFactura.aspx.vb | 36 ++++++++++----------------------- 1 file changed, 11 insertions(+), 25 deletions(-) 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