GDiaz 2025-01-14

This commit is contained in:
rakcsle
2025-01-14 08:22:47 -07:00
parent b018aca7fe
commit 1b89c3b198
7 changed files with 151 additions and 22 deletions

View File

@@ -3735,7 +3735,7 @@
<div class="modal-body">
<asp:GridView AutoGenerateColumns="false" runat="server" ID="GvOCsVinculadas" GridLines="None" CssClass="table table-striped table-hover Widthall">
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="CveOrdenCompra" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" Target="_blank" HeaderText="Folio" DataTextField="FolioOC" ItemStyle-HorizontalAlign="Center" />
<asp:HyperLinkField DataNavigateUrlFields="CveOrdenCompra" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" Target="_blank" HeaderText="Folio" DataTextField="SerieFolioOC" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Descripción" DataField="Descripcion" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" />
</Columns>

View File

@@ -1577,29 +1577,141 @@ Partial Class PopUpVerFactura
If UrlParametros("OP").ToString = "AMORTIZACIONHIS" Then
'CveViajePasajero
Dim CVEIE As Integer = UrlParametros("CVEIE").ToString.ToEntero
Dim CVEVENTAAMORTIZADA As Integer = UrlParametros("CVEVENTAAMORTIZADA").ToString.ToEntero
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 SALDO As Decimal = UrlParametros("SALDO").ToString.ToDecimal
If CVECLIENTE > 0 AndAlso (CVEIE > 0 Or CVEVENTA > 0) Then
ImprimirSaldosAmortizacion(CVEIE, CVEVENTA, CVECLIENTE)
ImprimirSaldosAmortizacion(CVEVENTAAMORTIZADA, CVEIE, CVEVENTA, CVECLIENTE, MONTO, SALDO)
End If
End If
End Sub
Private Sub ImprimirSaldosAmortizacion(CVEIE As Integer, CVEVENTA As Integer, CVECLIENTE As Integer)
If CVEVENTA > 0 Then
Private Sub ImprimirSaldosAmortizacion(CveVentaAmortizada As Integer, CveIE As Integer, CveVenta As Integer, CveCliente As Integer, Monto As Decimal, Saldo As Decimal)
Dim ObjMovtos As New ClsMovimientos()
Dim SaldoAntNCDev As Decimal = 0
Dim DatosSaldoAntNCDev As New DataTable
Dim TipoDocto As String = ""
Dim Folio As String = ""
Dim DTNCVinculadas As New DataTable
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente) Then
DatosSaldoAntNCDev = ObjMovtos.DtResultados
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}"))
Folio = If(CveVenta > 0,
DatosSaldoAntNCDev.FiltroPrimeroValor("Folio", $"CveVenta={CveVenta}"),
DatosSaldoAntNCDev.FiltroPrimeroValor("Folio", $"CveIE={CveIE}"))
If CveIE > 0 Then
CveVenta = DatosSaldoAntNCDev.FiltroPrimeroValor("CveVenta", $"CveIE={CveIE}").ToEntero
End If
End If
If CVEIE > 0 Then
If TipoDocto.Contiene("Egs", "Dev", "Ant") Then
Dim AplicaAmortizacion As Boolean = False
If TipoDocto.Contiene("Ant") Then AplicaAmortizacion = True
Dim ObjVentas As New ClsVentas
If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion) Then
DTNCVinculadas = ObjVentas.DtResultados.Copy()
End If
ObjVentas.Dispose()
End If
If DTNCVinculadas IsNot Nothing Then
Dim params As New List(Of ReportParameter)
Dim ObjVentas As New ClsVentas
If ObjVentas.GetVenta(CveVentaAmortizada, UsuarioActual.CveEmpresa) Then
Dim DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
If DbRowVenta IsNot Nothing Then
'Dim VentaActual As New Venta(UsuarioActual)
'VentaActual.CveVenta = CveVentaAmortizada
'VentaActual.TipoDocto = DbRowVenta("TipoDocto").ToString
'VentaActual.Fecha = DbRowVenta("Fecha").ToString.ToDate
'VentaActual.CveCliente = DbRowVenta("CveCliente").ToString.ToEntero
'VentaActual.CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero
'VentaActual.SerieFolio = DbRowVenta("SerieFolio").ToString
'VentaActual.ClienteNombre = DbRowVenta("ClienteNombre").ToString
'VentaActual.TC = DbRowVenta("TipoCambio").ToString.ToDecimal
'VentaActual.Total = DbRowVenta("Total").ToString.ToDecimal
'VentaActual.IVA = DbRowVenta("IVA").ToString.ToDecimal
'VentaActual.IEPS = DbRowVenta("IEPS").ToString.ToDecimal
'VentaActual.RetIVA = DbRowVenta("RetIVA").ToString.ToDecimal
'VentaActual.RetISR = DbRowVenta("RetISR").ToString.ToDecimal
'VentaActual.PorcentajeIVA = DbRowVenta("PorcentajeIVA").ToString.ToDecimal
'VentaActual.UsuarioActual = UsuarioActual
'VentaActual.CveSubProyecto = DbRowVenta("CveSubProyecto").ToString.ToEntero
'VentaActual.CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero
'VentaActual.SerieFolio = DbRowVenta("SerieFolio").ToString
params.Add(New ReportParameter("SerieFolio", DbRowVenta("SerieFolio").ToString))
params.Add(New ReportParameter("Moneda", DbRowVenta("Moneda").ToString))
params.Add(New ReportParameter("Cliente", DbRowVenta("Cliente").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("FechaInicio", FechaI))
'params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("FechaImpresion", NowADS().ToString))
'params.Add(New ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {Grupo}{FechaIn}{FechaFn}"))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
params.Add(New ReportParameter("SaldoAntNCDev", SaldoAntNCDev.ToString))
params.Add(New ReportParameter("Monto", Monto.ToString))
params.Add(New ReportParameter("Saldo", Saldo.ToString))
Dim NombreArchivo As String = "SaldoAntNCDev.rdlc"
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo))
If Archivo.Exists Then
ImprimirPDF(Archivo.FullName, DTNCVinculadas, params, "OrdenesdeCompraporvincular ", Opcion)
Else
ImprimirPDF($"Empresas/Grales/Formatos/{NombreArchivo}", DTNCVinculadas, params, "OrdenesdeCompraporvincular", Opcion)
End If
End If
End Sub
Private Function Parametros(Cadena As String) As Hashtable