diff --git a/l10n_es_vat_book/README.rst b/l10n_es_vat_book/README.rst index ad19d1a66da..7d73ab0ab4f 100644 --- a/l10n_es_vat_book/README.rst +++ b/l10n_es_vat_book/README.rst @@ -23,7 +23,7 @@ Libro de IVA :target: https://runbot.odoo-community.org/runbot/189/11.0 :alt: Try me on Runbot -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| Módulo que calcula el libro de IVA español. @@ -119,6 +119,7 @@ Contributors * `Tecnativa `_: * Pedro M. Baeza + * Carlos Dauden Maintainers ~~~~~~~~~~~ diff --git a/l10n_es_vat_book/i18n/es.po b/l10n_es_vat_book/i18n/es.po index b2778e40b18..d8b79a17fd3 100644 --- a/l10n_es_vat_book/i18n/es.po +++ b/l10n_es_vat_book/i18n/es.po @@ -6,15 +6,16 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-08-08 11:17+0000\n" -"PO-Revision-Date: 2018-08-08 11:17+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2019-10-14 14:53+0200\n" +"PO-Revision-Date: 2019-10-14 14:53+0200\n" +"Last-Translator: Carlos Dauden \n" "Language-Team: \n" -"Language: \n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" +"Content-Transfer-Encoding: 8bit\n" "Plural-Forms: \n" +"X-Generator: Poedit 1.8.7.1\n" #. module: l10n_es_vat_book #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_summary @@ -26,6 +27,24 @@ msgstr "Total" msgid "Account Tax" msgstr "Impuesto" +#. module: l10n_es_vat_book +#: model:ir.model,name:l10n_es_vat_book.model_account_move_line_taxes_report +msgid "Account move line taxes" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:79 +#, python-format +msgid "Affected Tax Amount" +msgstr "Cuota IVA Repercutida" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:83 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:194 +#, python-format +msgid "Amount" +msgstr "Importe" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_auto_renumber msgid "Auto renumber invoices received" @@ -42,11 +61,10 @@ msgid "BOOK REGISTER OF INVOICES RECEIVED" msgstr "LIBRO REGISTRO DE FACTURAS RECIBIDAS" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:23 +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_base_amount #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_base_amount #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_taxes_head -#, python-format msgid "Base" msgstr "Base" @@ -72,6 +90,12 @@ msgstr "Fecha de cálculo" msgid "Click to create a new VAT book." msgstr "Pulse para crear un nuevo libro de IVA." +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:62 +#, python-format +msgid "Collection (Cash Criteria Operation)" +msgstr "Cobro (Operación Criterio de Caja)" + #. module: l10n_es_vat_book #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head msgid "Company Name" @@ -82,11 +106,23 @@ msgstr "Nombre compañía" msgid "Company:" msgstr "Compañía:" +#. module: l10n_es_vat_book +#: model:ir.model.fields,help:l10n_es_vat_book.field_l10n_es_vat_book_line_with_req +msgid "Con recargo de equivalencia" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_contact msgid "Contact phone:" msgstr "Teléfono de contacto:" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:71 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:181 +#, python-format +msgid "Country Code" +msgstr "Código País" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_create_uid #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_create_uid @@ -106,7 +142,8 @@ msgid "Created on" msgstr "Creado en" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:20 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:82 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:193 #, python-format msgid "Date" msgstr "Fecha" @@ -116,6 +153,12 @@ msgstr "Fecha" msgid "Date Range:" msgstr "Rango de fechas:" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:190 +#, python-format +msgid "Deductible Tax Amount" +msgstr "Cuota Deducible" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_display_name #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_display_name @@ -146,6 +189,31 @@ msgstr "Excepción" msgid "Exception text" msgstr "Texto de excepción" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:168 +#, python-format +msgid "Expediter Invoice Identification" +msgstr "Identificación Factura del Expedidor" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:183 +#, python-format +msgid "Expediter Name" +msgstr "Nombre Expedidor" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:170 +#, python-format +msgid "Expediter VAT" +msgstr "NIF Expedidor" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:65 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:174 +#, python-format +msgid "Expedition Date" +msgstr "Fecha Expedición" + #. module: l10n_es_vat_book #: model:ir.ui.view,arch_db:l10n_es_vat_book.view_l10n_es_vat_book_form msgid "Export to XLSX" @@ -157,13 +225,29 @@ msgid "External Reference" msgstr "Referencia externa" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:25 #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_taxes_head -#, python-format msgid "Fee" msgstr "Cuota" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:69 +#, python-format +msgid "Final Number" +msgstr "Número Final" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:179 +#, python-format +msgid "Final Reception Number" +msgstr "Número Recepción Final" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:177 +#, python-format +msgid "Final-Number" +msgstr "Número-Final" + #. module: l10n_es_vat_book #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_dates msgid "Fiscal Year:" @@ -180,9 +264,20 @@ msgid "ID" msgstr "ID (identificación)" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:19 -#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_invoice_id +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:52 +#, python-format +msgid "ISSUED" +msgstr "EXPEDIDAS" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:72 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:182 #, python-format +msgid "Identification" +msgstr "Identificación" + +#. module: l10n_es_vat_book +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_invoice_id msgid "Invoice" msgstr "Factura" @@ -191,6 +286,17 @@ msgstr "Factura" msgid "Invoice Date" msgstr "Fecha factura" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:60 +#, python-format +msgid "Invoice Identification" +msgstr "Identificación Factura" + +#. module: l10n_es_vat_book +#: model:ir.model.fields,help:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_is_req +msgid "Is Recargo de Equivalencia" +msgstr "Es Recargo de Equivalencia" + #. module: l10n_es_vat_book #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head msgid "Issue Date" @@ -204,19 +310,15 @@ msgid "Issued" msgstr "Emitida" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:59 #: model:ir.ui.view,arch_db:l10n_es_vat_book.report_vat_book_invoices_issued_document #: model:ir.ui.view,arch_db:l10n_es_vat_book.view_l10n_es_vat_book_form -#, python-format msgid "Issued Invoices" msgstr "Facturas emitidas" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:63 #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_rectification_issued_line_ids #: model:ir.ui.view,arch_db:l10n_es_vat_book.report_vat_book_invoices_issued_document #: model:ir.ui.view,arch_db:l10n_es_vat_book.view_l10n_es_vat_book_form -#, python-format msgid "Issued Refund Invoices" msgstr "Facturas rectificativas emitidas" @@ -247,6 +349,23 @@ msgstr "Facturas Emitidas/Recibidas" msgid "Journal Entry" msgstr "Asiento contable" +#. module: l10n_es_vat_book +#: model:ir.model,name:l10n_es_vat_book.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:54 +#, python-format +msgid "LIBRO REGISTRO FACTURAS EXPEDIDAS" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:162 +#, python-format +msgid "LIBRO REGISTRO FACTURAS RECIBIDAS" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book___last_update #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line___last_update @@ -302,21 +421,80 @@ msgid "NIF" msgstr "NIF" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:328 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:58 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:166 +#, python-format +msgid "Name: %s" +msgstr "Nombre: %s" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:350 #, python-format msgid "No AEAT Tax Mapping was found" msgstr "No se encontró Mapeo de Impuestos AEAT" #. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:68 #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head +#, python-format msgid "Number" msgstr "Número" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:21 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:66 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:175 #, python-format -msgid "Partner" -msgstr "Empresa" +msgid "Operation Date" +msgstr "Fecha Operación" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:75 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:185 +#, python-format +msgid "Operation Key" +msgstr "Clave de Operación" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:171 +#, python-format +msgid "Payment (Cash Criteria Operation)" +msgstr "Pago (Operación Criterio de Caja)" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:84 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:195 +#, python-format +msgid "Payment Mode" +msgstr "Medio Utilizado" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:85 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:196 +#, python-format +msgid "Payment Mode Identification" +msgstr "Identificación Medio Utilizado" + +#. module: l10n_es_vat_book +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_is_req +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_with_req +msgid "R.Eq." +msgstr "" + +#. module: l10n_es_vat_book +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_req_tax_id +msgid "R.Eq. Tax" +msgstr "Impuesto Recargo Eq." + +#. module: l10n_es_vat_book +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_req_tax_amount +msgid "R.Eq. Tax fee" +msgstr "Cuota Recargo Eq." + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:160 +#, python-format +msgid "RECEIVED" +msgstr "RECIBIDAS" #. module: l10n_es_vat_book #: selection:l10n.es.vat.book.line,line_type:0 @@ -326,19 +504,15 @@ msgid "Received" msgstr "Recibida" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:67 #: model:ir.ui.view,arch_db:l10n_es_vat_book.report_vat_book_invoices_received_document #: model:ir.ui.view,arch_db:l10n_es_vat_book.view_l10n_es_vat_book_form -#, python-format msgid "Received Invoices" msgstr "Facturas recibidas" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:71 #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_rectification_received_line_ids #: model:ir.ui.view,arch_db:l10n_es_vat_book.report_vat_book_invoices_received_document #: model:ir.ui.view,arch_db:l10n_es_vat_book.view_l10n_es_vat_book_form -#, python-format msgid "Received Refund Invoices" msgstr "Facturas rectificativas recibidas" @@ -358,9 +532,25 @@ msgid "Received invoices" msgstr "Facturas recibidas" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:29 -#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_ref +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:73 #, python-format +msgid "Receiver Name" +msgstr "Nombre Destinatario" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:61 +#, python-format +msgid "Receiver VAT" +msgstr "NIF Destinatario" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:178 +#, python-format +msgid "Reception Number" +msgstr "Número Recepción" + +#. module: l10n_es_vat_book +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_ref msgid "Reference" msgstr "Referencia" @@ -374,6 +564,25 @@ msgstr "Rectificativa emitida" msgid "Refund Received" msgstr "Rectificativa recibida" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:67 +#, python-format +msgid "Serial" +msgstr "Serie" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:176 +#, python-format +msgid "Serial-Number" +msgstr "Serie-Número" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:74 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:184 +#, python-format +msgid "Substitute Invoice" +msgstr "Factura Sustitutiva" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_summary_ids #: model:ir.ui.view,arch_db:l10n_es_vat_book.report_vat_book_invoices_issued_document @@ -384,17 +593,35 @@ msgstr "Rectificativa recibida" msgid "Summary" msgstr "Resumen" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:189 +#, python-format +msgid "Supported Tax Amount" +msgstr "Cuota IVA Soportado" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:81 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:192 +#, python-format +msgid "Surcharge Amount" +msgstr "Cuota Recargo Eq." + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:80 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:191 +#, python-format +msgid "Surcharge Type" +msgstr "Tipo de Recargo Eq." + #. module: l10n_es_vat_book #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_contact msgid "Surnames and name contact:" msgstr "Apellidos y nombre de contacto:" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:24 #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_tax_id #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_taxes_head -#, python-format msgid "Tax" msgstr "Impuesto" @@ -415,6 +642,13 @@ msgstr "Tipo Impositivo (%)" msgid "Tax Summary" msgstr "Resumen de impuestos" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:78 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:188 +#, python-format +msgid "Tax Type" +msgstr "Tipo de IVA" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_summary_tax_amount #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_tax_summary_tax_amount @@ -437,26 +671,32 @@ msgid "Taxes" msgstr "Impuestos" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:261 +#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:292 #, python-format msgid "The partner doesn't have a VAT number" msgstr "La empresa no tiene NIF" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:312 +#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:334 #, python-format msgid "This company doesn't have VAT" msgstr "Esta compañía no tiene NIF" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:26 #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_total_amount +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_total_amount #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_taxes_head -#, python-format msgid "Total" msgstr "Total" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:76 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:186 +#, python-format +msgid "Total Invoice" +msgstr "Total Factura" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_summary_total_amount #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_tax_summary_total_amount @@ -464,9 +704,26 @@ msgid "Total amount" msgstr "Importe Total" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:22 -#: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_total_amount_req_include +msgid "Total w/REq" +msgstr "Total sin REq" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:70 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:180 #, python-format +msgid "Type" +msgstr "Tipo" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:77 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:187 +#, python-format +msgid "Untaxed Amount" +msgstr "Base Imponible" + +#. module: l10n_es_vat_book +#: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head msgid "VAT" msgstr "NIF" @@ -495,6 +752,13 @@ msgstr "Informe XLSX de libro de IVA" msgid "VAT:" msgstr "NIF:" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:57 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:165 +#, python-format +msgid "VAT: %s" +msgstr "NIF: %s" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_vat_book_line_id msgid "Vat Book Line" @@ -527,6 +791,13 @@ msgstr "Ver facturas emitidas" msgid "View Received Invoices" msgstr "Ver facturas recibidas" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:56 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:164 +#, python-format +msgid "Year: %s" +msgstr "Ejercicio: %s" + #. module: l10n_es_vat_book #: model:ir.model,name:l10n_es_vat_book.model_l10n_es_vat_book msgid "l10n.es.vat.book" @@ -556,3 +827,6 @@ msgstr "l10n.es.vat.book.tax.summary" #: model:ir.model,name:l10n_es_vat_book.model_report_l10n_es_vat_book_l10n_es_vat_book_xlsx msgid "report.l10n_es_vat_book.l10n_es_vat_book_xlsx" msgstr "report.l10n_es_vat_book.l10n_es_vat_book_xlsx" + +#~ msgid "Partner" +#~ msgstr "Empresa" diff --git a/l10n_es_vat_book/i18n/l10n_es_vat_book.pot b/l10n_es_vat_book/i18n/l10n_es_vat_book.pot index e258c855e29..d3bb58d7010 100644 --- a/l10n_es_vat_book/i18n/l10n_es_vat_book.pot +++ b/l10n_es_vat_book/i18n/l10n_es_vat_book.pot @@ -6,6 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-10-14 12:52+0000\n" +"PO-Revision-Date: 2019-10-14 12:52+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -23,6 +25,24 @@ msgstr "" msgid "Account Tax" msgstr "" +#. module: l10n_es_vat_book +#: model:ir.model,name:l10n_es_vat_book.model_account_move_line_taxes_report +msgid "Account move line taxes" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:79 +#, python-format +msgid "Affected Tax Amount" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:83 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:194 +#, python-format +msgid "Amount" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_auto_renumber msgid "Auto renumber invoices received" @@ -39,11 +59,10 @@ msgid "BOOK REGISTER OF INVOICES RECEIVED" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:23 +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_base_amount #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_base_amount #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_taxes_head -#, python-format msgid "Base" msgstr "" @@ -69,6 +88,12 @@ msgstr "" msgid "Click to create a new VAT book." msgstr "" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:62 +#, python-format +msgid "Collection (Cash Criteria Operation)" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head msgid "Company Name" @@ -79,11 +104,23 @@ msgstr "" msgid "Company:" msgstr "" +#. module: l10n_es_vat_book +#: model:ir.model.fields,help:l10n_es_vat_book.field_l10n_es_vat_book_line_with_req +msgid "Con recargo de equivalencia" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_contact msgid "Contact phone:" msgstr "" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:71 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:181 +#, python-format +msgid "Country Code" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_create_uid #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_create_uid @@ -103,7 +140,8 @@ msgid "Created on" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:20 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:82 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:193 #, python-format msgid "Date" msgstr "" @@ -113,6 +151,12 @@ msgstr "" msgid "Date Range:" msgstr "" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:190 +#, python-format +msgid "Deductible Tax Amount" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_display_name #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_display_name @@ -143,6 +187,31 @@ msgstr "" msgid "Exception text" msgstr "" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:168 +#, python-format +msgid "Expediter Invoice Identification" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:183 +#, python-format +msgid "Expediter Name" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:170 +#, python-format +msgid "Expediter VAT" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:65 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:174 +#, python-format +msgid "Expedition Date" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.ui.view,arch_db:l10n_es_vat_book.view_l10n_es_vat_book_form msgid "Export to XLSX" @@ -154,13 +223,29 @@ msgid "External Reference" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:25 #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_taxes_head -#, python-format msgid "Fee" msgstr "" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:69 +#, python-format +msgid "Final Number" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:179 +#, python-format +msgid "Final Reception Number" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:177 +#, python-format +msgid "Final-Number" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_dates msgid "Fiscal Year:" @@ -177,9 +262,20 @@ msgid "ID" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:19 -#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_invoice_id +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:52 +#, python-format +msgid "ISSUED" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:72 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:182 #, python-format +msgid "Identification" +msgstr "" + +#. module: l10n_es_vat_book +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_invoice_id msgid "Invoice" msgstr "" @@ -188,6 +284,17 @@ msgstr "" msgid "Invoice Date" msgstr "" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:60 +#, python-format +msgid "Invoice Identification" +msgstr "" + +#. module: l10n_es_vat_book +#: model:ir.model.fields,help:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_is_req +msgid "Is Recargo de Equivalencia" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head msgid "Issue Date" @@ -201,19 +308,15 @@ msgid "Issued" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:59 #: model:ir.ui.view,arch_db:l10n_es_vat_book.report_vat_book_invoices_issued_document #: model:ir.ui.view,arch_db:l10n_es_vat_book.view_l10n_es_vat_book_form -#, python-format msgid "Issued Invoices" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:63 #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_rectification_issued_line_ids #: model:ir.ui.view,arch_db:l10n_es_vat_book.report_vat_book_invoices_issued_document #: model:ir.ui.view,arch_db:l10n_es_vat_book.view_l10n_es_vat_book_form -#, python-format msgid "Issued Refund Invoices" msgstr "" @@ -244,6 +347,23 @@ msgstr "" msgid "Journal Entry" msgstr "" +#. module: l10n_es_vat_book +#: model:ir.model,name:l10n_es_vat_book.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:54 +#, python-format +msgid "LIBRO REGISTRO FACTURAS EXPEDIDAS" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:162 +#, python-format +msgid "LIBRO REGISTRO FACTURAS RECIBIDAS" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book___last_update #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line___last_update @@ -299,20 +419,79 @@ msgid "NIF" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:328 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:58 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:166 +#, python-format +msgid "Name: %s" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:350 #, python-format msgid "No AEAT Tax Mapping was found" msgstr "" #. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:68 #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head +#, python-format msgid "Number" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:21 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:66 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:175 +#, python-format +msgid "Operation Date" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:75 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:185 +#, python-format +msgid "Operation Key" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:171 +#, python-format +msgid "Payment (Cash Criteria Operation)" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:84 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:195 +#, python-format +msgid "Payment Mode" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:85 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:196 +#, python-format +msgid "Payment Mode Identification" +msgstr "" + +#. module: l10n_es_vat_book +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_is_req +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_with_req +msgid "R.Eq." +msgstr "" + +#. module: l10n_es_vat_book +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_req_tax_id +msgid "R.Eq. Tax" +msgstr "" + +#. module: l10n_es_vat_book +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_req_tax_amount +msgid "R.Eq. Tax fee" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:160 #, python-format -msgid "Partner" +msgid "RECEIVED" msgstr "" #. module: l10n_es_vat_book @@ -323,19 +502,15 @@ msgid "Received" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:67 #: model:ir.ui.view,arch_db:l10n_es_vat_book.report_vat_book_invoices_received_document #: model:ir.ui.view,arch_db:l10n_es_vat_book.view_l10n_es_vat_book_form -#, python-format msgid "Received Invoices" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:71 #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_rectification_received_line_ids #: model:ir.ui.view,arch_db:l10n_es_vat_book.report_vat_book_invoices_received_document #: model:ir.ui.view,arch_db:l10n_es_vat_book.view_l10n_es_vat_book_form -#, python-format msgid "Received Refund Invoices" msgstr "" @@ -355,9 +530,25 @@ msgid "Received invoices" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:29 -#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_ref +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:73 +#, python-format +msgid "Receiver Name" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:61 +#, python-format +msgid "Receiver VAT" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:178 #, python-format +msgid "Reception Number" +msgstr "" + +#. module: l10n_es_vat_book +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_ref msgid "Reference" msgstr "" @@ -371,6 +562,25 @@ msgstr "" msgid "Refund Received" msgstr "" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:67 +#, python-format +msgid "Serial" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:176 +#, python-format +msgid "Serial-Number" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:74 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:184 +#, python-format +msgid "Substitute Invoice" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_summary_ids #: model:ir.ui.view,arch_db:l10n_es_vat_book.report_vat_book_invoices_issued_document @@ -381,17 +591,35 @@ msgstr "" msgid "Summary" msgstr "" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:189 +#, python-format +msgid "Supported Tax Amount" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:81 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:192 +#, python-format +msgid "Surcharge Amount" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:80 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:191 +#, python-format +msgid "Surcharge Type" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_contact msgid "Surnames and name contact:" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:24 #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_tax_id #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_taxes_head -#, python-format msgid "Tax" msgstr "" @@ -412,6 +640,13 @@ msgstr "" msgid "Tax Summary" msgstr "" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:78 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:188 +#, python-format +msgid "Tax Type" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_summary_tax_amount #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_tax_summary_tax_amount @@ -434,26 +669,32 @@ msgid "Taxes" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:261 +#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:292 #, python-format msgid "The partner doesn't have a VAT number" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:312 +#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:334 #, python-format msgid "This company doesn't have VAT" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:26 #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_total_amount +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_total_amount #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head #: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_taxes_head -#, python-format msgid "Total" msgstr "" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:76 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:186 +#, python-format +msgid "Total Invoice" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_summary_total_amount #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_tax_summary_total_amount @@ -461,9 +702,26 @@ msgid "Total amount" msgstr "" #. module: l10n_es_vat_book -#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:22 -#: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head +#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_total_amount_req_include +msgid "Total w/REq" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:70 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:180 +#, python-format +msgid "Type" +msgstr "" + +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:77 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:187 #, python-format +msgid "Untaxed Amount" +msgstr "" + +#. module: l10n_es_vat_book +#: model:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head msgid "VAT" msgstr "" @@ -492,6 +750,13 @@ msgstr "" msgid "VAT:" msgstr "" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:57 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:165 +#, python-format +msgid "VAT: %s" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax_vat_book_line_id msgid "Vat Book Line" @@ -524,6 +789,13 @@ msgstr "" msgid "View Received Invoices" msgstr "" +#. module: l10n_es_vat_book +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:56 +#: code:addons/l10n_es_vat_book/report/vat_book_xlsx.py:164 +#, python-format +msgid "Year: %s" +msgstr "" + #. module: l10n_es_vat_book #: model:ir.model,name:l10n_es_vat_book.model_l10n_es_vat_book msgid "l10n.es.vat.book" diff --git a/l10n_es_vat_book/models/l10n_es_vat_book.py b/l10n_es_vat_book/models/l10n_es_vat_book.py index ce2a19ac26a..22165a708d1 100644 --- a/l10n_es_vat_book/models/l10n_es_vat_book.py +++ b/l10n_es_vat_book/models/l10n_es_vat_book.py @@ -3,6 +3,7 @@ # Copyright 2017 Eficent Business and IT Consulting Services, S.L. # # Copyright 2018 Luis M. Ontalba +# Copyright 2019 Tecnativa - Carlos Dauden # License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0 import datetime @@ -134,11 +135,14 @@ def _create_vat_book_tax_summary(self, tax_summary_data_recs, tax_summary_data_recs[tax_id]) return tax_summary - @api.model def _prepare_vat_book_summary(self, tax_summary_recs, book_type): - base_amount = sum(tax_summary_recs.mapped('base_amount')) + groups = self.env['l10n.es.vat.book.line'].read_group([ + ('vat_book_id', '=', self.id), + ('line_type', '=', book_type), + ], ['base_amount'], []) + base_amount = groups[0]['base_amount'] or 0.0 tax_amount = sum(tax_summary_recs.mapped('tax_amount')) - total_amount = sum(tax_summary_recs.mapped('total_amount')) + total_amount = base_amount + tax_amount return { 'book_type': book_type, 'base_amount': base_amount, @@ -152,7 +156,6 @@ def _create_vat_book_summary(self, tax_summary_recs, book_type): vals = self._prepare_vat_book_summary(tax_summary_recs, book_type) self.env['l10n.es.vat.book.summary'].create(vals) - @api.multi def calculate(self): """ Funcion call from vat_book @@ -160,114 +163,96 @@ def calculate(self): self._calculate_vat_book() return True - def _get_vals_invoice_line(self, move, line_type): + def _prepare_book_line_vals(self, move_line, line_type): """ This function make the dictionary to create a new record in issued invoices, Received invoices or rectification invoices Args: - move (obj): move + move_line (obj): move Returns: dictionary: Vals from the new record. """ - ref = move.ref + ref = move_line.ref ext_ref = '' - invoice = move.line_ids.mapped('invoice_id')[:1] - partner = move.partner_id + invoice = move_line.invoice_id + partner = move_line.partner_id if invoice: partner = invoice.commercial_partner_id ref = invoice.number ext_ref = invoice.reference return { 'line_type': line_type, - 'invoice_date': move.date, + 'invoice_date': invoice.date_invoice or move_line.date, 'partner_id': partner.id, 'vat_number': partner.vat, 'invoice_id': invoice.id, 'ref': ref, 'external_ref': ext_ref, 'vat_book_id': self.id, - 'move_id': move.id, + 'move_id': move_line.move_id.id, + 'tax_lines': {}, + 'base_amount': 0.0, + 'with_req': False, } - def _get_vat_book_line_tax(self, tax, move, vat_book_line): - base_move_lines = move.line_ids.filtered( - lambda l: any(t == tax for t in l.tax_ids)) - base_amount_untaxed = sum(x.credit - x.debit for x in base_move_lines) - - parent_tax = self.env['account.tax'].search([ - ('children_tax_ids.id', '=', tax.id)], limit=1) - taxes = self.env['account.tax'] - if parent_tax: - taxes = tax.children_tax_ids - tax = parent_tax - else: - taxes += tax - fee_move_lines = move.line_ids.filtered( - lambda l: l.tax_line_id in taxes) - fee_amount_untaxed = 0.0 - if fee_move_lines: - fee_amount_untaxed = sum( - x.credit - x.debit for x in fee_move_lines) - - if vat_book_line.line_type == 'issued' and fee_amount_untaxed < 0.0: - vat_book_line.line_type = 'rectification_issued' - - if vat_book_line.line_type == 'received' and fee_amount_untaxed > 0.0: - vat_book_line.line_type = 'rectification_received' - - if vat_book_line.line_type in ['received', 'rectification_received']: - base_amount_untaxed *= -1 - fee_amount_untaxed *= -1 - + def _prepare_book_line_tax_vals(self, move_line, vat_book_line): + balance = move_line.credit - move_line.debit + if vat_book_line['line_type'] in [ + 'received', 'rectification_received']: + balance = -balance + base_amount_untaxed = balance if move_line.tax_ids else 0.0 + fee_amount_untaxed = balance if move_line.tax_line_id else 0.0 return { - 'tax_id': tax.id, + 'tax_id': move_line.tax_line_id.id, 'base_amount': base_amount_untaxed, 'tax_amount': fee_amount_untaxed, 'total_amount': base_amount_untaxed + fee_amount_untaxed, - 'move_line_ids': [(4, aml.id) for aml - in base_move_lines + fee_move_lines], - 'vat_book_line_id': vat_book_line.id, + 'move_line_ids': [(4, move_line.id)], + 'is_req': False, } - def _create_vat_book_line_tax(self, tax, vat_book_line_id, - move): - vat_book_line_tax_obj = self.env['l10n.es.vat.book.line.tax'] - vals = self._get_vat_book_line_tax(tax, move, vat_book_line_id) - - new_record = vat_book_line_tax_obj.create(vals) - - return new_record - - def _create_vat_book_line(self, move, line_type): - """ - This function create a new record in issued invoices, Received - invoices or rectification invoices - - Args: - move (obj): move - - Returns: - obj: obj with new object create depends invoice type. - """ - vat_book_line_obj = self.env['l10n.es.vat.book.line'] - - vals = self._get_vals_invoice_line(move, line_type) - exception_text = "" - exception = False - if vals['invoice_id'] and not vals['vat_number']: - exception = True - exception_text += _("The partner doesn't have a VAT number") - - if exception: - vals.update({ - 'exception': True, - 'exception_text': exception_text, + def upsert_book_line_tax(self, move_line, vat_book_line, implied_taxes): + vals = self._prepare_book_line_tax_vals(move_line, vat_book_line) + tax_lines = vat_book_line['tax_lines'] + if move_line.tax_line_id: + key = self.get_book_line_tax_key(move_line, move_line.tax_line_id) + if key not in tax_lines: + tax_lines[key] = vals + else: + tax_lines[key]['tax_amount'] += vals['tax_amount'] + tax_lines[key]['total_amount'] += vals['total_amount'] + tax_lines[key]['move_line_ids'] += vals['move_line_ids'] + for i, tax in enumerate(move_line.tax_ids): + if i == 0: + vat_book_line['base_amount'] += vals['base_amount'] + if tax not in implied_taxes: + continue + key = self.get_book_line_tax_key(move_line, tax) + if key not in tax_lines: + tax_lines[key] = vals + tax_lines[key]['tax_id'] = tax.id + else: + tax_lines[key]['base_amount'] += vals['base_amount'] + tax_lines[key]['total_amount'] += vals['total_amount'] + # if i == 0: + tax_lines[key]['move_line_ids'] += vals['move_line_ids'] + if '_REQ' in tax.description: + vat_book_line['with_req'] = True + tax_lines[key]['is_req'] = True + if vat_book_line['with_req']: + base_line = next(filter( + lambda l: not l['is_req'], tax_lines.values())) + req_line = next(filter( + lambda l: l['is_req'], tax_lines.values())) + base_line.update({ + 'req_tax_id': req_line['tax_id'], + 'req_tax_amount': req_line['tax_amount'], + 'total_amount_req_include': + base_line['total_amount'] + req_line['tax_amount'], }) - return vat_book_line_obj.create(vals) - def _clear_old_data(self): """ This function clean all the old data to make a new calculation @@ -283,23 +268,60 @@ def _account_move_line_domain(self, taxes): '|', ('tax_ids', 'in', taxes.ids), ('tax_line_id', 'in', taxes.ids)] - def _get_account_moves(self, taxes): - aml_obj = self.env['account.move.line'] - groups = aml_obj.read_group( - self._account_move_line_domain(taxes), ['move_id'], ['move_id']) - return self.env['account.move'].browse([ - x['move_id'][0] for x in groups - ]) - - def _create_vat_book_records(self, move, line_type, taxes): - line = self._create_vat_book_line( - move, line_type) - # Create tax lines - ml_taxes = move.line_ids.mapped('tax_ids') - for tax in ml_taxes.filtered(lambda x: x.id in taxes.ids): - # Create tax lines for the current vat_book_line - self._create_vat_book_line_tax( - tax, line, move) + def _get_account_move_lines(self, taxes): + return self.env['account.move.line'].search( + self._account_move_line_domain(taxes)) + + def get_book_line_key(self, move_line): + return '{}-{}'.format( + move_line.move_id.ids, move_line.invoice_id.ids) + + def get_book_line_tax_key(self, move_line, tax): + return '{}-{}-{}'.format( + move_line.move_id.ids, move_line.invoice_id.ids, tax.id) + + def _set_line_type(self, line_vals, line_type): + if line_vals['base_amount'] < 0.0: + line_vals['line_type'] = 'rectification_{}'.format(line_type) + + def _check_exceptions(self, line_vals): + exception_text = "" + exception = False + if line_vals['partner_id'] and not line_vals['vat_number']: + exception = True + exception_text += _("The partner doesn't have a VAT number") + + if exception: + line_vals.update({ + 'exception': True, + 'exception_text': exception_text, + }) + + def create_vat_book_lines(self, move_lines, line_type, taxes): + VatBookLine = self.env['l10n.es.vat.book.line'] + moves_dic = {} + for move_line in move_lines: + line_key = self.get_book_line_key(move_line) + if line_key not in moves_dic: + moves_dic[line_key] = self._prepare_book_line_vals( + move_line, line_type) + self.upsert_book_line_tax(move_line, moves_dic[line_key], taxes) + + for line_vals in moves_dic.values(): + tax_lines = line_vals.pop('tax_lines') + tax_line_list = [] + tax_amount = 0.0 + for tax_line_vals in tax_lines.values(): + tax_amount += tax_line_vals['tax_amount'] + tax_line_list.append((0, 0, tax_line_vals)) + self._set_line_type(line_vals, line_type) + line_vals.update({ + 'total_amount': line_vals['base_amount'] + tax_amount, + 'tax_line_ids': [ + (0, 0, vals) for vals in tax_lines.values()], + }) + self._check_exceptions(line_vals) + VatBookLine.create(line_vals) def _calculate_vat_book(self): """ @@ -344,17 +366,11 @@ def _calculate_vat_book(self): # Get all the account move lines that contain VAT that is # applicable to this report. - moves_issued = rec._get_account_moves(taxes_issued) - - for move in moves_issued: - line_type = 'issued' - rec._create_vat_book_records(move, line_type, taxes_issued) - - moves_received = rec._get_account_moves(taxes_received) - - for move in moves_received: - line_type = 'received' - rec._create_vat_book_records(move, line_type, taxes_received) + lines_issued = rec._get_account_move_lines(taxes_issued) + self.create_vat_book_lines(lines_issued, 'issued', taxes_issued) + lines_received = rec._get_account_move_lines(taxes_received) + self.create_vat_book_lines( + lines_received, 'received', taxes_received) # Issued book_type = 'issued' @@ -408,7 +424,6 @@ def _calculate_vat_book(self): 'calculation_date': fields.Datetime.now(), }) - @api.multi def view_issued_invoices(self): self.ensure_one() action = self.env.ref( @@ -417,7 +432,6 @@ def view_issued_invoices(self): vals['context'] = self.env.context return vals - @api.multi def view_received_invoices(self): self.ensure_one() action = self.env.ref( @@ -434,7 +448,6 @@ def _format_date(self, date): return datetime.datetime.strftime( fields.Date.from_string(date), date_format) - @api.multi def export_xlsx(self): self.ensure_one() context = dict(self.env.context, active_ids=self.ids) diff --git a/l10n_es_vat_book/models/l10n_es_vat_book_line.py b/l10n_es_vat_book/models/l10n_es_vat_book_line.py index 2793c96e386..7d1324b61d8 100644 --- a/l10n_es_vat_book/models/l10n_es_vat_book_line.py +++ b/l10n_es_vat_book/models/l10n_es_vat_book_line.py @@ -2,6 +2,7 @@ # Daniel Rodriguez Lijo # Copyright 2017 Eficent Business and IT Consulting Services, S.L. # +# Copyright 2019 Tecnativa - Carlos Dauden # License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0 from odoo import api, fields, models @@ -52,6 +53,17 @@ class L10nEsVatBookLine(models.Model): exception_text = fields.Char( string="Exception text") + base_amount = fields.Float( + string='Base', + ) + total_amount = fields.Float( + string='Total', + ) + with_req = fields.Boolean( + string='R.Eq.', + help='Con recargo de equivalencia', + ) + @api.multi @api.depends('tax_id') def _compute_tax_rate(self): diff --git a/l10n_es_vat_book/models/l10n_es_vat_book_line_tax.py b/l10n_es_vat_book/models/l10n_es_vat_book_line_tax.py index 74083332bed..8c4a226e925 100644 --- a/l10n_es_vat_book/models/l10n_es_vat_book_line_tax.py +++ b/l10n_es_vat_book/models/l10n_es_vat_book_line_tax.py @@ -2,6 +2,7 @@ # Daniel Rodriguez Lijo # Copyright 2017 Eficent Business and IT Consulting Services, S.L. # +# Copyright 2019 Tecnativa - Carlos Dauden # License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0 from odoo import api, fields, models @@ -10,9 +11,12 @@ class L10nEsVatBookLineTax(models.Model): _name = 'l10n.es.vat.book.line.tax' - vat_book_line_id = fields.Many2one(comodel_name='l10n.es.vat.book.line', - required=True, ondelete='cascade') - + vat_book_line_id = fields.Many2one( + comodel_name='l10n.es.vat.book.line', + required=True, + ondelete='cascade', + index=True, + ) base_amount = fields.Float( string='Base') @@ -28,6 +32,20 @@ class L10nEsVatBookLineTax(models.Model): move_line_ids = fields.Many2many( comodel_name='account.move.line', string='Move Lines') + is_req = fields.Boolean( + string='R.Eq.', + help='Is Recargo de Equivalencia', + ) + req_tax_id = fields.Many2one( + comodel_name='account.tax', + string='R.Eq. Tax', + ) + req_tax_amount = fields.Float( + string='R.Eq. Tax fee', + ) + total_amount_req_include = fields.Float( + string='Total w/REq', + ) @api.multi @api.depends('tax_id') diff --git a/l10n_es_vat_book/report/common_templates.xml b/l10n_es_vat_book/report/common_templates.xml index df1ec89c753..081093bd983 100644 --- a/l10n_es_vat_book/report/common_templates.xml +++ b/l10n_es_vat_book/report/common_templates.xml @@ -200,7 +200,10 @@ Total - + + + +# Copyright 2019 Tecnativa - Carlos Dauden # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import _, models +from odoo import _, fields, models class VatNumberXlsx(models.AbstractModel): _name = 'report.l10n_es_vat_book.l10n_es_vat_book_xlsx' _inherit = 'report.report_xlsx.abstract' + def parse_vat_info(self, line, europe_codes): + identifier_type = '' + vat_number = line.vat_number and line.vat_number or '' + if vat_number[:2] in europe_codes: + country_code = vat_number[:2] + vat_number = vat_number[2:] + if country_code != 'ES': + identifier_type = '02' + return country_code, identifier_type, vat_number + country_code = line.partner_id.country_id.code + if country_code in europe_codes: + if country_code != 'ES': + identifier_type = '02' + else: + identifier_type = '04' + return country_code, identifier_type, vat_number + + def format_boe_date(self, date): + return fields.Datetime.from_string(date).strftime('%d/%m/%Y') + + def create_issued_sheet(self, workbook, book): + title_format = workbook.add_format({ + 'bold': 1, + 'border': 1, + 'align': 'center', + 'valign': 'vjustify', + }) + header_format = workbook.add_format({ + 'bold': 1, + 'border': 1, + 'align': 'center', + 'valign': 'vjustify', + 'fg_color': '#F2F2F2'}) + subheader_format = workbook.add_format({ + 'bold': 1, + 'border': 1, + 'align': 'center', + 'valign': 'vjustify'}) + number_format = workbook.add_format() + number_format.set_num_format('0.00') + + sheet = workbook.add_worksheet(_('ISSUED')) + + sheet.merge_range('B1:Q1', _('LIBRO REGISTRO FACTURAS EXPEDIDAS'), + title_format) + sheet.write('A2', _('Year: %s' % book.year)) + sheet.write('A3', _('VAT: %s' % book.company_vat)) + sheet.merge_range('A4:D4', _('Name: %s' % book.company_id.name)) + + sheet.merge_range('C6:E6', _('Invoice Identification'), header_format) + sheet.merge_range('F6:H6', _('Receiver VAT'), header_format) + sheet.merge_range('R6:U6', _('Collection (Cash Criteria Operation)'), + header_format) + + sheet.merge_range('A6:A7', _('Expedition Date'), header_format) + sheet.merge_range('B6:B7', _('Operation Date'), header_format) + sheet.write('C7', _('Serial'), subheader_format) + sheet.write('D7', _('Number'), subheader_format) + sheet.write('E7', _('Final Number'), subheader_format) + sheet.write('F7', _('Type'), subheader_format) + sheet.write('G7', _('Country Code'), subheader_format) + sheet.write('H7', _('Identification'), subheader_format) + sheet.merge_range('I6:I7', _('Receiver Name'), header_format) + sheet.merge_range('J6:J7', _('Substitute Invoice'), header_format) + sheet.merge_range('K6:K7', _('Operation Key'), header_format) + sheet.merge_range('L6:L7', _('Total Invoice'), header_format) + sheet.merge_range('M6:M7', _('Untaxed Amount'), header_format) + sheet.merge_range('N6:N7', _('Tax Type'), header_format) + sheet.merge_range('O6:O7', _('Affected Tax Amount'), header_format) + sheet.merge_range('P6:P7', _('Surcharge Type'), header_format) + sheet.merge_range('Q6:Q7', _('Surcharge Amount'), header_format) + sheet.write('R7', _('Date'), subheader_format) + sheet.write('S7', _('Amount'), subheader_format) + sheet.write('T7', _('Payment Mode'), subheader_format) + sheet.write('U7', _('Payment Mode Identification'), subheader_format) + + sheet.set_column('A:A', 16) + sheet.set_column('B:B', 16) + sheet.set_column('C:C', 14) + sheet.set_column('D:D', 17) + sheet.set_column('E:E', 17) + sheet.set_column('F:F', 8) + sheet.set_column('G:G', 12) + sheet.set_column('H:H', 14) + sheet.set_column('I:I', 40) + sheet.set_column('J:J', 16) + sheet.set_column('K:K', 16) + sheet.set_column('L:L', 14) + sheet.set_column('M:M', 14) + sheet.set_column('N:N', 14) + sheet.set_column('O:O', 14) + sheet.set_column('P:P', 14) + sheet.set_column('Q:Q', 14) + sheet.set_column('R:R', 14) + sheet.set_column('S:S', 14) + sheet.set_column('T:T', 14) + sheet.set_column('U:U', 30) + + return sheet + + def fill_issued_row_data(self, sheet, row, line, tax_line, europe_codes, + tax_index): + """ Fill issued data """ + + invoice_date = self.format_boe_date(line.invoice_date) + country_code, identifier_type, vat_number = self.parse_vat_info( + line, europe_codes) + sheet.write('A' + str(row), invoice_date) + sheet.write('B' + str(row), invoice_date) + sheet.write('C' + str(row), line.ref[:-20]) + sheet.write('D' + str(row), line.ref[-20:]) + sheet.write('E' + str(row), '') # Final number + sheet.write('F' + str(row), identifier_type) + if country_code != 'ES': + sheet.write('G' + str(row), country_code) + sheet.write('H' + str(row), vat_number) + sheet.write('I' + str(row), line.partner_id.name[:40]) + # TODO: Substitute Invoice + # sheet.write('J' + str(row), + # line.invoice_id.refund_invoice_id.number or '') + sheet.write('K' + str(row), '') # Operation Key + if tax_index == 0: + sheet.write('L' + str(row), line.total_amount) + sheet.write('M' + str(row), tax_line.base_amount) + sheet.write('N' + str(row), tax_line.tax_id.amount) + sheet.write('O' + str(row), tax_line.tax_amount) + if tax_line.req_tax_amount: + sheet.write('P' + str(row), tax_line.req_tax_id.amount) + sheet.write('Q' + str(row), tax_line.req_tax_amount) + + def create_received_sheet(self, workbook, book): + title_format = workbook.add_format({ + 'bold': 1, + 'border': 1, + 'align': 'center', + 'valign': 'vjustify', + }) + header_format = workbook.add_format({ + 'bold': 1, + 'border': 1, + 'align': 'center', + 'valign': 'vjustify', + 'fg_color': '#F2F2F2'}) + subheader_format = workbook.add_format({ + 'bold': 1, + 'border': 1, + 'align': 'center', + 'valign': 'vjustify'}) + number_format = workbook.add_format() + number_format.set_num_format('0.00') + + sheet = workbook.add_worksheet(_('RECEIVED')) + + sheet.merge_range('B1:S1', _('LIBRO REGISTRO FACTURAS RECIBIDAS'), + title_format) + sheet.write('A2', _('Year: %s' % book.year)) + sheet.write('A3', _('VAT: %s' % book.company_vat)) + sheet.merge_range('A4:D4', _('Name: %s' % book.company_id.name)) + + sheet.merge_range('C6:D6', _('Expediter Invoice Identification'), + header_format) + sheet.merge_range('G6:I6', _('Expediter VAT'), header_format) + sheet.merge_range('T6:W6', _('Payment (Cash Criteria Operation)'), + header_format) + + sheet.merge_range('A6:A7', _('Expedition Date'), header_format) + sheet.merge_range('B6:B7', _('Operation Date'), header_format) + sheet.write('C7', _('Serial-Number'), subheader_format) + sheet.write('D7', _('Final-Number'), subheader_format) + sheet.merge_range('E6:E7', _('Reception Number'), header_format) + sheet.merge_range('F6:F7', _('Final Reception Number'), header_format) + sheet.write('G7', _('Type'), subheader_format) + sheet.write('H7', _('Country Code'), subheader_format) + sheet.write('I7', _('Identification'), subheader_format) + sheet.merge_range('J6:J7', _('Expediter Name'), header_format) + sheet.merge_range('K6:K7', _('Substitute Invoice'), header_format) + sheet.merge_range('L6:L7', _('Operation Key'), header_format) + sheet.merge_range('M6:M7', _('Total Invoice'), header_format) + sheet.merge_range('N6:N7', _('Untaxed Amount'), header_format) + sheet.merge_range('O6:O7', _('Tax Type'), header_format) + sheet.merge_range('P6:P7', _('Supported Tax Amount'), header_format) + sheet.merge_range('Q6:Q7', _('Deductible Tax Amount'), header_format) + sheet.merge_range('R6:R7', _('Surcharge Type'), header_format) + sheet.merge_range('S6:S7', _('Surcharge Amount'), header_format) + sheet.write('T7', _('Date'), subheader_format) + sheet.write('U7', _('Amount'), subheader_format) + sheet.write('V7', _('Payment Mode'), subheader_format) + sheet.write('W7', _('Payment Mode Identification'), subheader_format) + + sheet.set_column('A:A', 16) + sheet.set_column('B:B', 16) + sheet.set_column('C:C', 17) + sheet.set_column('D:D', 17) + sheet.set_column('E:E', 17) + sheet.set_column('F:F', 17) + sheet.set_column('G:G', 8) + sheet.set_column('H:H', 12) + sheet.set_column('I:I', 14) + sheet.set_column('J:J', 40) + sheet.set_column('K:K', 16) + sheet.set_column('L:L', 14) + sheet.set_column('M:M', 14) + sheet.set_column('N:N', 14) + sheet.set_column('O:O', 14) + sheet.set_column('P:P', 14) + sheet.set_column('Q:Q', 14) + sheet.set_column('R:R', 14) + sheet.set_column('S:S', 14) + sheet.set_column('T:T', 14) + sheet.set_column('U:U', 14) + sheet.set_column('V:V', 14) + sheet.set_column('W:W', 30) + + return sheet + + def fill_received_row_data(self, sheet, row, line, tax_line, europe_codes, + tax_index): + """ Fill received data """ + + invoice_date = self.format_boe_date(line.invoice_date) + country_code, identifier_type, vat_number = self.parse_vat_info( + line, europe_codes) + sheet.write('A' + str(row), invoice_date) + sheet.write('B' + str(row), invoice_date) + sheet.write('C' + str(row), + line.external_ref and line.external_ref[:40] or '') + sheet.write('D' + str(row), '') + sheet.write('E' + str(row), line.ref[:20]) + sheet.write('F' + str(row), '') + sheet.write('G' + str(row), identifier_type) + if country_code != 'ES': + sheet.write('H' + str(row), country_code) + sheet.write('I' + str(row), vat_number) + sheet.write('J' + str(row), line.partner_id.name[:40]) + # TODO: Substitute Invoice + # sheet.write('K' + str(row), + # line.invoice_id.refund_invoice_id.number or '') + sheet.write('L' + str(row), '') # Operation Key + if tax_index == 0: + sheet.write('M' + str(row), line.total_amount) + sheet.write('N' + str(row), tax_line.base_amount) + sheet.write('O' + str(row), tax_line.tax_id.amount) + sheet.write('P' + str(row), tax_line.tax_amount) + sheet.write('Q' + str(row), tax_line.tax_amount) + if tax_line.req_tax_amount: + sheet.write('R' + str(row), tax_line.req_tax_id.amount) + sheet.write('S' + str(row), tax_line.req_tax_amount) + def generate_xlsx_report(self, workbook, data, objects): + """ Create vat book xlsx in BOE format """ + + europe = self.env.ref('base.europe', raise_if_not_found=False) + if not europe: + europe = self.env["res.country.group"].search( + [('name', '=', 'Europe')], limit=1) + europe_codes = europe.country_ids.mapped('code') + book = objects[0] - bold = workbook.add_format({'bold': True}) - - def fill_table(sheet_name, lines, received_lines=False): - sheet = workbook.add_worksheet(sheet_name[:31]) - row = col = 0 - xlsx_header = [ - _('Invoice'), - _('Date'), - _('Partner'), - _('VAT'), - _('Base'), - _('Tax'), - _('Fee'), - _('Total'), - ] - if received_lines: - xlsx_header.insert(0, _('Reference')) - for col_header in xlsx_header: - sheet.write(row, col, col_header, bold) - col += 1 - - row = 1 - for line in lines: - for tax_line in line.tax_line_ids: - col = 0 - if received_lines: - sheet.write(row, col, line.invoice_id.reference) - col += 1 - sheet.write(row, col, line.invoice_id.number) - col += 1 - sheet.write(row, col, line.invoice_date) - col += 1 - sheet.write(row, col, line.partner_id.name) - col += 1 - sheet.write(row, col, line.vat_number) - col += 1 - sheet.write(row, col, tax_line.base_amount) - col += 1 - sheet.write(row, col, tax_line.tax_id.name) - col += 1 - sheet.write(row, col, tax_line.tax_amount) - col += 1 - sheet.write(row, col, tax_line.total_amount) + + # Issued + issued_sheet = self.create_issued_sheet(workbook, book) + lines = book.issued_line_ids + book.rectification_issued_line_ids + lines = lines.sorted(key=lambda l: (l.invoice_date, l.ref)) + row = 8 + for line in lines: + for i, tax_line in enumerate(line.tax_line_ids): + if not tax_line.is_req: + # TODO: Payments bucle + self.fill_issued_row_data( + issued_sheet, row, line, tax_line, europe_codes, i) row += 1 - if book.issued_line_ids: - report_name = _('Issued Invoices') - lines = book.issued_line_ids - fill_table(report_name, lines) - if book.rectification_issued_line_ids: - report_name = _('Issued Refund Invoices') - lines = book.rectification_issued_line_ids - fill_table(report_name, lines) - if book.received_line_ids: - report_name = _('Received Invoices') - lines = book.received_line_ids - fill_table(report_name, lines, received_lines=True) - if book.rectification_received_line_ids: - report_name = _('Received Refund Invoices') - lines = book.rectification_received_line_ids - fill_table(report_name, lines, received_lines=True) + # Received + received_sheet = self.create_received_sheet(workbook, book) + lines = book.received_line_ids + book.rectification_received_line_ids + lines = lines.sorted(key=lambda l: (l.invoice_date, l.ref)) + row = 8 + for line in lines: + for i, tax_line in enumerate(line.tax_line_ids): + # TODO: Payments bucle + self.fill_received_row_data( + received_sheet, row, line, tax_line, europe_codes, i) + row += 1 diff --git a/l10n_es_vat_book/report/vat_book_xlsx.xml b/l10n_es_vat_book/report/vat_book_xlsx.xml index c272a982127..7d9ac24e7f8 100644 --- a/l10n_es_vat_book/report/vat_book_xlsx.xml +++ b/l10n_es_vat_book/report/vat_book_xlsx.xml @@ -1,13 +1,11 @@ - - VAT book XLSX report - l10n.es.vat.book - ir.actions.report - l10n_es_vat_book.l10n_es_vat_book_xlsx - xlsx - l10n_es_vat_book - + diff --git a/l10n_es_vat_book/views/l10n_es_vat_book_line.xml b/l10n_es_vat_book/views/l10n_es_vat_book_line.xml index c36750db607..23dc3532372 100644 --- a/l10n_es_vat_book/views/l10n_es_vat_book_line.xml +++ b/l10n_es_vat_book/views/l10n_es_vat_book_line.xml @@ -13,6 +13,9 @@ + + + @@ -25,13 +28,29 @@ + + + +
- - - - + + + + + + + + + + + + @@ -57,6 +76,9 @@ + + +