From d345089468540514bd199a5bc8bdab7d259d2994 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 12 Apr 2025 16:31:02 -0700 Subject: [PATCH] --FIX impresion de saldos aplicados --- Compras/PopUpVerFactura.aspx.vb | 76 +- Empresas/189/Formatos/SaldoAntNCDev.rdlc | 1168 ---------------------- Ventas/PVCobranza.aspx.vb | 35 +- 3 files changed, 54 insertions(+), 1225 deletions(-) delete mode 100644 Empresas/189/Formatos/SaldoAntNCDev.rdlc diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index a71ab3f41..3ebde3353 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1587,19 +1587,18 @@ Partial Class PopUpVerFactura Dim CVEVENTA As Integer = UrlParametros("CVEVENTA").ToString.ToEntero Dim CVECLIENTE As Integer = UrlParametros("CVECLIENTE").ToString.ToEntero Dim MONTO As Decimal = UrlParametros("MONTO").ToString.ToDecimal + Dim TIPO As String = UrlParametros("TIPO").ToString If CVECLIENTE > 0 AndAlso (CVEIE > 0 Or CVEVENTA > 0) Then - ImprimirSaldosAmortizacion(CVEVENTAAMORTIZADA, CVEIE, CVEVENTA, CVECLIENTE, MONTO) + ImprimirSaldosAmortizacion(TIPO, CVEVENTAAMORTIZADA, CVEIE, CVEVENTA, CVECLIENTE, MONTO) End If End If End Sub - Private Sub ImprimirSaldosAmortizacion(CveVentaAmortizada As Integer, CveIE As Integer, CveVenta As Integer, CveCliente As Integer, Monto As Decimal) + Private Sub ImprimirSaldosAmortizacion(Tipo As String, CveVentaAmortizada As Integer, CveIE As Integer, CveVenta As Integer, CveCliente As Integer, Monto As Decimal) - - Dim ObjMovtos As New ClsMovimientos() Dim SaldoAntNCDev As Decimal = 0 Dim DatosSaldoAntNCDev As New DataTable Dim TipoDocto As String = "" @@ -1607,36 +1606,22 @@ Partial Class PopUpVerFactura Dim Saldo As Decimal = 0D Dim DTNCVinculadas As New DataTable - + Dim ObjMovtos As New ClsMovimientos() If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente) Then - DatosSaldoAntNCDev = ObjMovtos.DtResultados + If Tipo.Contiene("NC", "Ant") Then + DatosSaldoAntNCDev = ObjMovtos.DtResultados.FiltraParametros($"Tipo='{Tipo}' AND CveVenta={CveVenta}") + ElseIf Tipo.Contiene("IxC") Then + DatosSaldoAntNCDev = ObjMovtos.DtResultados.FiltraParametros($"Tipo='{Tipo}' AND CveIE={CveIE}") + End If End If ObjMovtos.Dispose() If DatosSaldoAntNCDev IsNot Nothing AndAlso DatosSaldoAntNCDev.Rows.Count > 0 Then - SaldoAntNCDev = If(CveVenta > 0, - DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo", $"CveVenta={CveVenta}").ToDecimal, - DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo", $"CveIE={CveIE}").ToDecimal) - - TipoDocto = If(CveVenta > 0, - DatosSaldoAntNCDev.FiltroPrimeroValor("Tipo", $"CveVenta={CveVenta}"), - DatosSaldoAntNCDev.FiltroPrimeroValor("Tipo", $"CveIE={CveIE}")) - - - - - If CveIE > 0 Then - CveVenta = DatosSaldoAntNCDev.FiltroPrimeroValor("CveVenta", $"CveIE={CveIE}").ToEntero - Folio = DatosSaldoAntNCDev.FiltroPrimeroValor("Folio", $"CveIE={CveIE}") - Saldo = DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo", $"CveIE={CveIE}").ToDecimal - Else - Folio = DatosSaldoAntNCDev.FiltroPrimeroValor("Folio", $"CveVenta={CveVenta}") - Saldo = DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo", $"CveVenta={CveVenta}").ToDecimal - End If - - - + SaldoAntNCDev = DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo").ToDecimal + TipoDocto = DatosSaldoAntNCDev.FiltroPrimeroValor("Tipo") + Folio = DatosSaldoAntNCDev.FiltroPrimeroValor("Folio") + Saldo = DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo").ToDecimal End If @@ -1651,30 +1636,53 @@ Partial Class PopUpVerFactura ObjVentas.Dispose() End If + If TipoDocto.Contiene("IxC") Then + + DTNCVinculadas = New DataTable() + DTNCVinculadas.Columns.Add(New DataColumn("SerieFolioEstatus", GetType(String))) + DTNCVinculadas.Columns.Add(New DataColumn("FechaAplicado", GetType(String))) + DTNCVinculadas.Columns.Add(New DataColumn("Moneda", GetType(String))) + DTNCVinculadas.Columns.Add(New DataColumn("TotalNC", GetType(String))) + Dim DtIxC As DataTable = Nothing + Dim ObjVentas As New ClsVentas + If ObjVentas.GetRepAnticiposNCIXCDetalle(CveCliente, -1, MinFecha, MaxFecha, UsuarioActual.CveEmpresa, -1, 3, -1, MinFecha, MaxFecha, TipoCambio:=1, TCEspecifico:=-1) Then + DtIxC = ObjVentas.DtResultados.FiltraParametros($"CveIE={CveIE} AND TipoColumna ='Aplicación'") + End If + ObjVentas.Dispose() + + If DtIxC IsNot Nothing Then + For Each RowIxC As DataRow In DtIxC.Rows + Dim Row As DataRow = DTNCVinculadas.NewRow + Row("SerieFolioEstatus") = RowIxC("SerieFolioAmortizacion") + Row("FechaAplicado") = RowIxC("FechaAmortizacion") + Row("Moneda") = RowIxC("MonedaAmortizacion") + Row("TotalNC") = RowIxC("ImporteAmortizacion") + DTNCVinculadas.Rows.Add(Row) + Next + End If + End If + If DTNCVinculadas IsNot Nothing Then Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("Tipo", Tipo)) + Dim ObjVentas As New ClsVentas If ObjVentas.GetVenta(CveVentaAmortizada, UsuarioActual.CveEmpresa) Then Dim DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("") If DbRowVenta IsNot Nothing Then - params.Add(New ReportParameter("SerieFolio", DbRowVenta("SerieFolio").ToString)) + params.Add(New ReportParameter("SerieFolio", Folio)) params.Add(New ReportParameter("Moneda", DbRowVenta("Moneda").ToString)) params.Add(New ReportParameter("Cliente", DbRowVenta("ClienteNombre").ToString)) - End If End If ObjVentas.Dispose() - - Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") - - params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("FechaImpresion", NowADS().ToString)) diff --git a/Empresas/189/Formatos/SaldoAntNCDev.rdlc b/Empresas/189/Formatos/SaldoAntNCDev.rdlc deleted file mode 100644 index e09e5fbaa..000000000 --- a/Empresas/189/Formatos/SaldoAntNCDev.rdlc +++ /dev/null @@ -1,1168 +0,0 @@ - - - 0 - - - - System.Data.DataSet - /* Local Connection */ - - f55ecc33-47ff-4fc5-a233-35ea9bb1f578 - - - - - - DataSet - /* Local Query */ - - - - SerieFolio - System.String - - - SerieFolioEstatus - System.String - - - FechaAplicado - System.String - - - Importe - System.Double - - - TotalNC - System.Double - - - Moneda - System.String - - - - DataSet - C:\Users\Caudillo\Documents\Visual Studio 2013\WebSites\WebSite9\App_Code\DataSet.xsd - DataTable1 - - - - - - - - - - - - - - - - - - true - true - - - - - Folio - - - - - - - Textbox28 - - - - LightGrey - - - LightGrey - - - LightGrey - - - - - LightGrey - 1pt - - - - - - - - - - - 3.42604cm - - - 2.43119cm - - - 3.94465cm - - - - - 0.44125cm - - - - - true - true - - - - - =Fields!FechaAplicado.Value - - - - - - - FechaAplicado - - - =IIF(Fields!TotalNC.Value < 0, "#e7505a","White") - 0.5pt - - - - - - - - true - true - - - - - =Fields!Moneda.Value - - - - - - - Moneda - - - =IIF(Fields!TotalNC.Value < 0, "#e7505a","White") - 0.5pt - - - - - - - - true - true - - - - - =Fields!TotalNC.Value - - - - - - - TotalNC - - - =IIF(Fields!TotalNC.Value < 0, "#e7505a","White") - 0.5pt - - - - - - - - - - - - - 0.44125cm - - - true - true - - - - - Fecha - - - - - - - Textbox19 - - - LightGrey - 1pt - - - - - - - - 0.44125cm - - - true - true - - - - - Moneda - - - - - - - Textbox21 - - - LightGrey - 1pt - - - - - - - - 0.44125cm - - - true - true - - - - - Importe - - - - - - - Textbox23 - - - LightGrey - 1pt - - - - - - - - - - - - - 6.69369cm - - - true - true - - - - - =Fields!SerieFolioEstatus.Value - - - - - - - SerieFolioEstatus - - - =IIF(Fields!TotalNC.Value < 0, "#e7505a","White") - 0.5pt - - - - - - - - true - true - DataSet1 - 0.12375cm - 0.25664cm - 0.8825cm - 16.49557cm - - - - - - 0.39616in - - - - - - - Textbox1 - 3.8144cm - 0.6cm - 13.0693cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Aplicaciones de facturas - - - - - - - Textbox2 - 0.63528cm - 3.77912cm - 0.52945cm - 13.0693cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!LogoPath.Value - FitProportional - 0.06614cm - 2.22362cm - 3.00743cm - 2 - - - - - - true - true - - - - - Cliente: - - - - - - - - - true - true - - - - - =Parameters!Cliente.Value - - - - - - true - true - - - - - Factura: - - - - - - - - - true - true - - - - - =Parameters!SerieFolio.Value - - - - - - true - true - - - - - Monto: - - - - - - - - - true - true - - - - - =Parameters!Monto.Value - - - - - - true - true - - - - - Saldo: - - - - - - - - - true - true - - - - - =Parameters!Saldo.Value - - - - - - true - true - - - - - Aplicaciones de facturas: - - - - - - - - - true - true - - - - - Folio: - - - - - - - - - true - true - - - - - =Parameters!Folio.Value - - - - - - true - true - - - - - Fecha: - - - - - - - - - true - true - - - - - =Parameters!FechaImpresion.Value - - - - - - true - true - - - - - Moneda: - - - - - - - - - true - true - - - - - =Parameters!Moneda.Value - - - - - - - - - - - 0.48291cm - true - true - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 0.08291cm - 18.6093cm - 0.4cm - 2.06587cm - - - 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 - - - - - - - - 29.7cm - 21cm - 0.1cm - 0.1cm - 1cm - 0.5cm - 0.13cm -