From 84a35794bd3d8a5e81ae5c4a6b9d8b0d4d8677cf Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 4 Jun 2022 18:29:22 -0700 Subject: [PATCH] EMD. PDF Con subreporte de carta porte, asignacion de mercancias --- App_Code/ClsPaginas.vb | 90 +- App_Code/Modelos.vb | 14 + App_Code/Timbres.vb | 18 +- Compras/PopUpVerFactura.aspx.vb | 1020 +- Empresas/13/Formatos/CartaPorteTimbrado.rdlc | 4609 +++++++++ Empresas/13/Formatos/Factura.rdlc | 9404 +++++++++--------- Ventas/Ventas.aspx | 75 +- Ventas/Ventas.aspx.vb | 319 +- 8 files changed, 10523 insertions(+), 5026 deletions(-) create mode 100644 Empresas/13/Formatos/CartaPorteTimbrado.rdlc diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index e5e7ab30e..ae103e7e7 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -55,6 +55,16 @@ Public Class ClsPaginas #Region "Propiedades" + Private Property SubReportData As Modelos.MSubReportData + Get + Return If(IsNothing(ViewState("SubReportData")), Nothing, DirectCast(ViewState("SubReportData"), Modelos.MSubReportData)) + End Get + + Set(value As Modelos.MSubReportData) + ViewState("SubReportData") = value + End Set + End Property + Public Shared ReadOnly Property UrlSitio As String Get If IsNothing(System.Configuration.ConfigurationManager.AppSettings("UrlSitio")) Then @@ -5927,17 +5937,17 @@ Public Class ClsPaginas ''' Opcional Nombre del archivo que se descarga ''' Optional, Formato de Generacion PDF o Excel ''' - Public Sub ImprimirPDF(RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing, Optional Content_Disposition As String = "attachment") + Public Sub ImprimirPDF(RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing, Optional Content_Disposition As String = "attachment", Optional SubReportData As Modelos.MSubReportData = Nothing) 'limpio ReportViwer - ImprimirbytesPDF(StreamPDF(RutaReporte, DataSource, Parametros, NombreArchivo, Formato, MR), NombreArchivo, Formato, Content_Disposition:=Content_Disposition) + ImprimirbytesPDF(StreamPDF(RutaReporte, DataSource, Parametros, NombreArchivo, Formato, MR, SubReportData), NombreArchivo, Formato, Content_Disposition:=Content_Disposition) End Sub - Public Function StreamPDF(RutaReporte As String, DtDatos As DataTable, Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "DataSet1", Optional MR As ReportViewer = Nothing) As Byte() + Public Function StreamPDF(RutaReporte As String, DtDatos As DataTable, Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "DataSet1", Optional MR As ReportViewer = Nothing, Optional SubReportData As Modelos.MSubReportData = Nothing) As Byte() Dim lrds As New List(Of ReportDataSource) Dim rds As New ReportDataSource rds.Name = RDSName rds.Value = DtDatos lrds.Add(rds) - Return StreamPDF(RutaReporte, lrds, Parametros, NombreArchivo, Formato, MR) + Return StreamPDF(RutaReporte, lrds, Parametros, NombreArchivo, Formato, MR, SubReportData) End Function 'Public Function StreamPDF(RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing) As Byte() ' 'limpio ReportViwer @@ -5981,10 +5991,13 @@ Public Class ClsPaginas ' Return Bytes 'End Function - Public Function StreamPDF(RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing) As Byte() + Public Function StreamPDF(RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing, Optional SubReportData As Modelos.MSubReportData = Nothing) As Byte() 'limpio ReportViwer Dim sw As New System.Diagnostics.Stopwatch() sw.Start() + + Me.SubReportData = Nothing + Dim Bytes As Byte() = Nothing Dim CveUsuario As Integer = 0 @@ -6030,12 +6043,21 @@ Public Class ClsPaginas reportobjects.Add(ojext) End If Next + For Each rpds As ReportParameter In Parametros Dim param As New WSRDLC.ReportParameter param.Name = rpds.Name - param.Values = {rpds.Values(0)} + + 'SI ES TEXTO, QUITAR TABS Y OTROS ESPACIOS QUE DEN PROBLEMAS AL MANDAR LA PETICION + If rpds IsNot Nothing AndAlso rpds.Values IsNot Nothing AndAlso rpds.Values.Count > 0 AndAlso rpds.Values(0) IsNot Nothing AndAlso rpds.Values(0).GetType() = GetType(String) Then + param.Values = {rpds.Values(0).Replace(vbVerticalTab, "")} + Else + param.Values = {rpds.Values(0)} + End If + params.Add(param) Next + Bytes = wsreport.StreamNEWPDFBytes(RutaReporte, ds, reportobjects.ToArray(), params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario) wsreport = Nothing params = Nothing @@ -6050,9 +6072,16 @@ Public Class ClsPaginas MR.LocalReport.ReportPath = RutaReporte MR.ProcessingMode = ProcessingMode.Local + + If SubReportData IsNot Nothing Then + Me.SubReportData = SubReportData + AddHandler MR.LocalReport.SubreportProcessing, AddressOf LocalReport_SubreportProcessing + End If + MR.LocalReport.EnableExternalImages = True MR.LocalReport.SetParameters(Parametros) MR.LocalReport.Refresh() + Dim Warnings As Warning() = Nothing Dim StreamIds As String() = Nothing Dim MimeType As String = Nothing @@ -6121,6 +6150,14 @@ Public Class ClsPaginas Return Bytes End Function + Private Sub LocalReport_SubreportProcessing(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs) + If SubReportData IsNot Nothing Then + For Each ds In SubReportData.DataSources + e.DataSources.Add(ds) + Next + End If + End Sub + Public Function ImprimirPDFCrystal(RutaReporte As String, DataSource As DataTable, Parametros As List(Of CrystalParametro), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportDocument = Nothing) As Byte() 'limpio ReportViwer Dim sw As New System.Diagnostics.Stopwatch() @@ -6934,7 +6971,7 @@ Public Class ClsPaginas GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex)) End Try End Sub - Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True) As Byte() + Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True, Optional SubReportData As Modelos.MSubReportData = Nothing) As Byte() Dim retorno As Byte() = Nothing ' Dim ObjVentas As New ClsVentas @@ -7754,6 +7791,13 @@ Public Class ClsPaginas 'Next 'ast.ToString.GuardaLog() + 'PASAR LOS PARAMETROS SI TIENE SUBREPORTE + If SubReportData IsNot Nothing Then + For Each parametro As ReportParameter In SubReportData.Parametros + params.Add(parametro) + Next + End If + Dim Archivo As New System.IO.FileInfo(RutaFormato) If Archivo.Exists Then 'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then @@ -7762,7 +7806,7 @@ Public Class ClsPaginas 'Else ' retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing) 'End If - retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing) + retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData) Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio)) If Guardar Then @@ -7792,7 +7836,7 @@ Public Class ClsPaginas 'Else ' retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing) 'End If - retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing) + retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData) End If Catch ex As Exception GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex)) @@ -7831,12 +7875,12 @@ Public Class ClsPaginas End If 'SITIO DE PRUEBA EN IIS - Dim Url = New Uri(String.Format("{0}{1}", "http://localhost:2202/", Opcion)) - - Try - Dim dataSourceArray As New JArray() - Dim paramsArray As New JArray() - + Dim Url = New Uri(String.Format("{0}{1}", "http://localhost:2202/", Opcion)) + + Try + Dim dataSourceArray As New JArray() + Dim paramsArray As New JArray() + For Each rds As ReportDataSource In DataSource dataSourceArray.Add(New JObject(New JProperty("Nombre", rds.Name), New JProperty("Valor", JArray.Parse(JsonConvert.SerializeObject(rds.Value))))) Next @@ -7850,10 +7894,10 @@ Public Class ClsPaginas New JProperty("ruta", RutaReporte), New JProperty("parametros", paramsArray), New JProperty("dataSource", dataSourceArray) - ) - - Dim data = New StringContent(payload.ToString(), Encoding.UTF8, "application/json") - + ) + + Dim data = New StringContent(payload.ToString(), Encoding.UTF8, "application/json") + Using httpClient = New HttpClient() Using request = New HttpRequestMessage(HttpMethod.Post, Url) 'request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks))) @@ -7863,10 +7907,10 @@ Public Class ClsPaginas Bytes = response.Content.ReadAsByteArrayAsync().Result End If End Using - End Using - Catch ex As Exception - OnError("Ocurrió un error al descargar la factura", ex) - End Try + End Using + Catch ex As Exception + OnError("Ocurrió un error al descargar la factura", ex) + End Try sw.Stop() diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 5e3693e62..0e7dfa58f 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -35,6 +35,20 @@ Namespace Modelos Public Property CveEmpresa As Integer End Class + + Public Class MSubReportData + Public Sub New() + Me.Nombre = "" + Me.SerieFolio = "" + Me.Parametros = New List(Of ReportParameter) + Me.DataSources = New List(Of ReportDataSource) + End Sub + + Public Property Nombre As String + Public Property SerieFolio As String + Public Property Parametros As List(Of ReportParameter) + Public Property DataSources As List(Of ReportDataSource) + End Class Public Class Evento Public Sub New() diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb index 23070a859..3ae384497 100644 --- a/App_Code/Timbres.vb +++ b/App_Code/Timbres.vb @@ -375,7 +375,7 @@ Public Class Timbres Public Property CartaPorte As CFDICartaPorte End Class - Public Shared Function PreParaCartaPorteFactura(CveTimbre As Integer, Obj As Modelos.Factura, UsuarioActual As Usuario) As MMensajeCartaPorte + Public Shared Function PreParaCartaPorteFactura(CveTimbre As Integer, UsuarioActual As Usuario) As MMensajeCartaPorte Dim Retorno As New MMensajeCartaPorte Try @@ -399,7 +399,7 @@ Public Class Timbres Dim ObjGrales As New ClsGenerales - If ObjGrales.GetGralTimbre(CveTimbre, "Man", FI, FF, -1, UsuarioActual.CveEmpresa, -1) Then + If ObjGrales.GetGralTimbre(CveTimbre, "Ing", FI, FF, -1, UsuarioActual.CveEmpresa, -1) Then If ObjGrales.DtResultados.Rows.Count = 1 Then Dim DtMovimientos As DataTable = Nothing @@ -466,16 +466,6 @@ Public Class Timbres End If - If drT("ClaveTipoRemolque1").ToString <> "" Then - Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")} - CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1) - End If - - If drT("ClaveTipoRemolque2").ToString <> "" Then - Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")} - CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2) - End If - Dim DomOrigen As CFDICartaPorteDomicilio = Nothing DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drT("DirOriCalle").ToString, @@ -569,7 +559,7 @@ Public Class Timbres .ClaveUnidad = drr("SATClaveUM").ToString, .Unidad = drr("UM").ToString, .Dimensiones = drr("Dimensiones").ToString, - .PesoenKg = drr("PesoKg").ToString.ToDecimal, + .PesoenKg = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, .MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", ""), .ClaveMaterialPeligroso = drr("ClaveMaterialPeligroso").ToString, .Embalaje = drr("ClaveEmbalaje").ToString, @@ -580,7 +570,7 @@ Public Class Timbres .UUIDComercioExt = "" } - Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal} + Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal} conceptoCarta.DetalleMercancia = DetalleMercancia Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"} diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 887f721e6..2c3283f4a 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -111,6 +111,11 @@ Partial Class PopUpVerFactura End If End If + + If Request("CVETIMBRE") IsNot Nothing AndAlso Request("CVETIMBRE") IsNot Nothing Then + ImprimeFormatoCartaPorteTimbrado(Request("CVETIMBRE").ToString.ToEntero) + End If + If Request("RFC") IsNot Nothing AndAlso Request("File") IsNot Nothing Then Dim Path As String = String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, Request("RFC"), Request("File")) Dim Archivo As New System.IO.FileInfo(Path) @@ -1563,465 +1568,498 @@ Partial Class PopUpVerFactura End Function Private Sub ImprimeFormatoCartaPorteTimbrado(CveTimbre As Integer) - If CveTimbre > 0 Then - - '01 Autotransporte Federal - '02 Transporte Marítimo - '03 Transporte Aéreo - '04 Transporte Ferroviario - '05 Ducto - Dim HtTransporte As New Hashtable() - HtTransporte.Add("01", "Autotransporte Federal") - HtTransporte.Add("02", "Transporte Marítimo") - HtTransporte.Add("03", "Transporte Aéreo") - HtTransporte.Add("04", "Transporte Ferroviario") - HtTransporte.Add("05", "Ducto") - - 'EMISOR - Dim LugarExpedicion As String = "" - Dim ImgCBB As String = "" - 'COMPROBANTE - Dim SerieFolio As String = "" - Dim Telefono As String = "" - Dim SubTotal As Decimal = 0 - Dim Descuentos As Decimal = 0 - Dim Total As Decimal = 0 - 'DATOS DEL CLIENTE - Dim ClienteRFC As String = "" - Dim ClienteNombre As String = "" - Dim ClienteUsoCFDi As String = "" - - 'TRANSPORTE - Dim MedioTransporte As String = "" - Dim TransporteInternacional As String = "" - Dim PermisoSTCC As String = "" - Dim NumPermiso As String = "" - Dim AseguradoraRespCivil As String = "" - Dim NumPolizaSeguroRespCivil As String = "" - Dim NombreAseguradoraMedioAmbiente As String = "" - Dim NumPolizaSeguroMedioAmbiente As String = "" - Dim NombreAseguradoraCarga As String = "" - Dim NumPolizaSeguroCarga As String = "" - - Dim RemolquePlaca1 As String = "" - Dim RemolquePlaca2 As String = "" - Dim RemolqueSubtimo1 As String = "" - Dim RemolqueSubtimo2 As String = "" - - Dim PlacaVM As String = "" - Dim AnioModeloVM As String = "" - 'TIMBRADO - Dim FolioFiscal As String = "" - Dim NoCertificadoSAT As String = "" - Dim CadenaOriginal As String = "" - Dim NoSerieCertificado As String = "" - Dim FechaCertificacion As DateTime = Nothing - Dim SelloCFDi As String = "" - Dim SelloSAT As String = "" - Dim TipoDocto As String = "" - - Dim ObjInv As New ClsGenerales - - If ObjInv.GetGralTimbre(CveTimbre, "-1", MinFecha, MaxFecha, -1, UsuarioActual.CveEmpresa, -1) Then - If ObjInv.DtResultados.Rows.Count > 0 Then - Dim Dr As DataRow = ObjInv.DtResultados.Rows(0) - If Dr IsNot Nothing Then - SerieFolio = Dr("SerieFolio").ToString - Telefono = Dr("FiguraTelefono").ToString - TipoDocto = Dr("TipoDocto").ToString - End If - End If - End If - ObjInv.Dispose() - - Dim DtConceptos As New DataTable() - DtConceptos.Columns.Add(New DataColumn("Cantidad", GetType(Decimal))) - DtConceptos.Columns.Add(New DataColumn("Unidad", GetType(String))) - DtConceptos.Columns.Add(New DataColumn("Descripcion", GetType(String))) - DtConceptos.Columns.Add(New DataColumn("ValorUnitario", GetType(Decimal))) - DtConceptos.Columns.Add(New DataColumn("Importe", GetType(Decimal))) - - Dim DtUbicaciones As New DataTable() - DtUbicaciones.Columns.Add(New DataColumn("Distancia", GetType(String))) - DtUbicaciones.Columns.Add(New DataColumn("TipoUbicacion", GetType(String))) - DtUbicaciones.Columns.Add(New DataColumn("RFC", GetType(String))) - DtUbicaciones.Columns.Add(New DataColumn("Nombre", GetType(String))) - DtUbicaciones.Columns.Add(New DataColumn("FechaHoraSalida", GetType(DateTime))) - DtUbicaciones.Columns.Add(New DataColumn("Direccion", GetType(String))) - - Dim DtMercancias As New DataTable() - DtMercancias.Columns.Add(New DataColumn("Cantidad", GetType(Decimal))) - DtMercancias.Columns.Add(New DataColumn("UnidadMedida", GetType(String))) - DtMercancias.Columns.Add(New DataColumn("Descripcion", GetType(String))) - DtMercancias.Columns.Add(New DataColumn("PesoEnKg", GetType(String))) - - DtMercancias.Columns.Add(New DataColumn("CveMaterialPeligroso", GetType(String))) - DtMercancias.Columns.Add(New DataColumn("Embalaje", GetType(String))) - - Dim DtOperadores As New DataTable() - DtOperadores.Columns.Add(New DataColumn("RFC", GetType(String))) - DtOperadores.Columns.Add(New DataColumn("NumLicencia", GetType(String))) - DtOperadores.Columns.Add(New DataColumn("NombreOperador", GetType(String))) - - Dim DTRelacionados As New DataTable() - DTRelacionados.Columns.Add(New DataColumn("Relacion", GetType(String))) - DTRelacionados.Columns.Add(New DataColumn("UUID", GetType(String))) - - - Dim XMLDoc As New XmlDocument - Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, "XML", TipoDocto, String.Format("{0}", SerieFolio), "xml") - Dim Archivo As New System.IO.FileInfo(Path) - - If Archivo.Exists Then - Try - XMLDoc.Load(Path) - Catch ex As Exception - Try - Dim oReader = New StreamReader(Path, Encoding.GetEncoding("ISO-8859-1")) - XMLDoc.Load(oReader) - oReader.Dispose() - Catch ex2 As Exception - GuardaLog("Error al intentar leer el XML del SAT. Error:" & ex2.ToString()) - End Try - End Try - End If - - If XMLDoc IsNot Nothing AndAlso Archivo.Exists Then - - Dim RutaCBB As String = String.Format("{0}\CBB\{1}.jpg", UsuarioActual.Empresa.Ruta, SerieFolio) - Dim ImagenCBB As New System.IO.FileInfo(RutaCBB) - - Dim nodo As XmlNode = XMLDoc.DocumentElement - - Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix) - Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3" - Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable) - - If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2" - namespaces.AddNamespace(Prefijo, cfdVer) - namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") - namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal") - namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal") - namespaces.AddNamespace("cartaporte", "http://www.sat.gob.mx/CartaPorte") - namespaces.AddNamespace("cartaporte20", "http://www.sat.gob.mx/CartaPorte20") - - Dim nodeComprobante As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Comprobante", Prefijo), namespaces) - If nodeComprobante IsNot Nothing Then - LugarExpedicion = ValorXML(nodeComprobante, "LugarExpedicion") - SubTotal = ValorXML(nodeComprobante, "SubTotal").ToDecimal() - Total = ValorXML(nodeComprobante, "Total").ToDecimal() - End If - - Dim nodeCliente As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Receptor", Prefijo), namespaces) - - If nodeCliente IsNot Nothing Then - ClienteRFC = ValorXML(nodeCliente, "RFC") - ClienteNombre = ValorXML(nodeCliente, "Nombre") - Dim UsoCFDI = ValorXML(nodeCliente, "UsoCFDI") - ClienteUsoCFDi = String.Format("{0} - {1}", UsoCFDI, GlobalDTSATUsosCFDI().FiltroPrimeroValor("Descripcion", String.Format("UsoCFDI = '{0}'", UsoCFDI))) - End If - - Dim nodeConceptos As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Conceptos", Prefijo), namespaces) - - If nodeConceptos IsNot Nothing Then - For Each node As XmlNode In nodeConceptos.ChildNodes - Dim Row As DataRow = DtConceptos.NewRow - - Row("Cantidad") = ValorXML(node, "Cantidad", "") - Row("Unidad") = ValorXML(node, "Unidad", "") - Row("Descripcion") = ValorXML(node, "Descripcion", "") - Row("ValorUnitario") = ValorXML(node, "ValorUnitario", "") - Row("Importe") = ValorXML(node, "Importe", "") - - DtConceptos.Rows.Add(Row) - Next - End If - - - Dim nodeComp As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", Prefijo), namespaces) - - Dim nodeCartaPorte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:CartaPorte", "cartaporte20"), namespaces) - If nodeCartaPorte IsNot Nothing Then - TransporteInternacional = ValorXML(nodeCartaPorte, "TranspInternac", "") - End If - - Dim nodeAutotransporteFederal As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:Autotransporte", "cartaporte20"), namespaces) - If nodeAutotransporteFederal IsNot Nothing Then - PermisoSTCC = ValorXML(nodeAutotransporteFederal, "PermSCT", "") - NumPermiso = ValorXML(nodeAutotransporteFederal, "NumPermisoSCT", "") - End If - - Dim nodeIdentificacionVehicular As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:IdentificacionVehicular", "cartaporte20"), namespaces) - If nodeIdentificacionVehicular IsNot Nothing Then - PlacaVM = ValorXML(nodeIdentificacionVehicular, "PlacaVM", "") - AnioModeloVM = ValorXML(nodeIdentificacionVehicular, "AnioModeloVM", "") - End If - - Dim nodeSeguros As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:Seguros", "cartaporte20"), namespaces) - If nodeIdentificacionVehicular IsNot Nothing Then - AseguradoraRespCivil = ValorXML(nodeSeguros, "AseguraRespCivil", "") - NumPolizaSeguroRespCivil = ValorXML(nodeSeguros, "PolizaRespCivil", "") - - 'Por Definir de donde sale - NombreAseguradoraMedioAmbiente = ValorXML(nodeSeguros, "AseguraMedAmbiente", "") - NumPolizaSeguroMedioAmbiente = ValorXML(nodeSeguros, "PolizaMedAmbiente", "") - NombreAseguradoraCarga = ValorXML(nodeSeguros, "AseguraCarga", "") - NumPolizaSeguroCarga = ValorXML(nodeSeguros, "PolizaCarga", "") - End If - - - Dim nodeRemolques As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:Remolques", "cartaporte20"), namespaces) - - If nodeRemolques IsNot Nothing Then - If nodeRemolques.ChildNodes.Count = 1 Then - RemolquePlaca1 = ValorXML(nodeRemolques.ChildNodes(0), "Placa", "") - RemolqueSubtimo1 = ValorXML(nodeRemolques.ChildNodes(0), "SubTipoRem", "") - ElseIf nodeRemolques.ChildNodes.Count > 1 Then - RemolquePlaca1 = ValorXML(nodeRemolques.ChildNodes(0), "Placa", "") - RemolqueSubtimo1 = ValorXML(nodeRemolques.ChildNodes(0), "SubTipoRem", "") - RemolquePlaca2 = ValorXML(nodeRemolques.ChildNodes(1), "Placa", "") - RemolqueSubtimo2 = ValorXML(nodeRemolques.ChildNodes(1), "SubTipoRem", "") - End If - End If - - 'Dim nodeFiguraTransporte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:FiguraTransporte", "cartaporte20"), namespaces) - 'If nodeFiguraTransporte IsNot Nothing Then - ' Dim CveTransporte As String = ValorXML(nodeFiguraTransporte, "TipoFigura", "") - ' MedioTransporte = String.Format("{0} - {1}", CveTransporte, HtTransporte(CveTransporte).ToString()) - 'End If - - Dim nodeMercancias As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Mercancia", "cartaporte20"), namespaces) - For Each node As XmlNode In nodeMercancias - Dim Row As DataRow = DtMercancias.NewRow - - Row("Cantidad") = ValorXML(node, "Cantidad", "") - Row("UnidadMedida") = ValorXML(node, "Unidad", "") - Row("Descripcion") = ValorXML(node, "Descripcion", "") - Row("PesoEnKg") = ValorXML(node, "PesoEnKg", "") - - Row("CveMaterialPeligroso") = ValorXML(node, "CveMaterialPeligroso", "") - Row("Embalaje") = ValorXML(node, "Embalaje", "") - - DtMercancias.Rows.Add(Row) - Next - - Dim nodeOperadores As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:TiposFigura", "cartaporte20"), namespaces) - For Each node As XmlNode In nodeOperadores - Dim Row As DataRow = DtOperadores.NewRow - - Row("RFC") = ValorXML(node, "RFCFigura", "") - Row("NumLicencia") = ValorXML(node, "NumLicencia", "") - Row("NombreOperador") = ValorXML(node, "NombreFigura", "") - - DtOperadores.Rows.Add(Row) - Next - - - Dim nodeUbicaciones As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Ubicacion", "cartaporte20"), namespaces) - For Each node As XmlNode In nodeUbicaciones - Dim Row As DataRow = DtUbicaciones.NewRow - - Row("Distancia") = ValorXML(node, "DistanciaRecorrida", "") - Row("TipoUbicacion") = ValorXML(node, "TipoUbicacion", "") - Row("FechaHoraSalida") = ValorXML(node, "FechaHoraSalidaLlegada", "") - Row("RFC") = ValorXML(node, "RFCRemitenteDestinatario", "") - Row("Nombre") = ValorXML(node, "NombreRemitenteDestinatario", "") - - Dim nodeDomicilio = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte20:Domicilio") 'node.SelectSingleNode(String.Format("//{0}:Domicilio", "cartaporte"), namespaces) - If nodeDomicilio IsNot Nothing Then - - Dim Estado As String = "" - Dim Municipio As String = "" - Dim Colonia As String = "" - Dim calle = ValorXML(nodeDomicilio, "Calle", "") - Dim CP = ValorXML(nodeDomicilio, "CodigoPostal", "") - - Dim dr As DataRow = GlobalDTGralColonias(ValorXML(nodeDomicilio, "Estado", ""), ValorXML(nodeDomicilio, "Municipio", ""), ValorXML(nodeDomicilio, "Colonia", "")).FiltroPrimero("") - If dr IsNot Nothing Then - Estado = dr("NombreEstado").ToString - Municipio = dr("NombreMunicipio").ToString - Colonia = dr("NombreAsentamiento").ToString - End If - Row("Direccion") = String.Format("{0} Col.{1},{2},{3}. CP {4}", calle, Colonia, Municipio, Estado, CP) - End If - - - DtUbicaciones.Rows.Add(Row) - Next - - - - Dim nodeRelacion = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) - - If nodeRelacion IsNot Nothing Then - Dim RelacionCodigo As String = ValorXML(nodeRelacion, "TipoRelacion") - Dim Relacion As String = "" - - Select Case RelacionCodigo - Case "01" - Relacion = "01 - Nota de crédito de los documentos relacionados" - Case "02" - Relacion = "02 - Nota de débito de los documentos relacionados" - Case "03" - Relacion = "03 - Devolución de mercancía sobre facturas o traslados previos" - Case "04" - Relacion = "04 - Sustitución de los CFDI previos" - Case "05" - Relacion = "05 - Traslados de mercancias facturados previamente" - Case "06" - Relacion = "06 - Factura generada por los traslados previos" - Case "07" - Relacion = "07 - CFDI por aplicación de anticipo" - Case "08" - Relacion = "08 - Factura generada por pagos en parcialidades" - Case "09" - Relacion = "09 - Factura generada por pagos diferidos" - - End Select - - Dim nodoDocumentosRealcionados = XMLDoc.SelectNodes(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) - For Each node As XmlNode In nodoDocumentosRealcionados - - Dim nRow As DataRow = DTRelacionados.NewRow - nRow("Relacion") = Relacion - - Try - Dim nodoUUID = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cfdi:CfdiRelacionado") - nRow("UUID") = ValorXML(nodoUUID, "UUID", "") - Catch ex As Exception - nRow("UUID") = "" - End Try - - DTRelacionados.Rows.Add(nRow) - Next - End If - - - - - Dim nodeTFD As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:TimbreFiscalDigital", "tfd"), namespaces) - If nodeTFD IsNot Nothing Then - FolioFiscal = ValorXML(nodeTFD, "UUID", "") - NoSerieCertificado = ValorXML(nodeTFD, "NoCertificadoSAT", "") - FechaCertificacion = ValorXML(nodeTFD, "FechaTimbrado", "").ToDateTime - SelloCFDi = ValorXML(nodeTFD, "SelloCFD", "") - SelloSAT = ValorXML(nodeTFD, "SelloSAT", "") - NoCertificadoSAT = ValorXML(nodeTFD, "NoCertificadoSAT", "") - - CadenaOriginal = "||1.0|" + FolioFiscal + "|" + FechaCertificacion.ToString("yyyy-MM-dd") + "T" + FechaCertificacion.ToString("HH:mm:ss") + "|" + SelloCFDi + "|" + NoSerieCertificado + "||" - End If - - If Not ImagenCBB.Exists Then - Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() - CBB.GenerarCBB(UsuarioActual.Empresa.RFC, ClienteRFC, Total, FolioFiscal, RutaCBB) - End If - - - ImagenCBB = New System.IO.FileInfo(RutaCBB) - - If ImagenCBB.Exists Then - ImgCBB = String.Format("file://{0}", ImagenCBB.FullName) - Else - ImgCBB = "" - End If - - End If - - If DtConceptos.Rows.Count > 0 Then - Dim params As New List(Of ReportParameter) - Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - - If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) - Else - params.Add(New ReportParameter("LogoPath", "")) - End If - 'EMPRESA - params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) - params.Add(New ReportParameter("RegimenFiscal", UsuarioActual.Empresa.Regimen)) - params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) - params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) - params.Add(New ReportParameter("DomicilioFiscal", $"{UsuarioActual.Empresa.Direccion}, {UsuarioActual.Empresa.Colonia}, {UsuarioActual.Empresa.Localidad}, {UsuarioActual.Empresa.Estado}, Tel. {Telefono}")) - params.Add(New ReportParameter("SerieFolio", SerieFolio)) - params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC)) - params.Add(New ReportParameter("DomicilioExpedicion", LugarExpedicion)) - 'CLIENTE - params.Add(New ReportParameter("ClienteNombre", ClienteNombre)) - params.Add(New ReportParameter("ClienteRFC", ClienteRFC)) - params.Add(New ReportParameter("UsoCFDi", ClienteUsoCFDi)) - 'TRANSPORTE - params.Add(New ReportParameter("MedioTransporte", MedioTransporte)) - params.Add(New ReportParameter("TransporteInternacional", TransporteInternacional)) - params.Add(New ReportParameter("PermisoSTCC", PermisoSTCC)) - params.Add(New ReportParameter("NumPermiso", NumPermiso)) - - params.Add(New ReportParameter("Aseguradora", AseguradoraRespCivil)) - params.Add(New ReportParameter("NumPoliza", NumPolizaSeguroRespCivil)) - - params.Add(New ReportParameter("NombreAseguradoraMedioAmbiente", NombreAseguradoraMedioAmbiente)) - params.Add(New ReportParameter("NumPolizaSeguroMedioAmbiente", NumPolizaSeguroMedioAmbiente)) - - params.Add(New ReportParameter("NombreAseguradoraCarga", NombreAseguradoraCarga)) - params.Add(New ReportParameter("NumPolizaSeguroCarga", NumPolizaSeguroCarga)) - - params.Add(New ReportParameter("PlacaVM", PlacaVM)) - params.Add(New ReportParameter("AnioVM", AnioModeloVM)) - 'TIMBRADO - params.Add(New ReportParameter("FolioFiscal", FolioFiscal)) - params.Add(New ReportParameter("QR", ImgCBB)) - params.Add(New ReportParameter("SelloCFDI", SelloCFDi)) - params.Add(New ReportParameter("CertificadoContribuyente", NoCertificadoSAT)) - params.Add(New ReportParameter("CadenaOriginal", CadenaOriginal)) - params.Add(New ReportParameter("SerieCertificadoSAT", NoSerieCertificado)) - params.Add(New ReportParameter("FechaCertificacion", FechaCertificacion.ToString("dd/MM/yyyy HH:mm:ss"))) - params.Add(New ReportParameter("SelloSAT", SelloSAT)) - 'TOTALES - params.Add(New ReportParameter("SubTotal", SubTotal.ToString())) - params.Add(New ReportParameter("Descuentos", Descuentos.ToString())) - params.Add(New ReportParameter("Total", Total.ToString())) - - params.Add(New ReportParameter("RemolquePlaca1", RemolquePlaca1)) - params.Add(New ReportParameter("RemolqueSubtimo1", RemolqueSubtimo1)) - params.Add(New ReportParameter("RemolquePlaca2", RemolquePlaca2)) - params.Add(New ReportParameter("RemolqueSubtimo2", RemolqueSubtimo2)) - - - ' [@CertificadoContribuyente] - '[@CadenaOriginal] - - Dim lrds As New List(Of ReportDataSource) - - Dim rds As New ReportDataSource - rds.Name = "DataSet1" - rds.Value = DtConceptos - lrds.Add(rds) - - Dim rds2 As New ReportDataSource - rds2.Name = "DataSet2" - rds2.Value = DtUbicaciones - lrds.Add(rds2) - - Dim rds3 As New ReportDataSource - rds3.Name = "DataSet3" - rds3.Value = DtMercancias - lrds.Add(rds3) - - Dim rds4 As New ReportDataSource - rds4.Name = "DataSet4" - rds4.Value = DtOperadores - lrds.Add(rds4) - - - Dim rds5 As New ReportDataSource - rds5.Name = "DataSet5" - rds5.Value = DTRelacionados - lrds.Add(rds5) - - ImprimirPDF("Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc", lrds, params, SerieFolio) - End If + Dim resp = PreParaImpresionCartaPorte(CveTimbre) + If resp.DataSources.Count > 0 AndAlso resp.Parametros.Count > 0 Then + ImprimirPDF("Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc", resp.DataSources, resp.Parametros, resp.SerieFolio) End If End Sub + Private Function PreParaImpresionCartaPorte(CveTimbre As Integer, Optional AplicaSubReporte As Boolean = False) As Modelos.MSubReportData + Dim retorno As New Modelos.MSubReportData + retorno.Nombre = "CartaPorte" + Try + If CveTimbre > 0 Then + Dim params As New List(Of ReportParameter) + '01 Autotransporte Federal + '02 Transporte Marítimo + '03 Transporte Aéreo + '04 Transporte Ferroviario + '05 Ducto + Dim HtTransporte As New Hashtable() + HtTransporte.Add("01", "Autotransporte Federal") + HtTransporte.Add("02", "Transporte Marítimo") + HtTransporte.Add("03", "Transporte Aéreo") + HtTransporte.Add("04", "Transporte Ferroviario") + HtTransporte.Add("05", "Ducto") + + 'EMISOR + Dim LugarExpedicion As String = "" + Dim ImgCBB As String = "" + 'COMPROBANTE + Dim SerieFolio As String = "" + Dim Telefono As String = "" + Dim SubTotal As Decimal = 0 + Dim Descuentos As Decimal = 0 + Dim Total As Decimal = 0 + 'DATOS DEL CLIENTE + Dim ClienteRFC As String = "" + Dim ClienteNombre As String = "" + Dim ClienteUsoCFDi As String = "" + + 'TRANSPORTE + Dim MedioTransporte As String = "" + Dim TransporteInternacional As String = "" + Dim PermisoSTCC As String = "" + Dim NumPermiso As String = "" + Dim AseguradoraRespCivil As String = "" + Dim NumPolizaSeguroRespCivil As String = "" + Dim NombreAseguradoraMedioAmbiente As String = "" + Dim NumPolizaSeguroMedioAmbiente As String = "" + Dim NombreAseguradoraCarga As String = "" + Dim NumPolizaSeguroCarga As String = "" + + Dim RemolquePlaca1 As String = "" + Dim RemolquePlaca2 As String = "" + Dim RemolqueSubtimo1 As String = "" + Dim RemolqueSubtimo2 As String = "" + + Dim PlacaVM As String = "" + Dim AnioModeloVM As String = "" + 'TIMBRADO + Dim FolioFiscal As String = "" + Dim NoCertificadoSAT As String = "" + Dim CadenaOriginal As String = "" + Dim NoSerieCertificado As String = "" + Dim FechaCertificacion As DateTime = Nothing + Dim SelloCFDi As String = "" + Dim SelloSAT As String = "" + Dim TipoDocto As String = "" + + Dim ObjInv As New ClsGenerales + + If ObjInv.GetGralTimbre(CveTimbre, "-1", MinFecha, MaxFecha, -1, UsuarioActual.CveEmpresa, -1) Then + If ObjInv.DtResultados.Rows.Count > 0 Then + Dim Dr As DataRow = ObjInv.DtResultados.Rows(0) + If Dr IsNot Nothing Then + SerieFolio = Dr("SerieFolio").ToString + Telefono = Dr("FiguraTelefono").ToString + TipoDocto = Dr("TipoDocto").ToString + End If + End If + End If + ObjInv.Dispose() + + retorno.SerieFolio = SerieFolio + + Dim DtConceptos As New DataTable() + DtConceptos.Columns.Add(New DataColumn("Cantidad", GetType(Decimal))) + DtConceptos.Columns.Add(New DataColumn("Unidad", GetType(String))) + DtConceptos.Columns.Add(New DataColumn("Descripcion", GetType(String))) + DtConceptos.Columns.Add(New DataColumn("ValorUnitario", GetType(Decimal))) + DtConceptos.Columns.Add(New DataColumn("Importe", GetType(Decimal))) + + Dim DtUbicaciones As New DataTable() + DtUbicaciones.Columns.Add(New DataColumn("Distancia", GetType(String))) + DtUbicaciones.Columns.Add(New DataColumn("TipoUbicacion", GetType(String))) + DtUbicaciones.Columns.Add(New DataColumn("RFC", GetType(String))) + DtUbicaciones.Columns.Add(New DataColumn("Nombre", GetType(String))) + DtUbicaciones.Columns.Add(New DataColumn("FechaHoraSalida", GetType(DateTime))) + DtUbicaciones.Columns.Add(New DataColumn("Direccion", GetType(String))) + + Dim DtMercancias As New DataTable() + DtMercancias.Columns.Add(New DataColumn("Cantidad", GetType(Decimal))) + DtMercancias.Columns.Add(New DataColumn("UnidadMedida", GetType(String))) + DtMercancias.Columns.Add(New DataColumn("Descripcion", GetType(String))) + DtMercancias.Columns.Add(New DataColumn("PesoEnKg", GetType(String))) + + DtMercancias.Columns.Add(New DataColumn("CveMaterialPeligroso", GetType(String))) + DtMercancias.Columns.Add(New DataColumn("Embalaje", GetType(String))) + + Dim DtOperadores As New DataTable() + DtOperadores.Columns.Add(New DataColumn("RFC", GetType(String))) + DtOperadores.Columns.Add(New DataColumn("NumLicencia", GetType(String))) + DtOperadores.Columns.Add(New DataColumn("NombreOperador", GetType(String))) + + Dim DTRelacionados As New DataTable() + DTRelacionados.Columns.Add(New DataColumn("Relacion", GetType(String))) + DTRelacionados.Columns.Add(New DataColumn("UUID", GetType(String))) + + + Dim XMLDoc As New XmlDocument + Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, "XML", TipoDocto, String.Format("{0}", SerieFolio), "xml") + Dim Archivo As New System.IO.FileInfo(Path) + + If Archivo.Exists Then + Try + XMLDoc.Load(Path) + Catch ex As Exception + Try + Dim oReader = New StreamReader(Path, Encoding.GetEncoding("ISO-8859-1")) + XMLDoc.Load(oReader) + oReader.Dispose() + Catch ex2 As Exception + GuardaLog("Error al intentar leer el XML del SAT. Error:" & ex2.ToString()) + End Try + End Try + End If + + If XMLDoc IsNot Nothing AndAlso Archivo.Exists Then + + Dim RutaCBB As String = String.Format("{0}\CBB\{1}.jpg", UsuarioActual.Empresa.Ruta, SerieFolio) + Dim ImagenCBB As New System.IO.FileInfo(RutaCBB) + + Dim nodo As XmlNode = XMLDoc.DocumentElement + + Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix) + Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3" + Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable) + + If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2" + namespaces.AddNamespace(Prefijo, cfdVer) + namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") + namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal") + namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal") + namespaces.AddNamespace("cartaporte", "http://www.sat.gob.mx/CartaPorte") + namespaces.AddNamespace("cartaporte20", "http://www.sat.gob.mx/CartaPorte20") + + Dim nodeComprobante As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Comprobante", Prefijo), namespaces) + If nodeComprobante IsNot Nothing Then + LugarExpedicion = ValorXML(nodeComprobante, "LugarExpedicion") + SubTotal = ValorXML(nodeComprobante, "SubTotal").ToDecimal() + Total = ValorXML(nodeComprobante, "Total").ToDecimal() + End If + + Dim nodeCliente As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Receptor", Prefijo), namespaces) + + If nodeCliente IsNot Nothing Then + ClienteRFC = ValorXML(nodeCliente, "RFC") + ClienteNombre = ValorXML(nodeCliente, "Nombre") + Dim UsoCFDI = ValorXML(nodeCliente, "UsoCFDI") + ClienteUsoCFDi = String.Format("{0} - {1}", UsoCFDI, GlobalDTSATUsosCFDI().FiltroPrimeroValor("Descripcion", String.Format("UsoCFDI = '{0}'", UsoCFDI))) + End If + + Dim nodeConceptos As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Conceptos", Prefijo), namespaces) + + If nodeConceptos IsNot Nothing Then + For Each node As XmlNode In nodeConceptos.ChildNodes + Dim Row As DataRow = DtConceptos.NewRow + + Row("Cantidad") = ValorXML(node, "Cantidad", "") + Row("Unidad") = ValorXML(node, "Unidad", "") + Row("Descripcion") = ValorXML(node, "Descripcion", "") + Row("ValorUnitario") = ValorXML(node, "ValorUnitario", "") + Row("Importe") = ValorXML(node, "Importe", "") + + DtConceptos.Rows.Add(Row) + Next + End If + + + Dim nodeComp As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", Prefijo), namespaces) + + Dim nodeCartaPorte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:CartaPorte", "cartaporte20"), namespaces) + If nodeCartaPorte IsNot Nothing Then + TransporteInternacional = ValorXML(nodeCartaPorte, "TranspInternac", "") + End If + + Dim nodeAutotransporteFederal As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:Autotransporte", "cartaporte20"), namespaces) + If nodeAutotransporteFederal IsNot Nothing Then + PermisoSTCC = ValorXML(nodeAutotransporteFederal, "PermSCT", "") + NumPermiso = ValorXML(nodeAutotransporteFederal, "NumPermisoSCT", "") + End If + + Dim nodeIdentificacionVehicular As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:IdentificacionVehicular", "cartaporte20"), namespaces) + If nodeIdentificacionVehicular IsNot Nothing Then + PlacaVM = ValorXML(nodeIdentificacionVehicular, "PlacaVM", "") + AnioModeloVM = ValorXML(nodeIdentificacionVehicular, "AnioModeloVM", "") + End If + + Dim nodeSeguros As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:Seguros", "cartaporte20"), namespaces) + If nodeIdentificacionVehicular IsNot Nothing Then + AseguradoraRespCivil = ValorXML(nodeSeguros, "AseguraRespCivil", "") + NumPolizaSeguroRespCivil = ValorXML(nodeSeguros, "PolizaRespCivil", "") + + 'Por Definir de donde sale + NombreAseguradoraMedioAmbiente = ValorXML(nodeSeguros, "AseguraMedAmbiente", "") + NumPolizaSeguroMedioAmbiente = ValorXML(nodeSeguros, "PolizaMedAmbiente", "") + NombreAseguradoraCarga = ValorXML(nodeSeguros, "AseguraCarga", "") + NumPolizaSeguroCarga = ValorXML(nodeSeguros, "PolizaCarga", "") + End If + + + Dim nodeRemolques As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:Remolques", "cartaporte20"), namespaces) + + If nodeRemolques IsNot Nothing Then + If nodeRemolques.ChildNodes.Count = 1 Then + RemolquePlaca1 = ValorXML(nodeRemolques.ChildNodes(0), "Placa", "") + RemolqueSubtimo1 = ValorXML(nodeRemolques.ChildNodes(0), "SubTipoRem", "") + ElseIf nodeRemolques.ChildNodes.Count > 1 Then + RemolquePlaca1 = ValorXML(nodeRemolques.ChildNodes(0), "Placa", "") + RemolqueSubtimo1 = ValorXML(nodeRemolques.ChildNodes(0), "SubTipoRem", "") + RemolquePlaca2 = ValorXML(nodeRemolques.ChildNodes(1), "Placa", "") + RemolqueSubtimo2 = ValorXML(nodeRemolques.ChildNodes(1), "SubTipoRem", "") + End If + End If + + 'Dim nodeFiguraTransporte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:FiguraTransporte", "cartaporte20"), namespaces) + 'If nodeFiguraTransporte IsNot Nothing Then + ' Dim CveTransporte As String = ValorXML(nodeFiguraTransporte, "TipoFigura", "") + ' MedioTransporte = String.Format("{0} - {1}", CveTransporte, HtTransporte(CveTransporte).ToString()) + 'End If + + Dim nodeMercancias As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Mercancia", "cartaporte20"), namespaces) + For Each node As XmlNode In nodeMercancias + Dim Row As DataRow = DtMercancias.NewRow + + Row("Cantidad") = ValorXML(node, "Cantidad", "") + Row("UnidadMedida") = ValorXML(node, "Unidad", "") + Row("Descripcion") = ValorXML(node, "Descripcion", "") + Row("PesoEnKg") = ValorXML(node, "PesoEnKg", "") + + Row("CveMaterialPeligroso") = ValorXML(node, "CveMaterialPeligroso", "") + Row("Embalaje") = ValorXML(node, "Embalaje", "") + + DtMercancias.Rows.Add(Row) + Next + + Dim nodeMercanciaPadre As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Mercancias", "cartaporte20"), namespaces) + If UsuarioActual.CveEmpresa = 13 AndAlso nodeMercanciaPadre IsNot Nothing Then + Dim PesoNetoTotal = ValorXML(nodeMercanciaPadre(0), "PesoNetoTotal", "") + params.Add(New ReportParameter("PesoNetoTotal", PesoNetoTotal)) + End If + + Dim nodeOperadores As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:TiposFigura", "cartaporte20"), namespaces) + For Each node As XmlNode In nodeOperadores + Dim Row As DataRow = DtOperadores.NewRow + + Row("RFC") = ValorXML(node, "RFCFigura", "") + Row("NumLicencia") = ValorXML(node, "NumLicencia", "") + Row("NombreOperador") = ValorXML(node, "NombreFigura", "") + + DtOperadores.Rows.Add(Row) + Next + + Dim DistanciaTotal As Decimal = 0 + Dim nodeUbicaciones As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Ubicacion", "cartaporte20"), namespaces) + For Each node As XmlNode In nodeUbicaciones + Dim Row As DataRow = DtUbicaciones.NewRow + + Row("Distancia") = ValorXML(node, "DistanciaRecorrida", "") + DistanciaTotal += Row("Distancia").ToString().ToDecimal() + Row("TipoUbicacion") = ValorXML(node, "TipoUbicacion", "") + Row("FechaHoraSalida") = ValorXML(node, "FechaHoraSalidaLlegada", "") + Row("RFC") = ValorXML(node, "RFCRemitenteDestinatario", "") + Row("Nombre") = ValorXML(node, "NombreRemitenteDestinatario", "") + + Dim nodeDomicilio = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte20:Domicilio") 'node.SelectSingleNode(String.Format("//{0}:Domicilio", "cartaporte"), namespaces) + If nodeDomicilio IsNot Nothing Then + + Dim Estado As String = "" + Dim Municipio As String = "" + Dim Colonia As String = "" + Dim calle = ValorXML(nodeDomicilio, "Calle", "") + Dim CP = ValorXML(nodeDomicilio, "CodigoPostal", "") + + Dim dr As DataRow = GlobalDTGralColonias(ValorXML(nodeDomicilio, "Estado", ""), ValorXML(nodeDomicilio, "Municipio", ""), ValorXML(nodeDomicilio, "Colonia", "")).FiltroPrimero("") + If dr IsNot Nothing Then + Estado = dr("NombreEstado").ToString + Municipio = dr("NombreMunicipio").ToString + Colonia = dr("NombreAsentamiento").ToString + End If + Row("Direccion") = String.Format("{0} Col.{1},{2},{3}. CP {4}", calle, Colonia, Municipio, Estado, CP) + End If + + + DtUbicaciones.Rows.Add(Row) + Next + + If UsuarioActual.CveEmpresa = 13 Then + params.Add(New ReportParameter("DistanciaTotal", DistanciaTotal.ToString())) + End If + + Dim nodeRelacion = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) + + If nodeRelacion IsNot Nothing Then + Dim RelacionCodigo As String = ValorXML(nodeRelacion, "TipoRelacion") + Dim Relacion As String = "" + + Select Case RelacionCodigo + Case "01" + Relacion = "01 - Nota de crédito de los documentos relacionados" + Case "02" + Relacion = "02 - Nota de débito de los documentos relacionados" + Case "03" + Relacion = "03 - Devolución de mercancía sobre facturas o traslados previos" + Case "04" + Relacion = "04 - Sustitución de los CFDI previos" + Case "05" + Relacion = "05 - Traslados de mercancias facturados previamente" + Case "06" + Relacion = "06 - Factura generada por los traslados previos" + Case "07" + Relacion = "07 - CFDI por aplicación de anticipo" + Case "08" + Relacion = "08 - Factura generada por pagos en parcialidades" + Case "09" + Relacion = "09 - Factura generada por pagos diferidos" + + End Select + + Dim nodoDocumentosRealcionados = XMLDoc.SelectNodes(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) + For Each node As XmlNode In nodoDocumentosRealcionados + + Dim nRow As DataRow = DTRelacionados.NewRow + nRow("Relacion") = Relacion + + Try + Dim nodoUUID = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cfdi:CfdiRelacionado") + nRow("UUID") = ValorXML(nodoUUID, "UUID", "") + Catch ex As Exception + nRow("UUID") = "" + End Try + + DTRelacionados.Rows.Add(nRow) + Next + End If + + + + + Dim nodeTFD As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:TimbreFiscalDigital", "tfd"), namespaces) + If nodeTFD IsNot Nothing Then + FolioFiscal = ValorXML(nodeTFD, "UUID", "") + NoSerieCertificado = ValorXML(nodeTFD, "NoCertificadoSAT", "") + FechaCertificacion = ValorXML(nodeTFD, "FechaTimbrado", "").ToDateTime + SelloCFDi = ValorXML(nodeTFD, "SelloCFD", "") + SelloSAT = ValorXML(nodeTFD, "SelloSAT", "") + NoCertificadoSAT = ValorXML(nodeTFD, "NoCertificadoSAT", "") + + CadenaOriginal = "||1.0|" + FolioFiscal + "|" + FechaCertificacion.ToString("yyyy-MM-dd") + "T" + FechaCertificacion.ToString("HH:mm:ss") + "|" + SelloCFDi + "|" + NoSerieCertificado + "||" + End If + + If Not ImagenCBB.Exists Then + Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() + CBB.GenerarCBB(UsuarioActual.Empresa.RFC, ClienteRFC, Total, FolioFiscal, RutaCBB) + End If + + + ImagenCBB = New System.IO.FileInfo(RutaCBB) + + If ImagenCBB.Exists Then + ImgCBB = String.Format("file://{0}", ImagenCBB.FullName) + Else + ImgCBB = "" + End If + + End If + + If DtConceptos.Rows.Count > 0 Then + + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + + If Imagen.Exists Then + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If + 'EMPRESA + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("RegimenFiscal", UsuarioActual.Empresa.Regimen)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) + params.Add(New ReportParameter("DomicilioFiscal", $"{UsuarioActual.Empresa.Direccion}, {UsuarioActual.Empresa.Colonia}, {UsuarioActual.Empresa.Localidad}, {UsuarioActual.Empresa.Estado}, Tel. {Telefono}")) + params.Add(New ReportParameter("SerieFolio", SerieFolio)) + params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC)) + params.Add(New ReportParameter("DomicilioExpedicion", LugarExpedicion)) + 'CLIENTE + params.Add(New ReportParameter("ClienteNombre", ClienteNombre)) + params.Add(New ReportParameter("ClienteRFC", ClienteRFC)) + params.Add(New ReportParameter("UsoCFDi", ClienteUsoCFDi)) + 'TRANSPORTE + params.Add(New ReportParameter("MedioTransporte", MedioTransporte)) + params.Add(New ReportParameter("TransporteInternacional", TransporteInternacional)) + params.Add(New ReportParameter("PermisoSTCC", PermisoSTCC)) + params.Add(New ReportParameter("NumPermiso", NumPermiso)) + + params.Add(New ReportParameter("Aseguradora", AseguradoraRespCivil)) + params.Add(New ReportParameter("NumPoliza", NumPolizaSeguroRespCivil)) + + params.Add(New ReportParameter("NombreAseguradoraMedioAmbiente", NombreAseguradoraMedioAmbiente)) + params.Add(New ReportParameter("NumPolizaSeguroMedioAmbiente", NumPolizaSeguroMedioAmbiente)) + + params.Add(New ReportParameter("NombreAseguradoraCarga", NombreAseguradoraCarga)) + params.Add(New ReportParameter("NumPolizaSeguroCarga", NumPolizaSeguroCarga)) + + params.Add(New ReportParameter("PlacaVM", PlacaVM)) + params.Add(New ReportParameter("AnioVM", AnioModeloVM)) + 'TIMBRADO + params.Add(New ReportParameter("FolioFiscal", FolioFiscal)) + params.Add(New ReportParameter("QR", ImgCBB)) + params.Add(New ReportParameter("SelloCFDI", SelloCFDi)) + params.Add(New ReportParameter("CertificadoContribuyente", NoCertificadoSAT)) + params.Add(New ReportParameter("CadenaOriginal", CadenaOriginal)) + params.Add(New ReportParameter("SerieCertificadoSAT", NoSerieCertificado)) + params.Add(New ReportParameter("FechaCertificacion", FechaCertificacion.ToString("dd/MM/yyyy HH:mm:ss"))) + params.Add(New ReportParameter("SelloSAT", SelloSAT)) + 'TOTALES + params.Add(New ReportParameter("SubTotal", SubTotal.ToString())) + params.Add(New ReportParameter("Descuentos", Descuentos.ToString())) + params.Add(New ReportParameter("Total", Total.ToString())) + + params.Add(New ReportParameter("RemolquePlaca1", RemolquePlaca1)) + params.Add(New ReportParameter("RemolqueSubtimo1", RemolqueSubtimo1)) + params.Add(New ReportParameter("RemolquePlaca2", RemolquePlaca2)) + params.Add(New ReportParameter("RemolqueSubtimo2", RemolqueSubtimo2)) + + + ' [@CertificadoContribuyente] + '[@CadenaOriginal] + + Dim lrds As New List(Of ReportDataSource) + + Dim rds As New ReportDataSource + rds.Name = "DataSet1" + rds.Value = DtConceptos + lrds.Add(rds) + + Dim rds2 As New ReportDataSource + rds2.Name = "DataSet2" + rds2.Value = DtUbicaciones + lrds.Add(rds2) + + Dim rds3 As New ReportDataSource + rds3.Name = "DataSet3" + rds3.Value = DtMercancias + lrds.Add(rds3) + + Dim rds4 As New ReportDataSource + rds4.Name = "DataSet4" + rds4.Value = DtOperadores + lrds.Add(rds4) + + + Dim rds5 As New ReportDataSource + rds5.Name = "DataSet5" + rds5.Value = DTRelacionados + lrds.Add(rds5) + + If AplicaSubReporte Then + For Each parametro As ReportParameter In params + retorno.Parametros.Add(New ReportParameter($"SRP_{parametro.Name}", parametro.Values.Item(0))) + Next + Else + retorno.Parametros.AddRange(params) + End If + + retorno.DataSources.AddRange(lrds) + End If + + End If + Catch ex As Exception + OnError("Ocurrió un error al generar el pdf de la carta porte", ex) + End Try + Return retorno + End Function #End Region #Region "OP = 'DesXmlTra' - IMPRIME XML TRASLADO" @@ -2316,7 +2354,7 @@ Partial Class PopUpVerFactura Archivo = Nothing End If End Sub - Public Sub imprimirFacturaVenta(CveVenta As Integer, AplicaPagare As String, Optional GuardarPDF As Boolean = False) + Public Sub imprimirFacturaVenta(CveVenta As Integer, AplicaPagare As String, Optional GuardarPDF As Boolean = False, Optional RegenerarPDF As Boolean = False) Dim ObjVentas As New ClsVentas Dim Vta As Modelos.Factura = Nothing @@ -2649,43 +2687,73 @@ Partial Class PopUpVerFactura End If ObjVentas.Dispose() + Dim CveTimbreCartaPorteVenta As Integer = -1 + Dim CartaPorte As Modelos.MSubReportData = Nothing + + If Vta.TipoDocto = "Ing" Then + Using ObjGral As New ClsGenerales + If ObjGral.GetGralTimbre(-1, "Ing", MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa, -1, CveVenta:=CveVenta) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then + Dim RowCP As DataRow = ObjGral.DtResultados.Rows(0) + CveTimbreCartaPorteVenta = RowCP("CveTimbre").ToString().ToEntero() + End If + End Using + + If CveTimbreCartaPorteVenta > 0 Then + 'CartaPorte = New Modelos.MSubReportData + 'CartaPorte.Parametros.Add(New ReportParameter("SRP_ParametroPrueba", "Rarametro pasado")) + 'Dim dt As New DataTable() + 'dt.Columns.Add(New DataColumn("Cantidad", GetType(Decimal))) + 'dt.Columns.Add(New DataColumn("Unidad", GetType(String))) + + 'Dim row As DataRow = dt.NewRow() + 'row("Cantidad") = 2.3D + 'row("Unidad") = "PIEZAS" + + 'dt.Rows.Add(row) + 'CartaPorte.DataSources.Add(New ReportDataSource() With {.Name = "DataSet1", .Value = dt}) + + CartaPorte = PreParaImpresionCartaPorte(CveTimbreCartaPorteVenta, AplicaSubReporte:=true) + End If + End If + Dim Guardar As Boolean = If(GuardarPDF, True, If(AplicaPagare = "1", False, True)) - - - - - - If Not IsNothing(Vta) Then Dim PathArchivo As String = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio) Dim Archivo As New System.IO.FileInfo(PathArchivo) If Archivo.Exists Then - - HttpContext.Current.Response.Clear() - HttpContext.Current.Response.ClearContent() - HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".txt", "text/plain", "application/pdf") - HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name) - HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) - HttpContext.Current.Response.TransmitFile(PathArchivo) - 'HttpContext.Current.Response.Flush() - HttpContext.Current.Response.End() - Archivo = Nothing - + If RegenerarPDF Then + Archivo.Delete() + If UsuarioActual.Empresa.CvePlataforma = 2 Then + GeneraPDFVtaPyMe(Vta, "PDF") + Else + ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=True, SubReportData:=CartaPorte), Vta.SerieFolio, "PDF") + Vta = Nothing + End If + Else + HttpContext.Current.Response.Clear() + HttpContext.Current.Response.ClearContent() + HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".txt", "text/plain", "application/pdf") + HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name) + HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) + HttpContext.Current.Response.TransmitFile(PathArchivo) + 'HttpContext.Current.Response.Flush() + HttpContext.Current.Response.End() + Archivo = Nothing + End If Else '04/05/2018 - Se agrega seccion pruebas para generar factura venta .mrt para PyME If UsuarioActual.Empresa.CvePlataforma = 2 Then GeneraPDFVtaPyMe(Vta, "PDF") Else - ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=Guardar), Vta.SerieFolio, "PDF") + ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=Guardar, SubReportData:=CartaPorte), Vta.SerieFolio, "PDF") Vta = Nothing End If End If - End If End Sub diff --git a/Empresas/13/Formatos/CartaPorteTimbrado.rdlc b/Empresas/13/Formatos/CartaPorteTimbrado.rdlc new file mode 100644 index 000000000..970407272 --- /dev/null +++ b/Empresas/13/Formatos/CartaPorteTimbrado.rdlc @@ -0,0 +1,4609 @@ + + + + + + + + + + + + true + true + + + + + Cantidad + + + + + + + Textbox28 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 3.22889cm + + + 6.57288cm + + + 2.71968cm + + + 2.12432cm + + + 2.57447cm + + + + + 0.6cm + + + + + true + true + + + + + =Fields!UnidadMedida.Value + + + + + + + UM + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Descripcion.Value + + + + + + + Textbox31 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!CveMaterialPeligroso.Value + + + + + + + CveMaterialPeligroso + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Embalaje.Value + + + + + + + Embalaje + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PesoEnKg.Value + + + + + + + PesoEnKg + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 0.52062cm + + + true + true + + + + + Unidad + + + + + + + Textbox40 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + Producto + + + + + + + Textbox30 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + Cod. Material + + + + Peligroso + + + + + + + Textbox37 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + Embalaje + + + + + + + Textbox40 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + Peso (KG) + + + + + + + Textbox64 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 3.14705cm + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + DataSet3 + 6.6164cm + 0.06623cm + 1.12062cm + 20.36729cm + + + + + + true + true + + + + + DETALLE MERCANCIAS + + + + + + + Textbox3 + 6.1004cm + 0.06623cm + 0.50189cm + 8.01543in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + true + true + + + + + Distancia + + + + + + + Textbox28 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 1.9529cm + + + 2.76367cm + + + 4.4249cm + + + 2.46447cm + + + 7.16731cm + + + + + 0.6cm + + + + + true + true + + + + + =Fields!TipoUbicacion.Value + + + + + + + TipoUbicacion + + 2pt + + + + + + 1pt + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!RFC.Value + + + + + + + UM + + 2pt + + + + + + 1pt + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Nombre.Value + + + + + + + Textbox31 + + 5pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FechaHoraSalida.Value + + + + + + + Textbox65 + + 5pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Direccion.Value + + + + + + + Direccion + + 5pt + + + + 1pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 0.52062cm + + + true + true + + + + + Ubicación + + + + + + + Textbox28 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + RFC + + + + + + + Textbox40 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + Nombre + + + + + + + Textbox30 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + Fecha + + + + + + + Textbox64 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + Dirección + + + + + + + Textbox1 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 1.61241cm + + + true + true + + + + + =Fields!Distancia.Value + + + + + + + Cantidad + + 2pt + + + + + + 1pt + + + 1pt + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + DataSet2 + 9.1543cm + 0.06623cm + 1.12062cm + 20.38566cm + 2 + + + + + + true + true + + + + + ORIGEN / DESTINO + + + + + + + Textbox3 + 8.56422cm + 0.06623cm + 0.5cm + 8.01861in + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + true + true + + + + + RFC + + + + + + + Textbox28 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 4.89586cm + + + 10.35081cm + + + + + 0.6cm + + + + + true + true + + + + + =Fields!NumLicencia.Value + + + + + + + UM + + 2pt + + + + + + 1pt + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!NombreOperador.Value + + + + + + + Textbox31 + + 5pt + + + + 1pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 0.52062cm + + + true + true + + + + + LICENCIA + + + + + + + Textbox40 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + NOMBRE OPERADOR + + + + + + + Textbox30 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 5.12057cm + + + true + true + + + + + =Fields!RFC.Value + + + + + + + Cantidad + + 2pt + + + + + + 1pt + + + 1pt + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + DataSet4 + 11.8213cm + 0.06623cm + 1.12062cm + 20.36724cm + 4 + + + + + + true + true + + + + + FIGURAS DE TRANSPORTE + + + + + + + Textbox3 + 11.23122cm + 0.06623cm + 0.5cm + 8.01861in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Medio de transporte + + + + : + + + + =Parameters!MedioTransporte.Value + + + + + + + + + Transporte Internacional: + + + + =Parameters!TransporteInternacional.Value + + + + + + + + + Permiso SCT: + + + + + + + + =Parameters!PermisoSTCC.Value + + + + + + + + + Numero de Permiso + + + + : + + + + =Parameters!NumPermiso.Value + + + + + + + + + Placa: + + + + =Parameters!PlacaVM.Value + + + + + + + + + Año: + + + + =Parameters!AnioVM.Value + + + + + + + + + + + Textbox2 + 1.09361in + 0.06623cm + 0.95951in + 3.78787in + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + DETALLE TRANSPORTE + + + + + + + Textbox3 + 2.27425cm + 0.06623cm + 0.5cm + 8.01543in + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Aseguradora Responsabilidad Civil: + + + + =Parameters!Aseguradora.Value + + + + + + + + + Número de Póliza: + + + + =Parameters!NumPoliza.Value + + + + + + + + + Aseguradora Medio Ambiente: + + + + =Parameters!NombreAseguradoraMedioAmbiente.Value + + + + + + + + + Número de Póliza: + + + + =Parameters!NumPolizaSeguroMedioAmbiente.Value + + + + + + + + + Aseguradora Carga: + + + + =Parameters!NombreAseguradoraCarga.Value + + + + + + + + + Número de Póliza: + + + + =Parameters!NumPolizaSeguroCarga.Value + + + + + + + + + + + + + + + + Textbox2 + 1.09361in + 9.72269cm + 0.95951in + 4.21685in + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Remolque 1 + + + + Placa: + + + + =Parameters!RemolquePlaca1.Value + + + + Tipo Rem: + + + + =Parameters!RemolqueSubtimo1.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Remolque 2 + + + + Placa: + + + + =Parameters!RemolquePlaca2.Value + + + + Tipo Rem: + + + + =Parameters!RemolqueSubtimo2.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + true + true + + + + + RELACIÓN + + + + + + + Textbox62 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + UUID + + + + + + + Textbox69 + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 1.25962cm + + + + + 0.6cm + + + + + true + true + + + + + + + + + + + + UM + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 0.52062cm + + + true + true + + + + + + + + + + + + Textbox40 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + =Fields!Relacion.Value + + + + + =Fields!Relacion.Value + + + + 9.54971cm + + + true + true + + + + + =Fields!Relacion.Value + + + + + + + Relacion + + 2pt + + + + + + 1pt + + + 1pt + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + =Fields!UUID.Value + + + + + =Fields!UUID.Value + + + + 9.34933cm + + + true + true + + + + + =Fields!UUID.Value + + + + + + + UUID + + 2pt + + + + + + 1pt + + + + 1pt + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + true + true + DataSet5 + 0.50301cm + 0.08761cm + 1.12062cm + 20.15866cm + + + + + + true + true + + + + + FOLIOS RELACIONADOS + + + + + + + Textbox3 + 0.02618cm + 0.5cm + 7.96066in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + 13.15006cm + 0.06623cm + 1.78092cm + 20.36726cm + 11 + + =IIf(CountRows("DataSet5") = 0, True, False) + + + + + + + + + true + true + + + + + N + + + + ombre: + + + + =Parameters!ClienteNombre.Value + + + + + + + + + RFC: + + + + =Parameters!ClienteRFC.Value + + + + + + + + + Uso CFDi: + + + + + + + + =Parameters!UsoCFDi.Value + + + + + + + Textbox2 + 0.26311in + 0.08761cm + 0.54893in + 8.01543in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + DATOS DEL CLIENTE + + + + + + + Textbox3 + 0.10114cm + 0.08761cm + 0.5cm + 8.01543in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + 0.03528cm + 0.06623cm + 2.09786cm + 20.4468cm + 12 + + =(Parameters!EsSubReporte.Value) + + + + + + + + + true + true + + + + + Sello digital del CFDI: + + + + + + + + + =Parameters!SelloCFDI.Value + + + + + + + + + Cadena original del complemento de certificación digital del SAT: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!QR.Value + FitProportional + 1.6047in + 6.68415in + 1.2939in + 1.28682in + 1 + + + + + + + + + + + + true + true + + + + + CANTIDAD + + + + + + + Textbox28 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 3.2638cm + + + 9.16926cm + + + 2.60938cm + + + 3.20474cm + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Unidad.Value + + + + + + + UM + + 2pt + + + + + + 1pt + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Descripcion.Value + + + + + + + Textbox31 + + 5pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ValorUnitario.Value + + + + + + + PesoEnKg + + 5pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + 5pt + + + + 1pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 0.52062cm + + + true + true + + + + + UNIDAD DE MEDIDA + + + + + + + Textbox40 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + DESCRIPCIÓN + + + + + + + Textbox30 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + PU + + + + + + + Textbox64 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + IMPORTE + + + + + + + Textbox5 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 2.1201cm + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad + + 2pt + + + + + + 1pt + + + 1pt + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + DataSet1 + 0.59008cm + 1.12062cm + 20.36728cm + 2 + + + + + + true + true + + + + + CONCEPTOS + + + + + + + Textbox3 + 0.5cm + 8.01861in + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!SubTotal.Value + + + + + + + Textbox3 + 0.78988in + 6.96227in + 0.60856cm + 1.0615in + 4 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + SUBTOTAL + + + + : + + + + + + + Textbox3 + 2.00629cm + 5.84376in + 0.60856cm + 1.12267in + 5 + + + White + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!Descuentos.Value + + + + + + + Textbox3 + 1.02947in + 6.96435in + 0.60856cm + 1.05108in + 6 + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + DESCUENTOS: + + + + + + + Textbox3 + 2.61484cm + 5.83821in + 0.60856cm + 1.12683in + 7 + + + White + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!Total.Value + + + + + + + Textbox3 + 1.26906in + 6.96643in + 0.60856cm + 1.05108in + 8 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + TOTAL: + + + + + + + Textbox3 + 3.22339cm + 5.84029in + 0.60856cm + 1.12614in + 9 + + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + "Este documento es una representación impresa de un CFDI" + + + + + + + + + + + + + + + + + + Folio fiscal: + + + + =Parameters!FolioFiscal.Value + + + + + + + + + + + =Parameters!FechaCertificacion.Value + + + + + + + + + + + =Parameters!CertificadoContribuyente.Value + + + + + + + =Parameters!SerieCertificadoSAT.Value + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + 15.01212cm + 0.0743cm + 7.44771cm + 20.42542cm + 13 + + =Parameters!EsSubReporte.Value + + + + + + + true + true + + + + + Pesto Neto Total (KG): + + + + =Parameters!PesoNetoTotal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Distancia Total: + + + + =Parameters!DistanciaTotal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 8.84245in + + + + + + + Textbox2 + 0.38703cm + 5.23849cm + 0.78571cm + 9.73471cm + + + + true + true + + + + + RFC: + + + + =Parameters!RFC.Value + + + + + + + + + + + =Parameters!DomicilioFiscal.Value + + + + + + + =Parameters!RegimenFiscal.Value + + + + + + + =Parameters!DomicilioExpedicion.Value + + + + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.19452in + 0.46171in + 1.23522in + 2 + + + + + + true + + + + + CARTA PORTE - TRASLADO + + + + + + + Textbox3 + 0.38703cm + 6.09531in + 0.5cm + 1.83161in + 3 + + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SerieFolio.Value + + + + + + + Textbox3 + 0.3607in + 6.09531in + 0.60856cm + 1.83161in + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 1.23524cm + true + true + + + 0.03524cm + 0.06623cm + 0cm + 20.38566cm + + + + + + true + true + + + + + Usuario: + + + + + + + Textbox13 + 0.14107cm + 0.71425cm + 0.54708cm + 1.55632cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + + Textbox14 + 0.14107cm + 2.27057cm + 0.54708cm + 4.96223cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresion: + + + + + + + Textbox13 + 0.14107cm + 7.33864cm + 0.54708cm + 2.84562cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + Textbox14 + 0.14107cm + 10.18425cm + 0.54708cm + 4.68641cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox14 + 0.1446cm + 14.99343cm + 0.54708cm + 4.04906cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + IMPRESO EN SIG, Traspaso Almacén + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 19.59cm + 0cm + 0cm + 1cm + 1cm + 0.13cm + - - - - - - - - DE C.V. RFC: EMD950206SRA - - - - - - - - - Tipo de Comprobante: I - Ingreso - - - - - - - - - Del Cobre No. 95 Col. Parque Industrial Hermosillo, Sonora. México, C.P. 83299 - - - - - - - - - Tel. 6622510249 - - - - - - - - - Régimen Fiscal: 601 - General de Ley Personas Morales - - - - - - - Textbox4 - 1.83923in - 1.10377in - 6.21276in - - - 2pt - 2pt - 2pt - 2pt - - - - Embedded - Logo1 - FitProportional - 0.65302cm - 2.88998cm - 3.84225cm - 1 - - - - - - true - true - - - - - Nombre: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteNombre.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 1.50708cm - - - 1.63629cm - - - 1.29788cm - - - 1.66402cm - - - 8.32569cm - - - 1.42482cm - - - 1.73271cm - - - 2.4815cm - - - - - 0.74994cm - - - - - true - - - - - Cantidad - - - - - - - Textbox34 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Codigo - - - - - - - Textbox15 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - C.U. SAT - - - - - - - Textbox75 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Clave - - - - - - - - - Producto - - - - - - - Textbox82 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Descripción - - - - - - - Textbox79 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - P.U. - - - - - - - Textbox84 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Impuestos - - - - - - - Textbox91 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Importe - - - - - - - - - - - - - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.48536cm - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad1 - - - - #4f81bd - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SATClaveProdServ.Value - - - - - - - SATClaveProdServ - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SATClaveUM.Value - - - - - - - SATClaveUM - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Codigo.Value - - - - - - - Codigo - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PS.Value & " " & Fields!Obs.Value - - - - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PU.Value - - - - - - - PU1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteIVA.Value - - - - - - - ImporteIVA - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Cantidad.Value*Fields!PU.Value - - - - - - - Textbox88 - - - - #4f81bd - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DsOC - 6.28717cm - 0.44641cm - 1.2353cm - 20.06999cm - 4 - - - - - - true - true - - - - - =Parameters!ClienteDatoExtra1.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 3.15414cm - - - - - 0.27059cm - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - 0.38492cm - - - - - true - true - - - - - =Replace(Parameters!Moneda.Value,"Pesos","Peso mexicano") - - - - - - - Textbox47 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - =Fields!ImpuestoLocal.Value - - - - 2.52863cm - - - true - true - - - - - =Fields!ImpuestoLocal.Value - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - 2.52863cm - - - true - true - - - - - Moneda - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - Before - - - - DataSet1 - 7.71422cm - 14.83363cm - 0.65551cm - 5.68277cm - 6 - - - - - - true - true - - - - - Folio Factura - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =IIF(Parameters!Serie.Value.ToString="",Parameters!Folio.Value,Parameters!Serie.Value & "-" &Parameters!Folio.Value) - - - - - - - Textbox3 - 2.79612cm - 17.39754cm - 0.41303cm - 3.066cm - 8 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Fecha.Value - - - - - - - Textbox12 - 3.22326cm - 17.39754cm - 0.42714cm - 3.066cm - 10 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Lugar de Expedición - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - 83299 - - - - - - - Textbox55 - 3.75976cm - 17.39754cm - 0.46681cm - 3.05452cm - 12 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Forma de Pago - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FormaPago.Value - - - - - - - Textbox3 - 3.0229cm - 4.48098cm - 0.42944cm - 6.76133cm - 14 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Método de Pago - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =IIF(Parameters!MetodoPago.Value.ToString="","No Identificado",Parameters!MetodoPago.Value) - - - - - - - Textbox3 - 3.46998cm - 4.48098cm - 0.40122cm - 6.76133cm - 16 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Moneda - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Moneda.Value - - - - - - - - Tipo de Cambio - - - - - - - - =Parameters!TipoCambio.Value - - - - - - - - - - - Textbox3 - 3.95234cm - 4.48098cm - 0.43297cm - 6.76133cm - 18 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Datos del Cliente - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - R.F.C.: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteRFC.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Uso CFDI: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!UsoCFDI.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Domicilio: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteDireccion.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - OBSERVACIONES GENERALES: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Observaciones.Value - - - - - - - Textbox3 - 7.54478cm - 5.057cm - 0.44003cm - 9.60024cm - 27 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ImporteLetra.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Importe Con Letra: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!QR.Value - FitProportional - 3.40943in - 0.22897in - 1.14694in - 1.34784in - 30 - - - - - - true - true - - - - - Serie del Certificado del Emisor - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Folio Fiscal - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - No. de Serie del Certificado de l SAT - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha y Hora de Certificación - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!CertificadoContribuyente.Value - - - - - - - Textbox2 - 9.29495cm - 14.82657cm - 0.35889cm - 5.62289cm - 35 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FolioFiscal.Value - - - - - - - Textbox2 - 9.67148cm - 14.82657cm - 0.40122cm - 5.62289cm - 36 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SerieCertificadoSAT.Value - - - - - - - Textbox2 - 10.05859cm - 14.82657cm - 0.3536cm - 5.62289cm - 37 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FechaCertificacion.Value - - - - - - - Textbox2 - 10.41395cm - 14.82657cm - 0.31479cm - 5.62289cm - 38 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Este documento es una representación impresa de un CFDI - - - - - - - - - Version 3.3 - - - - - - - Textbox19 - 4.27878in - 9.81667cm - 0.34009in - 4.18614in - 39 - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SelloCFDI.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Sello Digital del CFDI - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SelloSAT.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Sello SAT - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!CadenaSAT.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Cadena Original del Complemento del Certificación Digital del SAT - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - true - true - - - - - CFDI Relacionados - - - - - - - Textbox5 - 0.14926cm - 0.9525cm - 0.46066cm - 18.98926cm - - - White - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Tipo Relación: - - - - - - - Textbox29 - 0.735cm - 4.71624cm - 0.41981cm - 5.31841cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!TipoRelacionTexto.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 2.42456cm - - - 2.05585cm - - - 3.03631cm - - - 7.7847cm - - - - - 0.44125cm - - - - - true - true - - - - - Folio - - - - - - - Textbox10 - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Fecha - - - - - - - Textbox12 - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Importe - - - - - - - Textbox21 - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Folio Fiscal - - - - - - - Textbox11 - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.41479cm - - - - - true - true - - - - - =Fields!SerieFolio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Fecha.Value - - - - - - - Fecha - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!FolioFiscal.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - After - - - - - - - DataSet4 - 1.39643cm - 3.2145cm - 0.85604cm - 15.30142cm - 3 - - - - - - true - 14.54249cm - 0.07193cm - 2.25247cm - 20.37753cm - 46 - - =Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True) - - - - - - - 16.79496cm - - - - - - - Textbox3 - 0.04232cm - 16.34905cm - 0.6cm - 3.95896cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - - - =Today - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 0.5cm - 0.5cm - 1cm - 0.5cm - 1.27cm - + + + + + + + + DE C.V. RFC: EMD950206SRA + + + + + + + + + Tipo de Comprobante: I - Ingreso + + + + + + + + + Del Cobre No. 95 Col. Parque Industrial Hermosillo, Sonora. México, C.P. 83299 + + + + + + + + + Tel. 6622510249 + + + + + + + + + Régimen Fiscal: 601 - General de Ley Personas Morales + + + + + + + Textbox4 + 1.94795in + 1.12067in + 5.98809in + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo1 + FitProportional + 0.92917cm + 2.88998cm + 3.84225cm + 1 + + + + + + true + true + + + + + Nombre: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteNombre.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 1.50708cm + + + 1.63629cm + + + 1.29788cm + + + 1.66402cm + + + 8.32569cm + + + 1.42482cm + + + 1.73271cm + + + 2.4815cm + + + + + 0.74994cm + + + + + true + + + + + Cantidad + + + + + + + Textbox34 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Codigo + + + + + + + Textbox15 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + C.U. SAT + + + + + + + Textbox75 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Clave + + + + + + + + + Producto + + + + + + + Textbox82 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Descripción + + + + + + + Textbox79 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + P.U. + + + + + + + Textbox84 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Impuestos + + + + + + + Textbox91 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Importe + + + + + + + + + + + + + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.48536cm + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad1 + + + + #4f81bd + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SATClaveProdServ.Value + + + + + + + SATClaveProdServ + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SATClaveUM.Value + + + + + + + SATClaveUM + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + + Codigo + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value & " " & Fields!Obs.Value + + + + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PU.Value + + + + + + + PU1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteIVA.Value + + + + + + + ImporteIVA + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cantidad.Value*Fields!PU.Value + + + + + + + Textbox88 + + + + #4f81bd + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsOC + 6.28717cm + 0.08756cm + 1.2353cm + 20.06999cm + 4 + + + + + + true + true + + + + + =Parameters!ClienteDatoExtra1.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 3.15414cm + + + + + 0.27059cm + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + 0.38492cm + + + + + true + true + + + + + =Replace(Parameters!Moneda.Value,"Pesos","Peso mexicano") + + + + + + + Textbox47 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + =Fields!ImpuestoLocal.Value + + + + 2.52863cm + + + true + true + + + + + =Fields!ImpuestoLocal.Value + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 2.52863cm + + + true + true + + + + + Moneda + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + Before + + + + DataSet1 + 7.71422cm + 14.47478cm + 0.65551cm + 5.68277cm + 6 + + + + + + true + true + + + + + Folio Factura + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Serie.Value.ToString="",Parameters!Folio.Value,Parameters!Serie.Value & "-" &Parameters!Folio.Value) + + + + + + + Textbox3 + 2.79612cm + 17.03869cm + 0.41303cm + 3.066cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Fecha.Value + + + + + + + Textbox12 + 3.22326cm + 17.03869cm + 0.42714cm + 3.066cm + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Lugar de Expedición + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 83299 + + + + + + + Textbox55 + 3.75976cm + 17.03869cm + 0.46681cm + 3.05452cm + 12 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Forma de Pago + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FormaPago.Value + + + + + + + Textbox3 + 3.0229cm + 4.12213cm + 0.42944cm + 6.76133cm + 14 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Método de Pago + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!MetodoPago.Value.ToString="","No Identificado",Parameters!MetodoPago.Value) + + + + + + + Textbox3 + 3.46998cm + 4.12213cm + 0.40122cm + 6.76133cm + 16 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Moneda + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Moneda.Value + + + + + + + + Tipo de Cambio + + + + + + + + =Parameters!TipoCambio.Value + + + + + + + + + + + Textbox3 + 3.95234cm + 4.12213cm + 0.43297cm + 6.76133cm + 18 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Datos del Cliente + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + R.F.C.: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteRFC.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Uso CFDI: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!UsoCFDI.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Domicilio: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteDireccion.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + OBSERVACIONES GENERALES: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + + Textbox3 + 7.54478cm + 4.69815cm + 0.44003cm + 9.60024cm + 27 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ImporteLetra.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Importe Con Letra: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!QR.Value + FitProportional + 3.40943in + 0.08769in + 1.14694in + 1.34784in + 30 + + + + + + true + true + + + + + Serie del Certificado del Emisor + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Folio Fiscal + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + No. de Serie del Certificado de l SAT + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha y Hora de Certificación + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CertificadoContribuyente.Value + + + + + + + Textbox2 + 9.29495cm + 14.46772cm + 0.35889cm + 5.62289cm + 35 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FolioFiscal.Value + + + + + + + Textbox2 + 9.67148cm + 14.46772cm + 0.40122cm + 5.62289cm + 36 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SerieCertificadoSAT.Value + + + + + + + Textbox2 + 10.05859cm + 14.46772cm + 0.3536cm + 5.62289cm + 37 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaCertificacion.Value + + + + + + + Textbox2 + 10.41395cm + 14.46772cm + 0.31479cm + 5.62289cm + 38 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Este documento es una representación impresa de un CFDI + + + + + + + + + Version 3.3 + + + + + + + Textbox19 + 4.27878in + 9.45782cm + 0.34009in + 4.18614in + 39 + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SelloCFDI.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sello Digital del CFDI + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SelloSAT.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sello SAT + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CadenaSAT.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Cadena Original del Complemento del Certificación Digital del SAT + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + true + true + + + + + CFDI Relacionados + + + + + + + Textbox5 + 0.14926cm + 1.30058cm + 0.46066cm + 18.98926cm + + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Tipo Relación: + + + + + + + Textbox29 + 0.735cm + 5.06432cm + 0.41981cm + 5.31841cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!TipoRelacionTexto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.42456cm + + + 2.05585cm + + + 3.03631cm + + + 7.7847cm + + + + + 0.44125cm + + + + + true + true + + + + + Folio + + + + + + + Textbox10 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha + + + + + + + Textbox12 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox21 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Folio Fiscal + + + + + + + Textbox11 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.41479cm + + + + + true + true + + + + + =Fields!SerieFolio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Fecha.Value + + + + + + + Fecha + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FolioFiscal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet4 + 1.39643cm + 3.56258cm + 0.85604cm + 15.30142cm + 3 + + + + + + true + 14.54249cm + 2.28935cm + 20.28984cm + 46 + + =Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True) + + + + + + + + + true + true + + + + + CARTA PORTE - TRASLADO + + + + + + + Textbox6 + 0.12917cm + 0.06399cm + 0.6cm + 20.02662cm + + + 2pt + 2pt + 2pt + 2pt + + + + + Start + + true + 16.87906cm + 0.80985cm + 20.28984cm + 47 + + + + + + CartaPorteTimbrado + + + =Parameters!SRP_LogoPath.Value + + + =Parameters!SRP_RFC.Value + + + =Parameters!SRP_SerieFolio.Value + + + =Parameters!SRP_DomicilioFiscal.Value + + + =Parameters!SRP_RegimenFiscal.Value + + + =Parameters!SRP_DomicilioExpedicion.Value + + + =Parameters!SRP_ClienteDireccion.Value + + + =Parameters!SRP_ClienteNombre.Value + + + =Parameters!SRP_ClienteRFC.Value + + + =Parameters!SRP_MedioTransporte.Value + + + =Parameters!SRP_TransporteInternacional.Value + + + =Parameters!SRP_FolioFiscal.Value + + + =Parameters!SRP_FechaCertificacion.Value + + + =Parameters!SRP_CertificadoContribuyente.Value + + + =Parameters!SRP_SerieCertificadoSAT.Value + + + =Parameters!SRP_SelloCFDI.Value + + + =Parameters!SRP_CadenaOriginal.Value + + + =Parameters!SRP_SelloSAT.Value + + + =Parameters!SRP_QR.Value + + + =Parameters!SRP_PermisoSTCC.Value + + + =Parameters!SRP_NumPermiso.Value + + + =Parameters!SRP_Aseguradora.Value + + + =Parameters!SRP_NumPoliza.Value + + + =Parameters!SRP_PlacaVM.Value + + + =Parameters!SRP_AnioVM.Value + + + =Parameters!SRP_TipoTI.Value + + + =Parameters!SRP_ViaTI.Value + + + =Parameters!SRP_UsoCFDi.Value + + + =Parameters!SRP_SubTotal.Value + + + =Parameters!SRP_Total.Value + + + =Parameters!SRP_Descuentos.Value + + + =Parameters!SRP_NombreAseguradoraMedioAmbiente.Value + + + =Parameters!SRP_NumPolizaSeguroMedioAmbiente.Value + + + =Parameters!SRP_NombreAseguradoraCarga.Value + + + =Parameters!SRP_NumPolizaSeguroCarga.Value + + + =Parameters!SRP_RemolquePlaca1.Value + + + =Parameters!SRP_RemolqueSubtimo1.Value + + + =Parameters!SRP_RemolquePlaca2.Value + + + =Parameters!SRP_RemolqueSubtimo2.Value + + + =True + + + =Parameters!SRP_PesoNetoTotal.Value + + + =Parameters!SRP_DistanciaTotal.Value + + + 17.78979cm + 1.77607cm + 20.12945cm + 48 + + + + + + 19.56586cm + + + + + + + Textbox3 + 0.04232cm + 16.6252cm + 0.6cm + 3.66464cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + + + =Today + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0.5cm + 0.5cm + 1cm + 0.5cm + 1.27cm +