From acb87ae7435ac9ccb733139c52f50ecd25e3c976 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 12 Apr 2024 18:10:41 -0700 Subject: [PATCH] --Reporte de cortes, grid movimientos de caja con agrupador --- App_Code/ClsPuntoVenta.vb | 19 +++++++++ Bancos/RepCortes.aspx | 75 +++++++++++++++++++++------------ Bancos/RepCortes.aspx.vb | 52 ++++++++++++++++------- Compras/PopUpVerFactura.aspx.vb | 2 +- 4 files changed, 104 insertions(+), 44 deletions(-) diff --git a/App_Code/ClsPuntoVenta.vb b/App_Code/ClsPuntoVenta.vb index 416ba3ef3..6bbffe680 100644 --- a/App_Code/ClsPuntoVenta.vb +++ b/App_Code/ClsPuntoVenta.vb @@ -404,6 +404,25 @@ Public Class ClsPuntoVenta OnError("Ocurrió un error al obtener los Movimientos de Caja del Cortes del Punto de Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try + Return Retorno + End Function + + Public Function GetVta_MovimientosCajasReporte(CveCorte As Integer, TipoMovimiento As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_MovimientosCajasRepGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCorte", SqlDbType.Int).Value = CveCorte + .Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de caja del cortes del punto de venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno End Function diff --git a/Bancos/RepCortes.aspx b/Bancos/RepCortes.aspx index 74c40e724..f04019057 100644 --- a/Bancos/RepCortes.aspx +++ b/Bancos/RepCortes.aspx @@ -427,35 +427,54 @@ - - - - - Serie - Folio +
+
+
+ Movimientos del día + + + + + Serie - Folio - - - - - - - - - - - - - - - - - <%----%> - - - - - - + + + + + + + + + + + + + + + + + <%----%> + + + + + + +
+
+
+
+
+ Movimientos de caja + + + + + + + +
+
diff --git a/Bancos/RepCortes.aspx.vb b/Bancos/RepCortes.aspx.vb index 2dacc1727..ea4d9efb6 100644 --- a/Bancos/RepCortes.aspx.vb +++ b/Bancos/RepCortes.aspx.vb @@ -125,6 +125,13 @@ Partial Class Bancos_RepCortes End If End Sub + Protected Sub GvIngresosRetiros_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvIngresosRetiros.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("CveMovimiento").ToString = "" Then + e.Row.CssClass = "Totales" + End If + End If + End Sub @@ -167,31 +174,39 @@ Partial Class Bancos_RepCortes Dim Finalizado As Integer = gvr.DataKey("Finalizado").ToString.ToEntero Fecha = gvr.DataKey("FechaInicial").ToString Nombre = gvr.DataKey("Nombre").ToString - Dim Vent As New ClsPuntoVenta - Dim Vn As New ClsVentas - If Vn.GetCortesDetalleVentasResumen(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then - GvP.DataSource = Vn.DtResultados - DtCortesVentasResumen = Vn.DtResultados + 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 Vn.GetCortesDetalleVentasResumenIVA(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then - GvPorIVA.DataSource = Vn.DtResultados + If ObjVentas.GetCortesDetalleVentasResumenIVA(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + GvPorIVA.DataSource = ObjVentas.DtResultados End If End If - If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso Vn.GetCortesDetalleDepositosCaja(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then - GvDep.DataSource = Vn.DtResultados - If Vn.DtResultados.Rows.Count > 0 Then + 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 Vent.GetCortesDetalleVentas(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2) Then - GvD.DataSource = Vent.DtResultados - DtCortesVentas = Vent.DtResultados + 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 + If (DtCortesVentasResumen IsNot Nothing AndAlso DtCortesVentasResumen.Rows.Count > 0) Or (DtCortesVentas IsNot Nothing AndAlso DtCortesVentas.Rows.Count > 0) Then HplDownPDF.Visible = True HplDownEXCEL.Visible = True @@ -201,8 +216,15 @@ Partial Class Bancos_RepCortes HplDownPDF.Visible = False HplDownEXCEL.Visible = False End If - Vn.Dispose() - Vent.Dispose() + ObjVentas.Dispose() + ObjPuntoVenta.Dispose() + + + GvD.DataBind() + GvP.DataBind() + GvDep.DataBind() + GvPorIVA.DataBind() + GvIngresosRetiros.DataBind() GvD.DataBind() diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index ad012761a..490365528 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1597,7 +1597,7 @@ Partial Class PopUpVerFactura DtReporteCorte = ObjPuntoVenta.DtResultados.FiltraParametros("CveCorte > 0") End If - If ObjPuntoVenta.GetVta_MovimientosCajas(CveCorte, -1) Then + If ObjPuntoVenta.GetVta_MovimientosCajasReporte(CveCorte, -1) Then DtIngresosRetiros = ObjPuntoVenta.DtResultados.Copy() End If End If