<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>La Cofradía Digital &#187; Tips técnicos</title>
	<atom:link href="http://cofradia.org/category/tips-tecnicos/feed/" rel="self" type="application/rss+xml" />
	<link>http://cofradia.org</link>
	<description>Hermandad informática</description>
	<lastBuildDate>Wed, 08 Feb 2012 02:15:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Estudio de sistemas ERP open source</title>
		<link>http://cofradia.org/2011/05/30/estudio-de-sistemas-erp-open-source/</link>
		<comments>http://cofradia.org/2011/05/30/estudio-de-sistemas-erp-open-source/#comments</comments>
		<pubDate>Mon, 30 May 2011 20:00:49 +0000</pubDate>
		<dc:creator>zodman</dc:creator>
				<category><![CDATA[Negocios]]></category>
		<category><![CDATA[software libre]]></category>
		<category><![CDATA[Tips técnicos]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=5730</guid>
		<description><![CDATA[Me llego este documento muy interesante (en versión PDF) sobre proyectos de ERP (Enterprise resource planning) libres. Por cierto la comunidad de tryton en mexico esta en http://code.google.com/p/tryton-mx]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://cofradia.org/2011/05/30/estudio-de-sistemas-erp-open-source/"></g:plusone></div><p>Me llego <A HREF="http://goo.gl/wAKLZ">este documento</A> muy interesante (en versión PDF) sobre proyectos de ERP (Enterprise resource planning) libres.</p>
<p>Por cierto la comunidad de tryton en mexico esta en <a title="tryton-mx" href="http://code.google.com/p/tryton-mx">http://code.google.com/p/tryton-mx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2011/05/30/estudio-de-sistemas-erp-open-source/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mejores prácticas para obtener fondeo de Kickstarter</title>
		<link>http://cofradia.org/2011/04/14/kickstarter-best-practices-for-getting-startup-seed-money/</link>
		<comments>http://cofradia.org/2011/04/14/kickstarter-best-practices-for-getting-startup-seed-money/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 04:17:10 +0000</pubDate>
		<dc:creator>solrac</dc:creator>
				<category><![CDATA[Negocios]]></category>
		<category><![CDATA[Tips técnicos]]></category>
		<category><![CDATA[entrepreneur]]></category>
		<category><![CDATA[innovation]]></category>
		<category><![CDATA[Startup]]></category>
		<category><![CDATA[Web app]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=5450</guid>
		<description><![CDATA[Nos mandan nuestros amigos de IBM una guía de consejos para poder obtener fondos para proyectos presentados a la comunidad en Kickstarter: Startups fail often because they create a product or service that no one really wants in mass. To mitigate Startup failure you can test your Idea at Kickstarter &#8211; A cool place to [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://cofradia.org/2011/04/14/kickstarter-best-practices-for-getting-startup-seed-money/"></g:plusone></div><p><a href="http://cofradia.org/wp-content/uploads/2011/02/kickstarter_logo.jpg"><img src="http://cofradia.org/wp-content/uploads/2011/02/kickstarter_logo-300x72.jpg" alt="" title="kickstarter_logo" width="300" height="72" class="alignnone size-medium wp-image-4759" /></a></p>
<p>Nos mandan nuestros amigos de IBM una guía de consejos para poder obtener fondos para proyectos presentados a la comunidad en <A HREF="http://www.kickstarter.com/">Kickstarter</A>:</p>
<blockquote><p>
Startups fail often because they create a product or service that no one really wants in mass. To mitigate Startup failure you can <a href="https://www.ibm.com/developerworks/mydeveloperworks/blogs/782c981b-356f-4bd8-b494-da4da4899e70/entry/kickstarter_best_practices_for_getting_the_crowdsourced_startup_seed_money_you_need29?cmp=dw&amp;cpb=dwmyd&amp;ct=dwgra&amp;cr=twitter&amp;ccy=zz&amp;crs=kickstarterbestpractices">test your Idea at Kickstarter</a> &#8211; A cool place to not only test interest in your idea, but also a great place tp obtain croudsourced funding for your Startup. A good idea, communicated well on KickStarter can spread fast and wide, and the large Kickstarter community can be a tremendous source of money and encouragement.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2011/04/14/kickstarter-best-practices-for-getting-startup-seed-money/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hack para el AirPlay en Perl</title>
		<link>http://cofradia.org/2011/04/11/hack-para-el-airplay-en-perl/</link>
		<comments>http://cofradia.org/2011/04/11/hack-para-el-airplay-en-perl/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 22:34:57 +0000</pubDate>
		<dc:creator>El Pop</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Tips técnicos]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=5445</guid>
		<description><![CDATA[En la página de mafipulation.org leo la liberación del ShairPort 0.03. Este es un programa en Perl que permite emular el protocolo de AirPlay de Apple en cualquier computadora.]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://cofradia.org/2011/04/11/hack-para-el-airplay-en-perl/"></g:plusone></div><p>En la página de mafipulation.org leo la liberación del <A HREF="http://mafipulation.org/blagoblig/2011/04/08#shairport">ShairPort 0.03</A>. Este es un programa en Perl que permite emular el protocolo de AirPlay de Apple en cualquier computadora.</p>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2011/04/11/hack-para-el-airplay-en-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Open Enchilada Project en el marco del COSIT</title>
		<link>http://cofradia.org/2011/04/02/the-open-enchilada-project-en-el-marco-del-cosit/</link>
		<comments>http://cofradia.org/2011/04/02/the-open-enchilada-project-en-el-marco-del-cosit/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 04:17:49 +0000</pubDate>
		<dc:creator>El Pop</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[software libre]]></category>
		<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[Tips técnicos]]></category>
		<category><![CDATA[WTF]]></category>
		<category><![CDATA[¿Qué hacer en mi tiempo libre?]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=5389</guid>
		<description><![CDATA[Les dejamos la liga al stream del último video del programa de Open Enchilada. En el cual se habla del COSIT, ACTA, e-voto, Blender y miscelaneos. con @el_pop @tacvbo @casyopea @octagesimal y mas banda, conducido por @gnuowned Liga al podcast.]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://cofradia.org/2011/04/02/the-open-enchilada-project-en-el-marco-del-cosit/"></g:plusone></div><p><a href="http://cofradia.org/wp-content/uploads/2011/04/open_enchilada.jpg"><img src="http://cofradia.org/wp-content/uploads/2011/04/open_enchilada.jpg" alt="" title="open_enchilada" width="203" height="197" class="alignleft size-full wp-image-5393" /></a></p>
<p>Les dejamos la liga al stream del <A HREF="http://www.gnuowned.org/post/4300069454/stream-grabacion-de-the-open-enchilada-project">último video</A> del programa de Open Enchilada.</p>
<p>En el cual se habla del COSIT, ACTA, e-voto, Blender y miscelaneos. con @el_pop @tacvbo @casyopea @octagesimal y mas banda, conducido por @gnuowned</p>
<p>Liga <A HREF="http://www.openenchilada.com/2011/04/03/the-open-enchilada-project-s02e12-cosit-mx/">al podcast</A>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2011/04/02/the-open-enchilada-project-en-el-marco-del-cosit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Convirtiendo facturas electrónicas del XML a PDF</title>
		<link>http://cofradia.org/2011/03/27/convirtiendo-facturas-electronicas-del-xml-a-pdf/</link>
		<comments>http://cofradia.org/2011/03/27/convirtiendo-facturas-electronicas-del-xml-a-pdf/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 00:49:22 +0000</pubDate>
		<dc:creator>El Pop</dc:creator>
				<category><![CDATA[Paranoia Fan Club]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Tips técnicos]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=5344</guid>
		<description><![CDATA[Pues hemos mencionado la generación de sellos para las facturas electrónicas del SAT, su validación y ahora vamos a dar cierre al ciclo de la emisión, con lo que se le conoce como la representación impresa del comprobante fiscal digital. Me dí a la tarea de hacer un pequeño script en Perl que convierte el [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://cofradia.org/2011/03/27/convirtiendo-facturas-electronicas-del-xml-a-pdf/"></g:plusone></div><p>Pues hemos mencionado la <A HREF="http://cofradia.org/2010/12/18/how-to-de-facturacion-electronica-para-unixeros-generacion-de-sellos/">generación de sellos</A> para las facturas electrónicas del SAT, su <A HREF="http://cofradia.org/2010/12/29/how-to-de-facturacion-electronica-verificacion-de-facturas/">validación</A> y ahora vamos a dar cierre al ciclo de la emisión, con lo que se le conoce como la representación impresa del comprobante fiscal digital.</p>
<p>Me dí a la tarea de hacer un pequeño script en Perl que convierte el XML de la factura electrónica a su versión en PDF, tomando en cuenta que yo lo hago por Medios Propios (versión 2.0).<br />
<span id="more-5344"></span><br />
Este utiliza varios módulos para Perl de <A HREF="http://cpan.org">CPAN</A>:<br />
<UL><br />
<LI><A HREF="http://search.cpan.org/~larslund/PDF-Reuse-0.35/Reuse.pm">PDF::Reuse</A> para la manipulación de PDF&#8217;s</LI><br />
<LI><A HREF="http://search.cpan.org/~jrey/Lingua-ES-Numeros-0.08/lib/Lingua/ES/Numeros.pm">Lingua::ES::Numeros</A> para convertir números a leyenda en letra</LI><br />
<LI><A HREF="http://search.cpan.org/~grantm/XML-Simple-2.18/lib/XML/Simple.pm">XML::Simple</A> para la manipulación del XML de la factura electrónica</LI><br />
<LI><A HREF="http://search.cpan.org/~schubiger/Text-Wrap-Smart-0.6/lib/Text/Wrap/Smart.pm">Text::Wrap::Smart</A> para poner bonito el texto</LI><br />
</UL></p>
<p>Para instalar estos módulos sigan la <A HREF="http://www.cpan.org/modules/INSTALL.html">guía de instalación</A> de CPAN.</p>
<p>Es necesario para el manejo de la cadena original tener instalado el <A HREF="http://xmlsoft.org/XSLT/xsltproc2.html">xsltproc</A> y el archivo descriptor de xslt del SAT para usarlo: <A HREF="http://www.sat.gob.mx/sitio_internet/cfd/2/cadenaoriginal_2_0/cadenaoriginal_2_0.xslt">cadenaoriginal_2_0.xslt</A> (liga al ftp del SAT).</p>
<p>Mis ejemplos los pueden bajar <A HREF="http://cofradia.org/down/CFD_PDF.tar.gz">aquí</A> (archivo CFD_PDF.tar.gz, mide 285 Kb).</p>
<p>El programa usa un machote de PDF previamente hecho con alguna herramienta o procesador de texto. En mi caso use un programa para Mac llamado <A HREF="http://www.omnigroup.com/products/omnigraffle/">Omnigraffle</A> y generé un template (factura.pdf). </p>
<p>Tomé un logo de prueba y lo dejé en formato jpeg (logo.jpg) y deje un ejemplo de un XML de factura electrónica para transformalo a PDF (Fac_Sample.xml).</p>
<p>El programa es este (que esta contenido en el archivo de ejemplos mencionados anteriormente):</p>
<p><b>CFD_to_PDF.pl</b></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #666666; font-style: italic;">#===================================================================#</span>
<span style="color: #666666; font-style: italic;"># Program =&gt; CFD_to_PDF.pl (In Perl 5.0)              version 0.0.1 #</span>
<span style="color: #666666; font-style: italic;">#===================================================================#</span>
<span style="color: #666666; font-style: italic;"># Autor         =&gt; Fernando &quot;El Pop&quot; Romo        (pop@cofradia.org) #</span>
<span style="color: #666666; font-style: italic;"># Creation date =&gt; 06/feb/2011                                      #</span>
<span style="color: #666666; font-style: italic;">#-------------------------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;"># Info =&gt; This program take a CFD file in xml format and convert to #</span>
<span style="color: #666666; font-style: italic;">#         PDF using a template                                      #</span>
<span style="color: #666666; font-style: italic;">#-------------------------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;">#                    (c) 2011 - Fernando Romo                       #</span>
<span style="color: #666666; font-style: italic;">#-------------------------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;">#              Release under the GNU/GPL License v3.0               #</span>
<span style="color: #666666; font-style: italic;">#===================================================================#</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Load Modules</span>
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> PDF<span style="color: #339933;">::</span><span style="color: #006600;">Reuse</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Lingua<span style="color: #339933;">::</span><span style="color: #006600;">ES</span><span style="color: #339933;">::</span><span style="color: #006600;">Numeros</span> <span style="color: #ff0000;">&quot;:constants&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> XML<span style="color: #339933;">::</span><span style="color: #006600;">Simple</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Text<span style="color: #339933;">::</span><span style="color: #006600;">Wrap</span><span style="color: #339933;">::</span><span style="color: #006600;">Smart</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span>wrap_smart<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$file</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$Fac</span> <span style="color: #339933;">=</span> XMLin<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$file</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/.xml$//g</span><span style="color: #339933;">;</span>
&nbsp;
prFile <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#123;</span> Name         <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;$file.pdf&quot;</span><span style="color: #339933;">,</span>
           HideToolbar  <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>          <span style="color: #666666; font-style: italic;"># 1 or 0</span>
           HideMenubar  <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>          <span style="color: #666666; font-style: italic;"># 1 or 0</span>
           HideWindowUI <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>          <span style="color: #666666; font-style: italic;"># 1 or 0</span>
           FitWindow    <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>          <span style="color: #666666; font-style: italic;"># 1 or 0</span>
           CenterWindow <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span>   <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;"># 1 or 0</span>
&nbsp;
prForm <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#123;</span> file     <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'factura.pdf'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;"># template file</span>
           page     <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>             <span style="color: #666666; font-style: italic;"># page number (of imported template)</span>
           adjust   <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>             <span style="color: #666666; font-style: italic;"># try to fill the media box</span>
           effect   <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>             <span style="color: #666666; font-style: italic;"># action to be taken</span>
           tolerant <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>             <span style="color: #666666; font-style: italic;"># continue even with an invalid form</span>
           x        <span style="color: #339933;">=&gt;</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">13</span><span style="color: #339933;">,</span>           <span style="color: #666666; font-style: italic;"># $x points from the left</span>
           <span style="color: #000066;">y</span>        <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">50</span><span style="color: #339933;">,</span>            <span style="color: #666666; font-style: italic;"># $y points from the bottom</span>
           rotate   <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>             <span style="color: #666666; font-style: italic;"># rotate </span>
           size     <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>             <span style="color: #666666; font-style: italic;"># multiply everything by $size</span>
           xsize    <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>             <span style="color: #666666; font-style: italic;"># multiply horizontally by $xsize</span>
           ysize    <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>        <span style="color: #666666; font-style: italic;"># multiply vertically by $ysize</span>
&nbsp;
prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Helvetica'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># ejemplo insertando Logo</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$intName</span> <span style="color: #339933;">=</span> prJpeg<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;logo.jpg&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">300</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">104</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$str</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;q<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #0000ff;">$str</span>   <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;110 0 0 38 430 773 cm<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #0000ff;">$str</span>   <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;/$intName Do<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #0000ff;">$str</span>   <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;Q<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
prAdd<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Moneda</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$Sufijo</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'PESOS'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$Moneda</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'M.N.'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$Fac</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>Moneda<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$Fac</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>Moneda<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">'MXN'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #0000ff;">$Sufijo</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'PESOS'</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$Moneda</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'M.N.'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #0000ff;">$Moneda</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Moneda}&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$Sufijo</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">''</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> Escape_UTF8 <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@out</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@out</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #009966; font-style: italic;">s/á/\x{e1}/g</span><span style="color: #339933;">;</span>
        <span style="color: #009966; font-style: italic;">s/é/\x{e9}/g</span><span style="color: #339933;">;</span>
        <span style="color: #009966; font-style: italic;">s/í/\x{ed}/g</span><span style="color: #339933;">;</span>
        <span style="color: #009966; font-style: italic;">s/ó/\x{f3}/g</span><span style="color: #339933;">;</span>
        <span style="color: #009966; font-style: italic;">s/ú/\x{fa}/g</span><span style="color: #339933;">;</span>
        <span style="color: #009966; font-style: italic;">s/Á/\x{c1}/g</span><span style="color: #339933;">;</span>
        <span style="color: #009966; font-style: italic;">s/É/\x{c9}/g</span><span style="color: #339933;">;</span>
        <span style="color: #009966; font-style: italic;">s/Í/\x{cd}/g</span><span style="color: #339933;">;</span>
        <span style="color: #009966; font-style: italic;">s/Ó/\x{d3}/g</span><span style="color: #339933;">;</span>
        <span style="color: #009966; font-style: italic;">s/Ú/\x{da}/g</span><span style="color: #339933;">;</span>
        <span style="color: #009966; font-style: italic;">s/ñ/\x{f1}/g</span><span style="color: #339933;">;</span>
        <span style="color: #009966; font-style: italic;">s/Ñ/\x{d1}/g</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066;">return</span> <span style="color: #000066;">wantarray</span> <span style="color: #339933;">?</span> <span style="color: #0000ff;">@out</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">$out</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> Wrap_Text <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ref_string</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$col</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$width</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$font_size</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$space</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$split</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@text</span> <span style="color: #339933;">=</span> wrap_smart<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$ref_string</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> no_split <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$split</span><span style="color: #339933;">,</span> max_msg_size <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$width</span><span style="color: #339933;">,</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    prFontSize <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$font_size</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$linea</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@text</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        prText<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$col</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$linea</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$row</span> <span style="color: #339933;">-</span> <span style="color: #0000ff;">$space</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066;">return</span> <span style="color: #0000ff;">$row</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">$space</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> Dinero <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$number</span> <span style="color: #339933;">=</span> <span style="color: #000066;">sprintf</span> <span style="color: #ff0000;">&quot;%.2f&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066;">shift</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span>
    <span style="color: #cc66cc;">1</span> <span style="color: #b1b100;">while</span> <span style="color: #0000ff;">$number</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/^(-?\d+)(\d\d\d)/$1,$2/</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$number</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/^(-?)/$1\$/</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">return</span> <span style="color: #0000ff;">$number</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> Cantidad <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$number</span> <span style="color: #339933;">=</span> <span style="color: #000066;">sprintf</span> <span style="color: #ff0000;">&quot;%.2f&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066;">shift</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span>
    <span style="color: #cc66cc;">1</span> <span style="color: #b1b100;">while</span> <span style="color: #0000ff;">$number</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/^(-?\d+)(\d\d\d)/$1,$2/</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">return</span> <span style="color: #0000ff;">$number</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> Parte <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ref_parte</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%Pedimentos</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@SinPedimento</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$parte_aux</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'N.S.: '</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">ref</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$ref_parte</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">'ARRAY'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$i</span> <span style="color: #339933;">&lt;=</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">$$ref_parte</span> <span style="color: #009900;">&#125;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span> <span style="color: #0000ff;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$ref_parte</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>InformacionAduanera<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #0000ff;">$Pedimentos</span><span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">$$ref_parte</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>InformacionAduanera<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>numero<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>aduana<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> 
                    <span style="color: #0000ff;">$$ref_parte</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>InformacionAduanera<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>aduana<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
                <span style="color: #0000ff;">$Pedimentos</span><span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">$$ref_parte</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>InformacionAduanera<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>numero<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>fecha<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span>
                    <span style="color: #0000ff;">$$ref_parte</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>InformacionAduanera<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>fecha<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
                <span style="color: #000066;">push</span> <span style="color: #339933;">@</span><span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">$Pedimentos</span><span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">$$ref_parte</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>InformacionAduanera<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>numero<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>serie<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
                    <span style="color: #0000ff;">$$ref_parte</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>noIdentificacion<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> 
            <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066;">push</span> <span style="color: #0000ff;">@SinPedimento</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$$ref_parte</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>noIdentificacion<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$numero</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">sort</span> <span style="color: #000066;">keys</span> <span style="color: #0000ff;">%Pedimentos</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #0000ff;">$parte_aux</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'N.S.: '</span><span style="color: #339933;">;</span>
            <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$row</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">;</span>
            <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> Wrap_Text<span style="color: #009900;">&#40;</span>\<span style="color: #ff0000;">&quot;Pedimento: $numero, Aduana: $Pedimentos{$numero}{aduana}, Fecha: $Pedimentos{$numero}{fecha}&quot;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">85</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">70</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$x</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$x</span> <span style="color: #339933;">&lt;=</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">$Pedimentos</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$numero</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>serie<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span> <span style="color: #0000ff;">$x</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #0000ff;">$parte_aux</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;$Pedimentos{$numero}{serie}[$x], &quot;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #0000ff;">$parte_aux</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/, $//</span><span style="color: #339933;">;</span>
            <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$row</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">;</span>
            <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> Wrap_Text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\$parte_aux</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">85</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">70</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$#SinPedimento</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #0000ff;">$parte_aux</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'N.S.: '</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$serie</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">sort</span> <span style="color: #0000ff;">@SinPedimento</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #0000ff;">$parte_aux</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">$serie</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">', '</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #0000ff;">$parte_aux</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/, $//</span><span style="color: #339933;">;</span>
            <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$row</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">;</span>
            <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> Wrap_Text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\$parte_aux</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">85</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">70</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$ref_parte</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>InformacionAduanera<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$row</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$aduana_aux</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'Pedimento: '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$$ref_parte</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>InformacionAduanera<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>numero<span style="color: #009900;">&#125;</span> <span style="color: #339933;">.</span>
                             <span style="color: #ff0000;">', Aduana: '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$$ref_parte</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>InformacionAduanera<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>aduana<span style="color: #009900;">&#125;</span> <span style="color: #339933;">.</span>
                             <span style="color: #ff0000;">', fecha: '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$$ref_parte</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>InformacionAduanera<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>fecha<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
            <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> Wrap_Text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\$aduana_aux</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">85</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">70</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$row</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$parte_aux</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">$$ref_parte</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>noIdentificacion<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> Wrap_Text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\$parte_aux</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">85</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">70</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066;">return</span> <span style="color: #0000ff;">$row</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> Concepto <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ref_concepto</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">ref</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$ref_concepto</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">'ARRAY'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$i</span> <span style="color: #339933;">&lt;=</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">$$ref_concepto</span> <span style="color: #009900;">&#125;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span> <span style="color: #0000ff;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            prFontSize <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">18</span><span style="color: #339933;">,</span>  <span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>noIdentificacion<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">375</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span> Cantidad<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>cantidad<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">477</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span> Dinero<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>valorUnitario<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; $Moneda&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">580</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span> Dinero<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>importe<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; $Moneda&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> Wrap_Text<span style="color: #009900;">&#40;</span>\<span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>descripcion<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">85</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">55</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>Parte<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> Parte<span style="color: #009900;">&#40;</span>\<span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>Parte<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$row</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$row</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        prFontSize <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">18</span><span style="color: #339933;">,</span>  <span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>noIdentificacion<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">375</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span> Cantidad<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>cantidad<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">477</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span> Dinero<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>valorUnitario<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; $Moneda&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">580</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span> Dinero<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>importe<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; $Moneda&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> Wrap_Text<span style="color: #009900;">&#40;</span>\<span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>descripcion<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">85</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$row</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">55</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>Parte<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> Parte<span style="color: #009900;">&#40;</span>\<span style="color: #0000ff;">$$ref_concepto</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>Parte<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$row</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$row</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066;">return</span> <span style="color: #0000ff;">$row</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Datos del CSD</span>
&nbsp;
prFontSize <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">140</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">790</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{noCertificado}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">140</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">778</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{noAprobacion}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">300</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">778</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{anoAprobacion}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">140</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">766</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{tipoDeComprobante}&quot;</span><span style="color: #339933;">,,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">275</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">766</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{fecha}&quot;</span><span style="color: #339933;">,,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">140</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">754</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{formaDePago}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prFontSize <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">16</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">140</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">736</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{serie}-$Fac-&gt;{folio}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Emisor</span>
&nbsp;
prFontSize <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Helvetica-Bold'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">402</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">768</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Emisor}{nombre}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Helvetica'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prFontSize <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">402</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">756</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Emisor}{DomicilioFiscal}{calle} $Fac-&gt;{Emisor}{DomicilioFiscal}{noExterior} $Fac-&gt;{Emisor}{DomicilioFiscal}{noInterior}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">402</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">746</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Col. $Fac-&gt;{Emisor}{DomicilioFiscal}{colonia} C.P. $Fac-&gt;{Emisor}{DomicilioFiscal}{codigoPostal}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">402</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">736</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Emisor}{DomicilioFiscal}{municipio}, $Fac-&gt;{Emisor}{DomicilioFiscal}{estado}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">402</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">726</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Emisor}{DomicilioFiscal}{localidad}, $Fac-&gt;{Emisor}{DomicilioFiscal}{pais}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prFontSize <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">402</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">684</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;R.F.C.:&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Helvetica-Bold'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">437</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">684</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Emisor}{rfc}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Helvetica'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Lugar de emision</span>
&nbsp;
prFontSize <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">402</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">650</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Emisor}{ExpedidoEn}{calle} $Fac-&gt;{Emisor}{ExpedidoEn}{noExterior} $Fac-&gt;{Emisor}{ExpedidoEn}{noInterior}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">402</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">640</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Emisor}{ExpedidoEn}{colonia}, C.P. $Fac-&gt;{Emisor}{ExpedidoEn}{codigoPostal}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">402</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">630</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Emisor}{ExpedidoEn}{municipio}, $Fac-&gt;{Emisor}{ExpedidoEn}{estado}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">402</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">620</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Emisor}{ExpedidoEn}{localidad}, $Fac-&gt;{Emisor}{ExpedidoEn}{pais}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Facturado A</span>
&nbsp;
prFontSize <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Helvetica-Bold'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">690</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Receptor}{nombre}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Helvetica'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">678</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Receptor}{Domicilio}{calle} $Fac-&gt;{Receptor}{Domicilio}{noExterior} $Fac-&gt;{Receptor}{Domicilio}{noInterior}&quot;</span> <span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">666</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Receptor}{Domicilio}{colonia}, C.P. $Fac-&gt;{Receptor}{Domicilio}{codigoPostal}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">654</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Receptor}{Domicilio}{municipio}, $Fac-&gt;{Receptor}{Domicilio}{localidad}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">642</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Receptor}{Domicilio}{estado}, $Fac-&gt;{Receptor}{Domicilio}{pais}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">620</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;R.F.C.:&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Helvetica-Bold'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">56</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">620</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$Fac-&gt;{Receptor}{rfc}&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Helvetica'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># partidas</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$row</span> <span style="color: #339933;">=</span> Concepto<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\$Fac</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>Conceptos<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>Concepto<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">575</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Addenda</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$Fac</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>Addenda<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>Incuvox<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>Note<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Helvetica-Oblique'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$nota</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'Nota: '</span> <span style="color: #339933;">.</span>  <span style="color: #0000ff;">$Fac</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>Addenda<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>Incuvox<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>Note<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    Wrap_Text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\$nota</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">85</span><span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$row</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">80</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Helvetica'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Numero en letras</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$pesos</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$centavos</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #000066;">split</span><span style="color: #009900;">&#40;</span> <span style="color: #009966; font-style: italic;">/\./</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$Fac</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>total<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$pesos</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">unless</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$pesos</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$centavos</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">unless</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$centavos</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$obj</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Lingua<span style="color: #339933;">::</span><span style="color: #006600;">ES</span><span style="color: #339933;">::</span><span style="color: #006600;">Numeros</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'MAYUSCULAS'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> ACENTOS <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$letrero</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$obj</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">cardinal</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$pesos</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; $Sufijo &quot;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;$centavos/100 $Moneda<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
Wrap_Text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\$letrero</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">65</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">334</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">70</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Totales</span>
&nbsp;
prFontSize <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">580</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">334</span><span style="color: #339933;">,</span> Dinero<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$Fac</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>descuento<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; $Moneda&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">580</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">323</span><span style="color: #339933;">,</span> Dinero<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$Fac</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>subTotal<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; $Moneda&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">458</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">312</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'16'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">580</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">312</span><span style="color: #339933;">,</span> Dinero<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$Fac</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>Impuestos<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>totalImpuestosTrasladados<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; $Moneda&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Helvetica-Bold'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prText<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">580</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">301</span><span style="color: #339933;">,</span> Dinero<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$Fac</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>total<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; $Moneda&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Helvetica'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Cadena Original</span>
&nbsp;
prFont<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Courier'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cadena</span> <span style="color: #339933;">=</span> Escape_UTF8<span style="color: #009900;">&#40;</span><span style="color: #000066;">qx</span><span style="color: #009900;">&#40;</span>xsltproc <span style="color: #339933;">~/</span>SAT<span style="color: #339933;">/</span>xslt<span style="color: #339933;">/</span>cadenaoriginal_2_0<span style="color: #339933;">.</span>xslt <span style="color: #0000ff;">$file</span><span style="color: #339933;">.</span>xml<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Wrap_Text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\$cadena</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">269</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">155</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Sello</span>
&nbsp;
Wrap_Text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\$Fac</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>sello<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">75</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">124</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">130</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
prEnd<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Para utilizarlo (instalando mis scripts y las dependencias de CPAN previamente) solo tendran que hacer esto:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>CFD_to_PDF.pl Fac_Sample.xml</pre></div></div>

<p>El XML que procesamos para este ejemplo:</p>
<p><b>Fac_Sample.xml</b></p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Comprobante</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.sat.gob.mx/cfd/2&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;http://www.sat.gob.mx/cfd/2</span>
<span style="color: #009900;">                        http://www.sat.gob.mx/sitio_internet/cfd/2/cfdv2.xsd</span>
<span style="color: #009900;">                        http://incuvox.com/cfd/incuvox.xsd&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;2.0&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">serie</span>=<span style="color: #ff0000;">&quot;AA&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">folio</span>=<span style="color: #ff0000;">&quot;1619&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">fecha</span>=<span style="color: #ff0000;">&quot;2011-03-27T18:20:36&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">sello</span>=<span style="color: #ff0000;">&quot;rVoq96VkMeQ6gt993DnVuaWiAXwjNSeJKT27gJ8pOuC/tHo9SzvB6t0zM0hj03ivHC/gWvC2kK9nQ5JxCiJ96f08pyGP00jSD4z0/LCplTxb3nASc7/gDV5L42RW0drh7dtV2UWMfrrZE7Xfj9l38kigH5+cvo8/V8IiJLBKmLc=&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">noAprobacion</span>=<span style="color: #ff0000;">&quot;263844&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">anoAprobacion</span>=<span style="color: #ff0000;">&quot;2010&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">tipoDeComprobante</span>=<span style="color: #ff0000;">&quot;ingreso&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">formaDePago</span>=<span style="color: #ff0000;">&quot;Contado en una sola exibición&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">noCertificado</span>=<span style="color: #ff0000;">&quot;00001000000102302081&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">certificado</span>=<span style="color: #ff0000;">&quot;</span>
<span style="color: #009900;">MIIE/TCCA+WgAwIBAgIUMzAwMDEwMDAwMDAxMDAwMDA4MDcwDQYJKoZIhvcNAQEFBQAwggFvMRgwFgYDVQQDDA9BLkMuIGRlIHBydWViYXMxLzAtBgNVBAoMJlNlcnZpY2lvIGRlIEFkbWluaXN0cmFjacOzbiBUcmlidXRhcmlhMTgwNgYDVQQLDC9BZG1pbmlzdHJhY2nDs24gZGUgU2VndXJpZGFkIGRlIGxhIEluZm9ybWFjacOzbjEpMCcGCSqGSIb3DQEJARYaYXNpc25ldEBwcnVlYmFzLnNhdC5nb2IubXgxJjAkBgNVBAkMHUF2LiBIaWRhbGdvIDc3LCBDb2wuIEd1ZXJyZXJvMQ4wDAYDVQQRDAUwNjMwMDELMAkGA1UEBhMCTVgxGTAXBgNVBAgMEERpc3RyaXRvIEZlZGVyYWwxEjAQBgNVBAcMCUNveW9hY8OhbjEVMBMGA1UELRMMU0FUOTcwNzAxTk4zMTIwMAYJKoZIhvcNAQkCDCNSZXNwb25zYWJsZTogSMOpY3RvciBPcm5lbGFzIEFyY2lnYTAeFw0xMDA3MzAxNjU4NDZaFw0xMjA3MjkxNjU4NDZaMIGWMRIwEAYDVQQDDAlNYXRyaXogU0ExEjAQBgNVBCkMCU1hdHJpeiBTQTESMBAGA1UECgwJTWF0cml6IFNBMSUwIwYDVQQtExxBQUEwMTAxMDFBQUEgLyBBQUFBMDEwMTAxQUFBMR4wHAYDVQQFExUgLyBBQUFBMDEwMTAxSERGUlhYMDExETAPBgNVBAsMCFVuaWRhZCA4MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVvLjg4dC8rIWzeRV6v+ZxYTpzgiK11bHLeYRYF8Pho+1fTeRn7oOUdGfYSUEsqXV8s99F+rdJeA9Ma9iAt5zYBW+qkWlr8NDkkxQyMiOv8oEoJiXFsNWekAhnniyFoPn9pbA1FVBfBsaIe82HKi+Vq0Nd0QKh28afj2f6yhwZnwIDAQABo4HqMIHnMAwGA1UdEwEB/wQCMAAwCwYDVR0PBAQDAgbAMB0GA1UdDgQWBBSXXSAB98HZaYvKFyKXq5u8z4SG+zAuBgNVHR8EJzAlMCOgIaAfhh1odHRwOi8vcGtpLnNhdC5nb2IubXgvc2F0LmNybDAzBggrBgEFBQcBAQQnMCUwIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLnNhdC5nb2IubXgvMB8GA1UdIwQYMBaAFOtZfQQimlONnnEaoFiWKfU54KDFMBAGA1UdIAQJMAcwBQYDKgMEMBMGA1UdJQQMMAoGCCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4IBAQAlyBvfqLEsWYW11levSQLbsvCpaWmIqtbhfM65Ly+b3848+S3WF9qZJLbH6NkViGUKy9WtTOwegicPSY/dihx1ZDOplARutbrscpLGqwfKsg/qh7ppK7CwqZv5rvrjnaflI8KDV9b+2hsyI0oGY9kVnZb0GgpNZMAKvUmvqXq5Z4ehoNWJmvixV7MgnX/heCZEcKZbR1pIoropUgiR5M8TUF9SUQlPPyRHgNA/v6vNwwZT+JYa62x65IrguUgLCg3DJgo4hk4zADM81Irn3jiTLBZcF2LTQageqxYxSj8MCWz7vGoB8Kv70CLY+Xin/IscCmZ2ohbG636sFNi6so4T&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">subTotal</span>=<span style="color: #ff0000;">&quot;1450.50&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">descuento</span>=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">Moneda</span>=<span style="color: #ff0000;">&quot;USD&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">TipoCambio</span>=<span style="color: #ff0000;">&quot;12.13&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">total</span>=<span style="color: #ff0000;">&quot;1682.58&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Emisor</span> <span style="color: #000066;">rfc</span>=<span style="color: #ff0000;">&quot;COS101109Q36&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">nombre</span>=<span style="color: #ff0000;">&quot;Cofradia Software, S.A. de C.V.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;DomicilioFiscal</span> <span style="color: #000066;">calle</span>=<span style="color: #ff0000;">&quot;Av. División del Norte&quot;</span></span>
<span style="color: #009900;">                             <span style="color: #000066;">noExterior</span>=<span style="color: #ff0000;">&quot;1354&quot;</span></span>
<span style="color: #009900;">                             <span style="color: #000066;">noInterior</span>=<span style="color: #ff0000;">&quot;202&quot;</span></span>
<span style="color: #009900;">                             <span style="color: #000066;">colonia</span>=<span style="color: #ff0000;">&quot;Letrán-Valle&quot;</span></span>
<span style="color: #009900;">                             <span style="color: #000066;">localidad</span>=<span style="color: #ff0000;">&quot;Distrito Federal&quot;</span></span>
<span style="color: #009900;">                             <span style="color: #000066;">referencia</span>=<span style="color: #ff0000;">&quot;Esquina con Miguel Laurent&quot;</span></span>
<span style="color: #009900;">                             <span style="color: #000066;">municipio</span>=<span style="color: #ff0000;">&quot;Benito Juárez&quot;</span></span>
<span style="color: #009900;">                             <span style="color: #000066;">estado</span>=<span style="color: #ff0000;">&quot;Distrito Federal&quot;</span></span>
<span style="color: #009900;">                             <span style="color: #000066;">pais</span>=<span style="color: #ff0000;">&quot;México&quot;</span></span>
<span style="color: #009900;">                             <span style="color: #000066;">codigoPostal</span>=<span style="color: #ff0000;">&quot;03650&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ExpedidoEn</span> <span style="color: #000066;">calle</span>=<span style="color: #ff0000;">&quot;Av. División del Norte&quot;</span></span>
<span style="color: #009900;">                        <span style="color: #000066;">noExterior</span>=<span style="color: #ff0000;">&quot;1354&quot;</span></span>
<span style="color: #009900;">                        <span style="color: #000066;">noInterior</span>=<span style="color: #ff0000;">&quot;202&quot;</span></span>
<span style="color: #009900;">                        <span style="color: #000066;">colonia</span>=<span style="color: #ff0000;">&quot;Letrán-Valle&quot;</span></span>
<span style="color: #009900;">                        <span style="color: #000066;">localidad</span>=<span style="color: #ff0000;">&quot;Distrito Federal&quot;</span></span>
<span style="color: #009900;">                        <span style="color: #000066;">municipio</span>=<span style="color: #ff0000;">&quot;Benito Juárez&quot;</span></span>
<span style="color: #009900;">                        <span style="color: #000066;">estado</span>=<span style="color: #ff0000;">&quot;Distrito Federal&quot;</span></span>
<span style="color: #009900;">                        <span style="color: #000066;">pais</span>=<span style="color: #ff0000;">&quot;México&quot;</span></span>
<span style="color: #009900;">                        <span style="color: #000066;">codigoPostal</span>=<span style="color: #ff0000;">&quot;03650&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Emisor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Receptor</span> <span style="color: #000066;">rfc</span>=<span style="color: #ff0000;">&quot;JCC960111P76&quot;</span></span>
<span style="color: #009900;">              <span style="color: #000066;">nombre</span>=<span style="color: #ff0000;">&quot;Juan Camanei Company, S.A. de C.V.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Domicilio</span> <span style="color: #000066;">calle</span>=<span style="color: #ff0000;">&quot;Av. Insurgentes Sur&quot;</span></span>
<span style="color: #009900;">                         <span style="color: #000066;">noExterior</span>=<span style="color: #ff0000;">&quot;1600&quot;</span></span>
<span style="color: #009900;">                         <span style="color: #000066;">noInterior</span>=<span style="color: #ff0000;">&quot;301&quot;</span></span>
<span style="color: #009900;">                         <span style="color: #000066;">colonia</span>=<span style="color: #ff0000;">&quot;Guadalupe Inn&quot;</span></span>
<span style="color: #009900;">                         <span style="color: #000066;">localidad</span>=<span style="color: #ff0000;">&quot;Distrito Federal&quot;</span></span>
<span style="color: #009900;">                         <span style="color: #000066;">municipio</span>=<span style="color: #ff0000;">&quot;Álvaro Obregón&quot;</span></span>
<span style="color: #009900;">                         <span style="color: #000066;">estado</span>=<span style="color: #ff0000;">&quot;Distrito Federal&quot;</span></span>
<span style="color: #009900;">                         <span style="color: #000066;">pais</span>=<span style="color: #ff0000;">&quot;México&quot;</span></span>
<span style="color: #009900;">                         <span style="color: #000066;">codigoPostal</span>=<span style="color: #ff0000;">&quot;01020&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Receptor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Conceptos<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Concepto</span> <span style="color: #000066;">cantidad</span>=<span style="color: #ff0000;">&quot;10&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">unidad</span>=<span style="color: #ff0000;">&quot;Hora&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">noIdentificacion</span>=<span style="color: #ff0000;">&quot;SPREDV&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">descripcion</span>=<span style="color: #ff0000;">&quot;hora de servicios profesionales en análisis de Redes y VoIP&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">valorUnitario</span>=<span style="color: #ff0000;">&quot;120.00&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">importe</span>=<span style="color: #ff0000;">&quot;1200.00&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Concepto</span> <span style="color: #000066;">cantidad</span>=<span style="color: #ff0000;">&quot;3&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">unidad</span>=<span style="color: #ff0000;">&quot;pz&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">noIdentificacion</span>=<span style="color: #ff0000;">&quot;6731i&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">descripcion</span>=<span style="color: #ff0000;">&quot;TELEFONO AASTRA MOD. 6731i SIP&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">valorUnitario</span>=<span style="color: #ff0000;">&quot;83.50&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">importe</span>=<span style="color: #ff0000;">&quot;250.50&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Parte</span> <span style="color: #000066;">cantidad</span>=<span style="color: #ff0000;">&quot;1.00&quot;</span></span>
<span style="color: #009900;">                         <span style="color: #000066;">noIdentificacion</span>=<span style="color: #ff0000;">&quot;0D10361C9D&quot;</span></span>
<span style="color: #009900;">                         <span style="color: #000066;">descripcion</span>=<span style="color: #ff0000;">&quot;TELEFONO AASTRA MOD. 6731i SIP&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;InformacionAduanera</span> <span style="color: #000066;">numero</span>=<span style="color: #ff0000;">&quot;37780005637&quot;</span></span>
<span style="color: #009900;">                                              <span style="color: #000066;">fecha</span>=<span style="color: #ff0000;">&quot;2010-11-05&quot;</span></span>
<span style="color: #009900;">                                              <span style="color: #000066;">aduana</span>=<span style="color: #ff0000;">&quot;LAREDO&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/InformacionAduanera<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Parte<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Parte</span> <span style="color: #000066;">cantidad</span>=<span style="color: #ff0000;">&quot;1.00&quot;</span> </span>
<span style="color: #009900;">                         <span style="color: #000066;">noIdentificacion</span>=<span style="color: #ff0000;">&quot;0D10361C91&quot;</span></span>
<span style="color: #009900;">                         <span style="color: #000066;">descripcion</span>=<span style="color: #ff0000;">&quot;TELEFONO AASTRA MOD. 6731i SIP&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;InformacionAduanera</span> <span style="color: #000066;">numero</span>=<span style="color: #ff0000;">&quot;37780005637&quot;</span> </span>
<span style="color: #009900;">                                              <span style="color: #000066;">fecha</span>=<span style="color: #ff0000;">&quot;2010-11-05&quot;</span></span>
<span style="color: #009900;">                                              <span style="color: #000066;">aduana</span>=<span style="color: #ff0000;">&quot;LAREDO&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/InformacionAduanera<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Parte<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Parte</span> <span style="color: #000066;">cantidad</span>=<span style="color: #ff0000;">&quot;1.00&quot;</span> </span>
<span style="color: #009900;">                         <span style="color: #000066;">noIdentificacion</span>=<span style="color: #ff0000;">&quot;0D10361CAF&quot;</span></span>
<span style="color: #009900;">                         <span style="color: #000066;">descripcion</span>=<span style="color: #ff0000;">&quot;TELEFONO AASTRA MOD. 6731i SIP&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;InformacionAduanera</span> <span style="color: #000066;">numero</span>=<span style="color: #ff0000;">&quot;37780005699&quot;</span> </span>
<span style="color: #009900;">                                              <span style="color: #000066;">fecha</span>=<span style="color: #ff0000;">&quot;2010-11-08&quot;</span></span>
<span style="color: #009900;">                                              <span style="color: #000066;">aduana</span>=<span style="color: #ff0000;">&quot;LAREDO&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/InformacionAduanera<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Parte<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Concepto<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Conceptos<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Impuestos</span> <span style="color: #000066;">totalImpuestosTrasladados</span>=<span style="color: #ff0000;">&quot;232.08&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Traslados<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Traslado</span> <span style="color: #000066;">impuesto</span>=<span style="color: #ff0000;">&quot;IVA&quot;</span></span>
<span style="color: #009900;">                             <span style="color: #000066;">tasa</span>=<span style="color: #ff0000;">&quot;16.00&quot;</span></span>
<span style="color: #009900;">                             <span style="color: #000066;">importe</span>=<span style="color: #ff0000;">&quot;232.08&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Traslados<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Impuestos<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Addenda<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Incuvox</span> <span style="color: #000066;">Note</span>=<span style="color: #ff0000;">&quot;Servicios solicitadas por la gente que quiere hacer facturas&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Addenda<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Comprobante<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>y el resultado queda así:</p>
<p><a href="http://cofradia.org/wp-content/uploads/2011/03/Fac_Sample.pdf"><img src="http://cofradia.org/wp-content/uploads/2011/03/pdf_de_CFD-229x300.png" alt="" title="pdf_de_CFD" width="229" height="300" class="alignnone size-medium wp-image-5352" /></a></p>
<p>Queda al lector ajustar su PDF de template y la salida deseada.</p>
<p>Autor: Fernando “El Pop” Romo (pop at cofradia.org), twitter @El_Pop</p>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2011/03/27/convirtiendo-facturas-electronicas-del-xml-a-pdf/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Error en XSLT del SAT provoca errores en la generación/validación de factura electrónica</title>
		<link>http://cofradia.org/2011/01/04/error-en-xslt-del-sat-provoca-errores-en-la-generacionvalidacion-de-factura-electronica/</link>
		<comments>http://cofradia.org/2011/01/04/error-en-xslt-del-sat-provoca-errores-en-la-generacionvalidacion-de-factura-electronica/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 08:14:11 +0000</pubDate>
		<dc:creator>El Pop</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[Paranoia Fan Club]]></category>
		<category><![CDATA[Política]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Tips técnicos]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=4505</guid>
		<description><![CDATA[Pues nuestros amigos del Sistema de Administración Tributaria (SAT), cambiaron o borraron una dependencia que se encuentra en los archivos de transformación de los XSLT&#8217;s que producen la cadena original que sirve para generar el &#8220;sello&#8221; de la factura electrónica. Esta error produce que facturas previamente validadas y que aparecían como correctas ahora se vean [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://cofradia.org/2011/01/04/error-en-xslt-del-sat-provoca-errores-en-la-generacionvalidacion-de-factura-electronica/"></g:plusone></div><p><P>Pues nuestros amigos del Sistema de Administración Tributaria (SAT), cambiaron o borraron una dependencia que se encuentra en los archivos de transformación de los XSLT&#8217;s que producen la cadena original que sirve para generar el &#8220;sello&#8221; de la factura electrónica.</p>
<p>Esta error produce que facturas previamente validadas y que aparecían como correctas ahora se vean como inválidas en su <A HREF="https://www.consulta.sat.gob.mx/SICOFI_WEB/ModuloECFD_Plus/ValidadorComprobantes/Validador.asp">propio validador</A>.</p>
<p>La dependencia que no se puede resolver es esta liga referenciada en el archivo cadenaorigina_2_0.xslt:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">http://www.sat.gob.mx/sitio_internet/cfd/terceros/terceros.xslt</pre></div></div>

<p><span id="more-4505"></span></p>
<p>un work-around para que puedan seguir produciendo sus cadenas originales es este:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.sat.gob.mx/sitio_internet/cfd/ecc/ecc.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.sat.gob.mx/sitio_internet/cfd/psgecfd/psgecfd.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.sat.gob.mx/sitio_internet/cfd/donat/donat.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.sat.gob.mx/sitio_internet/cfd/divisas/divisas.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.sat.gob.mx/sitio_internet/cfd/ecb/ecb.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.sat.gob.mx/sitio_internet/cfd/detallista/detallista.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.sat.gob.mx/sitio_internet/cfd/implocal/implocal.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #808080; font-style: italic;">&lt;!-- xsl:include href=&quot;http://www.sat.gob.mx/sitio_internet/cfd/terceros/terceros.xslt&quot;/ --&gt;</span>
        <span style="color: #808080; font-style: italic;">&lt;!-- Aquí iniciamos el procesamiento de la cadena original con su | inicial y el terminador</span></pre></div></div>

<p>Si se fijan, basta comentar esta linea y nosotros podemos generar la cadena original correcta.</p>
<p>Ahora bien, pueden bajar todas las dependencias en un directorio para poder facturar fuera de linea y evitar estos errores del SAT. Obtenemos las cadenas originales:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>SAT
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>SAT<span style="color: #000000; font-weight: bold;">/</span>xslt
$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>SAT<span style="color: #000000; font-weight: bold;">/</span>xslt
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>sitio_internet<span style="color: #000000; font-weight: bold;">/</span>cfd<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">/</span>cadenaoriginal_2_0<span style="color: #000000; font-weight: bold;">/</span>cadenaoriginal_2_0.xslt
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftp2.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>asistencia_servicio_ftp<span style="color: #000000; font-weight: bold;">/</span>publicaciones<span style="color: #000000; font-weight: bold;">/</span>solcedi<span style="color: #000000; font-weight: bold;">/</span>cadenaoriginal_3_0.xslt</pre></div></div>

<p>Despues bajamos las dependencias:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>SAT<span style="color: #000000; font-weight: bold;">/</span>xslt
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> include
$ <span style="color: #7a0874; font-weight: bold;">cd</span> include
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>sitio_internet<span style="color: #000000; font-weight: bold;">/</span>cfd<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">/</span>cadenaoriginal_2_0<span style="color: #000000; font-weight: bold;">/</span>utilerias.xslt
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>sitio_internet<span style="color: #000000; font-weight: bold;">/</span>cfd<span style="color: #000000; font-weight: bold;">/</span>ecc<span style="color: #000000; font-weight: bold;">/</span>ecc.xslt
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>sitio_internet<span style="color: #000000; font-weight: bold;">/</span>cfd<span style="color: #000000; font-weight: bold;">/</span>psgecfd<span style="color: #000000; font-weight: bold;">/</span>psgecfd.xslt
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>sitio_internet<span style="color: #000000; font-weight: bold;">/</span>cfd<span style="color: #000000; font-weight: bold;">/</span>donat<span style="color: #000000; font-weight: bold;">/</span>donat.xslt
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>sitio_internet<span style="color: #000000; font-weight: bold;">/</span>cfd<span style="color: #000000; font-weight: bold;">/</span>divisas<span style="color: #000000; font-weight: bold;">/</span>divisas.xslt
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>sitio_internet<span style="color: #000000; font-weight: bold;">/</span>cfd<span style="color: #000000; font-weight: bold;">/</span>ecb<span style="color: #000000; font-weight: bold;">/</span>ecb.xslt
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>sitio_internet<span style="color: #000000; font-weight: bold;">/</span>cfd<span style="color: #000000; font-weight: bold;">/</span>detallista<span style="color: #000000; font-weight: bold;">/</span>detallista.xslt
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>sitio_internet<span style="color: #000000; font-weight: bold;">/</span>cfd<span style="color: #000000; font-weight: bold;">/</span>implocal<span style="color: #000000; font-weight: bold;">/</span>implocal.xslt
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>sitio_internet<span style="color: #000000; font-weight: bold;">/</span>cfd<span style="color: #000000; font-weight: bold;">/</span>terceros<span style="color: #000000; font-weight: bold;">/</span>terceros.xslt</pre></div></div>

<p>Y finalmente editamos nuestros archivos de &#8220;cadenaoriginal_2_0.xslt&#8221; y &#8220;cadenaoriginal_3_0.xslt&#8221; para que queden de manera local así:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">        <span style="color: #808080; font-style: italic;">&lt;!-- Con el siguiente método se establece que la salida deberá ser en texto --&gt;</span>
        <span style="color: #808080; font-style: italic;">&lt;!-- &lt;xsl:output method=&quot;text&quot; version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; indent=&quot;no&quot;/&gt; --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:output</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span> <span style="color: #000066;">indent</span>=<span style="color: #ff0000;">&quot;no&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">                En esta sección se define la inclusión de las plantillas de utilería</span>
<span style="color: #808080; font-style: italic;">        --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/Users/pop/SAT/xslt/include/utilerias.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">                En esta sección se define la inclusión de las demás plantillas de transformación para</span>
<span style="color: #808080; font-style: italic;">                la generación de las cadenas originales de los complementos fiscales</span>
<span style="color: #808080; font-style: italic;">        --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/Users/pop/SAT/xslt/include/ecc.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/Users/pop/SAT/xslt/include/psgecfd.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/Users/pop/SAT/xslt/include/donat.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/Users/pop/SAT/xslt/include/divisas.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/Users/pop/SAT/xslt/include/ecb.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/Users/pop/SAT/xslt/include/detallista.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/Users/pop/SAT/xslt/include/implocal.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:include</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/Users/pop/SAT/xslt/include/terceros.xslt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #808080; font-style: italic;">&lt;!-- Aquí iniciamos el procesamiento de la cadena original con su | inicial y el terminador || --&gt;</span></pre></div></div>

<p>En mi caso use el path &#8220;/Users/pop/&#8221;, pero aquí lo cambian a lo que necesiten.</p>
<p>Otro cambio en el validador es que ya no recibe facturas que usaban MD5, ahora solo revisa SHA1, aunque las facturas anteriores al 1o de enero son válidas con este algoritmo.</p>
<p>Sin embargo el mismo validador del SAT esta afectado por este descuido y esperemos que resuelvan a la brevedad esta problema.</p>
<p>Intenté contactarlos vía el portal del SAT, pero este también esta de vacaciones:</p>
<p><a href="http://cofradia.org/wp-content/uploads/2011/01/vacaciones_sat.png"><img src="http://cofradia.org/wp-content/uploads/2011/01/vacaciones_sat.png" alt="" title="vacaciones_sat" width="480" height="285" class="alignnone size-full wp-image-4511" /></a></p>
<p>Gracias al cofrade tmsanchez por hacernos notar este error en el sistema del SAT.</p>
<p>Autor: Fernando “El Pop” Romo (pop at cofradia.org), twitter @El_Pop</p>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2011/01/04/error-en-xslt-del-sat-provoca-errores-en-la-generacionvalidacion-de-factura-electronica/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How-To de facturación electrónica (verificación de facturas)</title>
		<link>http://cofradia.org/2010/12/29/how-to-de-facturacion-electronica-verificacion-de-facturas/</link>
		<comments>http://cofradia.org/2010/12/29/how-to-de-facturacion-electronica-verificacion-de-facturas/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 07:58:19 +0000</pubDate>
		<dc:creator>El Pop</dc:creator>
				<category><![CDATA[Paranoia Fan Club]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[software libre]]></category>
		<category><![CDATA[Tips técnicos]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=4465</guid>
		<description><![CDATA[En el artículo anterior comentábamos del proceso de el firmado o &#8220;sellado&#8221; de documentos. En esta entrega, veremos brevemente el proceso de validación de las facturas que recibimos por parte de nuestros proveedores. De acuerdo a las reglas del Servicio de Administración Tributaria (SAT), el que recibe una factura electrónica es responsable de validar su [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://cofradia.org/2010/12/29/how-to-de-facturacion-electronica-verificacion-de-facturas/"></g:plusone></div><p>En el <A HREF="http://cofradia.org/2010/12/18/how-to-de-facturacion-electronica-para-unixeros-generacion-de-sellos/">artículo anterior</A> comentábamos del proceso de el firmado o &#8220;sellado&#8221; de documentos. En esta entrega, veremos brevemente el proceso de validación de las facturas que recibimos por parte de nuestros proveedores.</p>
<p>De acuerdo a las reglas del Servicio de Administración Tributaria (SAT), el que recibe una factura electrónica es responsable de validar su autenticidad, por lo cual tenemos que idear mecanismos que aseguren este requisito.</p>
<p><span id="more-4465"></span></p>
<p>Veamos un ejemplo en el cual me dan una factura a validar para saberl si cumple con los criterios mínimos para ser aceptada, en este caso recibo un documento (v.g. &#8220;NEO0303288Z1FAA9.xml&#8221;) en formato XML que contiene la siguiente información relevante:

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">$ cat NEO0303288Z1FAA9.xml
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span> 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Comprobante</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.sat.gob.mx/cfd/2&quot;</span></span>
<span style="color: #009900;">             <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> </span>
<span style="color: #009900;">             <span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;http://www.sat.gob.mx/cfd/2 </span>
<span style="color: #009900;">                                 http://www.sat.gob.mx/sitio_internet/cfd/2/cfdv2.xsd&quot;</span></span>
<span style="color: #009900;">             <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;2.0&quot;</span></span>
<span style="color: #009900;">             <span style="color: #000066;">serie</span>=<span style="color: #ff0000;">&quot;AA&quot;</span></span>
<span style="color: #009900;">             <span style="color: #000066;">folio</span>=<span style="color: #ff0000;">&quot;9&quot;</span></span>
<span style="color: #009900;">             <span style="color: #000066;">fecha</span>=<span style="color: #ff0000;">&quot;2010-12-27T14:03:21&quot;</span></span>
<span style="color: #009900;">             <span style="color: #000066;">sello</span>=<span style="color: #ff0000;">&quot;KgWheSp62N9E18uRA1EcC1tdAPuWA0Q0z6h+TbZLYgkc6IRA+TAWk6KBDPcn/euKePfXhcSPtEqjp6RsA1k2EUldBMmClQadjGfxjTO14oO+RzSInckAwfrGL/W0BO9OizkNNS+PDswduIquczZqXDfuPNHqOnLgwhdiyYH7LLU=&quot;</span></span>
<span style="color: #009900;">             <span style="color: #000066;">noAprobacion</span>=<span style="color: #ff0000;">&quot;353857&quot;</span></span>
<span style="color: #009900;">             <span style="color: #000066;">anoAprobacion</span>=<span style="color: #ff0000;">&quot;2010&quot;</span></span>
<span style="color: #009900;">             <span style="color: #000066;">formaDePago</span>=<span style="color: #ff0000;">&quot;Pago en una sola exhibición&quot;</span></span>
<span style="color: #009900;">             <span style="color: #000066;">noCertificado</span>=<span style="color: #ff0000;">&quot;00001000000102436855&quot;</span></span>
<span style="color: #009900;">             <span style="color: #000066;">certificado</span>=<span style="color: #ff0000;">&quot;MIIEDzCCAvegAwIBAgIUMD...</span></span></pre></div></div>

<p>vean los campos &#8220;version&#8221; y &#8220;noCertificado&#8221;, estos nos dan información importante para el proceso de validación del documento.</p>
<p>El campo <strong>version</strong> nos indica con que archivo de transformación debemos procesar la factura. Si el valor del campo es &#8220;2.0&#8243; entonces debemos aplicar el archivo <A HREF="http://www.sat.gob.mx/sitio_internet/cfd/2/cadenaoriginal_2_0/cadenaoriginal_2_0.xslt">cadenaoriginal_2_0.xslt</A>, en caso de que el valor sea &#8220;3.0&#8243;, debemos aplicar el archivo <A HREF="ftp://ftp2.sat.gob.mx/asistencia_servicio_ftp/publicaciones/solcedi/cadenaoriginal_3_0.xslt">cadenaoriginal_3_0.xslt</A>.</p>
<p>El campo <strong>noCertificado</strong> nos da el número del Certificado del Sello Digital (CSD) que necesitamos para validar el &#8220;sello&#8221; del documeto.</p>
<p>el archivo XML puede tener un certificado embebido, pero este puede llegar a ser apócrifo, y según la ley es &#8220;opcional&#8221;, por lo cual tenemos que buscar el certificado emitido por el SAT de alguna manera.</p>
<p><strong>Obteniendo los certificados del SAT</strong></p>
<p>Note que la aplicación <A HREF="https://www.servicios.sat.gob.mx/_mem_bin/formsloginFEA.asp?/ACCESO/CERTISAT.ASP">CertiSAT Web</A>, al buscar recuperar certificados me daba una información interesante:</p>
<p><a href="http://cofradia.org/wp-content/uploads/2010/12/certisat_ftp.jpg"><img src="http://cofradia.org/wp-content/uploads/2010/12/certisat_ftp.jpg" alt="" title="certisat_ftp" width="539" height="340" class="alignnone size-full wp-image-4466" /></a></p>
<p>Las ligas a los certificados tienen una estructura predecible, por lo cual puedo armar una regla de extracción del certificado (el cual es público) y obtenerlo directo del SAT para corroborar la información de la factura.</p>
<p>Si tenemos en nuestra factura en XML el valor &#8220;00001000000102436855&#8243; en el campo de &#8220;noCertificado&#8221;, entonces podemos inferir el siguiente comando para obtenerlo:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftp2.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>Certificados<span style="color: #000000; font-weight: bold;">/</span>FEA<span style="color: #000000; font-weight: bold;">/</span>000010<span style="color: #000000; font-weight: bold;">/</span>000001<span style="color: #000000; font-weight: bold;">/</span>02<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">43</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">68</span><span style="color: #000000; font-weight: bold;">/</span>00001000000102436855.cer</pre></div></div>

<p>Si se fijan, la ruta de los directorios del FTP del SAT utilizan &#8220;ftp://ftp2.sat.gob.mx/Certificados/FEA/&#8221;, seguido por los 6 digitos del inicio del nombre del certificado, despues los siguientes 6 y lo siguiente en 3 pares de digitos que componen el nombre del mismo, despreciando los 2 últimos caracteres.</p>
<p><strong>Validando la factura por medio del certificado y el &#8220;sello&#8221;</strong></p>
<p>Necesitamos una pequeña regla de transformación que llamaremos &#8220;saca_sello.xslt&#8221; que contiene lo siguiente:</p>

<div class="wp_syntax"><div class="code"><pre class="xsl" style="font-family:monospace;">&nbsp;
&lt;xsl:stylesheet version = '1.0'
    xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
    xmlns:cfd=&quot;http://www.sat.gob.mx/cfd/2&quot;&gt;
&nbsp;
&lt;xsl:output method = &quot;text&quot; /&gt; 
&nbsp;
&lt;xsl:template match=&quot;cfd:Comprobante&quot;&gt;
      &lt;xsl:value-of select=&quot;@sello&quot;/&gt;
&lt;/xsl:template&gt;
&nbsp;
&lt;/xsl:stylesheet&gt;</pre></div></div>

<p>Obtenemos el sello y lo dejamos en el archivo de trabajo &#8220;sello.enc&#8221;, con el siguiente comando:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ xsltproc saca_sello.xslt NEO0303288Z1FAA9.xml <span style="color: #000000; font-weight: bold;">|</span> openssl enc <span style="color: #660033;">-base64</span> <span style="color: #660033;">-d</span> <span style="color: #660033;">-A</span> <span style="color: #660033;">-out</span> sello.enc</pre></div></div>

<p>Ahora obtenemos la llave pública, del emisor de la factura, contenido en el certificado emitido por el SAT:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ openssl x509 <span style="color: #660033;">-inform</span> DER <span style="color: #660033;">-outform</span> PEM <span style="color: #660033;">-in</span> 00001000000102436855.cer <span style="color: #660033;">-pubkey</span> <span style="color: #000000; font-weight: bold;">&gt;</span> 00001000000102436855.cer.pem</pre></div></div>

<p>Ahora podemos usar la llave pública para validar el documento:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ xsltproc cadenaoriginal_2_0.xslt NEO0303288Z1FAA9.xml <span style="color: #000000; font-weight: bold;">|</span> openssl dgst <span style="color: #660033;">-md5</span> <span style="color: #660033;">-verify</span> 00001000000102436855.cer.pem <span style="color: #660033;">-signature</span> sello.enc</pre></div></div>

<p>A partir del 1o de enero del 2011, los documentos generados deberan usar SHA1 en lugar de MD5, aunque hay que validar con MD5 los documentos generados anteriormente a la mencionada fecha. La validación de cadena original versión 2.0 (medios propios), quedaría así:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ xsltproc cadenaoriginal_2_0.xslt NEO0303288Z1FAA9.xml <span style="color: #000000; font-weight: bold;">|</span> openssl dgst <span style="color: #660033;">-sha1</span> <span style="color: #660033;">-verify</span> 00001000000102436855.cer.pem <span style="color: #660033;">-signature</span> sello.enc</pre></div></div>

<p>En el caso de que nuestra factura en XML diga en el campo de versión el valor &#8220;3.0&#8243;, deberemos usar esta variante del comando:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ xsltproc cadenaoriginal_3_0.xslt NEO0303288Z1FAA9.xml <span style="color: #000000; font-weight: bold;">|</span> openssl dgst <span style="color: #660033;">-sha1</span> <span style="color: #660033;">-verify</span> 00001000000102436855.cer.pem <span style="color: #660033;">-signature</span> sello.enc</pre></div></div>

<p>Esto dara algunos &#8220;warnings&#8221; y si pasa la validación dara la leyenda &#8220;Verified OK&#8221; en caso contrario debemos rechazar la factura.</p>
<p>Finalmente, con ayuda de OpenSSL, obtenemos información importante para la validación con este comando:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ openssl x509 <span style="color: #660033;">-inform</span> DER <span style="color: #660033;">-in</span> 00001000000102436855.cer <span style="color: #660033;">-noout</span> <span style="color: #660033;">-issuer</span> <span style="color: #660033;">-subject</span> <span style="color: #660033;">-startdate</span> <span style="color: #660033;">-enddate</span> <span style="color: #660033;">-serial</span>
&nbsp;
<span style="color: #007800;">issuer</span>= <span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">CN</span>=A.C. del Servicio de Administraci\xC3\xB3n Tributaria<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">O</span>=Servicio de Administraci\xC3\xB3n Tributaria<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">emailAddress</span>=acods<span style="color: #000000; font-weight: bold;">@</span>sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">streetAddress</span>=Av. Hidalgo <span style="color: #000000;">77</span>, Col. Guerrero<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">postalCode</span>=06300<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">C</span>=MX<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">ST</span>=Distrito Federal<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">L</span>=Cuauhtemoc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">unstructuredName</span>=Responsable: Fernando Mart\xC3\xADnez Coss
<span style="color: #007800;">subject</span>= <span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">CN</span>=NEOCENTER SA DE CV<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">name</span>=NEOCENTER SA DE CV<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">O</span>=NEOCENTER SA DE CV<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">x500UniqueIdentifier</span>=NEO0303288Z1 <span style="color: #000000; font-weight: bold;">/</span> AAWA630919KZ5<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">serialNumber</span>= <span style="color: #000000; font-weight: bold;">/</span> AAWA630919HDFPNL07<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">OU</span>=UNIDAD
<span style="color: #007800;">notBefore</span>=Dec <span style="color: #000000;">20</span> <span style="color: #000000;">19</span>:<span style="color: #000000;">42</span>:<span style="color: #000000;">36</span> <span style="color: #000000;">2010</span> GMT
<span style="color: #007800;">notAfter</span>=Dec <span style="color: #000000;">19</span> <span style="color: #000000;">19</span>:<span style="color: #000000;">42</span>:<span style="color: #000000;">36</span> <span style="color: #000000;">2012</span> GMT
<span style="color: #007800;">serial</span>=<span style="color: #000000;">3030303031303030303030313032343336383535</span></pre></div></div>

<p>La información que nos da es la del SAT, la del emisor, la fecha de vigencia del certificado con la que se &#8220;sello&#8221; la factura y el número de serie del certificado, este esta en formato Hexadecimal, que al convertirlo a decimal nos da el número de certificado que obtuvimos previamente.</p>
<p>Si la fecha de la factura en XML no esta entre las cotas de tiempo definidas en el certificado, o el número de certificado y nombre no coincide con el del emisor, debemos rechazar esta factura.</p>
<p><strong>Validando las series y folios del documento</strong></p>
<p>Es fácil recibir facturas que pasan por los validadores del SAT, pero que no son emitidas por la persona u empresa reales, por lo cual hay que prestar atención al proceso de validación. de CSD y folios</p>
<p>Nuevamente recurrimos al FTP del SAT para obtener dos archivos (que se actualizan diario y miden varios megas) donde estan la relación de CSD&#8217;s otorgados y las series de facturas:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftp2.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>agti_servicio_ftp<span style="color: #000000; font-weight: bold;">/</span>verifica_comprobante_ftp<span style="color: #000000; font-weight: bold;">/</span>CSD.txt
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftp2.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>agti_servicio_ftp<span style="color: #000000; font-weight: bold;">/</span>verifica_comprobante_ftp<span style="color: #000000; font-weight: bold;">/</span>FoliosCFD.txt</pre></div></div>

<p>Queda al lector subir esta información a una Base de datos para agilizar las consultas, pero en este caso ejemplificare la busqueda con comandos de bash.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;00001000000102436855&quot;</span> CSD.txt 
00001000000102436855<span style="color: #000000; font-weight: bold;">|</span><span style="color: #000000;">2010</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">20</span> <span style="color: #000000;">19</span>:<span style="color: #000000;">42</span>:<span style="color: #000000;">36</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #000000;">2012</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">19</span>:<span style="color: #000000;">42</span>:<span style="color: #000000;">36</span><span style="color: #000000; font-weight: bold;">|</span>NEO0303288Z1<span style="color: #000000; font-weight: bold;">|</span>A</pre></div></div>

<p>Aquí buscamos si el número de CSD corresponde al R.F.C. del emisor, noten que el último caracter de la linea nos indica si el CSD esta activo o revocado, en este caso esta activo. Esto tambíen nos muestra las fechas de vigencia contenidas en el certifcado.</p>
<p>Si el número de certificado no nos da nada en la busqueda, aun teniendo las últimas versiones de los archivos de CSD y folios, quiere decir que es un certificado de FIEL y no uno de sellos autorizados, por lo que deberán rechazar el documento.</p>
<p>Ahora busquemos si la serie de facturas es válida:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;NEO0303288Z1&quot;</span> FoliosCFD.txt 
NEO0303288Z1<span style="color: #000000; font-weight: bold;">|</span><span style="color: #000000;">353857</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #000000;">2010</span><span style="color: #000000; font-weight: bold;">|</span>AA<span style="color: #000000; font-weight: bold;">|</span><span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #000000;">5000</span>
NEO0303288Z1<span style="color: #000000; font-weight: bold;">|</span><span style="color: #000000;">353857</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #000000;">2010</span><span style="color: #000000; font-weight: bold;">|</span>CC<span style="color: #000000; font-weight: bold;">|</span><span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #000000;">500</span></pre></div></div>

<p>Hacemos las busquedas por R.F.C., ya que las facturas estan asociadas al emisor y no al sello. Vemos que la factura emitida es una serie válida.</p>
<p>Esto es una muestra de un proceso que debe automatizarse, tomando en cuanta que los archivos de &#8220;CSD.txt&#8221; y &#8220;FoliosCFD.txt&#8221; aumentan diario, no se si el SAT tenga algún formato no acumulativo sino diario de las diferencias de los cambios.</p>
<p>Con esto concluimos el proceso de validación y en otra artículo hablaremos de como usar las transformaciones de XSLT para emitir documentos impresos a partir del XML de la factura electrónica ya sellada.</p>
<p>También hablaremos de un proyecto que queremos compartir con ustedes llamadao &#8220;SAT-O-Matic&#8221;, que pretende hacer un sistema Open Source y GPL para la emisión, validación e impresión de documentos orientado a usuarios no iniciados. Enfocaremos esfuerzos para ayudar a la iniciativa de Mauricio Baeza (de Universo Libre), que esta haciendo una <A HREF="http://www.universolibre.org/node/17">excelente herramienta</A> de facturación electrónica utilizando OpenOffice/LibreOffice, para que ademas de soportar &#8220;Medios Propios&#8221; (versión 2.0) pueda soportar el esquema de &#8220;Proveedor Autorizado de Certificación&#8221; (versión 3.0)</p>
<p><strong>Agradecimientos</strong></p>
<p>Agradezco la ayuda de Salvador Ortíz de <A HREF="http://www.msg.com.mx/">Matías Software Group</A>, <A HREF="http://www.lacorona.com.mx/fortiz/">Fernando Ortíz</A> y de Mauricio Baeza de <A HREF="http://universolibre.org/">Universo Libre</A> por la ayuda y orientación prestada con sus opiniones y artículos.</p>
<p>Autor: Fernando “El Pop” Romo (pop at cofradia.org), twitter @El_Pop</p>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/12/29/how-to-de-facturacion-electronica-verificacion-de-facturas/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Código de barras de 2D QR (Quick Response)</title>
		<link>http://cofradia.org/2010/12/23/codigo-de-barras-de-2d-qr-quick-response/</link>
		<comments>http://cofradia.org/2010/12/23/codigo-de-barras-de-2d-qr-quick-response/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 07:25:39 +0000</pubDate>
		<dc:creator>El Pop</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Tips técnicos]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=4420</guid>
		<description><![CDATA[Pues siguiendo la investigación de la mentada factura electrónica del SAT, me encuentro que hay un requerimiento para las facturas impresas de usar un código de Barras Bi-dimensional con un formato QR (Quick Response). Esto para poner información en la factura del RFC que emite y recibe la misma, así que me dí a la [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://cofradia.org/2010/12/23/codigo-de-barras-de-2d-qr-quick-response/"></g:plusone></div><p><a href="http://cofradia.org/wp-content/uploads/2010/12/demo_qr_code.png"><img src="http://cofradia.org/wp-content/uploads/2010/12/demo_qr_code.png" alt="" title="demo_qr_code" width="140" height="140" class="alignleft size-full wp-image-4421" /></a></p>
<p>Pues siguiendo la investigación de la mentada factura electrónica del SAT, me encuentro que hay un requerimiento para las facturas impresas de usar un código de Barras Bi-dimensional con un formato <A HREF="http://en.wikipedia.org/wiki/QR_Code">QR</A> (Quick Response).</p>
<p>Esto para poner información en la factura del RFC que emite y recibe la misma, así que me dí a la tarea de buscar como hacerlo&#8230;</p>
<p><span id="more-4420"></span></p>
<p>Pues yo que soy amante de Perl, encontré en <A HREF="http://www.cpan.org/">CPAN</A> una librería llamada <A HREF="http://search.cpan.org/~kurihara/Imager-QRCode-0.031/lib/Imager/QRCode.pm">Imager::QrCode</A> que hace la talacha.</p>
<p>Esta depende (y debe estar instalada) del módulo <A HREF="http://search.cpan.org/~tonyc/Imager-0.79/Imager.pm">Imager</A>.</p>
<p>Aunque deben instalar previamente la librería de <A HREF="http://www.libpng.org/pub/png/libpng.html">libpng</A> (en su versión <A HREF="http://sourceforge.net/projects/libpng/files/libpng12/1.2.44/">1.2</A>, aunque ya esta la rama 1.4) y la librería <A HREF="http://fukuchi.org/works/qrencode/index.en.html">libqrencode</A> (versión 3.1.1 o mayor). En Mac OS X necesite tener la última versión de <A HREF="http://pkg-config.freedesktop.org/wiki/">pkg-config</A></p>
<p>Ya con estos pre-requisitos hacemos un programa sencillo en Perl que genera lo que queramos:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #000000; font-weight: bold;">use</span> Imager<span style="color: #339933;">::</span><span style="color: #006600;">QRCode</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$qrcode</span> <span style="color: #339933;">=</span> Imager<span style="color: #339933;">::</span><span style="color: #006600;">QRCode</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span>
    size          <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span>
    margin        <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
    version       <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
    level         <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'M'</span><span style="color: #339933;">,</span>
    casesensitive <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
    lightcolor    <span style="color: #339933;">=&gt;</span> Imager<span style="color: #339933;">::</span><span style="color: #006600;">Color</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">255</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">255</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    darkcolor     <span style="color: #339933;">=&gt;</span> Imager<span style="color: #339933;">::</span><span style="color: #006600;">Color</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$img</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$qrcode</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">plot</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Las hormigas en Francia siempre se visten con elegancia&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$img</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">write</span><span style="color: #009900;">&#40;</span>file <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;2d_qr_demo.png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$img</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$qrcode</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">plot</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;?re=ROAF641217K94&amp;rr=INC101109Q36&amp;tt=1234567890.123456&amp;id=ad662d33-6934-459c-a128-BDf0393f0f44&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$img</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">write</span><span style="color: #009900;">&#40;</span>file <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;timbre_Fiscal_SAT.png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<div id="attachment_4427" class="wp-caption alignnone" style="width: 182px"><a href="http://cofradia.org/wp-content/uploads/2010/12/timbre_Fiscal_SAT.png"><img src="http://cofradia.org/wp-content/uploads/2010/12/timbre_Fiscal_SAT.png" alt="" title="timbre_Fiscal_SAT" width="172" height="172" class="size-full wp-image-4427" /></a><p class="wp-caption-text">Timbre Fiscal para el SAT</p></div>
<p>Y listo <img src='http://cofradia.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/12/23/codigo-de-barras-de-2d-qr-quick-response/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How-To de facturación electrónica para unixeros (generación de sellos)</title>
		<link>http://cofradia.org/2010/12/18/how-to-de-facturacion-electronica-para-unixeros-generacion-de-sellos/</link>
		<comments>http://cofradia.org/2010/12/18/how-to-de-facturacion-electronica-para-unixeros-generacion-de-sellos/#comments</comments>
		<pubDate>Sun, 19 Dec 2010 00:36:32 +0000</pubDate>
		<dc:creator>El Pop</dc:creator>
				<category><![CDATA[Paranoia Fan Club]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[software libre]]></category>
		<category><![CDATA[Tips técnicos]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=4311</guid>
		<description><![CDATA[Importante Esta guía esta enfocada a generación de facturas electrónicas por &#8220;medios propios&#8221;, por favor leanla completa, así como los enlaces recomendados, antes de ensayar con sus certificados. Entendiendo el requerimiento La factura electrónica no es tan solo un sello que se pone a un documento, es un mecanismo completo de fiscalización que empezará a [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://cofradia.org/2010/12/18/how-to-de-facturacion-electronica-para-unixeros-generacion-de-sellos/"></g:plusone></div><p><strong>Importante</strong></p>
<p>Esta guía esta enfocada a generación de facturas electrónicas por &#8220;medios propios&#8221;, por favor leanla completa, así como los enlaces recomendados, antes de ensayar con sus certificados.</p>
<p><strong>Entendiendo el requerimiento</strong></p>
<p>
La factura electrónica no es tan solo un sello que se pone a un documento, es un mecanismo completo de fiscalización que empezará a operar obligatoriamente a partir del 1o de enero del 2011.
</p>
<p>
Este consiste en el firmado e  información por medios digitales a la Secretaría de Hacienda y Crédito Público (SHCP) por medio de su entidad de control conocida como Sistema de Administración Tributaria (SAT) de las facturas que emitimos y recibimos.
</p>
<p>
El mecanismo incluye a saber dos versiones en su operación, una conocida como &#8220;facturación por medios propios&#8221; (versión 2.0) y una que utiliza un intermediario o &#8220;proveedor autorizado de certificación&#8221; (versión 3.0), esta última forma es donde la fiscalización es total.
</p>
<p><span id="more-4311"></span></p>
<p>
En ambos mecanismos debes contar con tu <A HREF="http://www.sat.gob.mx/sitio_internet/e_sat/tu_firma/">Firma Electrónica Avanzada</A> (FIEL) que es un manejo de <A HREF="http://en.wikipedia.org/wiki/Public_key_infrastructure">Public Key Infrastructure</A> (PKI) en la que el SAT es el organismo certificador (<A HREF="http://en.wikipedia.org/wiki/Certificate_authority">Certificate authority</A> o CA) que emite Certificados digitales que avalan al emisor, en este caso al contribuyente.
</p>
<p>
Es muy importante saber que las llaves privadas de la FIEL, la de los sellos y los paswords de las mismas NUNCA se deben proporcionar a terceros, según la ley es responsabilidad total del contribuyente el manejo y seguridad de estas llaves. Si a una empresa que emite facturas electrónicas les delegas tus passwords (para facilitar el proceso de su sistema hacia tí), le estas dando un cheque al portador con el cual pueden emitir una factura de la compra venta de tu empresa, coche, casa, etc, y legalmente dejarte en la calle. BAJO NINGUNA CIRCUNSTANCIA DES TUS CLAVES. Si ya hiciste esta soberana estupides, revoca tus certificados y acude al SAT.
</p>
<p>
Todo esto esta basado en el Famoso <A HREF="ftp://ftp2.sat.gob.mx/asistencia_servicio_ftp/publicaciones/cfd/Anexo20RMF2010.pdf">Anexo 20</A> publicado en el diario Oficial (en formato PDF). Es importante que lean el ﻿﻿<A HREF="http://info4.juridicas.unam.mx/ijure/fed/7/59.htm?s=">artículo 29 del Código Fiscal de la Federación</A></p>
<p>Aquí esta un <A HREF="ftp://ftp2.sat.gob.mx/asistencia_servicio_ftp/publicaciones/boletines/com2010_123.pdf">comunicado de prensa del SAT</A> en el que anuncia y explica el proceso de transición hacia la Facturación Electrónica (en formato pdf).</p>
<p><strong>Obteniendo tus certificados</strong></p>
<p>
Si ya cuentas con la FIEL, los pasos a seguir para obtener tus Certificados de Sello Digital (CSD) son sencillos, pero pueden llegar a ser algo confusos.
</p>
<p><OL><br />
<LI>Tienes que obtener el Programa <A HREF="ftp://ftp2.sat.gob.mx/asistencia_servicio_ftp/programas/solcedi/DSIC10312SOL.ZIP">SOLCEDI</A> que es una aplicación windows, pero que opera perfectamente con <A HREF="http://www.winehq.org/">WINE</A> con una instalación base del mismo. En mi caso lo hice en una Mac utilizando un virtualizador llamado <A HREF="http://www.parallels.com/">Parallels</A>.</LI><br />
<LI>El SOLCEDI es un generador de llaves privadas y públicas que nos permite, a partir de la FIEL, crear las llaves  de los sellos digitales, así como el archivo de requerimiento (.req) para que el SAT emita un certificado al mismo (.cer).</LI><br />
<LI>Una vez obtenido el archivo de requerimiento (.req) hay que &#8220;ensobretarlo&#8221; para generar un archivo con terminación .sdg, esto se hace también con la aplicación SOLCEDI</LI><br />
<LI>Ya con nuestro archivo .sdg tenemos que enviarlo a una aplicación llamada <A HREF="https://www.servicios.sat.gob.mx/_mem_bin/formsloginFEA.asp?/ACCESO/CERTISAT.ASP">CertiSAT Web</A> en la que mandaremos el archivo .sdg y obtendremos el certificado de nuestros sellos digitales.</LI><br />
<LI>Despues debemos pedir los folios por medio de otra aplicación conocida como  <A HREF="https://www.consulta.sat.gob.mx/SICOFI_WEB/moduloECFD_Plus/acceso.asp">SICOFI</A> donde a partir de la FIEL pediremos los folios.</LI><br />
</OL></p>
<p>Nota: Tanto el CertiSAT como el SICOFI usan aplicaciones de Java que no necesariamente operan bien con algunos navegadores. Queda al lector buscar como hacer que operen para completar su proceso. en mi caso use el Explorer de MS con el virtualizador de Parallels.</p>
<p>
Puedes pedir múltiples Sellos a partir de una FIEL, por ejemplo para que cada sucursal o unidad de negocio maneje su firma de facturas.
</p>
<p><P>Aquí esta un video en Youtube (cortesía de <A HREF="http://portal.mysuitemex.com/index.php">My$uite Services</A>)que explica paso a paso esto:</P></p>
<p><a href="http://www.youtube.com/watch?v=Qy65UOMOEY8&#038;fmt=18">http://www.youtube.com/watch?v=Qy65UOMOEY8</a></p>
<p><strong>Jugando con los certificados</strong></p>
<p>Todo el manejo de certificados se hace utilizando <A HREF="http://www.openssl.org/">OpenSSL</A> y la conversión de facturas y manejo de cadena original se hace con <A HREF="http://xmlsoft.org/XSLT/xsltproc2.html">xsltproc</A>, ambas herramientas estan disponibles en las distribuciones de Unix/Linux mas populares y en MacOS X</p>
<p>Esto ya lo hice con mis llaves, pero para fines didácticos, vamos a mostrar el esquema de manejo de llaves y firmado con uno de los certificados de prueba del SAT:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftp2.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>asistencia_servicio_ftp<span style="color: #000000; font-weight: bold;">/</span>publicaciones<span style="color: #000000; font-weight: bold;">/</span>solcedi<span style="color: #000000; font-weight: bold;">/</span>Cer_Sellos.zip</pre></div></div>

<p>También los certificados raíz  y padres para posteriormente hacer verificaciones:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftp2.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>asistencia_servicio_ftp<span style="color: #000000; font-weight: bold;">/</span>publicaciones<span style="color: #000000; font-weight: bold;">/</span>solcedi<span style="color: #000000; font-weight: bold;">/</span>Cert_Prod.zip
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftp2.sat.gob.mx<span style="color: #000000; font-weight: bold;">/</span>asistencia_servicio_ftp<span style="color: #000000; font-weight: bold;">/</span>publicaciones<span style="color: #000000; font-weight: bold;">/</span>solcedi<span style="color: #000000; font-weight: bold;">/</span>Certificados_P.zip</pre></div></div>

<p>Desempacamos el contenido y utilizamos alguno de los certificados de prueba al azar:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">unzip</span> Cer_Sellos.zip 
Archive:  Cer_Sellos.zip
 extracting: aaa010101aaa_csd_09.key  
  inflating: aaa010101aaa_csd_10.cer  
 extracting: aaa010101aaa_csd_10.key  
  inflating: aaa010101aaa_csd_01.cer  
 extracting: aaa010101aaa_csd_01.key  
  inflating: aaa010101aaa_csd_02.cer  
 extracting: aaa010101aaa_csd_02.key  
  inflating: aaa010101aaa_csd_03.cer  
 extracting: aaa010101aaa_csd_03.key  
  inflating: aaa010101aaa_csd_04.cer  
 extracting: aaa010101aaa_csd_04.key  
  inflating: aaa010101aaa_csd_05.cer  
 extracting: aaa010101aaa_csd_05.key  
  inflating: aaa010101aaa_csd_06.cer  
 extracting: aaa010101aaa_csd_06.key  
  inflating: aaa010101aaa_csd_07.cer  
 extracting: aaa010101aaa_csd_07.key  
  inflating: aaa010101aaa_csd_08.cer  
 extracting: aaa010101aaa_csd_08.key  
  inflating: aaa010101aaa_csd_09.cer  
 extracting: Contrase?a de Clave Privada.txt  
  inflating: aaa010101aaa_FIEL.cer   
 extracting: aaa010101aaa_FIEL.key</pre></div></div>

<p>Vamos a usar el CSD &#8220;aaa010101aaa_csd_08&#8243; para generar los componentes que necesitamos para firmar los documentos. es necesario manejar el certificado (.cer) y la llave privadad (.key) del CSD.</p>
<p><P>La llaves se manejan bajo una norma conocido como <A HREF="http://en.wikipedia.org/wiki/ASN.1">ASN1</A> en sus variantes de <A HREF="http://en.wikipedia.org/wiki/Basic_Encoding_Rules">Basic Encoding Rules</A> (BER) y <A HREF="http://en.wikipedia.org/wiki/Distinguished_Encoding_Rules">Distinguished Encoding Rules</A> (DER), pero para manejar las llaves con OpenSSL las transformaremos a formato <A HREF="http://en.wikipedia.org/wiki/Privacy-enhanced_Electronic_Mail">Privacy-enhanced Electronic Mail</A> (PEM).</p>
<p>Ahora vamos a transformar a formato PEM el archivo de llave privada del CSD:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ openssl pkcs8 <span style="color: #660033;">-inform</span> DER <span style="color: #660033;">-in</span> aaa010101aaa_csd_08.key <span style="color: #660033;">-out</span> aaa010101aaa_csd_08.key.pem <span style="color: #660033;">-passin</span> pass:a0123456789</pre></div></div>

<p>El archivo resultante se ve así:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQDVvLjg4dC8rIWzeRV6v+ZxYTpzgiK11bHLeYRYF8Pho+1fTeRn
7oOUdGfYSUEsqXV8s99F+rdJeA9Ma9iAt5zYBW+qkWlr8NDkkxQyMiOv8oEoJiXF
sNWekAhnniyFoPn9pbA1FVBfBsaIe82HKi+Vq0Nd0QKh28afj2f6yhwZnwIDAQAB
AoGACngF7i3hVXx1yAakQLDpjqAehs3W+WUQIlE/ZDk1xPWMiOB90YFjPIA/Hd7o
rFFYidUdmIXhOF4DEdEud4+GxQ8E3tlQPIB+0xF5yVor/CbDLmzGKu3Ued5eefeS
R2LdhlLjTGOr7MXM3Dw2nEoiTFvzOHr6qOnlrIUzyy6xEgECQQDq+NA76TZVzivW
LE2OrL9vtHkBF9+91mvY7lg0uCbsQPjJGlu3nFHyxRpJH1WaJxmOvD9aAlrp4B9M
8vC2Rh2BAkEA6N1sQ2P+CmV85qCHpwbIvEX4XAj6NMJK5F9qpJwrQVSZAXXYz2ci
ytLaafXFCs1uDjTIKJhKaNd5fZty1NAHHwJBALJPMI5WUrJYq3Fy20QrGXcmaDEJ
MfP4tIzBilQvbvIX9/N8Oh+i05k8M89LpQU/KKjld9nRMbaLKpWVQk+/84ECQBf1
iEkaxa2eKY61H5/w08CDVn1pswywnPIIWzmak9zB7og27trQGsVRkoVqcx6camFt
ztZWbPmCig6Bavw4dzMCQC4kCq50HLSLaUYc/CqTRjHU4HPBHHolDXKvViBeZNl0
n3Nh/XzJqVCP/AbPcpTmw53wf6Nl9PHHi6EfKMnZMug=
-----END RSA PRIVATE KEY-----</pre></div></div>

<p>Pero en este paso la llave privada esta expuesta, ya que al transformalo en formato PEM, esta quedo con el password embebido y en este momento es un &#8220;cheque al portador&#8221;, con el cual pueden firmar sellos de facturas indiscriminadamente.</p>
<p>
Se recomienda proteger de la siguiente manera:</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ openssl rsa <span style="color: #660033;">-in</span> aaa010101aaa_csd_08.key.pem <span style="color: #660033;">-des3</span> <span style="color: #660033;">-out</span> aaa010101aaa_csd_08.key.pem.secure
writing RSA key
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
&nbsp;
$ <span style="color: #c20cb9; font-weight: bold;">mv</span> aaa010101aaa_csd_08.key.pem.secure aaa010101aaa_csd_08.key.pem</pre></div></div>

</p>
<p>El &#8220;Pass Phrase&#8221; puede ser cualquier cosa que queramos, no tiene que ser ni el password del CSD o de la FIEL, digamos que es una firma para esta chequera en especifico.
</p>
<p>
Ahora el certificado se vera así:
</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,C3D4161A4C34F52F
&nbsp;
j8KgGJgH3TNrucpAFI7LyiFLOuPULgfifw4/MI+52RvjV355gYQD0LUIxPhvaWEm
goRqkWewc4zx5i7zCjeUQxU77lv2xEKuxGgKVBOW/C48CRHpbV4vqFWWJikV0eei
oQwCm2ipscfW4Vwgz8KT4OZTByqxVm8/ptRSsMHTazBpcA7+93GkC+lOPBWBsU9H
4cT/t0m3/K1qgryC5m19ovdLJ29V5dNWf2Zl0G/GrRhfecpWA+4/ZpqELovyOSpU
N/325k6YyWLEScrM6DIbpMmE1rxKmvPrGJk/rpxTwjLulBBueRD23fyrzPePp07q
bbV+gxf1UAOwUpL9vSAt6ezQlELM+xjMyOLm/UMW+Mnrx+V+H6KfrqcVboyG008z
o1mDBZe9S947hu2a2PUd6hlY2Uhn3pbRaXSlysW7VVi3fyR8Har6iq2uczQ5xz9H
joR8H56//WM2QQpqfZxMhBtGgtynrdVvFJrCsADEq+xYwxCevgYfPQ1C5the8HjO
RjRbm1cZ9B4moTDwpZBjYqs3T3KGtUeGhbCbdUYufzg2KbQCydWjPisNbD/JPZ0g
alPveWlETKYHuyiUoKD+yKdeKRgQpS0waAQb655QWQX+mte0HAdFwkh+OT3qBc3t
mn8sz0ms0nlvKoaBapE3e5UqmvmlVY0WCh7wvKIGYfqG1Q2EVN6m0qLzc8Yr4T18
IWz6azwv5J+kuob7erOBrWHUV1mK21qiMVYNdUBmvLDvBlaFaozaSEWypEkRTWsV
bCsTdhTrCOV2BWKbBaNejOzxPAnvbFAVj581JYxxPDWfNdvPLxhOUQ==
-----END RSA PRIVATE KEY-----</pre></div></div>

<p>
Este archivo dejenlo en alguna ruta (path) seguro en el servidor que utilizarán para generar sus facturas.
</p>
<p>Ahora tenemos que trabajar en el certificado del CSD, este es público y debe estar a la disposición de nuestros clientes para que verifiquen la autenticidad de nuestros documentos.
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ openssl enc <span style="color: #660033;">-base64</span> <span style="color: #660033;">-in</span> aaa010101aaa_csd_08.cer <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> aaa010101aaa_csd_08.cer.txt</pre></div></div>

<p>El Resultado lo guardamos para usarlo posteriormente.  Normalmente se embebe en el XML que utilizaremos como machote de la factura a procesar. El contenido debe verse así (pero sin retornos de carro o cambios de linea):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">MIIE/TCCA+WgAwIBAgIUMzAwMDEwMDAwMDAxMDAwMDA4MDcwDQYJKoZIhvcNAQEF
BQAwggFvMRgwFgYDVQQDDA9BLkMuIGRlIHBydWViYXMxLzAtBgNVBAoMJlNlcnZp
Y2lvIGRlIEFkbWluaXN0cmFjacOzbiBUcmlidXRhcmlhMTgwNgYDVQQLDC9BZG1p
bmlzdHJhY2nDs24gZGUgU2VndXJpZGFkIGRlIGxhIEluZm9ybWFjacOzbjEpMCcG
CSqGSIb3DQEJARYaYXNpc25ldEBwcnVlYmFzLnNhdC5nb2IubXgxJjAkBgNVBAkM
HUF2LiBIaWRhbGdvIDc3LCBDb2wuIEd1ZXJyZXJvMQ4wDAYDVQQRDAUwNjMwMDEL
MAkGA1UEBhMCTVgxGTAXBgNVBAgMEERpc3RyaXRvIEZlZGVyYWwxEjAQBgNVBAcM
CUNveW9hY8OhbjEVMBMGA1UELRMMU0FUOTcwNzAxTk4zMTIwMAYJKoZIhvcNAQkC
DCNSZXNwb25zYWJsZTogSMOpY3RvciBPcm5lbGFzIEFyY2lnYTAeFw0xMDA3MzAx
NjU4NDZaFw0xMjA3MjkxNjU4NDZaMIGWMRIwEAYDVQQDDAlNYXRyaXogU0ExEjAQ
BgNVBCkMCU1hdHJpeiBTQTESMBAGA1UECgwJTWF0cml6IFNBMSUwIwYDVQQtExxB
QUEwMTAxMDFBQUEgLyBBQUFBMDEwMTAxQUFBMR4wHAYDVQQFExUgLyBBQUFBMDEw
MTAxSERGUlhYMDExETAPBgNVBAsMCFVuaWRhZCA4MIGfMA0GCSqGSIb3DQEBAQUA
A4GNADCBiQKBgQDVvLjg4dC8rIWzeRV6v+ZxYTpzgiK11bHLeYRYF8Pho+1fTeRn
7oOUdGfYSUEsqXV8s99F+rdJeA9Ma9iAt5zYBW+qkWlr8NDkkxQyMiOv8oEoJiXF
sNWekAhnniyFoPn9pbA1FVBfBsaIe82HKi+Vq0Nd0QKh28afj2f6yhwZnwIDAQAB
o4HqMIHnMAwGA1UdEwEB/wQCMAAwCwYDVR0PBAQDAgbAMB0GA1UdDgQWBBSXXSAB
98HZaYvKFyKXq5u8z4SG+zAuBgNVHR8EJzAlMCOgIaAfhh1odHRwOi8vcGtpLnNh
dC5nb2IubXgvc2F0LmNybDAzBggrBgEFBQcBAQQnMCUwIwYIKwYBBQUHMAGGF2h0
dHA6Ly9vY3NwLnNhdC5nb2IubXgvMB8GA1UdIwQYMBaAFOtZfQQimlONnnEaoFiW
KfU54KDFMBAGA1UdIAQJMAcwBQYDKgMEMBMGA1UdJQQMMAoGCCsGAQUFBwMCMA0G
CSqGSIb3DQEBBQUAA4IBAQAlyBvfqLEsWYW11levSQLbsvCpaWmIqtbhfM65Ly+b
3848+S3WF9qZJLbH6NkViGUKy9WtTOwegicPSY/dihx1ZDOplARutbrscpLGqwfK
sg/qh7ppK7CwqZv5rvrjnaflI8KDV9b+2hsyI0oGY9kVnZb0GgpNZMAKvUmvqXq5
Z4ehoNWJmvixV7MgnX/heCZEcKZbR1pIoropUgiR5M8TUF9SUQlPPyRHgNA/v6vN
wwZT+JYa62x65IrguUgLCg3DJgo4hk4zADM81Irn3jiTLBZcF2LTQageqxYxSj8M
CWz7vGoB8Kv70CLY+Xin/IscCmZ2ohbG636sFNi6so4T</pre></div></div>

<p>Guardamos este resultado para empezar a manejar las facturas</p>
<p><strong>Las facturas y la &#8220;Cadena Original&#8221;</strong></p>
<p>La cadena original se obtiene de la transformación del formato XML que define la factura y el hash de esta es la que se firma</p>
<p>Hay dos cosas importantes en la generación de documentos y sus diferencias:
<p><P><strong>Medios Propios</strong> se le conoce como versión 2.0 y utiliza una regla de transformación de XML que utiliza el archivo <A HREF="http://www.sat.gob.mx/sitio_internet/cfd/2/cadenaoriginal_2_0/cadenaoriginal_2_0.xslt">cadenaoriginal_2_0.xslt</A>, la cadena original se procesa con <A HREF="http://es.wikipedia.org/wiki/MD5">MD5</A> y el resultado de esto es el que se firma con la llave privada para generar el sello digital. En esta modalidad nosotros controlamos el número de folio a emitir. el SAT debe tener acceso a todos nuestras facturas emitidas y recibidas por algún medio (página WEB, FTP, etc.). Esta solo es válida si emites comprobantes antes del 1o de enero del 2011 y estas excento de la obligación de la regla de intermediario (PSCFDI).</p>
<p><strong>Proveedor Autorizado de Certificación</strong>, tambien conocidos como PSCFDI, utilizan la versión de <A HREF="ftp://ftp2.sat.gob.mx/asistencia_servicio_ftp/publicaciones/solcedi/cadenaoriginal_3_0.xslt">cadenaoriginal_3_0.xslt</A> (en el ftp del SAT). Usa <A HREF="http://en.wikipedia.org/wiki/SHA-1">SHA1</A> para generar el hash a firmar. Cuando se usa esta modalidad, los folios de la factura son definidos por el proveedor del servicio, no por nosotros y debe llevar la firma digital de este proveedor en el documento sellado. El SAT recibe en linea cada factura emitida, ya que el PSCFDI debe informar a la SHCP cada movimiento que efectue en nuestro nombre. Esta forma es obligatoria a partir del 1o de enero del 2011 si no has facturado previamente por medios propios (versión 2.0).
</p>
<p>Ya que tenemos el achivo de transformación de la cadena original, en mi caso uso medios propios y yo genero mi sello (versión 2.0), necesito definir un machote de factura en XML (&#8220;factura.xml&#8221;) con la siguiente información mínima:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Comprobante</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.sat.gob.mx/cfd/2&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;http://www.sat.gob.mx/cfd/2 http://www.sat.gob.mx/sitio_internet/cfd/2/cfdv2.xsd&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;2.0&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">serie</span>=<span style="color: #ff0000;">&quot;A&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">folio</span>=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">fecha</span>=<span style="color: #ff0000;">&quot;2010-12-18T15:27:13&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">sello</span>=<span style="color: #ff0000;">&quot;&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">noAprobacion</span>=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">anoAprobacion</span>=<span style="color: #ff0000;">&quot;2006&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">tipoDeComprobante</span>=<span style="color: #ff0000;">&quot;ingreso&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">formaDePago</span>=<span style="color: #ff0000;">&quot;Contado en una sola exibicion&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">noCertificado</span>=<span style="color: #ff0000;">&quot;00001000000100000001&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">certificado</span>=<span style="color: #ff0000;">&quot;MIIE/TCCA+WgAwIBAgIUMzAwMDEwMDAwMDAxMDAwMDA4MDcwDQYJKoZIhvcNAQEFBQAwggFvMRgwFgYDVQQDDA9BLkMuIGRlIHBydWViYXMxLzAtBgNVBAoMJlNlcnZpY2lvIGRlIEFkbWluaXN0cmFjacOzbiBUcmlidXRhcmlhMTgwNgYDVQQLDC9BZG1pbmlzdHJhY2nDs24gZGUgU2VndXJpZGFkIGRlIGxhIEluZm9ybWFjacOzbjEpMCcGCSqGSIb3DQEJARYaYXNpc25ldEBwcnVlYmFzLnNhdC5nb2IubXgxJjAkBgNVBAkMHUF2LiBIaWRhbGdvIDc3LCBDb2wuIEd1ZXJyZXJvMQ4wDAYDVQQRDAUwNjMwMDELMAkGA1UEBhMCTVgxGTAXBgNVBAgMEERpc3RyaXRvIEZlZGVyYWwxEjAQBgNVBAcMCUNveW9hY8OhbjEVMBMGA1UELRMMU0FUOTcwNzAxTk4zMTIwMAYJKoZIhvcNAQkCDCNSZXNwb25zYWJsZTogSMOpY3RvciBPcm5lbGFzIEFyY2lnYTAeFw0xMDA3MzAxNjU4NDZaFw0xMjA3MjkxNjU4NDZaMIGWMRIwEAYDVQQDDAlNYXRyaXogU0ExEjAQBgNVBCkMCU1hdHJpeiBTQTESMBAGA1UECgwJTWF0cml6IFNBMSUwIwYDVQQtExxBQUEwMTAxMDFBQUEgLyBBQUFBMDEwMTAxQUFBMR4wHAYDVQQFExUgLyBBQUFBMDEwMTAxSERGUlhYMDExETAPBgNVBAsMCFVuaWRhZCA4MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVvLjg4dC8rIWzeRV6v+ZxYTpzgiK11bHLeYRYF8Pho+1fTeRn7oOUdGfYSUEsqXV8s99F+rdJeA9Ma9iAt5zYBW+qkWlr8NDkkxQyMiOv8oEoJiXFsNWekAhnniyFoPn9pbA1FVBfBsaIe82HKi+Vq0Nd0QKh28afj2f6yhwZnwIDAQABo4HqMIHnMAwGA1UdEwEB/wQCMAAwCwYDVR0PBAQDAgbAMB0GA1UdDgQWBBSXXSAB98HZaYvKFyKXq5u8z4SG+zAuBgNVHR8EJzAlMCOgIaAfhh1odHRwOi8vcGtpLnNhdC5nb2IubXgvc2F0LmNybDAzBggrBgEFBQcBAQQnMCUwIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLnNhdC5nb2IubXgvMB8GA1UdIwQYMBaAFOtZfQQimlONnnEaoFiWKfU54KDFMBAGA1UdIAQJMAcwBQYDKgMEMBMGA1UdJQQMMAoGCCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4IBAQAlyBvfqLEsWYW11levSQLbsvCpaWmIqtbhfM65Ly+b3848+S3WF9qZJLbH6NkViGUKy9WtTOwegicPSY/dihx1ZDOplARutbrscpLGqwfKsg/qh7ppK7CwqZv5rvrjnaflI8KDV9b+2hsyI0oGY9kVnZb0GgpNZMAKvUmvqXq5Z4ehoNWJmvixV7MgnX/heCZEcKZbR1pIoropUgiR5M8TUF9SUQlPPyRHgNA/v6vNwwZT+JYa62x65IrguUgLCg3DJgo4hk4zADM81Irn3jiTLBZcF2LTQageqxYxSj8MCWz7vGoB8Kv70CLY+Xin/IscCmZ2ohbG636sFNi6so4T&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">subTotal</span>=<span style="color: #ff0000;">&quot;21500.00&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">descuento</span>=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">total</span>=<span style="color: #ff0000;">&quot;24940.00&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Emisor</span> <span style="color: #000066;">rfc</span>=<span style="color: #ff0000;">&quot;CAJU010166K67&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">nombre</span>=<span style="color: #ff0000;">&quot;Juan Cama Nei&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;DomicilioFiscal</span> <span style="color: #000066;">calle</span>=<span style="color: #ff0000;">&quot;Av. Sal Si Puedes&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">noExterior</span>=<span style="color: #ff0000;">&quot;13&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">noInterior</span>=<span style="color: #ff0000;">&quot;666&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">colonia</span>=<span style="color: #ff0000;">&quot;Morelos&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">localidad</span>=<span style="color: #ff0000;">&quot;Distrito Federal&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">municipio</span>=<span style="color: #ff0000;">&quot;Cuauhtemoc&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">estado</span>=<span style="color: #ff0000;">&quot;Distrito Federal&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">pais</span>=<span style="color: #ff0000;">&quot;Mexico&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">codigoPostal</span>=<span style="color: #ff0000;">&quot;06000&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ExpedidoEn</span> <span style="color: #000066;">calle</span>=<span style="color: #ff0000;">&quot;Av. Sal Si Puedes 13&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">localidad</span>=<span style="color: #ff0000;">&quot;Distrito Federal&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">municipio</span>=<span style="color: #ff0000;">&quot;Cuauhtemoc&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">estado</span>=<span style="color: #ff0000;">&quot;Distrito Federal&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">pais</span>=<span style="color: #ff0000;">&quot;Mexico&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">codigoPostal</span>=<span style="color: #ff0000;">&quot;06000&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Emisor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Receptor</span> <span style="color: #000066;">rfc</span>=<span style="color: #ff0000;">&quot;ROAF641217Q94&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">nombre</span>=<span style="color: #ff0000;">&quot;Fernando -El Pop-&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Domicilio</span> <span style="color: #000066;">calle</span>=<span style="color: #ff0000;">&quot;Av. Division del Norte&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">noExterior</span>=<span style="color: #ff0000;">&quot;69&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">noInterior</span>=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">colonia</span>=<span style="color: #ff0000;">&quot;Letran-Valle&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">localidad</span>=<span style="color: #ff0000;">&quot;Distrito Federal&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">municipio</span>=<span style="color: #ff0000;">&quot;Benito Juarez&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">estado</span>=<span style="color: #ff0000;">&quot;Distrito Federal&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">pais</span>=<span style="color: #ff0000;">&quot;Mexico&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">codigoPostal</span>=<span style="color: #ff0000;">&quot;03650&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Receptor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Conceptos<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Concepto</span> <span style="color: #000066;">cantidad</span>=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">descripcion</span>=<span style="color: #ff0000;">&quot;Servicios Profesionales&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">valorUnitario</span>=<span style="color: #ff0000;">&quot;21500.00&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">importe</span>=<span style="color: #ff0000;">&quot;3440.00&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Conceptos<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Impuestos</span> <span style="color: #000066;">totalImpuestosTrasladados</span>=<span style="color: #ff0000;">&quot;3440.00&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Traslados<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Traslado</span> <span style="color: #000066;">impuesto</span>=<span style="color: #ff0000;">&quot;IVA&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">tasa</span>=<span style="color: #ff0000;">&quot;16.00&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">importe</span>=<span style="color: #ff0000;">&quot;3440.00&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Traslados<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Impuestos<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Comprobante<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Este documento en xml (&#8220;factura.xml&#8221;) puede ser facilmente generado a partir de una base de datos, queda al lector la generación de este documento base.</p>
<p>Ahora en el campo que dice <strong>certificado=&#8221;"</strong> pusimos lo que guardamos en el archivo &#8220;aaa010101aaa_csd_08.cer.txt&#8221;, ya que este es el que vamos a informar a nuestro cliente.
</p>
<p><strong>Creando el &#8220;sello&#8221;</strong></p>
<p>Ahora creamos el sello digital en un solo paso:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s:sello=\&quot;\&quot;:sello=\&quot;'</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>xsltproc cadenaoriginal_2_0.xslt factura.xml <span style="color: #000000; font-weight: bold;">|</span> openssl dgst <span style="color: #660033;">-md5</span> <span style="color: #660033;">-sign</span> aaa010101aaa_csd_08.key.pem <span style="color: #000000; font-weight: bold;">|</span> openssl enc <span style="color: #660033;">-base64</span> -A<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">'&quot;:'</span> factura.xml</pre></div></div>

<p><FONT color="red">[UPDATE]</FONT>: A partir del 1o de enero del 2011, aun utilizando &#8220;medios propios&#8221;, tendremos que usar SHA1 en lugar de MD5:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s:sello=\&quot;\&quot;:sello=\&quot;'</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>xsltproc cadenaoriginal_2_0.xslt factura.xml <span style="color: #000000; font-weight: bold;">|</span> openssl dgst <span style="color: #660033;">-sha1</span> <span style="color: #660033;">-sign</span> aaa010101aaa_csd_08.key.pem <span style="color: #000000; font-weight: bold;">|</span> openssl enc <span style="color: #660033;">-base64</span> -A<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">'&quot;:'</span> factura.xml</pre></div></div>

<p>Solo recuerden que para verificar una factura electrónica anterior al 1o de enero deberemos usar MD5.</p>
<p>Manda algunos warnings y espera la entrada del password que definimos cuando aplicamos criptografía al archivo &#8220;aaa010101aaa_csd_08.key.pem&#8221;.</p>
<p>
Si revisan el documento &#8220;factura.xml&#8221; veran que el campo de sello tiene este valor (ejemplo calculado con MD5):
</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sello=&quot;YPVa00DkxogixDyLeU515SfkIo4c8ZlErSmQtutMgS2HV7xyuyckDQGUmatucV7T2J1AE5wm44LhKIbnAt6hpJR16H8bdZhGaDaIZyFnvnH1GDTJ94EXaF5kYC9KgUpcJcmmfmaQUYHjQS63EXEQusZqRfNehvaHbvhyIxbqSJQ=&quot;</pre></div></div>

<p><strong>Entendiendo este comando &#8220;todo en uno&#8221;</strong></p>
<p><P>Si quieren obtener la cadena original le dan:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">xsltproc cadenaoriginal_2_0.xslt factura.xml</pre></div></div>

<p>y obtienen:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">||2.0|A|1|2010-12-18T15:27:13|1|2006|ingreso|Contado en una sola exibicion|21500.00|0|24940.00|CAJU010166K67|Juan Cama Nei|Av. Sal Si Puedes|13|666|Morelos|Distrito Federal|Cuauhtemoc|Distrito Federal|Mexico|06000|Av. Sal Si Puedes 13|Distrito Federal|Cuauhtemoc|Distrito Federal|Mexico|06000|ROAF641217Q94|Fernando -El Pop-|Av. Division del Norte|69|1|Letran-Valle|Distrito Federal|Benito Juarez|Distrito Federal|Mexico|03650|1|Servicios Profesionales|21500.00|3440.00|IVA|16.00|3440.00|3440.00||</pre></div></div>

<p>El MD5 de la cadena original es:</p>
<blockquote><p>
ece01145d293b01640ea296115f2af75
</p></blockquote>
<p>Lo que se firma es el MD5 de la cadena original y el resultado es el &#8220;sello&#8221;.</p>
<p><strong>Validación de la factura</strong></p>
<p>Ahora vamos a probar el archivo resultante (&#8220;factura.xml&#8221;) en el <A HREF="https://www.consulta.sat.gob.mx/SICOFI_WEB/ModuloECFD_Plus/ValidadorComprobantes/Validador.html">Validador de forma y sintaxis de Comprobantes Fiscales Digitales</A> del SAT (otra aplicación en Java), y verán esta salida:</p>
<blockquote><p>
<a href="http://cofradia.org/wp-content/uploads/2010/12/sat_validador_result.png"><img src="http://cofradia.org/wp-content/uploads/2010/12/sat_validador_result.png" alt="" title="sat_validador_result" width="495" height="349" class="alignnone size-full wp-image-4360" /></a>
</p></blockquote>
<p>Aquí nosotros embebimos el Certificado, pero este por ley es &#8220;opcional&#8221;, en caso de que este campo de certificado no tenga nada, el validador preguntará por el archivo de certificado para poder validar, en este caso el archivo &#8220;aaa010101aaa_csd_08.cer&#8221;.</p>
<p>Con esto ya generaron una factura válida, pero en el siguiente artículo pondré una de las partes mas importantes en el ciclo de la factura electrónica: La validación, ya que por ley, el que recibe una factura electrónica, es responsable de validarla.</p>
<p>[UPDATE]: Por cambios en el SAT ahora es necesario marcar los archivos con algo conocido como <A HREF="http://en.wikipedia.org/wiki/Byte_order_mark">BOM</A> (Byte order mark). Para ver como corregir esto lea <A HREF="http://cofradia.org/2011/07/11/castrosidades-del-sat-para-la-factura-electronica-ahora-necesitas-bom/">Castrosidades del SAT para la factura electrónica: Ahora necesitas BOM</A>.</p>
<p><strong>Problemas en la veracidad de los comprobantes</strong></p>
<p>Los verificadores del SAT solo comprueban la validez del certificado a partir de la llave, de hecho, generé certificados que pasaron el validador de hacienda a partir de mi FIEL. Esto quiere decir que personas que no se han dado de alta en el trámite de generación de sellos por medios propios, pueden mandar facturas válidas para la SHCP, aunque no lo sean. de allí que hay que hacer mecanismos de verificación en la recepción del documento.</p>
<p>De hecho, usando los certificados de un web server (como Apache) con OpenSSL, podrías generar certificados válidos para los validadores del SAT.</p>
<p>La continuación de este artículo esta <A HREF="http://cofradia.org/2010/12/29/how-to-de-facturacion-electronica-verificacion-de-facturas/">aquí</A> (verificación de facturas).</p>
<p><strong>Referencias</strong><br />
<OL><br />
<LI><A HREF="ftp://ftp2.sat.gob.mx/asistencia_servicio_ftp/publicaciones/cfd/Anexo20RMF2010.pdf">Anexo 20</A> de la ley publicada el el Diario Oficial de la Federación el 15 de junio de 2010.</LI><br />
<LI><A HREF="http://info4.juridicas.unam.mx/ijure/fed/7/59.htm?s=">artículo 29 del Código Fiscal de la Federación</A></LI><br />
<LI><A HREF="http://www.lacorona.com.mx/fortiz/sat/xsl.php">Uso de XSL para transformar la factura electronica XML</A></LI><br />
<LI><A HREF="http://www.universolibre.org/node/13">Implantación de la Factura Electrónica Libre 2</A></LI><br />
<LI><A HREF="http://www.w3schools.com/xsl/default.asp">Referencia de XLS para transformaciones de XML</A></LI><br />
<LI><A HREF="http://facturadigital.files.wordpress.com/2010/11/pyrfactelechoja9.pdf">FAQ sobre Factura Electrónica</A>(en PDF) cortesía de <A HREF="http://facturadigital.wordpress.com/">Factura electrónica (CFD / CFDI)</A></LI><br />
</OL></p>
<p><strong>Agradecimientos</strong></p>
<p>Agradezco la ayuda de Salvador Ortíz de <A HREF="http://www.msg.com.mx/">Matías Software Group</A>, <A HREF="http://www.lacorona.com.mx/fortiz/">Fernando Ortíz</A> y de Mauricio Baeza de <A HREF="http://universolibre.org/">Universo Libre</A> por la ayuda y orientación prestada con sus opiniones y artículos.</p>
<p>Autor: Fernando &#8220;El Pop&#8221; Romo (pop at cofradia.org), twitter @El_Pop</p>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/12/18/how-to-de-facturacion-electronica-para-unixeros-generacion-de-sellos/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Guía introductoria a GnuPG</title>
		<link>http://cofradia.org/2010/10/21/guia-introductoria-a-gnupg/</link>
		<comments>http://cofradia.org/2010/10/21/guia-introductoria-a-gnupg/#comments</comments>
		<pubDate>Thu, 21 Oct 2010 19:35:47 +0000</pubDate>
		<dc:creator>El Pop</dc:creator>
				<category><![CDATA[Seguridad]]></category>
		<category><![CDATA[Tips técnicos]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=4046</guid>
		<description><![CDATA[Leo en DevelopersWorks de IBM un artículo que es una guía básica del uso de GnuPG: Using Open PGP.]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://cofradia.org/2010/10/21/guia-introductoria-a-gnupg/"></g:plusone></div><p>Leo en DevelopersWorks de IBM un artículo que es una guía básica del uso de GnuPG: <A HREF="http://www.ibm.com/developerworks/aix/library/au-gnupg/index.html">Using Open PGP</A>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/10/21/guia-introductoria-a-gnupg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

