diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 426f396e0..5ae6fb294 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -7131,13 +7131,22 @@ Public Class ClsPaginas
Dim VendedorMail As String = ""
Dim VendedorTelefono As String = ""
Dim VendedorCelular As String = ""
- Dim RowVendedor As DataRow = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveVendedor = {0}", Vta.CveVendedor.ToString))
+
+ Dim RowVendedor As DataRow = Nothing
+
+ Dim ObjVendedores As New ClsVtaVendedores
+ If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then
+ RowVendedor = ObjVendedores.DtResultados.FiltroPrimero(String.Format("CveVendedor = {0}", Vta.CveVendedor.ToString))
+ End If
+ ObjVendedores.Dispose()
+
If Not IsNothing(RowVendedor) Then
VendedorNombre = RowVendedor("Vendedor").ToString
VendedorMail = RowVendedor("Correo").ToString
VendedorTelefono = RowVendedor("Telefono").ToString
VendedorCelular = RowVendedor("Celular").ToString
End If
+
params.Add(New ReportParameter("VendedorNombre", VendedorNombre))
params.Add(New ReportParameter("VendedorMail", VendedorMail))
params.Add(New ReportParameter("VendedorTelefono", VendedorTelefono))
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index e9bdcbea7..7a03c7d0b 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -4820,24 +4820,55 @@ Namespace Modelos
Return Retorno
End If
+
If Vigencia.Estado.ToUpper().Contains("CANCELADO") Then
ContinuarCancelacion = False
ObtenerAcuse = True
- Dim solicitud = New WSGF.Service1SoapClient()
- Dim acuse = solicitud.GetAcuse(UsuarioActual.Empresa.RFC, "rene.molina@adsistemas.mx", "rene2018", FolioFiscal)
+ RequiereAceptacion = False
- If acuse.Estado = 0 Then
- Dim xmlAcuse = New System.Xml.XmlDocument()
- xmlAcuse.LoadXml(DecodeBase64(acuse.CfdiB64))
- CancelacionAcuse = xmlAcuse.GetElementsByTagName("SignatureValue")(0).InnerText
- CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate()
- CveEstatus = 5
- Else
+ 'VERIFICA EN EL SERVICIO SI SE CANCELO
+ Try
+ Dim solicitud = New WSGF.Service1SoapClient()
+ Dim acuse = solicitud.GetAcuse(UsuarioActual.Empresa.RFC, "rene.molina@adsistemas.mx", "rene2018", FolioFiscal)
+
+ If acuse.Estado = 0 Then
+ Dim xmlAcuse = New System.Xml.XmlDocument()
+ xmlAcuse.LoadXml(DecodeBase64(acuse.CfdiB64))
+ CancelacionAcuse = xmlAcuse.GetElementsByTagName("SignatureValue")(0).InnerText
+ CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate()
+ CveEstatus = 5
+ Else
+ CancelacionFecha = Now.Date
+ CancelacionAcuse = ""
+ CveEstatus = 5
+ End If
+ Catch ex As Exception
+ GuardaLog(ex.ToString())
CancelacionFecha = Now.Date
CancelacionAcuse = ""
- CveEstatus = 5
+ End Try
+
+ 'SI NO SE PUDO OBTENER DEL SERVICIO, UTILIZA EL METODO DE CANCELACION PARA OBTENER EL ACUSE
+ If CancelacionAcuse = "" Then
+ If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, TotalT, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion, FolioSustitucion:=FolioSustitucion) Then
+ 'GENERAMOS EL ACUSE Y MANDAMOS MAIL DE CON EL ACUSE DE CANCELACIÓN
+ If RequiereAceptacion Then
+ CancelacionFecha = Now.Date
+ CveEstatus = 20
+ Else
+ CancelacionFecha = ObjCancelacion.CancelacionFecha
+ CveEstatus = 5
+ End If
+ CancelacionAcuse = ObjCancelacion.CancelacionAcuse
+ Else
+ Retorno.Mensaje = "Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.
Origen del error: WebService www.sat.gob.mx"
+ Retorno.TipoMensaje = TipoMensaje.MsgError
+
+ Return Retorno
+ End If
End If
+
ElseIf Vigencia.Estado.ToUpper().Contains("VIGENTE") Then
If Vigencia.EstatusCancelacion.ToUpper() = "EN PROCESO" Then
@@ -9304,21 +9335,28 @@ Namespace Modelos
End Set
End Property
-
-
- Property GlobalDTContaConceptosContables(CvePlantillaPoliza As Integer) As DataTable
+ Property GlobalDTContaConceptosContables(CveConceptoContable As Integer) As DataTable
Get
- If CvePlantillaPoliza <> -1 Then
- Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable), String.Format("CvePlantillaPoliza = {0}", CvePlantillaPoliza), "", DataViewRowState.CurrentRows)
+ Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables")
+ 'sino existe, recarga los datos
+ If HttpContext.Current.Application(AppNombre) Is Nothing Then
+ Using ObjContabilidad As New ClsContabilidad
+ If ObjContabilidad.GetConta_ConceptosContables() Then HttpContext.Current.Application(AppNombre) = ObjContabilidad.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing
+ End Using
+
+ End If
+ If CveConceptoContable <> -1 Then
+ Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveConceptoContable = {0}", CveConceptoContable), "", DataViewRowState.CurrentRows)
GlobalDTContaConceptosContables = Dv.ToTable
Dv.Dispose()
Else
- GlobalDTContaConceptosContables = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable)
+ GlobalDTContaConceptosContables = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
- HttpContext.Current.Application("GlobalDTContaConceptosContables") = value
+ Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables")
+ HttpContext.Current.Application(AppNombre) = value
End Set
End Property
#End Region
diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb
index 141331bbf..191c38d6e 100644
--- a/App_Code/Timbrado.vb
+++ b/App_Code/Timbrado.vb
@@ -133,6 +133,10 @@ Public Class Timbrado
Dim Retorno As Boolean = False
Dim MsgCancelacion As New StringBuilder
+ If CvePACCancelacion = 3 Then
+ ValidaFactura = False
+ End If
+
If Not (Empresa.Funcionalidad(529) = "1") Then
If ValidaFactura Then
Dim Vigencia = VerificarVigenciaSAT(FolioFiscal, RFCEmisor, RFCReceptor, Total.ToString(), True)
@@ -448,28 +452,42 @@ Public Class Timbrado
Dim resp As Profact.TimbraCFDI.ResultadoConsulta
resp = conector.ObtieneCFDI(RFCEmisor, FolioFiscal)
MsgCancelacion.AppendFormat("-3.3")
- If resultadoCancelacion.Exitoso Then
+
+ 'VERIFICA SI SE CANCELO O FUE CANCELADO PREVIAMENTE
+ If resultadoCancelacion.Exitoso OrElse resultadoCancelacion.NumeroError = "202" Then
MsgCancelacion.AppendFormat("-3.4")
CancelacionMensaje = resultadoCancelacion.Descripcion
Dim xmlDoc As New System.Xml.XmlDocument()
+ MsgCancelacion.AppendFormat("-3.4.1")
Try
xmlDoc.LoadXml(Encoding.UTF8.GetString(Convert.FromBase64String(resp.Xml)))
Catch ex As Exception
- xmlDoc.LoadXml(resp.Xml)
+ If resp.NumeroError.ToEntero() > 0 Then
+ CancelacionMensaje = resp.Descripcion
+ Else
+ Try
+ xmlDoc.LoadXml(resp.Xml)
+ Catch ex2 As Exception
+ Me.OnError("Ocurrió un error al leer el xml", ex)
+ End Try
+ End If
End Try
- MsgCancelacion.AppendFormat("-3.4.1")
+ If xmlDoc.HasChildNodes Then
+ Dim xpath As String = "Acuse/Folios"
+ Dim nodes = xmlDoc.SelectNodes(xpath)
+ CancelacionState = xmlDoc.GetElementsByTagName("EstatusUUID")(0).InnerText.ToEntero
+ MsgCancelacion.AppendFormat("-3.4.2")
+ xpath = "Acuse/Signature"
+ nodes = xmlDoc.SelectNodes(xpath)
+ MsgCancelacion.AppendFormat("-3.4.3")
+ CancelacionAcuse = xmlDoc.GetElementsByTagName("SignatureValue")(0).InnerText
+ CancelacionFecha = xmlDoc.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate
+ Else
+ CancelacionFecha = Now
+ End If
- Dim xpath As String = "Acuse/Folios"
- Dim nodes = xmlDoc.SelectNodes(xpath)
- CancelacionState = xmlDoc.GetElementsByTagName("EstatusUUID")(0).InnerText.ToEntero
- MsgCancelacion.AppendFormat("-3.4.2")
- xpath = "Acuse/Signature"
- nodes = xmlDoc.SelectNodes(xpath)
- MsgCancelacion.AppendFormat("-3.4.3")
- CancelacionAcuse = xmlDoc.GetElementsByTagName("SignatureValue")(0).InnerText
- CancelacionFecha = xmlDoc.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate
Retorno = True
Else
MsgCancelacion.AppendFormat("-3.5")
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index e50e6e1ac..78d5d76c9 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -320,6 +320,7 @@ Partial Class PopUpVerFactura
+
Dim lrds As New List(Of ReportDataSource)
Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = tablaReporte}
lrds.Add(rds)
@@ -4266,19 +4267,24 @@ Partial Class PopUpVerFactura
End If
ObjAcum.Dispose()
- Dim Dia As String = {"lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"}(If((Weekday(Today) - 2) = -1, 7, Weekday(Today) - 2))
- Dim Mes As String = {"enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"}(Month(Today) - 1)
+ 'Dim Dia As String = {"lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"}(If((Weekday(Today) - 2) = -1, 7, Weekday(Today) - 2))
+ 'Dim Mes As String = {"enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"}(Month(Today) - 1)
- Dim FechaConFormato As String = String.Format("{0}, {1} de {2} de {3}", Dia, Day(Today), Mes, Year(Today))
+ 'Dim FechaConFormato As String = String.Format("{0}, {1} de {2} de {3}", Dia, Day(Today), Mes, Year(Today))
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("Direccion", Almacen))
- params.Add(New ReportParameter("FechaConFormato", FechaConFormato))
+ params.Add(New ReportParameter("FechaConFormato", Now.ToString("dd/MM/yyyy")))
'params.Add(New ReportParameter("FechaInicial", Fecha))
'params.Add(New ReportParameter("FechaFinal", Today.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Sucursal", "Sucursal"))
params.Add(New ReportParameter("Cliente", NombreCliente))
+ params.Add(New ReportParameter("Folio", Folio))
+ params.Add(New ReportParameter("FechaImpresion", Now.ToString("dd/MM/yyyy hh:mm tt")))
+ params.Add(New ReportParameter("Recibio", Recibio))
+ params.Add(New ReportParameter("Observaciones", Observaciones))
+ 'params.Add(New ReportParameter("Observaciones", "Observaciones con un tamaño mas grande para ver como se ve en el ticket chico."))
ImprimirPDF(String.Format("Empresas/{0}/Formatos/UsadosEntradas.rdlc", UsuarioActual.CveEmpresa), DtMovimientos, params, "Reporte entrada usados", "PDF", "DsInventarios")
Case 7
diff --git a/CxC/RepCxC.aspx b/CxC/RepCxC.aspx
index 5baadfd42..da8b8d323 100644
--- a/CxC/RepCxC.aspx
+++ b/CxC/RepCxC.aspx
@@ -347,7 +347,7 @@