From 884c798c8fe91ef1914fca9977b1ba0a0c0699f3 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 31 May 2024 19:35:24 -0700 Subject: [PATCH] --unificacion de reporte de cortes, aspx --- Bancos/RepCortes.aspx.vb | 86 +++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 36 deletions(-) diff --git a/Bancos/RepCortes.aspx.vb b/Bancos/RepCortes.aspx.vb index bd784469f..500b19e0f 100644 --- a/Bancos/RepCortes.aspx.vb +++ b/Bancos/RepCortes.aspx.vb @@ -181,39 +181,62 @@ Partial Class Bancos_RepCortes CveCorte = gvr.DataKey("CveCorte").ToString.ToEntero Dim Finalizado As Integer = gvr.DataKey("Finalizado").ToString.ToEntero Fecha = gvr.DataKey("FechaInicial").ToString - Nombre = gvr.DataKey("Nombre").ToString - Dim ObjPuntoVenta As New ClsPuntoVenta - Dim ObjVentas As New ClsVentas - - If ObjVentas.GetCortesDetalleVentasResumen(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then - GvP.DataSource = ObjVentas.DtResultados - DtCortesVentasResumen = ObjVentas.DtResultados - End If - - If UsuarioActual.CveEmpresa.Contiene(190, 192) Then - DivIVA.Visible = True - If ObjVentas.GetCortesDetalleVentasResumenIVA(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then - GvPorIVA.DataSource = ObjVentas.DtResultados + Nombre = gvr.DataKey("Nombre").ToString + + 'If ObjPuntoVenta.GetCortesDetalleVentas(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2) Then + ' DtCortesVentas = ObjPuntoVenta.DtResultados.Copy() + ' GvD.DataSource = DtCortesVentas + + ' divDetalle.Visible = True + 'End If + + 'If ObjVentas.GetCortesDetalleVentasResumen(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + ' GvP.DataSource = ObjVentas.DtResultados + ' DtCortesVentasResumen = ObjVentas.DtResultados + 'End If + + 'If UsuarioActual.CveEmpresa.Contiene(190, 192) Then + ' DivIVA.Visible = True + ' If ObjVentas.GetCortesDetalleVentasResumenIVA(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + ' GvPorIVA.DataSource = ObjVentas.DtResultados + ' End If + 'End If + + Dim ObjPuntoVenta As New ClsPuntoVenta + If ObjPuntoVenta.GetVta_ReporteCortesDetalle(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2) Then + Dim DsDatos = ObjPuntoVenta.DataSetResultados.Copy() + If DsDatos IsNot Nothing Then + 'DESGLOSE + DtCortesVentas = DsDatos.Tables(0) + GvD.DataSource = DtCortesVentas + + divDetalle.Visible = True + 'RESUMEN + DtCortesVentasResumen = DsDatos.Tables(1) + GvP.DataSource = DtCortesVentasResumen + + 'RESUMEN - IVA + If UsuarioActual.CveEmpresa.Contiene(190, 192) Then + DivIVA.Visible = True + GvPorIVA.DataSource = DsDatos.Tables(2) + End If + End If End If + If ObjPuntoVenta.GetVta_MovimientosCajasReporte(CveCorte, -1) Then + GvIngresosRetiros.DataSource = ObjPuntoVenta.DtResultados.Copy() + End If + ObjPuntoVenta.Dispose() + + Dim ObjVentas As New ClsVentas If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso ObjVentas.GetCortesDetalleDepositosCaja(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then GvDep.DataSource = ObjVentas.DtResultados If ObjVentas.DtResultados.Rows.Count > 0 Then DivDep.Visible = True End If - End If - - If ObjPuntoVenta.GetCortesDetalleVentas(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2) Then - DtCortesVentas = ObjPuntoVenta.DtResultados.Copy() - GvD.DataSource = DtCortesVentas - - divDetalle.Visible = True - End If - - If ObjPuntoVenta.GetVta_MovimientosCajasReporte(CveCorte, -1) Then - GvIngresosRetiros.DataSource = ObjPuntoVenta.DtResultados.Copy() End If + ObjVentas.Dispose() If (DtCortesVentasResumen IsNot Nothing AndAlso DtCortesVentasResumen.Rows.Count > 0) Or (DtCortesVentas IsNot Nothing AndAlso DtCortesVentas.Rows.Count > 0) Then HplDownPDF.Visible = True @@ -223,22 +246,13 @@ Partial Class Bancos_RepCortes Else HplDownPDF.Visible = False HplDownEXCEL.Visible = False - End If - ObjVentas.Dispose() - ObjPuntoVenta.Dispose() - - - GvD.DataBind() - GvP.DataBind() - GvDep.DataBind() - GvPorIVA.DataBind() - GvIngresosRetiros.DataBind() - - + End If + GvD.DataBind() GvP.DataBind() GvDep.DataBind() GvPorIVA.DataBind() + GvIngresosRetiros.DataBind() If UsuarioActual.CveEmpresa.Contiene(189, 193, 195, 196, 197) Then DivAnexo.Visible = True