--FIX aplicacion de nc con relacion manual
This commit is contained in:
@@ -7572,7 +7572,7 @@ Partial Class Ventas
|
||||
UpFacturasRelacionadas.Update()
|
||||
End Sub
|
||||
Protected Sub CreaTmpFacturasRelacionadas()
|
||||
If CveVenta <= 0 OrElse EsCreaApartirDe Then
|
||||
If CveVenta <= 0 OrElse EsCreaApartirDe OrElse Me.AplicoNCFacturaActual Then
|
||||
Me.TmpDTFacturasRelacionadas = New DataTable()
|
||||
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("CveVenta", GetType(Integer)))
|
||||
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("SerieFolio", GetType(String)))
|
||||
@@ -7580,7 +7580,7 @@ Partial Class Ventas
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub LnkAgregarFacturaRelacionada_Click(sender As Object, e As EventArgs)
|
||||
If CveVenta <= 0 OrElse EsCreaApartirDe Then
|
||||
If CveVenta <= 0 OrElse EsCreaApartirDe OrElse Me.AplicoNCFacturaActual Then
|
||||
If Me.TmpDTFacturasRelacionadas Is Nothing Then
|
||||
CreaTmpFacturasRelacionadas()
|
||||
End If
|
||||
@@ -7611,7 +7611,7 @@ Partial Class Ventas
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAgregarFolioFiscalRelacionada_Click(sender As Object, e As EventArgs)
|
||||
If CveVenta <= 0 OrElse EsCreaApartirDe Then
|
||||
If CveVenta <= 0 OrElse EsCreaApartirDe OrElse Me.AplicoNCFacturaActual Then
|
||||
If Me.TmpDTFacturasRelacionadas Is Nothing Then
|
||||
CreaTmpFacturasRelacionadas()
|
||||
End If
|
||||
@@ -7641,7 +7641,7 @@ Partial Class Ventas
|
||||
|
||||
End Sub
|
||||
Protected Sub BtnAgregarFacturasRelaciondas_Click(sender As Object, e As EventArgs)
|
||||
If CveVenta <= 0 OrElse EsCreaApartirDe Then
|
||||
If CveVenta <= 0 OrElse EsCreaApartirDe OrElse Me.AplicoNCFacturaActual Then
|
||||
If Me.TmpDTFacturasRelacionadas Is Nothing OrElse Me.TmpDTFacturasRelacionadas.Rows.Count = 0 Then
|
||||
Me.AplicaRelacionManual = False
|
||||
Alert("No hay facturas para relacionar", TipoMensaje.MsgAdvertencia)
|
||||
@@ -7655,7 +7655,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
Me.AplicaRelacionManual = True
|
||||
RegistraScript("$('#DivFacturasRelaciondas').modal('hide');", "R1")
|
||||
RegistraScript("$('#DivFacturasRelacionadas').modal('hide');", "R1")
|
||||
Alert("Las facturas seleccionadas se relacionaran con la factura nueva")
|
||||
End If
|
||||
|
||||
@@ -13509,25 +13509,6 @@ Partial Class Ventas
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = ""
|
||||
End If
|
||||
|
||||
'SI LAS FACTURAS SE RELACIONARAN MANUALMENTE SE AGREGAN
|
||||
If Me.AplicaRelacionManual AndAlso DdlTipoRelacionARelacionar.SelectedValue.ToEntero() > 0 Then
|
||||
|
||||
Dim CveTipoRelacion As Integer = DdlTipoRelacionARelacionar.SelectedValue.ToEntero()
|
||||
|
||||
Obj.CveTipoRelacion = DdlTipoRelacionARelacionar.SelectedValue.ToEntero()
|
||||
|
||||
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {CveTipoRelacion}")
|
||||
|
||||
Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
|
||||
|
||||
For Each GvRow As GridViewRow In GvFacturasRelacionadas.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
Timbre.CFDIRelacionados.UUID.Add(GvRow.DataKey("FolioFiscal").Replace("test", ""))
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
'DEVOLUCIONES DE OTRA VENTA, APLICADAS EN UNA NUEVA
|
||||
If UsuarioActual.CveEmpresa.Contiene(1, 189) AndAlso Obj.TipoDocto = "Ing" AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then
|
||||
If ListaDevolucionesAplicadas IsNot Nothing AndAlso ListaDevolucionesAplicadas.Count > 0 Then
|
||||
@@ -13548,6 +13529,27 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
'SI LAS FACTURAS SE RELACIONARAN MANUALMENTE SE AGREGAN
|
||||
If Me.AplicaRelacionManual AndAlso DdlTipoRelacionARelacionar.SelectedValue.ToEntero() > 0 Then
|
||||
|
||||
Dim CveTipoRelacion As Integer = DdlTipoRelacionARelacionar.SelectedValue.ToEntero()
|
||||
|
||||
Obj.CveTipoRelacion = DdlTipoRelacionARelacionar.SelectedValue.ToEntero()
|
||||
|
||||
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {CveTipoRelacion}")
|
||||
|
||||
Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
|
||||
|
||||
Timbre.CFDIRelacionados.UUID.Clear()
|
||||
|
||||
For Each GvRow As GridViewRow In GvFacturasRelacionadas.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
Timbre.CFDIRelacionados.UUID.Add(GvRow.DataKey("FolioFiscal").Replace("test", ""))
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
Dim totSubTotal As Decimal = Obj.SubTotal
|
||||
Dim totIVA As Decimal = Obj.IVA
|
||||
Dim totRetIVA As Decimal = Obj.RetIVA
|
||||
@@ -30222,6 +30224,13 @@ Partial Class Ventas
|
||||
CveVentaUsadoDevolucionEfectivo = DdlVentaUsado.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
'SI SE VA APLICAR A LA FACTURA ACTUAL, NO UTILIZAR LOS DATOS DE AMORTIZACION
|
||||
Me.TmpDTAnticiposNCIxCCliente = Nothing
|
||||
GVAnticipos.DataSource = Me.TmpDTAnticiposNCIxCCliente
|
||||
GVAnticipos.DataBind()
|
||||
DdlTipoAmortizacionAnticipo.SelectedValueExist("-1")
|
||||
DdlTipoRelacionAnticipo.SelectedValueExist("-1")
|
||||
|
||||
AplicarNC(DdlNCPS.SelectedValue.ToEntero(), EsNCAmortizacion:=ChkAplicaNCAnticipo.Checked, AplicaImpuestosLocales:=AplicaImpuestosLocales, AplicaNuevoDocumento:=AplicaNuevoDocumento, AplicoNCFacturaActual:=True)
|
||||
|
||||
End Sub
|
||||
@@ -39427,6 +39436,19 @@ Partial Class Ventas
|
||||
|
||||
Protected Sub LnkFacturasRelacionadas_Click(sender As Object, e As EventArgs)
|
||||
CargaFacturasARelacionar()
|
||||
If Me.AplicoNCFacturaActual Then
|
||||
|
||||
DivDdlFacturaRela.Visible = True
|
||||
BtnAgregarFacturasRelaciondas.Visible = True
|
||||
DdlTipoRelacionARelacionar.Enabled = True
|
||||
DdlFacturaARelacionar.Enabled = True
|
||||
|
||||
Me.TmpDTFacturasRelacionadas = Nothing
|
||||
|
||||
GvFacturasRelacionadas.Columns(2).Visible = True
|
||||
GvFacturasRelacionadas.DataSource = Me.TmpDTFacturasRelacionadas
|
||||
GvFacturasRelacionadas.DataBind()
|
||||
End If
|
||||
RegistraScript("$('#DivFacturasRelacionadas').modal('show')")
|
||||
UpFacturasRelacionadas.Update()
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user