...
 
Commits (26)
<a name="2.6.6"></a>
## 2.6.6 (2018-09-27)
#### Bug Fixes
* **account.voucher:**
* obtiene el tipo de cambio a utilizar en el voucher ([76f84092](76f84092))
* mejora el calculo del importe pagado en transacciones multimoneda ([200051df](200051df))
<a name="2.6.5"></a>
## 2.6.5 (2018-09-26)
#### Bug Fixes
* **account.voucher:** corrige el RFC cuando el cliente es extranjero ([e15c127c](e15c127c))
<a name="2.6.4"></a>
## 2.6.4 (2018-09-25)
#### Bug Fixes
* **account.voucher:** corrije la llamada a la función que genera el código QR ([aecc9f22](aecc9f22))
<a name="2.6.3"></a>
## 2.6.3 (2018-09-24)
#### Features
* **account.invoice:** Nota de credito ([cd99f344](cd99f344))
* **report:** se agrega parser para imprimir account.voucher ([a9b4b2ee](a9b4b2ee))
#### Performance
* **template:** se modifica la funcion que imprime codigo qr ([16fb09aa](16fb09aa))
#### Bug Fixes
* **account.voucher:**
* agrega la referencia la parser del objeto account.voucher ([8b3c92c9](8b3c92c9))
* se modifica la definicion del reporte pdf del account voucher ([86a6e1e1](86a6e1e1))
* **es_MX:** corrige la traducción del campo `Método de pago` ([e361f836](e361f836))
<a name="2.6.2"></a>
## 2.6.2 (2018-09-07)
......
......@@ -2,7 +2,7 @@
{
'name': 'Factura Electronica CFDI',
'version': '2.6.2',
'version': '2.6.6',
'author': 'OpenPyme',
'category': 'Localization/Mexico',
'website': 'http://www.openpyme.mx/',
......
......@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0rc3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-22 06:23+0000\n"
"PO-Revision-Date: 2018-08-22 01:28-0500\n"
"POT-Creation-Date: 2018-09-14 17:12+0000\n"
"PO-Revision-Date: 2018-09-14 12:14-0500\n"
"Last-Translator: Agustín Cruz <agustin.cruz@openpyme.mx>\n"
"Language-Team: \n"
"Language: es_MX\n"
......@@ -139,6 +139,11 @@ msgstr "Adendas"
msgid "Adendas"
msgstr "Adendas"
#. module: l10n_mx_facturae
#: field:account.invoice,cfdi_folio_fiscal:0
msgid "CFD-I Folio Fiscal"
msgstr "Folio Fiscal"
#. module: l10n_mx_facturae
#: field:account.invoice,cfdi_id:0 field:account.voucher,cfdi_id:0
msgid "CFDI"
......@@ -179,12 +184,6 @@ msgstr ""
"El uso del CFDI que se usará por defecto para las facturas y notas de "
"crédito emitidas a este cliente"
#. module: l10n_mx_facturae
#: field:account.invoice,cfdi_adenda_code:0
#: field:res.partner,cfdi_adenda_code:0
msgid "Code"
msgstr "Código"
#. module: l10n_mx_facturae
#: view:res.partner:l10n_mx_facturae.res_partner_view_form
msgid "Configuraciones"
......@@ -231,9 +230,9 @@ msgid "Fiscal Number"
msgstr "Número fiscal"
#. module: l10n_mx_facturae
#: help:account.invoice,cfdi_adenda_code:0 help:res.partner,cfdi_adenda_code:0
msgid "Helper field to improve view management"
msgstr "Campo de ayuda para mejorar la gestión de vistas"
#: help:account.invoice,cfdi_folio_fiscal:0
msgid "Folio used in the electronic invoice"
msgstr "Folio usado en la factura electrónica"
#. module: l10n_mx_facturae
#: help:account.invoice,date_invoice_cancel:0
......@@ -241,7 +240,7 @@ msgid "If the invoice is cancelled, save the date when was cancel"
msgstr "Si la facura es cancelada, se guarda la fecha en que se cancela"
#. module: l10n_mx_facturae
#: code:addons/l10n_mx_facturae/models/account_invoice.py:454
#: code:addons/l10n_mx_facturae/models/account_invoice.py:455
#, python-format
msgid ""
"Incorrect tax sequence configuration, check this data in Account >> Tax >> "
......@@ -255,11 +254,6 @@ msgstr ""
msgid "Invoice"
msgstr "Factura"
#. module: l10n_mx_facturae
#: model:ir.actions.report.xml,name:l10n_mx_facturae.l10n_mx_facturae_report_aeroo
msgid "Invoice CFDI"
msgstr "CFDI"
#. module: l10n_mx_facturae
#: model:ir.model,name:l10n_mx_facturae.model_account_invoice_line
msgid "Invoice Line"
......@@ -270,6 +264,11 @@ msgstr "Línea de factura"
msgid "Invoice Refund"
msgstr "Nota de crédito"
#. module: l10n_mx_facturae
#: model:ir.actions.report.xml,name:l10n_mx_facturae.l10n_mx_facturae_report_aeroo
msgid "Invoice Report aero"
msgstr "Reporte de Factura"
#. module: l10n_mx_facturae
#: model:ir.actions.report.xml,name:l10n_mx_facturae.l10n_mx_facturae_report_aeroo_xml
msgid "Invoice XML Report aero"
......@@ -291,11 +290,6 @@ msgstr "Falta el código SAT para el producto: {product}"
msgid "Not Signed Vouchers"
msgstr "Comprobantes sin firmar"
#. module: l10n_mx_facturae
#: help:res.partner,supplier_number:0
msgid "Number or reference that the Client assigned to our company."
msgstr "Número o referencia que el Cliente le asignó a su compañía."
#. module: l10n_mx_facturae
#: view:res.partner:l10n_mx_facturae.res_partner_view_form
msgid ""
......@@ -319,14 +313,14 @@ msgstr "Empresa"
#: field:account.invoice,payment_method_id:0
#: field:res.partner,payment_method_id:0
msgid "Payment Method"
msgstr "Forma de pago"
msgstr "Método de pago"
#. module: l10n_mx_facturae
#: help:res.partner,payment_method_id:0
msgid ""
"Payment method associated with this partner accordingto CFDI 3.3 catalog."
msgstr ""
"Forma de pago asociado con esta empresa de acuerdo al catálogo del CFDI 3.3."
"Método de pago asociado con esta empresa de acuerdo al catálogo del CFDI 3.3."
#. module: l10n_mx_facturae
#: help:account.invoice,payment_method_id:0
......@@ -341,7 +335,7 @@ msgid "Posted"
msgstr "Posteda"
#. module: l10n_mx_facturae
#: code:addons/l10n_mx_facturae/models/account_invoice.py:437
#: code:addons/l10n_mx_facturae/models/account_invoice.py:438
#, python-format
msgid "Product {p} must have at least one tax selected."
msgstr "El producto {p} debe tener al menos un impuesto."
......@@ -387,11 +381,6 @@ msgstr "Estado"
msgid "State of attachments"
msgstr "Estado de los adjuntos"
#. module: l10n_mx_facturae
#: field:res.partner,supplier_number:0
msgid "Supplier number"
msgstr "Número de proveedor"
#. module: l10n_mx_facturae
#: help:res.partner,cfdi_adenda:0
msgid "This field allows adding a node or addendum to the invoice"
......
......@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0rc14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-22 06:23+0000\n"
"PO-Revision-Date: 2018-08-22 06:23+0000\n"
"POT-Creation-Date: 2018-09-14 17:12+0000\n"
"PO-Revision-Date: 2018-09-14 17:12+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
......@@ -118,6 +118,11 @@ msgstr ""
msgid "Adendas"
msgstr ""
#. module: l10n_mx_facturae
#: field:account.invoice,cfdi_folio_fiscal:0
msgid "CFD-I Folio Fiscal"
msgstr ""
#. module: l10n_mx_facturae
#: field:account.invoice,cfdi_id:0
#: field:account.voucher,cfdi_id:0
......@@ -156,12 +161,6 @@ msgstr ""
msgid "Cfdi usage that will be used by default on this customer invoices and credit notes"
msgstr ""
#. module: l10n_mx_facturae
#: field:account.invoice,cfdi_adenda_code:0
#: field:res.partner,cfdi_adenda_code:0
msgid "Code"
msgstr ""
#. module: l10n_mx_facturae
#: view:res.partner:l10n_mx_facturae.res_partner_view_form
msgid "Configuraciones"
......@@ -207,9 +206,8 @@ msgid "Fiscal Number"
msgstr ""
#. module: l10n_mx_facturae
#: help:account.invoice,cfdi_adenda_code:0
#: help:res.partner,cfdi_adenda_code:0
msgid "Helper field to improve view management"
#: help:account.invoice,cfdi_folio_fiscal:0
msgid "Folio used in the electronic invoice"
msgstr ""
#. module: l10n_mx_facturae
......@@ -218,7 +216,7 @@ msgid "If the invoice is cancelled, save the date when was cancel"
msgstr ""
#. module: l10n_mx_facturae
#: code:addons/l10n_mx_facturae/models/account_invoice.py:454
#: code:addons/l10n_mx_facturae/models/account_invoice.py:455
#, python-format
msgid "Incorrect tax sequence configuration, check this data in Account >> Tax >> Sequence"
msgstr ""
......@@ -228,11 +226,6 @@ msgstr ""
msgid "Invoice"
msgstr ""
#. module: l10n_mx_facturae
#: model:ir.actions.report.xml,name:l10n_mx_facturae.l10n_mx_facturae_report_aeroo
msgid "Invoice CFDI"
msgstr ""
#. module: l10n_mx_facturae
#: model:ir.model,name:l10n_mx_facturae.model_account_invoice_line
msgid "Invoice Line"
......@@ -243,6 +236,11 @@ msgstr ""
msgid "Invoice Refund"
msgstr ""
#. module: l10n_mx_facturae
#: model:ir.actions.report.xml,name:l10n_mx_facturae.l10n_mx_facturae_report_aeroo
msgid "Invoice Report aero"
msgstr ""
#. module: l10n_mx_facturae
#: model:ir.actions.report.xml,name:l10n_mx_facturae.l10n_mx_facturae_report_aeroo_xml
msgid "Invoice XML Report aero"
......@@ -264,11 +262,6 @@ msgstr ""
msgid "Not Signed Vouchers"
msgstr ""
#. module: l10n_mx_facturae
#: help:res.partner,supplier_number:0
msgid "Number or reference that the Client assigned to our company."
msgstr ""
#. module: l10n_mx_facturae
#: view:res.partner:l10n_mx_facturae.res_partner_view_form
msgid "Once you have selected the addendum, you must add the necessary information\n"
......@@ -303,7 +296,7 @@ msgid "Posted"
msgstr ""
#. module: l10n_mx_facturae
#: code:addons/l10n_mx_facturae/models/account_invoice.py:437
#: code:addons/l10n_mx_facturae/models/account_invoice.py:438
#, python-format
msgid "Product {p} must have at least one tax selected."
msgstr ""
......@@ -349,11 +342,6 @@ msgstr ""
msgid "State of attachments"
msgstr ""
#. module: l10n_mx_facturae
#: field:res.partner,supplier_number:0
msgid "Supplier number"
msgstr ""
#. module: l10n_mx_facturae
#: help:res.partner,cfdi_adenda:0
msgid "This field allows adding a node or addendum to the invoice"
......
......@@ -268,6 +268,11 @@ class AccountInvoice(models.Model):
usocfdi = self.env.ref('l10n_mx.cfdi_use_G02')
values['cfdi_use'] = usocfdi.id
values['cfdi_relation_type'] = self._context.get('cfdi_relation_type')
payment_type = self.env.ref('l10n_mx.pay_method_condonacion')
values['payment_type_ids'] = [(4, payment_type.id, None)]
payment_method = self.env.ref('l10n_mx.cfdi_payment_method_1')
values['payment_method_id'] = payment_method.id
return values
@signals.invoice_validate.connect
......
......@@ -103,10 +103,12 @@ class AccountVoucher(models.Model):
payments = invoice.mapped('payment_ids') & self.move_ids
for payment in payments:
# If amount_currency exists it means we are dealing with a multi
# If currency_id exists it means we are dealing with a multi
# currency payment, and thus we need to sum amount_currency to
# amount_paid instead of normal debit - credit
if payment.amount_currency:
# TODO: Relay on currency_id could result in wrong results when
# transactions done in three different currencies or more
if payment.currency_id:
amount_paid += payment.amount_currency * -1
else:
amount_paid += (payment.debit - payment.credit) * -1
......
No preview for this file type
# -*- coding: utf-8 -*-
from openerp.report import report_sxw
class Parser(report_sxw.rml_parse):
"""Parser para generar etiquetas con codigo qr"""
def __init__(self, cr, uid, name, context):
super(self.__class__, self).__init__(cr, uid, name, context)
self.localcontext.update({'datosqr': self._datosqr})
def _datosqr(self, o):
"""Genera el string con info para la elaboración del codigo qr"""
def xstr(s):
if s:
return str(s)
return str('N/A')
msg = 'https://verificacfdi.facturaelectronica.sat.gob.mx/default.aspx'
if o.cfdi_id.sello:
msg = msg + '?id=' + xstr(o.cfdi_id.uuid)
msg = msg + '&re=' + xstr(o.company_id.partner_id.vat_split)
msg = msg + '&rr=' + xstr(o.partner_id.vat_split)
msg = msg + '&tt=' + xstr(str(o.amount))
msg = msg + '&fe=' + xstr(o.cfdi_id.sello[-8: len(o.cfdi_id.sello)])
return msg
......@@ -20,17 +20,15 @@
eval="[(6, 0, [report_templates_aeroo_account_voucher_cfdi_33])]" />
<field name="parser_state">default</field>
</record>
</data>
<data noupdate="1">
<!-- PDF invoice report definition -->
<record id="report_templates_aeroo_account_voucher_cfdi_33" model="report.templates.aeroo">
<record id="report_templates_aeroo_account_voucher_pdf_cfdi_33" model="report.templates.aeroo">
<field name="name">Default Voucher PDF</field>
<field name="model">account.voucher</field>
<field name="report_name">account.voucher.cfdi.33.pdf</field>
<field name="report_rml">l10n_mx_facturae/report/account_voucher.odt</field>
</record>
<record id="ir_actions_report_xml_account_voucher_cfdi_33" model="ir.actions.report.xml">
<record id="ir_actions_report_pdf_account_voucher_cfdi_33" model="ir.actions.report.xml">
<field name="name">Account Voucher CFDI PDF</field>
<field name="type">ir.actions.report.xml</field>
<field name="model">account.voucher</field>
......@@ -39,7 +37,8 @@
<field name="in_format">oo-odt</field>
<field name="out_format" ref="report_aeroo.report_mimetypes_pdf_odt" />
<field name="aeroo_templates_ids" eval="[(6, 0, [report_templates_aeroo_account_voucher_cfdi_33])]" />
<field name="tml_source">file</field>
</record>
<field name="parser_loc">l10n_mx_facturae/report/account_voucher.py</field>
<field name="parser_state">loc</field>
</record>
</data>
</openerp>
......@@ -27,16 +27,22 @@
Nombre="${ html_escape(o.company_id.name) }"
RegimenFiscal="$o.company_id.account_position_id.code"/>
<cfdi:Receptor
{% choose o.partner_id.vat_split %}
{% when False %}${ validationerror(_('Missing VAT number for receiver')) }{% end %}
{% otherwise %}Rfc="${ html_escape(o.partner_id.vat_split) }"{% end %}
{% end %}
{% if o.partner_id.vat_split not in ('XAXX010101000', 'XEXX010101000') %}
Nombre="${ html_escape(o.partner_id.name) }"
{% end %}
{% if o.partner_id.country_id and o.partner_id.country_id.code != 'MX' %}
ResidenciaFiscal="$o.partner_id.country_id.code3"
NumRegIdTrib="${ html_escape(o.partner_id.vat) }"
{% choose o.partner_id.country_id and o.partner_id.country_id.code_alpha3 %}
{% when 'MEX' %}
{% choose o.partner_id.vat_split %}
{% when '' %}${ validationerror(_('Missing VAT number for receiver')) }{% end %}
{% otherwise %}Rfc="${ html_escape(o.partner_id.vat_split) }"{% end %}
{% end %}
{% end %}
{% otherwise %}
Rfc="XEXX010101000"
ResidenciaFiscal="$o.partner_id.country_id.code_alpha3"
{% choose o.partner_id.vat_split %}
{% when '' %}${ validationerror(_('Missing Tax Identification Number for receiver')) }{% end %}
{% otherwise %}NumRegIdTrib="${ html_escape(o.partner_id.vat_split) }"{% end %}
{% end %}
{% end %}
{% end %}
UsoCFDI="P01" />
<cfdi:Conceptos>
......@@ -51,7 +57,7 @@
<cfdi:Complemento>
<pago10:Pagos Version="1.0">
<pago10:Pago
FechaPago="${ format_date(o.date, '%Y-%m-%dT%H:%M:%S') }"
FechaPago="${ format_date(o.date, '%Y-%m-%dT12:%M:%S') }"
{% choose o.payment_type_id.code %}
{% when False %}${ validationerror(_('Missing payment method for voucher')) }{% end %}
{% when '99' %}${ validationerror(_('Payment method must be different than 99.')) }{% end %}
......@@ -114,9 +120,7 @@
{% end %}
{% end %}
{% end %}
{% if invoice.currency_id != o.currency_id or len(o.doctos_relacionados) > 1 %}
ImpPagado="${ '{0:.2f}'.format(o.imppagado(invoice)) }"
{% end %} />
ImpPagado="${ '{0:.2f}'.format(o.imppagado(invoice)) }" />
{% end %}
</pago10:Pago>
</pago10:Pagos>
......
......@@ -19,6 +19,32 @@ Característica: Generación de archivos XML para la emisión de recibos de pago
| País | México |
Y que el usuario Facturas y Pagos está logeado
Escenario: Recibo de pago con monto mayor al de la factura
Dado una Factura en MXN por los siguientes conceptos
| Concepto | Precio Unitario | Cantidad | Impuesto |
| ProductoA | 100.0 | 1.0 | IVA 16% |
Y la Factura está en estado Abierto
Y un pago por 116.01 MXN
Y selecciono conciliar saldo del pago
Cuando genero el Recibo electrónico de pagos
Entonces deben existir 1 nodos DoctoRelacionado
Y el ImpSaldoAnt para el nodo 1 debe ser 116.00
Y el ImportePagado debe ser 116.00
Y el ImpoSaldoInsoluto debe ser 0.00
Escenario: Recibo de pago con monto menor al de la factura
Dado una Factura en MXN por los siguientes conceptos
| Concepto | Precio Unitario | Cantidad | Impuesto |
| ProductoA | 100.0 | 1.0 | IVA 16% |
Y la Factura está en estado Abierto
Y un pago por 115.99 MXN
Y selecciono conciliar saldo del pago
Cuando genero el Recibo electrónico de pagos
Entonces deben existir 1 nodos DoctoRelacionado
Y el ImpSaldoAnt para el nodo 1 debe ser 116.00
Y el ImportePagado debe ser 116.00
Y el ImpoSaldoInsoluto debe ser 0.01
@Multimoneda
Escenario: Emisión de recibo de pagos en moneda extranjera
Dado una Factura en USD por los siguientes conceptos
......