Merge branch 'master' of http://192.168.10.111:8383/SIG
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
|
||||
|
||||
@@ -7723,7 +7723,7 @@ Partial Class Ventas
|
||||
' RBLPago.SelectedValue = "2"
|
||||
'End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso Me.PermiteCredito Then
|
||||
If Me.PermiteCredito Then
|
||||
If IfNull(Request("Op"), "").ToString() = "Cot" OrElse (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0) Then
|
||||
Dim CreditoDispo As Decimal = CargaCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero())
|
||||
If CreditoDispo > 0 Then
|
||||
@@ -13425,6 +13425,14 @@ Partial Class Ventas
|
||||
End If
|
||||
Obj.CveTipoRelacion = DdlTiposRelacion.SelectedValue.ToEntero()
|
||||
If HdnFolioFiscalNC.Value <> "0" And HdnFolioFiscalNC.Value <> "" Then Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
|
||||
|
||||
'SI LA NOTA DE CREDITO ES POR AMORTIZACION DE ANTICIPO , TAMBIEN DEBE TENER EL TIPO RELACION 07
|
||||
If DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero() = 2 AndAlso DdlTipoRelacionAnticipo.SelectedValue.ToEntero() = 7 Then
|
||||
Obj.CveTipoRelacion = 7
|
||||
Timbre.CFDIRelacionados.TipoRelacion = "07"
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = "CFDI por aplicación de anticipo"
|
||||
End If
|
||||
|
||||
End If
|
||||
' cuando es refacturacoin es cfdirelacionado, con relacion 04
|
||||
If Timbre.Comprobante.TipoComprobante = "I" AndAlso NuevaFactura = 1 Then
|
||||
@@ -13501,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
|
||||
@@ -13540,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
|
||||
@@ -30215,6 +30225,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
|
||||
@@ -39420,6 +39437,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