From eac68128e5360404b05460dd0e7da041ae57f26a Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 9 Apr 2024 23:16:36 -0700 Subject: [PATCH] --Cambios de formato de reporte de cortes --- Compras/PopUpVerFactura.aspx.vb | 87 +- Empresas/190/Formatos/RepCortes.rdlc | 636 ++++++++- Empresas/193/Formatos/RepCortes.rdlc | 1820 ++++++++++++++++++++++++++ 3 files changed, 2507 insertions(+), 36 deletions(-) create mode 100644 Empresas/193/Formatos/RepCortes.rdlc diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index a3fde73da..5810f81d3 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1566,18 +1566,22 @@ Partial Class PopUpVerFactura #Region "OP = CORT - IMPRIMIR CORTE" Private Sub ImprimeCorte(CveCorte As Integer, Formato As String, Optional CveSubProyecto As Integer = -1) - Dim ObjVenta As New ClsVentas - Dim ObjPuntoVenta As New ClsPuntoVenta Dim DtCortesVentasResumen As DataTable = Nothing Dim DtCortesVentas As DataTable = Nothing Dim DtReporteCorte As DataTable = Nothing + Dim DtIngresosRetiros As DataTable = Nothing Dim Fecha As String = "", Nombre As String = "" + Dim OpcionDetallado As Integer = 1 + If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then OpcionDetallado = 2 + + Dim ObjVenta As New ClsVentas + Dim ObjPuntoVenta As New ClsPuntoVenta + If ObjVenta.GetCortesDetalleVentasResumen(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa) Then DtCortesVentasResumen = ObjVenta.DtResultados.Copy() End If - Dim OpcionDetallado As Integer = 1 - If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then OpcionDetallado = 2 + If ObjPuntoVenta.GetCortesDetalleVentas(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa, OpcionDetallado) Then DtCortesVentas = ObjPuntoVenta.DtResultados.Copy() If DtCortesVentas.Rows.Count > 0 Then @@ -1592,6 +1596,10 @@ Partial Class PopUpVerFactura If ObjPuntoVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, CveSubProyecto, CveCorte:=CveCorte) Then DtReporteCorte = ObjPuntoVenta.DtResultados.FiltraParametros("CveCorte > 0") End If + + If ObjPuntoVenta.GetVta_MovimientosCajas(CveCorte, -1) Then + DtIngresosRetiros = ObjPuntoVenta.DtResultados.Copy() + End If End If ObjVenta.Dispose() @@ -1609,11 +1617,6 @@ Partial Class PopUpVerFactura DtMetodosPago = DtCortesVentasResumen.FiltraParametros("MetodoPago <> 'Crédito'") End If - Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = DtMetodosPago} - lrds.Add(rds) - Dim rds2 As New ReportDataSource With {.Name = "DataSet2", .Value = DtCortesVentas} - lrds.Add(rds2) - Dim DirFormato As String = "Empresas/Grales/Formatos/RepCortes.rdlc" If File.Exists(UsuarioActual.Empresa.Ruta + "\Formatos\RepCortes.rdlc") Then DirFormato = UsuarioActual.Empresa.Ruta + "\Formatos\RepCortes.rdlc" @@ -1629,35 +1632,45 @@ Partial Class PopUpVerFactura If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then If DtReporteCorte IsNot Nothing Then Dim DtTT = GenerateTransposedTable(DtReporteCorte) - Dim DtDatosResumen As New DataTable() - DtDatosResumen.Columns.Add(New DataColumn("Orden", GetType(Integer))) - DtDatosResumen.Columns.Add(New DataColumn("Columna", GetType(String))) - DtDatosResumen.Columns.Add(New DataColumn("Importe", GetType(Decimal))) + Dim DtDatosVentas As New DataTable() + DtDatosVentas.Columns.Add(New DataColumn("Orden", GetType(Integer))) + DtDatosVentas.Columns.Add(New DataColumn("Columna", GetType(String))) + DtDatosVentas.Columns.Add(New DataColumn("Importe", GetType(Decimal))) + + Dim DtDatosCajas As DataTable = DtDatosVentas.Copy() For Each row As DataRow In DtTT.Rows Dim Total = row(1).ToString() If IsNumeric(Total) Then + Dim TipoTabla As Integer = 0 + Dim Orden As Integer = 0 - Dim rowData = DtDatosResumen.NewRow() + Dim rowData = DtDatosVentas.NewRow() Select Case row(0).ToString() Case "ImporteInicial" rowData("Columna") = "Importe Inicial" Orden = 1 + TipoTabla = 2 Case "VentasCorte" rowData("Columna") = "Total Ventas" Orden = 2 + TipoTabla = 1 Case "NotasCredito" rowData("Columna") = "N.C." Orden = 3 + TipoTabla = 1 Case "VentasCredito" rowData("Columna") = "Ventas Crédito" Orden = 4 + TipoTabla = 1 Case "VentaTotalIngreso" rowData("Columna") = "Ventas Ingreso" Orden = 4 + TipoTabla = 1 Case "VentaTotalRemision" rowData("Columna") = "Ventas Remisiones" Orden = 4 + TipoTabla = 1 'Case "TotalEfectivo" ' rowData("Columna") = "Total Efectivo" 'Case "TotalCheque" @@ -1671,20 +1684,23 @@ Partial Class PopUpVerFactura Case "TotalRetiros" rowData("Columna") = "Total Retiro" Orden = 6 + TipoTabla = 2 Case "TotalIngresos" rowData("Columna") = "Total Ingreso" Orden = 5 + TipoTabla = 2 Case "Devoluciones" rowData("Columna") = "Devoluciones" Orden = 7 - Case "SaldoAnteriorAplicado" - rowData("Columna") = "Saldo Aplicado" - Orden = 8 + TipoTabla = 1 + 'Case "SaldoAnteriorAplicado" + ' rowData("Columna") = "Saldo Aplicado" + ' Orden = 0 + ' TipoTabla = 0 Case "TotalCaja" rowData("Columna") = "Total Caja" Orden = 9 - 'Case "TotalCorte" - ' rowData("Columna") = "Total Corte" + TipoTabla = 2 Case Else rowData("Columna") = row(0).ToString() Orden = 0 @@ -1692,21 +1708,41 @@ Partial Class PopUpVerFactura rowData("Importe") = Total.ToDecimal() rowData("Orden") = Orden - DtDatosResumen.Rows.Add(rowData) + + If TipoTabla = 1 Then + DtDatosVentas.Rows.Add(rowData.ItemArray) + ElseIf TipoTabla = 2 Then + DtDatosCajas.Rows.Add(rowData.ItemArray) + End If + + If row(0).ToString() = "SaldoAnteriorAplicado" Then + Dim RowMP As DataRow = DtMetodosPago.NewRow + RowMP("MetodoPago") = "Saldo Aplicado" + RowMP("Importe") = Total.ToDecimal() + + DtMetodosPago.Rows.Add(RowMP) + End If + End If Next Dim TotalCredito As Decimal = DtCortesVentasResumen.SUMD("Importe", "MetodoPago = 'Crédito'") - Dim rowCredito = DtDatosResumen.NewRow() + Dim rowCredito = DtDatosVentas.NewRow() rowCredito("Columna") = "Crédito" rowCredito("Importe") = TotalCredito rowCredito("Orden") = 4 - DtDatosResumen.Rows.Add(rowCredito) + DtDatosVentas.Rows.Add(rowCredito) - Dim rds3 As New ReportDataSource With {.Name = "DataSet3", .Value = DtDatosResumen.FiltraParametros("Orden > 0", "Orden")} + Dim rds3 As New ReportDataSource With {.Name = "DataSet3", .Value = DtDatosVentas.FiltraParametros("Orden > 0", "Orden")} lrds.Add(rds3) + Dim rds4 As New ReportDataSource With {.Name = "DataSet4", .Value = DtDatosCajas.FiltraParametros("Orden > 0", "Orden")} + lrds.Add(rds4) + + Dim rds5 As New ReportDataSource With {.Name = "DataSet5", .Value = DtIngresosRetiros} + lrds.Add(rds5) + 'params.Add(New ReportParameter("VentasCorte", RowCorte("VentasCorte").ToString())) 'params.Add(New ReportParameter("NotasCredito", RowCorte("NotasCredito").ToString())) 'params.Add(New ReportParameter("NotasCredito", RowCorte("NotasCredito").ToString())) @@ -1716,7 +1752,10 @@ Partial Class PopUpVerFactura End If End If - + Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = DtMetodosPago} + lrds.Add(rds) + Dim rds2 As New ReportDataSource With {.Name = "DataSet2", .Value = DtCortesVentas} + lrds.Add(rds2) ImprimirPDF(DirFormato, lrds, params, "ReporteCortes", Formato) diff --git a/Empresas/190/Formatos/RepCortes.rdlc b/Empresas/190/Formatos/RepCortes.rdlc index 7a6378907..8ea5c3a00 100644 --- a/Empresas/190/Formatos/RepCortes.rdlc +++ b/Empresas/190/Formatos/RepCortes.rdlc @@ -6,7 +6,7 @@ - 4.37444cm + 3.71406cm 2.97963cm @@ -179,10 +179,10 @@ DataSet1 - 1.27cm + 0.73025cm 0.06614cm 0.90467cm - 7.35407cm + 6.69369cm @@ -196,7 +196,7 @@ - Detalles del Corte + Detalles de Pagos + + + + + 2.68035cm + + + 2.97963cm + + + + + 0.47879cm + + + + + true + true + + + + + Resumen + + + + + + + Textbox4 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total + + + + + + + Textbox16 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.42588cm + + + + + true + + + + + =Fields!Columna.Value + + + + + + + MetodoPago + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet4 + 0.73025cm + 13.18603cm + 0.90467cm + 5.65998cm + 4 + + + + + + true + true + + + + + Ventas + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Cajas + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.73022cm + + + 7.79329cm + + + 2.28714cm + + + + + 0.47879cm + + + + + true + true + + + + + Tipo + + + + + + + Textbox4 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Descripción + + + + + + + Textbox16 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total + + + + + + + Textbox18 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.45234cm + + + + + true + + + + + =Fields!TipoMovimiento.Value + + + + + + + MetodoPago + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + =Fields!Descripcion.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + ImportePagado + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet5 + 2.73226cm + 0.06614cm + 0.93113cm + 12.81065cm + 7 + + + + + + true + true + + + + + Ingresos/Retiros + + + + + + 2pt + 2pt + 2pt + 2pt + + - 1.4395in + 1.83665in + + + + + + Textbox4 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total + + + + + + + Textbox16 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.42588cm + + + + + true + + + + + =Fields!MetodoPago.Value + + + + + + + MetodoPago + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet1 + 0.73025cm + 0.06614cm + 0.90467cm + 6.69369cm + + + + + + true + true + + + + + Detalles de Pagos + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.73022cm + + + 10.35439cm + + + 2.28714cm + + + 3.20444cm + + + + + 0.47879cm + + + + + true + true + + + + + Serie Folio + + + + + + + Textbox4 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Nombre Comercial + + + + + + + Textbox16 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total + + + + + + + Textbox18 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Método de Pago + + + + + + + Textbox20 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.45234cm + + + + + true + + + + + =Fields!SerieFolio.Value + + + + + + + MetodoPago + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + =Fields!NombreComercial.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImportePagado.Value + + + + + + + ImportePagado + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!MetodoPago.Value + + + + + + + MetodoPago1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet2 + 3.73395cm + 0.06614cm + 0.93113cm + 18.57619cm + 2 + + + + + + + + + 2.68035cm + + + 2.97963cm + + + + + 0.47879cm + + + + + true + true + + + + + Resumen + + + + + + + Textbox4 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total + + + + + + + Textbox16 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.42588cm + + + + + true + + + + + =Fields!Columna.Value + + + + + + + MetodoPago + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet3 + 0.73025cm + 7.21681cm + 0.90467cm + 5.65998cm + 3 + + + + + + + + + 2.68035cm + + + 2.97963cm + + + + + 0.47879cm + + + + + true + true + + + + + Resumen + + + + + + + Textbox4 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total + + + + + + + Textbox16 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.42588cm + + + + + true + + + + + =Fields!Columna.Value + + + + + + + MetodoPago + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet4 + 0.73025cm + 13.18603cm + 0.90467cm + 5.65998cm + 4 + + + + + + true + true + + + + + Ventas + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Cajas + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.73022cm + + + 7.79329cm + + + 2.28714cm + + + + + 0.47879cm + + + + + true + true + + + + + Tipo + + + + + + + Textbox4 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Descripción + + + + + + + Textbox16 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total + + + + + + + Textbox18 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.45234cm + + + + + true + + + + + =Fields!TipoMovimiento.Value + + + + + + + MetodoPago + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + =Fields!Descripcion.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + ImportePagado + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet5 + 2.73226cm + 0.06614cm + 0.93113cm + 12.81065cm + 7 + + + + + + true + true + + + + + Ingresos/Retiros + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 1.83665in + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + REPORTE DE CORTES + + + + + + + Textbox2 + 1.10271cm + 5.07342cm + 0.52945cm + 10.36447cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.06614cm + 2.22362cm + 2.33715cm + 2 + + + + + + true + true + + + + + =Parameters!AgrupoPor.Value + HTML + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.68792cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.0829cm + 15.43789cm + 0.38981cm + 3.20444cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaImpresion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0.5cm + 0.5cm + 0.3cm + 0.5cm + 0.13cm +