--FIX. Amortizacion de antipos con NC
This commit is contained in:
@@ -10437,11 +10437,6 @@ Partial Class Ventas
|
||||
' cambiar la condicion para saber si hay seleccionado
|
||||
If (TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2") OrElse NCDescuento Then
|
||||
Try
|
||||
'LIMPIA LOS ANTICIPOS RELACIONADOS QUE YA SE APLICARON
|
||||
If ListaAnticiposAplicados IsNot Nothing Then
|
||||
ListaAnticiposAplicados.Clear()
|
||||
End If
|
||||
|
||||
Dim CveVentaRelacionada As Integer = -1
|
||||
If NuevaFactura = 1 Then
|
||||
CveVentaRelacionada = ObjFactura.CveVenta
|
||||
@@ -10703,6 +10698,11 @@ Partial Class Ventas
|
||||
ObjFactura.DtDetalle = TmpDT 'actualiza por cambios de pedimentos.
|
||||
ObjFactura.Timbre = PreParaTimbre(ObjFactura)
|
||||
|
||||
'LIMPIA LOS ANTICIPOS RELACIONADOS QUE YA SE APLICARON
|
||||
If ListaAnticiposAplicados IsNot Nothing Then
|
||||
ListaAnticiposAplicados.Clear()
|
||||
End If
|
||||
|
||||
'ENVIAR POLIZA VIRTUAL
|
||||
If ErrorList.Count = 0 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(576) = "1" AndAlso EsProduccion Then
|
||||
@@ -11858,7 +11858,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'SI LA APLICACION DE ANTICIPO SE HACE A NIVEL TOTAL, FORZAR EL AJUSTE POR REDONDEO
|
||||
DtImpuestos = CargaDtImpuestosNC(gvrt.DataKey("CveVenta").ToString().ToEntero(), gvrt.FCTextBox(String.Format("TxtAnticipo{0}", gvrt.RowIndex)).Text.ToDecimal, AplicaImpuestosLocales:=True, NCDescuento:=False, NivelTotal:=tTipoAmortizacion, ForzarAjuste:=ForzarAjuste, AplicaDescuentos:=True)
|
||||
DtImpuestos = CargaDtImpuestosNC(gvrt.DataKey("CveVenta").ToString().ToEntero(), gvrt.FCTextBox(String.Format("TxtAnticipo{0}", gvrt.RowIndex)).Text.ToDecimal, AplicaImpuestosLocales:=True, NCDescuento:=False, NivelTotal:=tTipoAmortizacion, ForzarAjuste:=ForzarAjuste, AplicaDescuentos:=True, ReasignarTmpDT:=False)
|
||||
|
||||
Dim query = From ddr In DtImpuestos
|
||||
Group By PorcentajeIVA = ddr("PorcentajeIVA").ToString().ToDecimal,
|
||||
@@ -11956,7 +11956,7 @@ Partial Class Ventas
|
||||
DtVentasNC.Rows(0)("TCCambioValuacion") = factura.TipoCambio
|
||||
End If
|
||||
|
||||
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion)
|
||||
factura.Timbre = PreParaTimbre(factura)
|
||||
|
||||
'Registramos la venta
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, factura, tmpcon, -1, ObjBancos, EsNCAmortizacion:=True)
|
||||
@@ -13079,7 +13079,6 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
If HdnTipoDescuento.Value = "3" And DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero() > 0 Then
|
||||
|
||||
Timbre.CFDIRelacionados.TipoRelacion = "07"
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo"
|
||||
Else
|
||||
@@ -13111,21 +13110,32 @@ Partial Class Ventas
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = "09-Factura generada por pagos diferidos"
|
||||
End Select
|
||||
|
||||
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
|
||||
For Each Dr As DataRow In DtVentasNC.Rows
|
||||
Timbre.CFDIRelacionados.UUID.Add(Dr("FolioFiscal").ToString())
|
||||
Next
|
||||
Else
|
||||
If ListaAnticiposAplicados IsNot Nothing AndAlso ListaAnticiposAplicados.Count > 0 Then
|
||||
For Each Ant As Modelos.MAnticipoRelacionado In ListaAnticiposAplicados
|
||||
Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal)
|
||||
'SI ES NOTA DE CREDITO O REFACTURACION
|
||||
If Obj.TipoDocto.Contiene("Egs", "Dev") OrElse (NuevaFactura = 1) Then
|
||||
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
|
||||
Timbre.CFDIRelacionados.UUID.Clear()
|
||||
For Each Dr As DataRow In DtVentasNC.Rows
|
||||
Timbre.CFDIRelacionados.UUID.Add(Dr("FolioFiscal").ToString())
|
||||
Next
|
||||
Else
|
||||
If Not String.IsNullOrEmpty(HdnFolioFiscalNC.Value.Trim()) AndAlso HdnFolioFiscalNC.Value <> "0" Then
|
||||
Timbre.CFDIRelacionados.UUID.Clear()
|
||||
Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
|
||||
End If
|
||||
End If
|
||||
'ANTICIPO APLICADO A UNA FACTURA
|
||||
ElseIf Obj.TipoDocto = "Ing" AndAlso ListaAnticiposAplicados IsNot Nothing AndAlso ListaAnticiposAplicados.Count > 0 Then
|
||||
Timbre.CFDIRelacionados.UUID.Clear()
|
||||
For Each Ant As Modelos.MAnticipoRelacionado In ListaAnticiposAplicados
|
||||
Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal)
|
||||
Next
|
||||
Else
|
||||
If Not String.IsNullOrEmpty(HdnFolioFiscalNC.Value.Trim()) AndAlso HdnFolioFiscalNC.Value <> "0" Then
|
||||
Timbre.CFDIRelacionados.UUID.Clear()
|
||||
Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -30143,7 +30153,7 @@ Partial Class Ventas
|
||||
|
||||
Next
|
||||
End Sub
|
||||
Private Function CargaDtImpuestosNC(CveVentaNC As Integer, Importe As Decimal, Optional NCDescuento As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional NivelTotal As Integer = 1, Optional AplicaNCUsado As Boolean = False, Optional ForzarAjuste As Boolean = False, Optional AplicaDescuentos As Boolean = False) As DataTable
|
||||
Private Function CargaDtImpuestosNC(CveVentaNC As Integer, Importe As Decimal, Optional NCDescuento As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional NivelTotal As Integer = 1, Optional AplicaNCUsado As Boolean = False, Optional ForzarAjuste As Boolean = False, Optional AplicaDescuentos As Boolean = False, Optional ReasignarTmpDT As Boolean = True) As DataTable
|
||||
Dim Total As Decimal = 0, SubTotal As Decimal = 0, Saldo As Decimal = 0
|
||||
|
||||
Dim TmpDT As DataTable = Nothing
|
||||
@@ -30305,7 +30315,7 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not NCDescuento Then
|
||||
If Not NCDescuento AndAlso ReasignarTmpDT Then
|
||||
Me.TmpDT = TmpDT
|
||||
End If
|
||||
'CARGA FACTURA A LA CUAL SE APLICA LA NC
|
||||
|
||||
Reference in New Issue
Block a user