--FIX cobranza

This commit is contained in:
2025-02-05 17:56:41 -07:00
parent 4edc27d2db
commit 1b53da98c4

View File

@@ -716,7 +716,7 @@ Partial Class Ventas_PVCobranza
End If End If
'GENERAR NC PARA AMORTIZACION 'GENERAR NC PARA AMORTIZACION
If ListaAnticiposAplicados.Where(Function(x) x.Tipo = "Ant").Any() Then If ListaAnticiposAplicados IsNot Nothing AndAlso ListaAnticiposAplicados.Where(Function(x) x.Tipo = "Ant").Any() Then
For Each gvr As GridViewRow In GVAnticipos.Rows For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.DataKey("Tipo") = "Ant" AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then If gvr.DataKey("Tipo") = "Ant" AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
@@ -1091,6 +1091,7 @@ Partial Class Ventas_PVCobranza
Private Sub AjustarTimbreFactura(ByRef ObjFactura As Modelos.Factura) Private Sub AjustarTimbreFactura(ByRef ObjFactura As Modelos.Factura)
ObjFactura.Timbre.CFDIRelacionados.UUID.Clear() ObjFactura.Timbre.CFDIRelacionados.UUID.Clear()
If ListaAnticiposAplicados IsNot Nothing Then
'SI TIENE RELACIONADOS ANTICIPOS PONER TIPO RELACION 7 'SI TIENE RELACIONADOS ANTICIPOS PONER TIPO RELACION 7
If ListaAnticiposAplicados.Where(Function(x) x.Tipo = "Ant").Any() Then If ListaAnticiposAplicados.Where(Function(x) x.Tipo = "Ant").Any() Then
Dim Anticipos = ListaAnticiposAplicados.Where(Function(Obj) Obj.Tipo = "Ant") Dim Anticipos = ListaAnticiposAplicados.Where(Function(Obj) Obj.Tipo = "Ant")
@@ -1119,6 +1120,8 @@ Partial Class Ventas_PVCobranza
End If End If
End If End If
End If
End Sub End Sub
@@ -1347,6 +1350,7 @@ Partial Class Ventas_PVCobranza
ObjFactura.PedidoContrato = PedidoContrato ObjFactura.PedidoContrato = PedidoContrato
ObjFactura.OrdenCompra = OrdenCompra ObjFactura.OrdenCompra = OrdenCompra
If ListaAnticiposAplicados IsNot Nothing Then
'SI TIENE RELACIONADOS ANTICIPOS PONER TIPO RELACION 7 'SI TIENE RELACIONADOS ANTICIPOS PONER TIPO RELACION 7
If ListaAnticiposAplicados.Where(Function(x) x.Tipo = "Ant").Any() Then If ListaAnticiposAplicados.Where(Function(x) x.Tipo = "Ant").Any() Then
ObjFactura.CveTipoRelacion = 7 ObjFactura.CveTipoRelacion = 7
@@ -1356,6 +1360,7 @@ Partial Class Ventas_PVCobranza
If Not ListaAnticiposAplicados.Where(Function(x) x.Tipo = "Ant").Any() AndAlso ListaAnticiposAplicados.Where(Function(x) x.Tipo = "NC").Any() Then If Not ListaAnticiposAplicados.Where(Function(x) x.Tipo = "Ant").Any() AndAlso ListaAnticiposAplicados.Where(Function(x) x.Tipo = "NC").Any() Then
ObjFactura.CveTipoRelacion = 1 ObjFactura.CveTipoRelacion = 1
End If End If
End If
Retorno = ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True) Retorno = ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True)
Retorno.Factura = ObjFactura Retorno.Factura = ObjFactura