Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -897,6 +897,11 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
RealizarMovimientoVirtual = True
|
RealizarMovimientoVirtual = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'SI VA PASAR POR EL ALMACEN TRANSITORIO, DEBE TRASPASAR LOS VIRTUALES AHI PRIMERO
|
||||||
|
If ChkTransitorio.Checked Then
|
||||||
|
CveAlmacenVirtualEntrada = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenTransitorio.SelectedValue.ToEntero).FiltroPrimero("")("CveAlmacenVirtual").ToString().ToEntero()
|
||||||
|
End If
|
||||||
|
|
||||||
'VALIDA ALMACEN DISTINTA SUCURSAL DEBE SER TRANSITORIO
|
'VALIDA ALMACEN DISTINTA SUCURSAL DEBE SER TRANSITORIO
|
||||||
If Not UsuarioActual.CveEmpresa.Contiene(7, 140) Then '[IPP] EMPRESA VIGILANCIA NO OCUPA TRANSITORIOS - TIENEN MIL SUCURSALES Xd
|
If Not UsuarioActual.CveEmpresa.Contiene(7, 140) Then '[IPP] EMPRESA VIGILANCIA NO OCUPA TRANSITORIOS - TIENEN MIL SUCURSALES Xd
|
||||||
If Not ChkTransitorio.Checked Then
|
If Not ChkTransitorio.Checked Then
|
||||||
@@ -1920,7 +1925,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||||
|
|
||||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero()
|
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero()
|
||||||
Dim CveAlmacenVirtualSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenDestino").ToEntero).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero()
|
Dim CveAlmacenVirtualSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacenTransitorio).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero()
|
||||||
|
|
||||||
'SI EL ALMACEN ORIGEN ES DE APOPYO LOGISTICO EL ALMACEN VIRTUAL DEBE SER DE APOYO LOGISTICO
|
'SI EL ALMACEN ORIGEN ES DE APOPYO LOGISTICO EL ALMACEN VIRTUAL DEBE SER DE APOYO LOGISTICO
|
||||||
'Dim CveAlmacenVirtual As Integer = -1
|
'Dim CveAlmacenVirtual As Integer = -1
|
||||||
@@ -1993,9 +1998,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Else
|
'Else
|
||||||
TextoError = "La Sucursal no tiene creado un almacen virtual"
|
' TextoError = "La Sucursal no tiene creado un almacen virtual"
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -786,7 +786,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
Dim SeriesPago As New List(Of String)
|
Dim SeriesPago As New List(Of String)
|
||||||
|
|
||||||
Dim MsgError As String = ""
|
Dim MsgError As String = ""
|
||||||
Dim NCGeneradas As New List(Of Modelos.Factura.MMensajeFactura)
|
Dim NCGeneradas As New List(Of RespuestaNotaCredrito)
|
||||||
Dim ListaFacturasGenerarNC As New List(Of Modelos.Factura)
|
Dim ListaFacturasGenerarNC As New List(Of Modelos.Factura)
|
||||||
|
|
||||||
Dim ImporteSeleccionado As Decimal = 0
|
Dim ImporteSeleccionado As Decimal = 0
|
||||||
@@ -1563,13 +1563,14 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso MsgError = "" Then
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso MsgError = "" Then
|
||||||
If MsgError = "" Then
|
If MsgError = "" Then
|
||||||
If ListaFacturasGenerarNC.Count > 0 Then
|
If ListaFacturasGenerarNC.Count > 0 Then
|
||||||
|
|
||||||
For Each Fac As Modelos.Factura In ListaFacturasGenerarNC
|
For Each Fac As Modelos.Factura In ListaFacturasGenerarNC
|
||||||
Dim ListaNC As New List(Of Modelos.Factura)
|
Dim ListaNC As New List(Of Modelos.Factura)
|
||||||
ListaNC.Add(Fac)
|
ListaNC.Add(Fac)
|
||||||
|
|
||||||
Dim Resp As Modelos.Factura.MMensajeFactura = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaNC)
|
Dim Resp = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaNC)
|
||||||
|
|
||||||
If Resp.CveVenta > 0 Then
|
If Resp IsNot Nothing AndAlso Resp.Respuesta IsNot Nothing AndAlso Resp.Respuesta.CveVenta > 0 Then
|
||||||
NCGeneradas.Add(Resp)
|
NCGeneradas.Add(Resp)
|
||||||
Else
|
Else
|
||||||
MsgError = "No se pudo generar la nota de crédito"
|
MsgError = "No se pudo generar la nota de crédito"
|
||||||
@@ -1691,8 +1692,20 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
|
|
||||||
Dim TextoComplementoPago = EmitirComplementoPago(CveIE, CveVentasPago, SeriesPago)
|
Dim TextoComplementoPago = EmitirComplementoPago(CveIE, CveVentasPago, SeriesPago)
|
||||||
|
|
||||||
For Each NC In NCGeneradas
|
For Each RespuestaNotaCredito In NCGeneradas
|
||||||
StrMsg.AppendFormat("Nota de crédito generada correctamente.<br/><br/> Folio: <a href='/Ventas/Ventas.aspx?CveVenta={0}' target='_blank' class='Texto'>{1}</a><br/>", NC.CveVenta, NC.SerieFolio)
|
If RespuestaNotaCredito IsNot Nothing AndAlso RespuestaNotaCredito.Respuesta IsNot Nothing Then
|
||||||
|
Try
|
||||||
|
Dim ObjTimbradoNC As New Timbrado
|
||||||
|
Dim TimbroNC = ObjTimbradoNC.TimbrarFactura(UsuarioActual, RespuestaNotaCredito.ObjFacturaNC)
|
||||||
|
If Not TimbroNC Then
|
||||||
|
Alert(ObjTimbradoNC.MensajeErrorCFDI, TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
ObjTimbradoNC = Nothing
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al timbrar la NC.", ex)
|
||||||
|
End Try
|
||||||
|
StrMsg.AppendFormat("Nota de crédito generada correctamente.<br/><br/> Folio: <a href='/Ventas/Ventas.aspx?CveVenta={0}' target='_blank' class='Texto'>{1}</a><br/>", RespuestaNotaCredito.Respuesta.CveVenta, RespuestaNotaCredito.Respuesta.SerieFolio)
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Alert($"{StrMsg.ToString}<br/><br/>{TextoComplementoPago}", TipoMensaje.MsgInformacion, If(ChkSeguirRegistrando.Checked, "location.href =""#""", "location.href =""/Bancos/RepCxCCliente.aspx"""))
|
Alert($"{StrMsg.ToString}<br/><br/>{TextoComplementoPago}", TipoMensaje.MsgInformacion, If(ChkSeguirRegistrando.Checked, "location.href =""#""", "location.href =""/Bancos/RepCxCCliente.aspx"""))
|
||||||
@@ -1741,177 +1754,335 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
#Region " N O T A - D E - C R E D I T O"
|
#Region " N O T A - D E - C R E D I T O"
|
||||||
|
Private Class RespuestaNotaCredrito
|
||||||
|
Public Property ObjFacturaNC As Modelos.Factura
|
||||||
|
Public Property Respuesta As Modelos.Factura.MMensajeFactura
|
||||||
|
End Class
|
||||||
|
|
||||||
Private Function GenerarNC(SqlTransaccion As SqlClient.SqlTransaction, ObjConta As ClsContPAQi, ListaVentasGenerarNC As List(Of Modelos.Factura)) As Modelos.Factura.MMensajeFactura
|
Private Function GenerarNC(SqlTransaccion As SqlClient.SqlTransaction, ObjConta As ClsContPAQi, ListaVentasGenerarNC As List(Of Modelos.Factura)) As RespuestaNotaCredrito
|
||||||
Dim ObjFacturaDevolucion = New Modelos.Factura(UsuarioActual)
|
Dim Retorno As New RespuestaNotaCredrito()
|
||||||
ObjFacturaDevolucion.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.HTML
|
Try
|
||||||
ObjFacturaDevolucion.CveUsuario = UsuarioActual.CveUsuario
|
|
||||||
ObjFacturaDevolucion.UsuarioCreo = UsuarioActual.Usuario
|
|
||||||
|
|
||||||
Dim CveSubProyecto As Integer = Me.CveSubProyecto
|
Dim ObjFacturaDevolucion = New Modelos.Factura(UsuarioActual)
|
||||||
Dim CveMoneda As Integer = Me.CveMoneda
|
ObjFacturaDevolucion.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.HTML
|
||||||
Dim CveCliente As Integer = Me.CveCliente
|
ObjFacturaDevolucion.CveUsuario = UsuarioActual.CveUsuario
|
||||||
|
ObjFacturaDevolucion.UsuarioCreo = UsuarioActual.Usuario
|
||||||
|
|
||||||
If CveSubProyecto <= 0 Then
|
Dim CveSubProyecto As Integer = Me.CveSubProyecto
|
||||||
CveSubProyecto = ListaVentasGenerarNC(0).CveSubProyecto
|
Dim CveMoneda As Integer = Me.CveMoneda
|
||||||
End If
|
Dim CveCliente As Integer = Me.CveCliente
|
||||||
|
|
||||||
If CveMoneda <= 0 Then
|
|
||||||
CveMoneda = ListaVentasGenerarNC(0).CveMoneda
|
|
||||||
End If
|
|
||||||
|
|
||||||
If CveCliente <= 0 Then
|
|
||||||
CveCliente = ListaVentasGenerarNC(0).CveCliente
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim Folio As Integer = -1
|
|
||||||
Dim Serie As String = "-1"
|
|
||||||
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.CveEmpresa = UsuarioActual.CveEmpresa
|
|
||||||
ObjFacturaDevolucion.TipoCambio = If(Me.CveMoneda = 1, 1, GlobalTipoCambio(Now).FormatoNumero(4).ToDecimal())
|
|
||||||
ObjFacturaDevolucion.ConvertirPesos = False
|
|
||||||
ObjFacturaDevolucion.CveMoneda = CveMoneda
|
|
||||||
ObjFacturaDevolucion.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {CveMoneda}")
|
|
||||||
ObjFacturaDevolucion.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda}")
|
|
||||||
ObjFacturaDevolucion.Serie = Serie
|
|
||||||
ObjFacturaDevolucion.Folio = Folio
|
|
||||||
ObjFacturaDevolucion.Fecha = Now
|
|
||||||
ObjFacturaDevolucion.CvePrePoliza = -1
|
|
||||||
ObjFacturaDevolucion.CveMetodoPago = 0
|
|
||||||
ObjFacturaDevolucion.CondicionesPago = 0 ' 0 - Contado, 1 - Credito (CHECAR)
|
|
||||||
ObjFacturaDevolucion.FormaPago = 0
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.TipoDocto = "Egs"
|
|
||||||
ObjFacturaDevolucion.Fecha = Now
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.Version = "3.3"
|
|
||||||
ObjFacturaDevolucion.CveMetodoPago33 = 1
|
|
||||||
ObjFacturaDevolucion.MetodoPago33 = "Pago en una sola exhibición"
|
|
||||||
ObjFacturaDevolucion.ClaveMetodoPagoSAT = "PUE"
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.CveFormaPago33 = 21
|
|
||||||
ObjFacturaDevolucion.FormaPago33 = "Aplicación de anticipos"
|
|
||||||
ObjFacturaDevolucion.FormaPagoSAT33 = "30"
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.MetodoPago = ""
|
|
||||||
ObjFacturaDevolucion.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {ObjFacturaDevolucion.CveMetodoPago33}")
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.CveSubProyecto = CveSubProyecto
|
|
||||||
ObjFacturaDevolucion.SetSubProyecto()
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.CveCliente = CveCliente
|
|
||||||
ObjFacturaDevolucion.SetCliente()
|
|
||||||
|
|
||||||
Dim ObjCliente As New ClsClientes
|
|
||||||
If ObjCliente.GetClientes(ObjFacturaDevolucion.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
|
|
||||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.CveUsoCFDI = ObjCliente.CveUsoCFDI
|
|
||||||
ObjFacturaDevolucion.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
|
|
||||||
ObjFacturaDevolucion.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.DtDetalle = CreaDTDetalleNC()
|
|
||||||
|
|
||||||
CargaImpuestos(ObjFacturaDevolucion, ListaVentasGenerarNC, ObjCliente.DesglosaIEPS, ObjCliente.RetIVA, ObjCliente.RetISR)
|
|
||||||
|
|
||||||
|
If CveSubProyecto <= 0 Then
|
||||||
|
CveSubProyecto = ListaVentasGenerarNC(0).CveSubProyecto
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
If ObjCliente.GetSucursales(CveCliente) Then
|
If CveMoneda <= 0 Then
|
||||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
CveMoneda = ListaVentasGenerarNC(0).CveMoneda
|
||||||
ObjFacturaDevolucion.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero())
|
End If
|
||||||
|
|
||||||
|
If CveCliente <= 0 Then
|
||||||
|
CveCliente = ListaVentasGenerarNC(0).CveCliente
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim Folio As Integer = -1
|
||||||
|
Dim Serie As String = "-1"
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.CveEmpresa = UsuarioActual.CveEmpresa
|
||||||
|
ObjFacturaDevolucion.TipoCambio = If(Me.CveMoneda = 1, 1, GlobalTipoCambio(Now).FormatoNumero(4).ToDecimal())
|
||||||
|
ObjFacturaDevolucion.ConvertirPesos = False
|
||||||
|
ObjFacturaDevolucion.CveMoneda = CveMoneda
|
||||||
|
ObjFacturaDevolucion.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {CveMoneda}")
|
||||||
|
ObjFacturaDevolucion.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda}")
|
||||||
|
ObjFacturaDevolucion.Serie = Serie
|
||||||
|
ObjFacturaDevolucion.Folio = Folio
|
||||||
|
ObjFacturaDevolucion.Fecha = Now
|
||||||
|
ObjFacturaDevolucion.CvePrePoliza = -1
|
||||||
|
ObjFacturaDevolucion.CveMetodoPago = 0
|
||||||
|
ObjFacturaDevolucion.CondicionesPago = 0 ' 0 - Contado, 1 - Credito (CHECAR)
|
||||||
|
ObjFacturaDevolucion.FormaPago = 0
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.TipoDocto = "Egs"
|
||||||
|
ObjFacturaDevolucion.Fecha = Now
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||||
|
ObjFacturaDevolucion.Version = "4.0"
|
||||||
|
|
||||||
|
'If ObjFacturaDevolucion.Cliente Is Nothing Then
|
||||||
|
' ObjFacturaDevolucion.Cliente = New Modelos.ClienteModel
|
||||||
|
'End If
|
||||||
|
|
||||||
|
'ObjFacturaDevolucion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal
|
||||||
|
'ObjFacturaDevolucion.Cliente.RegimenFiscal = ClienteRegimenFiscal
|
||||||
Else
|
Else
|
||||||
ObjFacturaDevolucion.CveClienteSucursal = -1
|
ObjFacturaDevolucion.Version = "3.3"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.CveMetodoPago33 = 1
|
||||||
|
ObjFacturaDevolucion.MetodoPago33 = "PUE - Pago en una sola exhibición"
|
||||||
|
ObjFacturaDevolucion.ClaveMetodoPagoSAT = "PUE"
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.CveFormaPago33 = 21
|
||||||
|
ObjFacturaDevolucion.FormaPago33 = "30 - Aplicación de anticipos"
|
||||||
|
ObjFacturaDevolucion.FormaPagoSAT33 = "30"
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.CveSubProyecto = CveSubProyecto
|
||||||
|
ObjFacturaDevolucion.SetSubProyecto()
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.CveCliente = CveCliente
|
||||||
|
ObjFacturaDevolucion.SetCliente()
|
||||||
|
|
||||||
|
Dim ObjCliente As New ClsClientes
|
||||||
|
If ObjCliente.GetClientes(ObjFacturaDevolucion.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
|
||||||
|
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.CveUsoCFDI = ObjCliente.CveUsoCFDI
|
||||||
|
ObjFacturaDevolucion.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
|
||||||
|
ObjFacturaDevolucion.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.DtDetalle = CreaDTDetalleNC()
|
||||||
|
|
||||||
|
CargaImpuestos(ObjFacturaDevolucion, ListaVentasGenerarNC, ObjCliente.DesglosaIEPS, ObjCliente.RetIVA, ObjCliente.RetISR)
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ObjCliente.GetSucursales(CveCliente) Then
|
||||||
|
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||||
|
ObjFacturaDevolucion.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero())
|
||||||
|
Else
|
||||||
|
ObjFacturaDevolucion.CveClienteSucursal = -1
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjCliente.Dispose()
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.CveTipoRelacion = 1
|
||||||
|
ObjFacturaDevolucion.TipoRelacion = "01"
|
||||||
|
ObjFacturaDevolucion.DtVentasRelacionadas = New DataTable
|
||||||
|
ObjFacturaDevolucion.DtVentasRelacionadas.Columns.Add("CveVenta", GetType(Integer))
|
||||||
|
|
||||||
|
Dim Fol As New List(Of String)
|
||||||
|
For Each Fac In ListaVentasGenerarNC
|
||||||
|
Fol.Add(Fac.FolioFiscal)
|
||||||
|
|
||||||
|
Dim RowVenta As DataRow = ObjFacturaDevolucion.DtVentasRelacionadas.NewRow
|
||||||
|
RowVenta("CveVenta") = Fac.CveVenta
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.DtVentasRelacionadas.Rows.Add(RowVenta)
|
||||||
|
Next
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.UUIDRelacionados = Fol
|
||||||
|
|
||||||
|
Select Case ObjFacturaDevolucion.TipoDocto
|
||||||
|
Case "Ing"
|
||||||
|
ObjFacturaDevolucion.TipoDocumento = "Factura"
|
||||||
|
Case "REM"
|
||||||
|
ObjFacturaDevolucion.TipoDocumento = "Remision"
|
||||||
|
Case "Cot"
|
||||||
|
ObjFacturaDevolucion.TipoDocumento = "Cotizacion"
|
||||||
|
Case "Egs"
|
||||||
|
ObjFacturaDevolucion.TipoDocumento = "Nota de Crédito"
|
||||||
|
Case "Dev"
|
||||||
|
ObjFacturaDevolucion.TipoDocumento = "Nota de Devolución"
|
||||||
|
Case Else
|
||||||
|
ObjFacturaDevolucion.TipoDocumento = ""
|
||||||
|
End Select
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.FechaPago = Now
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.CveCorte = -1
|
||||||
|
ObjFacturaDevolucion.CveMesa = -1
|
||||||
|
ObjFacturaDevolucion.NumeroPersonas = 0
|
||||||
|
ObjFacturaDevolucion.CveContrato = -1
|
||||||
|
ObjFacturaDevolucion.DescripcionContrato = ""
|
||||||
|
ObjFacturaDevolucion.CveClienteSucursal = -1
|
||||||
|
ObjFacturaDevolucion.Entrega = ""
|
||||||
|
ObjFacturaDevolucion.CveAlmacen = -1
|
||||||
|
|
||||||
|
Dim DtVentasNC = InicializaDTVentasNC()
|
||||||
|
|
||||||
|
Dim TotalImporte As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("TotalImporte")
|
||||||
|
Dim ImporteIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIVA")
|
||||||
|
Dim ImporteRetIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetIVA")
|
||||||
|
Dim ImporteRetISR As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetISR")
|
||||||
|
Dim ImporteIEPS As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIEPS")
|
||||||
|
Dim Descuento As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("Descuento")
|
||||||
|
Dim Amortizacion As Decimal = 0
|
||||||
|
|
||||||
|
Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion)
|
||||||
|
|
||||||
|
'DETALLES
|
||||||
|
ObjFacturaDevolucion.SubTotal = TotalImporte
|
||||||
|
ObjFacturaDevolucion.Descuento = Descuento
|
||||||
|
ObjFacturaDevolucion.Amortizacion = Amortizacion
|
||||||
|
ObjFacturaDevolucion.IVA = ImporteIVA
|
||||||
|
ObjFacturaDevolucion.RetIVA = ImporteRetIVA
|
||||||
|
ObjFacturaDevolucion.RetISR = ImporteRetISR
|
||||||
|
ObjFacturaDevolucion.IEPS = ImporteIEPS
|
||||||
|
ObjFacturaDevolucion.Total = Total
|
||||||
|
ObjFacturaDevolucion.TotalOtrosConceptos = 0
|
||||||
|
|
||||||
|
For Each Fac In ListaVentasGenerarNC
|
||||||
|
Dim Drt = DtVentasNC.NewRow
|
||||||
|
Drt("CveVenta") = Fac.CveVenta
|
||||||
|
Drt("Importe") = Fac.DescuentoProntoPago
|
||||||
|
Drt("FolioFiscal") = Fac.FolioFiscal
|
||||||
|
DtVentasNC.Rows.Add(Drt)
|
||||||
|
Next
|
||||||
|
|
||||||
|
DtVentasNC.AcceptChanges()
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.DtVentasNC = DtVentasNC
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion, ListaVentasGenerarNC)
|
||||||
|
|
||||||
|
Try
|
||||||
|
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=SqlTransaccion, ObjContPaqTransac:=ObjConta)
|
||||||
|
Retorno.Respuesta = Resp
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al guardar la NC de pronto pago", ex)
|
||||||
|
Retorno.Respuesta = Nothing
|
||||||
|
End Try
|
||||||
|
Retorno.ObjFacturaNC = ObjFacturaDevolucion
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al generar la NC de pronto pago", ex)
|
||||||
|
Retorno = Nothing
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function PreParaTimbre(Obj As Modelos.Factura, ListaVentasGenerarNC As List(Of Modelos.Factura)) As CFDITimbre
|
||||||
|
Dim Timbre As New CFDITimbre
|
||||||
|
Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
|
||||||
|
Timbre.Comprobante.Folio = Obj.Folio.ToString()
|
||||||
|
Timbre.Comprobante.Serie = Obj.Serie
|
||||||
|
Timbre.Comprobante.Fecha = Obj.FechaCP
|
||||||
|
Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
|
||||||
|
Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
|
||||||
|
Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
|
||||||
|
Timbre.Comprobante.SubTotal = Obj.SubTotal
|
||||||
|
Timbre.Comprobante.Descuentos = Obj.Descuento
|
||||||
|
Timbre.Comprobante.Moneda = Obj.MonedaSAT
|
||||||
|
Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString())
|
||||||
|
Timbre.Comprobante.Total = Obj.Total
|
||||||
|
|
||||||
|
Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
|
||||||
|
If Timbre.Comprobante.LugarExpedicion = "" Then
|
||||||
|
Dim aa As String = "no se guardo lugar de expedicion"
|
||||||
|
aa.GuardaLog()
|
||||||
End If
|
End If
|
||||||
ObjCliente.Dispose()
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.CveTipoRelacion = 7
|
Timbre.Comprobante.Confirmacion = ""
|
||||||
ObjFacturaDevolucion.TipoRelacion = "07"
|
|
||||||
ObjFacturaDevolucion.DtVentasRelacionadas = New DataTable
|
|
||||||
ObjFacturaDevolucion.DtVentasRelacionadas.Columns.Add("CveVenta", GetType(Integer))
|
|
||||||
|
|
||||||
Dim Fol As New List(Of String)
|
If Obj.FacturarSucursal Then
|
||||||
For Each Fac In ListaVentasGenerarNC
|
Timbre.Receptor.RFC = Obj.ClienteSucursal.RFC
|
||||||
Fol.Add(Fac.FolioFiscal)
|
Timbre.Receptor.Nombre = Obj.ClienteSucursal.Nombre
|
||||||
|
Timbre.Receptor.DomicilioFiscalReceptor = Obj.ClienteSucursal.CP
|
||||||
|
Else
|
||||||
|
Timbre.Receptor.RFC = Obj.Cliente.RFC
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||||
|
Timbre.Receptor.Nombre = Obj.Cliente.Nombre
|
||||||
|
Else
|
||||||
|
Timbre.Receptor.Nombre = Obj.Cliente.Nombre + " " + Obj.Cliente.RegimenSociedad
|
||||||
|
End If
|
||||||
|
Timbre.Receptor.DomicilioFiscalReceptor = Obj.Cliente.CP
|
||||||
|
End If
|
||||||
|
|
||||||
Dim RowVenta As DataRow = ObjFacturaDevolucion.DtVentasRelacionadas.NewRow
|
Timbre.Receptor.RegimenFiscalReceptor = Obj.Cliente.CodigoRegimenFiscal
|
||||||
RowVenta("CveVenta") = Fac.CveVenta
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.DtVentasRelacionadas.Rows.Add(RowVenta)
|
Timbre.Receptor.ResidenciaFiscal = ""
|
||||||
|
Timbre.Receptor.NumeroRegistroTributario = ""
|
||||||
|
Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDI
|
||||||
|
|
||||||
|
If ListaVentasGenerarNC IsNot Nothing Then
|
||||||
|
Timbre.CFDIRelacionados.UUID.Clear()
|
||||||
|
|
||||||
|
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {Obj.CveTipoRelacion}")
|
||||||
|
|
||||||
|
Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
|
||||||
|
Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
|
||||||
|
|
||||||
|
For Each Fac In ListaVentasGenerarNC
|
||||||
|
Timbre.CFDIRelacionados.UUID.Add(Fac.FolioFiscal)
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim totSubTotal As Decimal = If(UsuarioActual.Empresa.CvePAC = 3, Obj.DtDetalle.SUMD("Total"), Obj.SubTotal) 'Obj.SubTotal
|
||||||
|
Dim totIVA As Decimal = Obj.IVA
|
||||||
|
Dim totRetIVA As Decimal = Obj.RetIVA
|
||||||
|
Dim totRetISR As Decimal = Obj.RetISR
|
||||||
|
|
||||||
|
Dim i As Integer = 1
|
||||||
|
|
||||||
|
'detalles
|
||||||
|
Dim tPS As String = ""
|
||||||
|
|
||||||
|
For Each drr As DataRow In Obj.DtDetalle.Rows
|
||||||
|
If drr("PS").ToString().Length = 1 Then
|
||||||
|
tPS = drr("Obs").ToString()
|
||||||
|
Else
|
||||||
|
If drr("PS").ToString().Length = 0 Then
|
||||||
|
tPS = ""
|
||||||
|
Else
|
||||||
|
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
tPS = tPS.Replace("|", " ")
|
||||||
|
|
||||||
|
If tPS.Length >= 1000 Then
|
||||||
|
Dim tPSRecortado = tPS.Remove(999, tPS.Length - 999)
|
||||||
|
tPS = tPSRecortado
|
||||||
|
End If
|
||||||
|
|
||||||
|
'condicionante, especial
|
||||||
|
If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
|
||||||
|
|
||||||
|
Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString().ToDecimal,
|
||||||
|
.Descripcion = tPS,
|
||||||
|
.ValorUnitario = drr("PU").ToString().ToDecimal,
|
||||||
|
.Importe = If(UsuarioActual.Empresa.CvePAC = 3, drr("Total").ToString().ToDecimal.RoundSQL(2), drr("TotalImporte").ToString().ToDecimal),
|
||||||
|
.Descuento = drr("Descuento").ToString().ToDecimal.RoundSQL(2),
|
||||||
|
.Unidad = drr("UM").ToString(),
|
||||||
|
.ClaveUnidad = drr("SATClaveUM").ToString(),
|
||||||
|
.ClaveProdServ = drr("SATClaveProdServ").ToString(),
|
||||||
|
.Noidentificacion = drr("Noidentificacion").ToString(),
|
||||||
|
.CuentaPredial = drr("CuentaPredial").ToString(),
|
||||||
|
.ImporteGravaIVAAdicional = drr("ImporteIEPS").ToString().ToDecimal,
|
||||||
|
.ObjetoImpuesto = drr("CodigoObjetoImpuesto").ToString()}
|
||||||
|
'verifica suma subtotales
|
||||||
|
If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal.RoundSQL(2) <> concepto.Importe.RoundSQL(2) AndAlso Math.Abs(totSubTotal.RoundSQL(2) - concepto.Importe.RoundSQL(2)) <= 0.01 Then 'proceso de ajusta de decimales
|
||||||
|
concepto.Importe = totSubTotal
|
||||||
|
End If
|
||||||
|
totSubTotal = totSubTotal - concepto.Importe
|
||||||
|
|
||||||
|
'siempre estaremos agregando el iva, auqnue sea en importe cero o tasa cero, para que se emita la factura
|
||||||
|
' If drr("ImporteIVA").ToString().ToDouble > 0 Then
|
||||||
|
|
||||||
|
'si es ingreso amortizado por la totalidad, y arroja el valor total de cero, no debe de impuestos, y si la BASE de calculo es mayor a cero
|
||||||
|
If Timbre.Comprobante.Total > 0 AndAlso concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional > 0 Then
|
||||||
|
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = (concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional).RoundSQL(6), .TasaOCuota = drr("PorcentajeIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString().ToDecimal})
|
||||||
|
End If
|
||||||
|
|
||||||
|
If drr("ImporteIEPS").ToString().ToDouble > 0 Then
|
||||||
|
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = (concepto.Importe - concepto.Descuento).RoundSQL(6), .TasaOCuota = drr("PorcentajeIEPS").ToString().ToDecimal, .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString().ToDecimal})
|
||||||
|
End If
|
||||||
|
|
||||||
|
If drr("ImporteRetIVA").ToString().ToDouble > 0 Then 'si hay retenciones
|
||||||
|
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = (concepto.Importe - concepto.Descuento).RoundSQL(6), .TasaOCuota = drr("PorcentajeRetIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString().ToDecimal})
|
||||||
|
End If
|
||||||
|
|
||||||
|
If drr("ImporteRetISR").ToString().ToDouble > 0 Then 'retención de ISR
|
||||||
|
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = (concepto.Importe - concepto.Descuento).RoundSQL(6), .TasaOCuota = drr("PorcentajeRetISR").ToString().ToDecimal, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString().ToDecimal})
|
||||||
|
End If
|
||||||
|
|
||||||
|
Timbre.Conceptos.Add(concepto)
|
||||||
|
i += 1
|
||||||
Next
|
Next
|
||||||
|
|
||||||
ObjFacturaDevolucion.UUIDRelacionados = Fol
|
Return Timbre
|
||||||
|
|
||||||
Select Case ObjFacturaDevolucion.TipoDocto
|
|
||||||
Case "Ing"
|
|
||||||
ObjFacturaDevolucion.TipoDocumento = "Factura"
|
|
||||||
Case "REM"
|
|
||||||
ObjFacturaDevolucion.TipoDocumento = "Remision"
|
|
||||||
Case "Cot"
|
|
||||||
ObjFacturaDevolucion.TipoDocumento = "Cotizacion"
|
|
||||||
Case "Egs"
|
|
||||||
ObjFacturaDevolucion.TipoDocumento = "Nota de Crédito"
|
|
||||||
Case "Dev"
|
|
||||||
ObjFacturaDevolucion.TipoDocumento = "Nota de Devolución"
|
|
||||||
Case Else
|
|
||||||
ObjFacturaDevolucion.TipoDocumento = ""
|
|
||||||
End Select
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.FechaPago = Now
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.CveCorte = -1
|
|
||||||
ObjFacturaDevolucion.CveMesa = -1
|
|
||||||
ObjFacturaDevolucion.NumeroPersonas = 0
|
|
||||||
ObjFacturaDevolucion.CveContrato = -1
|
|
||||||
ObjFacturaDevolucion.DescripcionContrato = ""
|
|
||||||
ObjFacturaDevolucion.CveClienteSucursal = -1
|
|
||||||
ObjFacturaDevolucion.Entrega = ""
|
|
||||||
ObjFacturaDevolucion.CveAlmacen = -1
|
|
||||||
|
|
||||||
Dim DtVentasNC = InicializaDTVentasNC()
|
|
||||||
|
|
||||||
Dim TotalImporte As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("TotalImporte")
|
|
||||||
Dim ImporteIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIVA")
|
|
||||||
Dim ImporteRetIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetIVA")
|
|
||||||
Dim ImporteRetISR As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetISR")
|
|
||||||
Dim ImporteIEPS As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIEPS")
|
|
||||||
Dim Descuento As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("Descuento")
|
|
||||||
Dim Amortizacion As Decimal = 0
|
|
||||||
|
|
||||||
Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion)
|
|
||||||
|
|
||||||
'DETALLES
|
|
||||||
ObjFacturaDevolucion.SubTotal = TotalImporte
|
|
||||||
ObjFacturaDevolucion.Descuento = Descuento
|
|
||||||
ObjFacturaDevolucion.Amortizacion = Amortizacion
|
|
||||||
ObjFacturaDevolucion.IVA = ImporteIVA
|
|
||||||
ObjFacturaDevolucion.RetIVA = ImporteRetIVA
|
|
||||||
ObjFacturaDevolucion.RetISR = ImporteRetISR
|
|
||||||
ObjFacturaDevolucion.IEPS = ImporteIEPS
|
|
||||||
ObjFacturaDevolucion.Total = Total
|
|
||||||
ObjFacturaDevolucion.TotalOtrosConceptos = 0
|
|
||||||
|
|
||||||
For Each Fac In ListaVentasGenerarNC
|
|
||||||
Dim Drt = DtVentasNC.NewRow
|
|
||||||
Drt("CveVenta") = Fac.CveVenta
|
|
||||||
Drt("Importe") = Fac.DescuentoProntoPago
|
|
||||||
Drt("FolioFiscal") = Fac.FolioFiscal
|
|
||||||
DtVentasNC.Rows.Add(Drt)
|
|
||||||
Next
|
|
||||||
|
|
||||||
DtVentasNC.AcceptChanges()
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.DtVentasNC = DtVentasNC
|
|
||||||
|
|
||||||
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=SqlTransaccion, ObjContPaqTransac:=ObjConta)
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.Dispose()
|
|
||||||
|
|
||||||
|
|
||||||
Return Resp
|
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
@@ -1978,7 +2149,10 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
Row("CveOrdenCompraDetalle") = CveOrdenCompraDetalle
|
Row("CveOrdenCompraDetalle") = CveOrdenCompraDetalle
|
||||||
Row("CveVentaDetalleRemision") = CveVentaDetalleRemision
|
Row("CveVentaDetalleRemision") = CveVentaDetalleRemision
|
||||||
Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion
|
Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion
|
||||||
|
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||||
|
If DrPS IsNot Nothing Then
|
||||||
|
Row("CodigoObjetoImpuesto") = DrPS("CodigoObjetoImpuesto")
|
||||||
|
End If
|
||||||
TmpDT.Rows.Add(Row)
|
TmpDT.Rows.Add(Row)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -2196,6 +2370,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
|
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
|
||||||
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
||||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||||
|
TmpDT.Columns.Add("CodigoObjetoImpuesto", GetType(String))
|
||||||
|
|
||||||
Return TmpDT
|
Return TmpDT
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -7777,6 +7777,11 @@ Partial Class Ventas
|
|||||||
e.Row.FCLiteral("LtCantidadFacturada").Text = e.Row.DBCampo("CantidadFacturadaPed2").ToDecimal.ToString("#,##0.##")
|
e.Row.FCLiteral("LtCantidadFacturada").Text = e.Row.DBCampo("CantidadFacturadaPed2").ToDecimal.ToString("#,##0.##")
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
|
If EsCreaApartirDe Then
|
||||||
|
e.Row.FCLinkButton("imgD").Visible = True
|
||||||
|
e.Row.FCLinkButton("imgE").Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
'If GvInv.Rows.Count > 0 AndAlso ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem" AndAlso e.Row.DataKey("CveVentaDetalle").ToString().ToEntero() > 0 Then
|
'If GvInv.Rows.Count > 0 AndAlso ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem" AndAlso e.Row.DataKey("CveVentaDetalle").ToString().ToEntero() > 0 Then
|
||||||
' e.Row.FCLinkButton("imgE").Enabled = False
|
' e.Row.FCLinkButton("imgE").Enabled = False
|
||||||
' e.Row.FCLinkButton("imgE").ToolTip = "No se puede editar debido a que ya hay un movimiento de almacen."
|
' e.Row.FCLinkButton("imgE").ToolTip = "No se puede editar debido a que ya hay un movimiento de almacen."
|
||||||
@@ -33201,6 +33206,15 @@ Partial Class Ventas
|
|||||||
UpFacturar.Update()
|
UpFacturar.Update()
|
||||||
End If
|
End If
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
|
'REGENERAR EL PDF
|
||||||
|
Try
|
||||||
|
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||||
|
Dim Hilo As New System.Threading.Thread(Sub() RegenerarPDF(CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, strURLHOST))
|
||||||
|
Hilo.Start()
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al regenerar el PDF", ex)
|
||||||
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function DeshabilitarAplicarNotaDeCredito(RFC As String) As Boolean
|
Private Function DeshabilitarAplicarNotaDeCredito(RFC As String) As Boolean
|
||||||
|
|||||||
Reference in New Issue
Block a user