-
This commit is contained in:
@@ -10436,11 +10436,6 @@ Partial Class Ventas
|
|||||||
' cambiar la condicion para saber si hay seleccionado
|
' cambiar la condicion para saber si hay seleccionado
|
||||||
If (TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2") OrElse NCDescuento Then
|
If (TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2") OrElse NCDescuento Then
|
||||||
Try
|
Try
|
||||||
'LIMPIA LOS ANTICIPOS RELACIONADOS QUE YA SE APLICARON
|
|
||||||
If ListaAnticiposAplicados IsNot Nothing Then
|
|
||||||
ListaAnticiposAplicados.Clear()
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim CveVentaRelacionada As Integer = -1
|
Dim CveVentaRelacionada As Integer = -1
|
||||||
If NuevaFactura = 1 Then
|
If NuevaFactura = 1 Then
|
||||||
CveVentaRelacionada = ObjFactura.CveVenta
|
CveVentaRelacionada = ObjFactura.CveVenta
|
||||||
@@ -10702,6 +10697,11 @@ Partial Class Ventas
|
|||||||
ObjFactura.DtDetalle = TmpDT 'actualiza por cambios de pedimentos.
|
ObjFactura.DtDetalle = TmpDT 'actualiza por cambios de pedimentos.
|
||||||
ObjFactura.Timbre = PreParaTimbre(ObjFactura)
|
ObjFactura.Timbre = PreParaTimbre(ObjFactura)
|
||||||
|
|
||||||
|
'LIMPIA LOS ANTICIPOS RELACIONADOS QUE YA SE APLICARON
|
||||||
|
If ListaAnticiposAplicados IsNot Nothing Then
|
||||||
|
ListaAnticiposAplicados.Clear()
|
||||||
|
End If
|
||||||
|
|
||||||
'ENVIAR POLIZA VIRTUAL
|
'ENVIAR POLIZA VIRTUAL
|
||||||
If ErrorList.Count = 0 Then
|
If ErrorList.Count = 0 Then
|
||||||
If UsuarioActual.Empresa.Funcionalidad(576) = "1" AndAlso EsProduccion Then
|
If UsuarioActual.Empresa.Funcionalidad(576) = "1" AndAlso EsProduccion Then
|
||||||
@@ -11857,7 +11857,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'SI LA APLICACION DE ANTICIPO SE HACE A NIVEL TOTAL, FORZAR EL AJUSTE POR REDONDEO
|
'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
|
Dim query = From ddr In DtImpuestos
|
||||||
Group By PorcentajeIVA = ddr("PorcentajeIVA").ToString().ToDecimal,
|
Group By PorcentajeIVA = ddr("PorcentajeIVA").ToString().ToDecimal,
|
||||||
@@ -11955,7 +11955,7 @@ Partial Class Ventas
|
|||||||
DtVentasNC.Rows(0)("TCCambioValuacion") = factura.TipoCambio
|
DtVentasNC.Rows(0)("TCCambioValuacion") = factura.TipoCambio
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion)
|
factura.Timbre = PreParaTimbre(factura)
|
||||||
|
|
||||||
'Registramos la venta
|
'Registramos la venta
|
||||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, factura, tmpcon, -1, ObjBancos, EsNCAmortizacion:=True)
|
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, factura, tmpcon, -1, ObjBancos, EsNCAmortizacion:=True)
|
||||||
@@ -13083,7 +13083,6 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If HdnTipoDescuento.Value = "3" And DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero() > 0 Then
|
If HdnTipoDescuento.Value = "3" And DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero() > 0 Then
|
||||||
|
|
||||||
Timbre.CFDIRelacionados.TipoRelacion = "07"
|
Timbre.CFDIRelacionados.TipoRelacion = "07"
|
||||||
Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo"
|
Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo"
|
||||||
Else
|
Else
|
||||||
@@ -13115,21 +13114,32 @@ Partial Class Ventas
|
|||||||
Timbre.CFDIRelacionados.TipoRelacionTexto = "09-Factura generada por pagos diferidos"
|
Timbre.CFDIRelacionados.TipoRelacionTexto = "09-Factura generada por pagos diferidos"
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
|
'SI ES NOTA DE CREDITO O REFACTURACION
|
||||||
For Each Dr As DataRow In DtVentasNC.Rows
|
If Obj.TipoDocto.Contiene("Egs", "Dev") OrElse (NuevaFactura = 1) Then
|
||||||
Timbre.CFDIRelacionados.UUID.Add(Dr("FolioFiscal").ToString())
|
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
|
||||||
Next
|
Timbre.CFDIRelacionados.UUID.Clear()
|
||||||
Else
|
For Each Dr As DataRow In DtVentasNC.Rows
|
||||||
If ListaAnticiposAplicados IsNot Nothing AndAlso ListaAnticiposAplicados.Count > 0 Then
|
Timbre.CFDIRelacionados.UUID.Add(Dr("FolioFiscal").ToString())
|
||||||
For Each Ant As Modelos.MAnticipoRelacionado In ListaAnticiposAplicados
|
|
||||||
Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal)
|
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
If Not String.IsNullOrEmpty(HdnFolioFiscalNC.Value.Trim()) AndAlso HdnFolioFiscalNC.Value <> "0" Then
|
If Not String.IsNullOrEmpty(HdnFolioFiscalNC.Value.Trim()) AndAlso HdnFolioFiscalNC.Value <> "0" Then
|
||||||
|
Timbre.CFDIRelacionados.UUID.Clear()
|
||||||
Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
|
Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
|
||||||
End If
|
End If
|
||||||
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
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -30147,7 +30157,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Next
|
Next
|
||||||
End Sub
|
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 Total As Decimal = 0, SubTotal As Decimal = 0, Saldo As Decimal = 0
|
||||||
|
|
||||||
Dim TmpDT As DataTable = Nothing
|
Dim TmpDT As DataTable = Nothing
|
||||||
@@ -30309,7 +30319,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not NCDescuento Then
|
If Not NCDescuento AndAlso ReasignarTmpDT Then
|
||||||
Me.TmpDT = TmpDT
|
Me.TmpDT = TmpDT
|
||||||
End If
|
End If
|
||||||
'CARGA FACTURA A LA CUAL SE APLICA LA NC
|
'CARGA FACTURA A LA CUAL SE APLICA LA NC
|
||||||
|
|||||||
Reference in New Issue
Block a user