diff options
| author | Katherine Zaoral <kz@adhoc.com.ar> | 2020-07-17 13:46:46 +0000 |
|---|---|---|
| committer | Katherine Zaoral <kz@adhoc.com.ar> | 2020-08-17 14:09:18 +0000 |
| commit | 1931a228350e63714ffbc97b8f3a708085abf476 (patch) | |
| tree | 244006ed1835e8204cfab3b32a3ed5c286c51f72 /addons/l10n_ar | |
| parent | 1c5ca6a16ddf2ba5b311d411a7523fd1f7360a2c (diff) | |
[IMP] l10n_ar: Argentinean invoice report
Port foward from 13.0 branch. Also update the _get_name_invoice_report()
method to match the one in account module.
Also update the name of payment field that has been change in master version
* o.invoice_payment_ref is now o.payment_reference
Diffstat (limited to 'addons/l10n_ar')
| -rw-r--r-- | addons/l10n_ar/demo/mono_demo.xml | 2 | ||||
| -rw-r--r-- | addons/l10n_ar/demo/respinsc_demo.xml | 6 | ||||
| -rw-r--r-- | addons/l10n_ar/i18n/es.po | 159 | ||||
| -rw-r--r-- | addons/l10n_ar/i18n/l10n_ar.pot | 145 | ||||
| -rw-r--r-- | addons/l10n_ar/models/account_move.py | 16 | ||||
| -rw-r--r-- | addons/l10n_ar/models/res_company.py | 2 | ||||
| -rw-r--r-- | addons/l10n_ar/views/report_invoice.xml | 265 |
7 files changed, 472 insertions, 123 deletions
diff --git a/addons/l10n_ar/demo/mono_demo.xml b/addons/l10n_ar/demo/mono_demo.xml index 86635862ec5..32a50e9f1ff 100644 --- a/addons/l10n_ar/demo/mono_demo.xml +++ b/addons/l10n_ar/demo/mono_demo.xml @@ -12,7 +12,7 @@ <field name="state_id" ref="base.state_ar_s"/> <field name="zip">2000</field> <field name="phone">+1 555 123 8069</field> - <field name="email">info@yourcompany.example.com</field> + <field name="email">info@example.com</field> <field name="website">www.example.com</field> </record> diff --git a/addons/l10n_ar/demo/respinsc_demo.xml b/addons/l10n_ar/demo/respinsc_demo.xml index c7b5b9a5fdf..57b75f1dbfe 100644 --- a/addons/l10n_ar/demo/respinsc_demo.xml +++ b/addons/l10n_ar/demo/respinsc_demo.xml @@ -12,7 +12,7 @@ <field name="state_id" ref="base.state_ar_s"/> <field name="zip">2000</field> <field name="phone">+1 555 123 8069</field> - <field name="email">info@yourcompany.example.com</field> + <field name="email">info@example.com</field> <field name="website">www.example.com</field> </record> @@ -21,7 +21,9 @@ <field name='currency_id' ref='base.ARS'/> <field name='partner_id' ref='partner_ri'/> <field name='name'>(AR) Responsable Inscripto</field> - <field name='l10n_ar_gross_income_type'>exempt</field> + <field name="l10n_ar_afip_start_date" eval="time.strftime('%Y-01-01')"/> + <field name='l10n_ar_gross_income_type'>local</field> + <field name='l10n_ar_gross_income_number'>901-21885123</field> </record> <function model="res.users" name="write"> diff --git a/addons/l10n_ar/i18n/es.po b/addons/l10n_ar/i18n/es.po index 57928f97f1e..fb1f5cf77b0 100644 --- a/addons/l10n_ar/i18n/es.po +++ b/addons/l10n_ar/i18n/es.po @@ -16,6 +16,16 @@ msgstr "" "Plural-Forms: \n" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.custom_header +msgid "- Activities Start:" +msgstr "- Inicio actividades:" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.custom_header +msgid "- CUIT:" +msgstr "" + +#. module: l10n_ar #: model:ir.model.fields.selection,name:l10n_ar.selection__account_tax_group__l10n_ar_tribute_afip_code__01 msgid "01 - National Taxes" msgstr "01 - Impuestos nacionales" @@ -81,6 +91,80 @@ msgid "99 - Others" msgstr "99 - Otros" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>CBU for payment: </strong>" +msgstr "<br/><strong>CBU de pago: </strong>" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>Currency: </strong>" +msgstr "<br/><strong>Moneda: </strong>" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>Exchange rate: </strong>" +msgstr "<br/><strong>Tipo de cambio: </strong>" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>Incoterm:</strong>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>Payment Terms: </strong>" +msgstr "<br/><strong>Plazos de Pago: </strong>" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>Reference:</strong>" +msgstr "<br/><strong>Referencia:</strong>" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>Source:</strong>" +msgstr "<br/><strong>Origen:</strong>" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "" +"<span " +"groups=\"account.group_show_line_subtotals_tax_included\">Amount</span>" +msgstr "" +"<span " +"groups=\"account.group_show_line_subtotals_tax_included\">Importe</span>" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<span>% VAT</span>" +msgstr "<span>% IVA</span>" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<span>NCM</span>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<strong>Customer: </strong>" +msgstr "<strong>Cliente: </strong>" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<strong>Due Date: </strong>" +msgstr "<strong>Fecha Vencimiento: </strong>" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<strong>Invoiced period: </strong>" +msgstr "<strong>Periodo facturado: </strong>" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<strong>VAT Cond: </strong>" +msgstr "<strong>Cond. IVA: </strong>" + +#. module: l10n_ar #: model:ir.model.fields,help:l10n_ar.field_account_move__l10n_ar_afip_concept msgid "" "A concept is suggested regarding the type of the products on the invoice but" @@ -190,13 +274,8 @@ msgstr "Activo" #. module: l10n_ar #: model:ir.model.fields,field_description:l10n_ar.field_res_company__l10n_ar_afip_start_date -msgid "Activities Start Date" -msgstr "Día de inicio de actividades" - -#. module: l10n_ar -#: model_terms:ir.ui.view,arch_db:l10n_ar.argentinian_extra_info -msgid "Activities Start Date:" -msgstr "Día de Inicio de Actividades:" +msgid "Activities Start" +msgstr "Inicio actividades" #. module: l10n_ar #: model_terms:ir.ui.view,arch_db:l10n_ar.view_document_type_filter @@ -476,6 +555,11 @@ msgid "DNI" msgstr "" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.custom_header +msgid "Date:" +msgstr "Fecha:" + +#. module: l10n_ar #: model:ir.model.fields,help:l10n_ar.field_account_move__l10n_ar_afip_responsibility_type_id #: model:ir.model.fields,help:l10n_ar.field_res_company__l10n_ar_afip_responsibility_type_id #: model:ir.model.fields,help:l10n_ar.field_res_partner__l10n_ar_afip_responsibility_type_id @@ -589,25 +673,20 @@ msgstr "Ir a Diarios" #: model_terms:ir.ui.view,arch_db:l10n_ar.view_company_form #: model_terms:ir.ui.view,arch_db:l10n_ar.view_partner_property_form msgid "Gross Income" -msgstr "Ingreso Bruto" +msgstr "Ingresos Brutos" #. module: l10n_ar #: model:ir.model.fields,field_description:l10n_ar.field_res_company__l10n_ar_gross_income_number #: model:ir.model.fields,field_description:l10n_ar.field_res_partner__l10n_ar_gross_income_number #: model:ir.model.fields,field_description:l10n_ar.field_res_users__l10n_ar_gross_income_number msgid "Gross Income Number" -msgstr "Número de Ingreso Bruto" +msgstr "Número de Ingresos Brutos" #. module: l10n_ar #: model:ir.model.fields,field_description:l10n_ar.field_res_partner__l10n_ar_gross_income_type #: model:ir.model.fields,field_description:l10n_ar.field_res_users__l10n_ar_gross_income_type msgid "Gross Income Type" -msgstr "Tipo de Ingreso Bruto" - -#. module: l10n_ar -#: model_terms:ir.ui.view,arch_db:l10n_ar.argentinian_extra_info -msgid "Gross Income:" -msgstr "Ingreso Bruto:" +msgstr "Tipo de Ingresos Brutos" #. module: l10n_ar #: model:product.product,name:l10n_ar.product_product_servicio_de_guarda @@ -638,6 +717,11 @@ msgid "IIBB Perceptions" msgstr "Percepción de IIBB" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.custom_header +msgid "IIBB:" +msgstr "" + +#. module: l10n_ar #: model:ir.model,name:l10n_ar.model_l10n_latam_identification_type msgid "Identification Types" msgstr "Tipos de Identificación" @@ -750,6 +834,11 @@ msgid "Local" msgstr "" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.custom_header +msgid "Logo" +msgstr "" + +#. module: l10n_ar #: code:addons/l10n_ar/models/account_move.py:0 #, python-format msgid "Missing Partner Configuration" @@ -803,6 +892,11 @@ msgid "Not Zero" msgstr "No Cero" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.custom_header +msgid "Nro:" +msgstr "" + +#. module: l10n_ar #: model_terms:ir.ui.view,arch_db:l10n_ar.view_company_form #: model_terms:ir.ui.view,arch_db:l10n_ar.view_partner_property_form msgid "Number..." @@ -858,6 +952,11 @@ msgid "Partner" msgstr "Empresa" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "Page: <span class=\"page\"/> / <span class=\"topage\"/>" +msgstr "Página: <span class=\"page\"/> / <span class=\"topage\"/>" + +#. module: l10n_ar #: code:addons/l10n_ar/models/account_move.py:0 #, python-format msgid "Please configure the AFIP Responsibility for \"%s\" in order to continue" @@ -1068,26 +1167,6 @@ msgid "Unified Book" msgstr "Libro Unificado" #. module: l10n_ar -#: model:product.product,uom_name:l10n_ar.product_product_arancel -#: model:product.product,uom_name:l10n_ar.product_product_cero -#: model:product.product,uom_name:l10n_ar.product_product_exento -#: model:product.product,uom_name:l10n_ar.product_product_no_gravado -#: model:product.product,uom_name:l10n_ar.product_product_quote_despacho -#: model:product.product,uom_name:l10n_ar.product_product_servicio_de_guarda -#: model:product.product,uom_name:l10n_ar.product_product_tasa_estadistica -#: model:product.product,uom_name:l10n_ar.product_product_telefonia -#: model:product.template,uom_name:l10n_ar.product_product_arancel_product_template -#: model:product.template,uom_name:l10n_ar.product_product_cero_product_template -#: model:product.template,uom_name:l10n_ar.product_product_exento_product_template -#: model:product.template,uom_name:l10n_ar.product_product_no_gravado_product_template -#: model:product.template,uom_name:l10n_ar.product_product_quote_despacho_product_template -#: model:product.template,uom_name:l10n_ar.product_product_servicio_de_guarda_product_template -#: model:product.template,uom_name:l10n_ar.product_product_tasa_estadistica_product_template -#: model:product.template,uom_name:l10n_ar.product_product_telefonia_product_template -msgid "Units" -msgstr "Unidades" - -#. module: l10n_ar #: model:ir.model.fields.selection,name:l10n_ar.selection__account_tax_group__l10n_ar_vat_afip_code__1 msgid "Untaxed" msgstr "No Gravado" @@ -1150,11 +1229,6 @@ msgid "VAT AFIP Code" msgstr "Código AFIP de IVA" #. module: l10n_ar -#: model_terms:ir.ui.view,arch_db:l10n_ar.argentinian_extra_info -msgid "VAT Cond.:" -msgstr "Cond. IVA:" - -#. module: l10n_ar #: model:account.tax.group,name:l10n_ar.tax_group_iva_exento msgid "VAT Exempt" msgstr "IVA Exento" @@ -1178,7 +1252,7 @@ msgstr "IVA No Gravado" #: code:addons/l10n_ar/models/account_fiscal_position.py:0 #, python-format msgid "Warning" -msgstr "Advertencia" +msgstr "Alerta" #. module: l10n_ar #: model_terms:ir.ui.view,arch_db:l10n_ar.view_account_invoice_report_search_inherit @@ -1249,6 +1323,7 @@ msgid "is not a valid value for" msgstr "no es un valor valido para" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document #: model_terms:ir.ui.view,arch_db:l10n_ar.view_move_form msgid "to" -msgstr "a" +msgstr "al" diff --git a/addons/l10n_ar/i18n/l10n_ar.pot b/addons/l10n_ar/i18n/l10n_ar.pot index 514f916dcc9..a1a132a2efa 100644 --- a/addons/l10n_ar/i18n/l10n_ar.pot +++ b/addons/l10n_ar/i18n/l10n_ar.pot @@ -16,6 +16,16 @@ msgstr "" "Plural-Forms: \n" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.custom_header +msgid "- Activities Start:" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.custom_header +msgid "- CUIT:" +msgstr "" + +#. module: l10n_ar #: model:ir.model.fields.selection,name:l10n_ar.selection__account_tax_group__l10n_ar_tribute_afip_code__01 msgid "01 - National Taxes" msgstr "" @@ -81,6 +91,78 @@ msgid "99 - Others" msgstr "" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>CBU for payment: </strong>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>Currency: </strong>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>Exchange rate: </strong>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>Incoterm:</strong>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>Payment Terms: </strong>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>Reference:</strong>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<br/><strong>Source:</strong>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "" +"<span " +"groups=\"account.group_show_line_subtotals_tax_included\">Amount</span>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<span>% VAT</span>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<span>NCM</span>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<strong>Customer: </strong>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<strong>Due Date: </strong>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<strong>Invoiced period: </strong>" +msgstr "" + +#. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "<strong>VAT Cond: </strong>" +msgstr "" + +#. module: l10n_ar #: model:ir.model.fields,help:l10n_ar.field_account_move__l10n_ar_afip_concept msgid "" "A concept is suggested regarding the type of the products on the invoice but" @@ -188,12 +270,7 @@ msgstr "" #. module: l10n_ar #: model:ir.model.fields,field_description:l10n_ar.field_res_company__l10n_ar_afip_start_date -msgid "Activities Start Date" -msgstr "" - -#. module: l10n_ar -#: model_terms:ir.ui.view,arch_db:l10n_ar.argentinian_extra_info -msgid "Activities Start Date:" +msgid "Activities Start" msgstr "" #. module: l10n_ar @@ -464,6 +541,11 @@ msgid "DNI" msgstr "" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.custom_header +msgid "Date:" +msgstr "" + +#. module: l10n_ar #: model:ir.model.fields,help:l10n_ar.field_account_move__l10n_ar_afip_responsibility_type_id #: model:ir.model.fields,help:l10n_ar.field_res_company__l10n_ar_afip_responsibility_type_id #: model:ir.model.fields,help:l10n_ar.field_res_partner__l10n_ar_afip_responsibility_type_id @@ -584,11 +666,6 @@ msgid "Gross Income Type" msgstr "" #. module: l10n_ar -#: model_terms:ir.ui.view,arch_db:l10n_ar.argentinian_extra_info -msgid "Gross Income:" -msgstr "" - -#. module: l10n_ar #: model:product.product,name:l10n_ar.product_product_servicio_de_guarda #: model:product.template,name:l10n_ar.product_product_servicio_de_guarda_product_template msgid "Guard Service" @@ -617,6 +694,11 @@ msgid "IIBB Perceptions" msgstr "" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.custom_header +msgid "IIBB:" +msgstr "" + +#. module: l10n_ar #: model:ir.model,name:l10n_ar.model_l10n_latam_identification_type msgid "Identification Types" msgstr "" @@ -722,6 +804,11 @@ msgid "Local" msgstr "" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.custom_header +msgid "Logo" +msgstr "" + +#. module: l10n_ar #: code:addons/l10n_ar/models/account_move.py:0 #, python-format msgid "Missing Partner Configuration" @@ -775,6 +862,11 @@ msgid "Not Zero" msgstr "" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.custom_header +msgid "Nro:" +msgstr "" + +#. module: l10n_ar #: model_terms:ir.ui.view,arch_db:l10n_ar.view_company_form #: model_terms:ir.ui.view,arch_db:l10n_ar.view_partner_property_form msgid "Number..." @@ -828,6 +920,11 @@ msgid "Partner" msgstr "" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document +msgid "Page: <span class=\"page\"/> / <span class=\"topage\"/>" +msgstr "" + +#. module: l10n_ar #: code:addons/l10n_ar/models/account_move.py:0 #, python-format msgid "Please configure the AFIP Responsibility for \"%s\" in order to continue" @@ -1020,26 +1117,6 @@ msgid "Unified Book" msgstr "" #. module: l10n_ar -#: model:product.product,uom_name:l10n_ar.product_product_arancel -#: model:product.product,uom_name:l10n_ar.product_product_cero -#: model:product.product,uom_name:l10n_ar.product_product_exento -#: model:product.product,uom_name:l10n_ar.product_product_no_gravado -#: model:product.product,uom_name:l10n_ar.product_product_quote_despacho -#: model:product.product,uom_name:l10n_ar.product_product_servicio_de_guarda -#: model:product.product,uom_name:l10n_ar.product_product_tasa_estadistica -#: model:product.product,uom_name:l10n_ar.product_product_telefonia -#: model:product.template,uom_name:l10n_ar.product_product_arancel_product_template -#: model:product.template,uom_name:l10n_ar.product_product_cero_product_template -#: model:product.template,uom_name:l10n_ar.product_product_exento_product_template -#: model:product.template,uom_name:l10n_ar.product_product_no_gravado_product_template -#: model:product.template,uom_name:l10n_ar.product_product_quote_despacho_product_template -#: model:product.template,uom_name:l10n_ar.product_product_servicio_de_guarda_product_template -#: model:product.template,uom_name:l10n_ar.product_product_tasa_estadistica_product_template -#: model:product.template,uom_name:l10n_ar.product_product_telefonia_product_template -msgid "Units" -msgstr "" - -#. module: l10n_ar #: model:ir.model.fields.selection,name:l10n_ar.selection__account_tax_group__l10n_ar_vat_afip_code__1 msgid "Untaxed" msgstr "" @@ -1102,11 +1179,6 @@ msgid "VAT AFIP Code" msgstr "" #. module: l10n_ar -#: model_terms:ir.ui.view,arch_db:l10n_ar.argentinian_extra_info -msgid "VAT Cond.:" -msgstr "" - -#. module: l10n_ar #: model:account.tax.group,name:l10n_ar.tax_group_iva_exento msgid "VAT Exempt" msgstr "" @@ -1196,6 +1268,7 @@ msgid "is not a valid value for" msgstr "" #. module: l10n_ar +#: model_terms:ir.ui.view,arch_db:l10n_ar.report_invoice_document #: model_terms:ir.ui.view,arch_db:l10n_ar.view_move_form msgid "to" msgstr "" diff --git a/addons/l10n_ar/models/account_move.py b/addons/l10n_ar/models/account_move.py index c6617ee81a7..b8bd0b01274 100644 --- a/addons/l10n_ar/models/account_move.py +++ b/addons/l10n_ar/models/account_move.py @@ -213,16 +213,6 @@ class AccountMove(models.Model): [('l10n_ar_letter', '=', self.l10n_latam_document_type_id.l10n_ar_letter)]).ids) return where_string, param - def _get_name_invoice_report(self, report_xml_id): - self.ensure_one() - if self.l10n_latam_use_documents and self.company_id.country_id.code == 'AR': - custom_report = { - 'account.report_invoice_document_with_payments': 'l10n_ar.report_invoice_document_with_payments', - 'account.report_invoice_document': 'l10n_ar.report_invoice_document', - } - return custom_report.get(report_xml_id) or report_xml_id - return super()._get_name_invoice_report(report_xml_id) - def _l10n_ar_get_amounts(self, company_currency=False): """ Method used to prepare data to present amounts and taxes related amounts when creating an electronic invoice for argentinian and the txt files for digital VAT books. Only take into account the argentinian taxes """ @@ -279,3 +269,9 @@ class AccountMove(models.Model): res += [{'Id': '3', 'BaseImp': vat_base_0, 'Importe': 0.0}] return res if res else [] + + def _get_name_invoice_report(self): + self.ensure_one() + if self.l10n_latam_use_documents and self.company_id.country_id.code == 'AR': + return 'l10n_ar.report_invoice_document' + return super()._get_name_invoice_report() diff --git a/addons/l10n_ar/models/res_company.py b/addons/l10n_ar/models/res_company.py index cdba6dbd784..72bd820f979 100644 --- a/addons/l10n_ar/models/res_company.py +++ b/addons/l10n_ar/models/res_company.py @@ -15,7 +15,7 @@ class ResCompany(models.Model): l10n_ar_afip_responsibility_type_id = fields.Many2one( domain="[('code', 'in', [1, 4, 6])]", related='partner_id.l10n_ar_afip_responsibility_type_id', readonly=False) l10n_ar_company_requires_vat = fields.Boolean(compute='_compute_l10n_ar_company_requires_vat', string='Company Requires Vat?') - l10n_ar_afip_start_date = fields.Date('Activities Start Date') + l10n_ar_afip_start_date = fields.Date('Activities Start') @api.onchange('country_id') def onchange_country(self): diff --git a/addons/l10n_ar/views/report_invoice.xml b/addons/l10n_ar/views/report_invoice.xml index 67bb314f1ee..8c09db138c4 100644 --- a/addons/l10n_ar/views/report_invoice.xml +++ b/addons/l10n_ar/views/report_invoice.xml @@ -1,43 +1,246 @@ <?xml version="1.0" encoding="utf-8"?> <odoo> - <template id="argentinian_extra_info"> - <li t-if="company.l10n_ar_afip_responsibility_type_id" class="list-inline-item">VAT Cond.: <span t-field="company.l10n_ar_afip_responsibility_type_id"/></li> - <li class="list-inline-item">Gross Income: <span t-esc="company.l10n_ar_gross_income_type == 'exempt' and 'Exento' or company.l10n_ar_gross_income_number"/></li> - <li t-if="company.l10n_ar_afip_start_date" class="list-inline-item">Activities Start Date: <span t-field="company.l10n_ar_afip_start_date"/></li> - </template> + <!-- this header can be used on any Argentinean report, to be useful some variables should be passed --> + <template id="custom_header"> + <div> + <div class="row" t-if="not pre_printed_report"> + <div name="left-upper-side" class="col-5"> + <img t-if="o.company_id.logo" t-att-src="image_data_uri(o.company_id.logo)" style="max-height: 45px;" alt="Logo"/> + </div> + <div name="center-upper" class="col-2 text-center" t-att-style="'color: %s;' % o.company_id.primary_color"> + <span style="display: inline-block; text-align: center; line-height: 8px;"> + <h1 style="line-height: 25px;"> + <strong><span t-esc="document_letter"/></strong> + </h1> + <span style="font-size: x-small;" t-esc="document_legend"/> + </span> + </div> + <div name="right-upper-side" class="col-5 text-right"> - <template id="external_layout_standard" inherit_id="web.external_layout_standard"> - <!-- footer --> - <ul class="list-inline mb4" position="inside"> - <t t-call="l10n_ar.argentinian_extra_info"/> - </ul> - </template> + <!-- (6) Titulo de Documento --> + <h4 t-att-style="'color: %s;' % o.company_id.primary_color"><strong> + <span t-esc="report_name"/> + </strong></h4> - <template id="external_layout_background" inherit_id="web.external_layout_background"> - <!-- footer --> - <ul class="list-inline" position="inside"> - <t t-call="l10n_ar.argentinian_extra_info"/> - </ul> - </template> + </div> + </div> + <div class="row"> + <div class="col-6"> + <t t-if="not pre_printed_report"> + <!-- (1) Nombre de Fantasia --> + <!-- (2) Apellido y Nombre o Razon Social --> + <span t-field="o.company_id.partner_id.name"/> - <template id="external_layout_boxed" inherit_id="web.external_layout_boxed"> - <!-- footer --> - <ul class="list-inline" position="inside"> - <t t-call="l10n_ar.argentinian_extra_info"/> - </ul> - </template> + <!-- (3) Domicilio Comercial (Domicilio Fiscal is the same) --> + <br/> + <div></div> + <!-- we dont use the address widget as it adds a new line on the phone and we want to reduce at maximum lines qty --> + <t t-esc="' - '.join([item for item in [ + ', '.join([item for item in [header_address.street, header_address.street2] if item]), + header_address.city, + header_address.state_id and header_address.state_id.name, + header_address.zip, + header_address.country_id and header_address.country_id.name] if item])"/><span t-if="header_address.phone"> - </span><span t-if="header_address.phone" style="white-space: nowrap;" t-esc="'Tel: ' + header_address.phone"/> + <br/> + <span t-att-style="'color: %s;' % o.company_id.primary_color" t-esc="' - '.join([item for item in [header_address.website.replace('https://', '').replace('http://', ''), header_address.email] if item])"/> + </t> + </div> + <div class="col-6 text-right" style="padding-left: 0px;"> + + <t t-if="not pre_printed_report"> + <!-- (7) Numero punto venta - (8) numero de documento --> + <span t-att-style="'color: %s;' % o.company_id.secondary_color">Nro: </span><span t-esc="report_number"/> + <br/> + </t> + + <!-- (9) Fecha --> + <span t-att-style="'color: %s;' % o.company_id.secondary_color">Date: </span><span t-esc="report_date" t-options='{"widget": "date"}'/> - <template id="external_layout_clean" inherit_id="web.external_layout_clean"> - <!-- header --> - <ul class="list-unstyled" position="inside"> - <t t-call="l10n_ar.argentinian_extra_info"/> - </ul> + <t t-if="not pre_printed_report"> + <!-- (5) Condicion de IVA / Responsabilidad --> + <!-- (10) CUIT --> + <br/> + <span t-field="o.company_id.l10n_ar_afip_responsibility_type_id"/><span t-att-style="'color: %s;' % o.company_id.secondary_color"> - CUIT: </span><span t-field="o.company_id.partner_id.l10n_ar_formatted_vat"/> + + <!-- (11) IIBB: --> + <!-- (12) Inicio de actividades --> + <br/><span t-att-style="'color: %s;' % o.company_id.secondary_color">IIBB: </span><span t-esc="o.company_id.l10n_ar_gross_income_type == 'exempt' and 'Exento' or o.company_id.l10n_ar_gross_income_number"/><span t-att-style="'color: %s;' % o.company_id.secondary_color"> - Activities Start: </span><span t-field="o.company_id.l10n_ar_afip_start_date"/> + </t> + + </div> + </div> + </div> </template> - <template id="report_invoice_document" inherit_id="l10n_latam_invoice_document.report_invoice_document"> - <xpath expr="//t[@id='inv_tax_id_label']" position="attributes"> - <attribute name="t-esc">o.partner_id.l10n_latam_identification_type_id.name or o.company_id.country_id.vat_label</attribute> + <template id="report_invoice_document" inherit_id="account.report_invoice_document" primary="True"> + <!-- custom header and footer --> + <t t-set="o" position="after"> + <t t-set="custom_header" t-value="'l10n_ar.custom_header'"/> + <t t-set="report_date" t-value="o.invoice_date"/> + <t t-set="report_number" t-value="o.l10n_latam_document_number"/> + <t t-set="pre_printed_report" t-value="report_type == 'pdf' and o.journal_id.l10n_ar_afip_pos_system == 'II_IM'"/> + <t t-set="document_letter" t-value="o.l10n_latam_document_type_id.l10n_ar_letter"/> + <t t-set="document_legend" t-value="o.l10n_latam_document_type_id.code and 'Cod. %02d' % int(o.l10n_latam_document_type_id.code) or ''"/> + <t t-set="report_name" t-value="o.l10n_latam_document_type_id.report_name"/> + <t t-set="header_address" t-value="o.journal_id.l10n_ar_afip_pos_partner_id"/> + + <t t-set="custom_footer"> + <div class="row"> + <div name="footer_left_column" class="col-8 text-center"> + </div> + <div name="footer_right_column" class="col-4 text-right"> + <div name="pager" t-if="report_type == 'pdf'"> + Page: <span class="page"/> / <span class="topage"/> + </div> + </div> + </div> + </t> + <t t-set="fiscal_bond" t-value="o.journal_id.l10n_ar_afip_pos_system in ['BFERCEL', 'BFEWS']"/> + </t> + + <!-- remove default partner address --> + <t t-set="address" position="replace"/> + + <!-- remove default document title --> + <h2 position="replace"/> + + <!-- NCM column for fiscal bond --> + <th name="th_description" position="after"> + <th t-if="fiscal_bond" name="th_ncm_code" class="text-left"><span>NCM</span></th> + </th> + <td name="account_invoice_line_name" position="after"> + <td t-if="fiscal_bond" name="ncm_code"><span t-field="line.product_id.l10n_ar_ncm_code"/></td> + </td> + + <!-- use latam prices (to include/exclude VAT) --> + <xpath expr="//span[@t-field='line.price_unit']" position="attributes"> + <attribute name="t-field">line.l10n_latam_price_unit</attribute> + </xpath> + <xpath expr="//span[@id='line_tax_ids']" position="attributes"> + <attribute name="t-esc">', '.join(map(lambda x: (x.description or x.name), line.l10n_latam_tax_ids))</attribute> + </xpath> + <t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" position="attributes"> + <attribute name="t-value">current_subtotal + line.l10n_latam_price_subtotal</attribute> + </t> + <!-- if b2c we still wants the latam subtotal --> + <t t-set="current_subtotal" t-value="current_subtotal + line.price_total" position="attributes"> + <attribute name="t-value">current_subtotal + line.l10n_latam_price_subtotal</attribute> + </t> + <!-- label amount for subtotal column on b2b and b2c --> + <xpath expr="//th[@name='th_subtotal']/span[@groups='account.group_show_line_subtotals_tax_included']" position="replace"> + <span groups="account.group_show_line_subtotals_tax_included">Amount</span> + </xpath> + <span t-field="line.price_subtotal" position="attributes"> + <attribute name="t-field">line.l10n_latam_price_subtotal</attribute> + </span> + <!-- if b2c we still wants the latam subtotal --> + <span t-field="line.price_total" position="attributes"> + <attribute name="t-field">line.l10n_latam_price_subtotal</attribute> + </span> + <span t-field="o.amount_untaxed" position="attributes"> + <attribute name="t-field">o.l10n_latam_amount_untaxed</attribute> + </span> + + <!-- use column vat instead of taxes and only if vat discriminated --> + <xpath expr="//th[@name='th_taxes']/span" position="replace"> + <span>% VAT</span> + </xpath> + + <xpath expr="//th[@name='th_taxes']" position="attributes"> + <attribute name="t-if">o.amount_by_group</attribute> + </xpath> + + <!-- use column vat instead of taxes and only list vat taxes--> + <xpath expr="//span[@id='line_tax_ids']/.." position="attributes"> + <attribute name="t-if">o.amount_by_group</attribute> + </xpath> + <span id="line_tax_ids" position="attributes"> + <attribute name="t-esc">', '.join(map(lambda x: (x.description or x.name), line.l10n_latam_tax_ids.filtered(lambda x: x.tax_group_id.l10n_ar_vat_afip_code)))</attribute> + </span> + + <!-- remove payment term, this is added on information section --> + <p name="payment_term" position="replace"/> + + <!-- remove payment reference that is not used in Argentina --> + <xpath expr="//span[@t-field='o.payment_reference']/../.." position="replace"/> + + <!-- replace information section and usage argentinean style --> + <div id="informations" position="replace"> + <div id="informations" class="row mt8 mb8"> + <div class="col-6"> + + <!-- IDENTIFICACION (ADQUIRIENTE-LOCATARIO-PRESTARIO) --> + + <!-- (14) Apellido uy Nombre: Denominicacion o Razon Soclial --> + <strong>Customer: </strong><span t-field="o.partner_id.name"/> + + <!-- (15) Domicilio Comercial --> + <br/> + <span t-field="o.partner_id" t-options="{'widget': 'contact', 'fields': ['address'], 'no_marker': true, 'no_tag_br': True}"/> + + <!-- (16) Responsabilidad AFIP --> + <strong>VAT Cond: </strong><span t-field="o.partner_id.l10n_ar_afip_responsibility_type_id"/> + + <!-- (17) CUIT --> + <t t-if="o.partner_id.vat and o.partner_id.l10n_latam_identification_type_id and o.partner_id.l10n_latam_identification_type_id.l10n_ar_afip_code != '99'"> + <br/><strong><t t-esc="o.partner_id.l10n_latam_identification_type_id.name or o.company_id.country_id.vat_label" id="inv_tax_id_label"/>:</strong> <span t-esc="o.partner_id.l10n_ar_formatted_vat if o.partner_id.l10n_latam_identification_type_id.is_vat else o.partner_id.vat"/> + </t> + + </div> + <div class="col-6"> + + <t t-if="o.invoice_date_due"> + <strong>Due Date: </strong> + <span t-field="o.invoice_date_due"/> + </t> + + <t t-if="o.invoice_payment_term_id" name="payment_term"> + <br/><strong>Payment Terms: </strong><span t-field="o.invoice_payment_term_id.name"/> + </t> + + <t t-if="o.invoice_origin"> + <br/><strong>Source:</strong> + <span t-field="o.invoice_origin"/> + </t> + + <t t-if="o.ref"> + <br/><strong>Reference:</strong> + <span t-field="o.ref"/> + </t> + + <!-- (18) REMITOS --> + <!-- We do not have remitos implement yet. print here the remito number when we have it --> + + <t t-if="o.invoice_incoterm_id"> + <br/><strong>Incoterm:</strong><span t-field="o.invoice_incoterm_id.name"/> + </t> + + </div> + + </div> + </div> + + <!-- we remove the ml auto and also give more space to avoid multiple lines on tax detail --> + <xpath expr="//div[@id='total']/div" position="attributes"> + <attribute name="t-attf-class">#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'}</attribute> + </xpath> + + <xpath expr="//div[@id='total']/div" position="before"> + <div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'}"> + + <t t-if="o.l10n_ar_afip_concept in ['2', '3', '4'] and o.l10n_ar_afip_service_start and o.l10n_ar_afip_service_end"> + <strong>Invoiced period: </strong><span t-field="o.l10n_ar_afip_service_start"/> to <span t-field="o.l10n_ar_afip_service_end"/> + </t> + <t t-if="o.currency_id != o.company_id.currency_id"> + <br/><strong>Currency: </strong><span t-esc="'%s - %s' % (o.currency_id.name, o.currency_id.currency_unit_label)"/> + <br/><strong>Exchange rate: </strong> <span t-field="o.l10n_ar_currency_rate"/> + </t> + <t t-if="o.l10n_latam_document_type_id.code in ['201', '206', '211']"> + <br/><strong>CBU for payment: </strong><span t-esc="o.invoice_partner_bank_id.acc_number or '' if o.invoice_partner_bank_id.acc_type == 'cbu' else ''"/> + </t> + + </div> </xpath> </template> |
