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 @@
-
-
Imprimir Saldo Aplicado {dr("Folio").ToString}
")
+ respFactura.Factura.Total, dr("Tipo")))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}
")
Next
End If
@@ -1064,12 +1069,12 @@ Partial Class Ventas_PVCobranza
If respNC IsNot Nothing AndAlso respNC.Factura IsNot Nothing AndAlso respNC.Factura.DtAnticiposAplicados IsNot Nothing Then
For Each dr As DataRow In respNC.Factura.DtAnticiposAplicados.Rows
- msBuild.AppendLine($"
Imprimir Saldo Aplicado {dr("Folio").ToString}
")
+ respNC.Factura.Total, dr("Tipo")))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}
")
Next
End If
@@ -1444,22 +1449,6 @@ Partial Class Ventas_PVCobranza
For Each msg In Retorno.Mensajes
SbAlert.AppendFormat("{0}
", msg)
Next
-
- SbAlert.AppendFormat("