fix(l10n.mx.facturae): se modifico el objeto impuesto

Se modifico el objetoImp ya que una factura generada con el 100 por ciento de descuento tiene que
ser sin objeto de impuesto, se agrego la condición para estos casos.
parent 2db33b3d
Pipeline #19756 passed with stage
in 1 minute and 2 seconds
......@@ -130,55 +130,59 @@
ValorUnitario="${ line.valorunitario }"
Importe="${ '{0:.2f}'.format(line.importe) }"
Descuento="${ '{0:.2f}'.format(line.descuento) }"
ObjetoImp="02" >
{% with taxes=line.impuestos %}
{% if sum_field(taxes['traslados'], 'base') or sum_field(taxes['retenciones'], 'base') %}
<cfdi:Impuestos>
{% if taxes.traslados %}
<cfdi:Traslados>
{% for tax in taxes.traslados %}
<cfdi:Traslado
Base="${ '{0:.2f}'.format(tax.base) }"
{% choose tax.group %}
{% when 'ISR' %}Impuesto="001"{% end %}
{% when 'IVA' %}Impuesto="002"{% end %}
{% when 'IEPS' %}Impuesto="003"{% end %}
{% otherwise %}${ validationerror(_('Missing SAT code for tax: {t}').format(t=tax.name)) }{% end %}
{% end %}
{% choose tax.type %}
{% when 'percent' %}TipoFactor="Tasa"{% end %}
{% when 'fixed' %}TipoFactor="Cuota"{% end %}
{% when 'none' %}TipoFactor="Exento"{% end %}
{% end %}
{% if tax.type != 'none' %}
TasaOCuota="${ '{0:.6f}'.format(tax.TasaOCuota) }"
Importe="${ '{0:.2f}'.format(tax.amount) }"
{% end %}/>
{% end %}
</cfdi:Traslados>
{% end %}
{% if taxes.retenciones %}
<cfdi:Retenciones>
{% for tax in taxes.retenciones %}
<cfdi:Retencion
Base="${ '{0:.2f}'.format(tax.base) }"
{% choose tax.group %}
{% when 'ISR' %}Impuesto="001"{% end %}
{% when 'IVA' %}Impuesto="002"{% end %}
{% when 'IEPS' %}Impuesto="003"{% end %}
{% otherwise %}${ validationerror(_('Missing SAT code for tax: {t}').format(t=tax.name)) }{% end %}
{% end %}
{% choose tax.type %}
{% when 'percent' %}TipoFactor="Tasa"{% end %}
{% when 'fixed' %}TipoFactor="Cuota"{% end %}
{% end %}
TasaOCuota="${ '{0:.6f}'.format(tax.TasaOCuota) }"
Importe="${ '{0:.2f}'.format(abs(tax.amount)) }" />
{% end %}
</cfdi:Retenciones>
{% end %}
</cfdi:Impuestos>
{% end %}
{% with
taxes = line.impuestos
objetoimp = sum_field(taxes['traslados'], 'base') or sum_field(taxes['retenciones'], 'base')
%}
ObjetoImp="${ '02' if objetoimp else '01' }"
>
{% if objetoimp %}
<cfdi:Impuestos>
{% if taxes.traslados %}
<cfdi:Traslados>
{% for tax in taxes.traslados %}
<cfdi:Traslado
Base="${ '{0:.2f}'.format(tax.base) }"
{% choose tax.group %}
{% when 'ISR' %}Impuesto="001"{% end %}
{% when 'IVA' %}Impuesto="002"{% end %}
{% when 'IEPS' %}Impuesto="003"{% end %}
{% otherwise %}${ validationerror(_('Missing SAT code for tax: {t}').format(t=tax.name)) }{% end %}
{% end %}
{% choose tax.type %}
{% when 'percent' %}TipoFactor="Tasa"{% end %}
{% when 'fixed' %}TipoFactor="Cuota"{% end %}
{% when 'none' %}TipoFactor="Exento"{% end %}
{% end %}
{% if tax.type != 'none' %}
TasaOCuota="${ '{0:.6f}'.format(tax.TasaOCuota) }"
Importe="${ '{0:.2f}'.format(tax.amount) }"
{% end %}/>
{% end %}
</cfdi:Traslados>
{% end %}
{% if taxes.retenciones %}
<cfdi:Retenciones>
{% for tax in taxes.retenciones %}
<cfdi:Retencion
Base="${ '{0:.2f}'.format(tax.base) }"
{% choose tax.group %}
{% when 'ISR' %}Impuesto="001"{% end %}
{% when 'IVA' %}Impuesto="002"{% end %}
{% when 'IEPS' %}Impuesto="003"{% end %}
{% otherwise %}${ validationerror(_('Missing SAT code for tax: {t}').format(t=tax.name)) }{% end %}
{% end %}
{% choose tax.type %}
{% when 'percent' %}TipoFactor="Tasa"{% end %}
{% when 'fixed' %}TipoFactor="Cuota"{% end %}
{% end %}
TasaOCuota="${ '{0:.6f}'.format(tax.TasaOCuota) }"
Importe="${ '{0:.2f}'.format(abs(tax.amount)) }" />
{% end %}
</cfdi:Retenciones>
{% end %}
</cfdi:Impuestos>
{% end %}
{% end %}
{% if line.cfdi_cuentapredial %}
<cfdi:CuentaPredial Numero="${ line.cfdi_cuentapredial }"/>
......@@ -262,4 +266,4 @@
</cfdi:Complemento>
{% end %}
</cfdi:Comprobante>
{% end %}
\ No newline at end of file
{% end %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment