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 @@
- +
diff --git a/Empresas/140/Formatos/Traslado.rdlc b/Empresas/140/Formatos/Traslado.rdlc index 722441982..85672b3ae 100644 --- a/Empresas/140/Formatos/Traslado.rdlc +++ b/Empresas/140/Formatos/Traslado.rdlc @@ -15,7 +15,10 @@ 2.19837cm - 8.85259cm + 6.04844cm + + + 2.80415cm 1.41521cm @@ -196,6 +199,48 @@ + + + + true + true + + + + + Serie + + + + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + @@ -420,6 +465,39 @@ + + + + true + true + + + + + =Fields!Serie.Value + + + + + + + Serie + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + @@ -500,6 +578,7 @@ + @@ -611,7 +690,7 @@ 0.72418in @@ -733,9 +812,9 @@ Textbox4 0.63803cm - 17.07518cm + 16.74886cm 0.6cm - 1.2347cm + 2.82632cm 3 Textbox5 0.03803cm - 17.07518cm + 16.74886cm 0.6cm - 1.18203cm + 1.50835cm 4 + + + + + + Textbox7 + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Código + + + + + + + Textbox9 + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Descripción + + + + + + + Textbox11 + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.32cm + + + + + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad + + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + + + + + =Fields!Codigo.Value + + + + + + + Codigo + + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + + + + + =Fields!PS.Value + + + + + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + + + + + + + + + + + + After + + + + + + + DsInventarios + 0.74054cm + 2.9in + + + + + + 0.29155in + + + + + 2.9in + + + 1.01598in + true + true + + + true + true + + + + + BDH BATERÍAS DISTRIBUCIONES DE HERMOSILLO S.A. DE C.V. + + + + + + + + + =Parameters!Direccion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!FechaConFormato.Value + + + + + + + + + + + FechaConFormato + 1.64702cm + 4.45513cm + 0.4473cm + 2.91087cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Entradas de Usados + + + + + + + Textbox37 + 1.16344cm + 0.38833cm + 7.366cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + Folio: + + + + =Parameters!Folio.Value + + + + + + + Textbox37 + 1.64932cm + 0.4473cm + 4.45513cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo2 + Fit + 0.00031in + 0.00522in + 0.3541in + 0.69825in + 4 + + + + + + true + + + + + Cliente: + + + + =Parameters!Cliente.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.59803in + true + true + + + 1.143cm + 0cm + 2.9in + + + + + + true + true + + + + + Fecha Impresión: + + + + + + + + =Parameters!FechaImpresion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + Recibió: + + + + =Parameters!Recibio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 0.03454cm + 0cm + 2.9in + 3 + + 0.5pt + + + + + true + + + + + Observaciones: + + + + =Parameters!Observaciones.Value + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 3.1in + 3.1in + 0.1in + 0.1in + 0.2in + 0.05118in +