ソースを参照

[ADD] custom_report_invoice: add module

FernizaM22 2 年 前
コミット
a217367d51

+ 0 - 0
cutom_report_invoice/__init__.py


+ 17 - 0
cutom_report_invoice/__manifest__.py

@@ -0,0 +1,17 @@
+{
+    "name": "Custom Report Invoice",
+    'description': """
+        Custom Report Invoice M22      
+    """,
+    "version": "16.0.1.0.0",
+    "category": "Partner",
+    "author": "M22",
+    'website': "https://www.m22.mx",
+    "license": "AGPL-3",
+    "depends": ["account", "l10n_mx_edi_40", ],
+    "data": [
+        "views/report_invoice_view.xml",
+        "report/report_invoice.xml",
+        ],
+    "installable": True,
+}

BIN
cutom_report_invoice/__pycache__/__init__.cpython-310.pyc


+ 278 - 0
cutom_report_invoice/i18n/es_MX.po

@@ -0,0 +1,278 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# 	* cutom_report_invoice
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 16.0+e\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2023-08-31 00:15+0000\n"
+"PO-Revision-Date: 2023-08-31 00:15+0000\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid ""
+"<span groups=\"account.group_show_line_subtotals_tax_excluded\">Amount</span>\n"
+"                                            <span groups=\"account.group_show_line_subtotals_tax_included\">Total Price</span>"
+msgstr ""
+"<span groups=\"account.group_show_line_subtotals_tax_excluded\">Importe</span>\n"
+"                                            <span groups=\"account.group_show_line_subtotals_tax_included\">Total</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span> - </span>"
+msgstr ""
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span> | Certification Date:</span>"
+msgstr "<span> | Fecha de Certificación:</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span> | Emission Date:</span>"
+msgstr "<span> | Fecha de Emisión:</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span> | Expedition place:</span>"
+msgstr "<span> | Lugar de expedición:</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span> | Fiscal Folio:</span>"
+msgstr "<span> | Folio Fiscal:</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span> | Fiscal Regime:</span>"
+msgstr "<span> | Régimen Fiscal:</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span> | SAT Certificate:</span>"
+msgstr "<span> | Certificado SAT:</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span>Description</span>"
+msgstr "<span>DESCRIPCIÓN</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span>Digital stamp SAT</span>"
+msgstr "<span>Sello digital de SAT</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span>Digital stamp of the emitter</span>"
+msgstr "<span>Sello digital del emisor</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span>Disc.%</span>"
+msgstr "<span>Desc.%</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span>Emitter certificate:</span>"
+msgstr "<span>Certificado del emisor:</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span>Extra Info</span>"
+msgstr "<span>Información Extra</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span>Original chain complement of digital certification SAT</span>"
+msgstr "<span>Cadena original del complemento del certificado digital del SAT</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span>Product code</span>"
+msgstr "<span>CÓDIGO PRODUCTO</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span>Taxes</span>"
+msgstr "<span>IMPUESTOS</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<span>Unit code</span>"
+msgstr "<span>CÓDIGO UNIDAD</span>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong class=\"mr16\">Subtotal</strong>"
+msgstr ""
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid ""
+"<strong class=\"text-center\">Scan me with your banking "
+"app.</strong><br/><br/>"
+msgstr ""
+"<strong class=\"text-center\">Escanéame con tu aplicación "
+"bancaria.</strong><br/><br/>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid ""
+"<strong>A signature of this invoice is required, but it is not "
+"signed.</strong>"
+msgstr ""
+"<strong>Se requiere una firma de esta factura, pero no "
+"está firmada.</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Bank Account:</strong>"
+msgstr "<strong>Cuenta Bancaria:</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Credit Note Date:</strong>"
+msgstr "<strong>Fecha de la nota de crédito:</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Currency:</strong>"
+msgstr "<strong>Divisa:</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Customer Code:</strong>"
+msgstr "<strong>Código de cliente:</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Date:</strong>"
+msgstr "<strong>Fecha:</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Due Date:</strong>"
+msgstr "<strong>Fecha de vencimiento:</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Incoterm: </strong>"
+msgstr ""
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Invoice Date:</strong>"
+msgstr "<strong>Fecha de factura:</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Payment Method:</strong>"
+msgstr "<strong>Método de Pago:</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Payment Way:</strong>"
+msgstr "<strong>Forma de Pago:</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Receipt Date:</strong>"
+msgstr "<strong>Fecha de recepción:</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Reference:</strong>"
+msgstr "<strong>Referencia:</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Source:</strong>"
+msgstr "<strong>Origen:</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>This document is a printed representation of a CFDI</strong>"
+msgstr "<strong>Este documento es una representación impresa de un CFDI</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "<strong>Usage:</strong>"
+msgstr "<strong>Uso:</strong>"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "Amount Due"
+msgstr "Monto adeudado"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "Barcode"
+msgstr ""
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "Cancelled Invoice"
+msgstr "Factura cancelada"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "Credit Note"
+msgstr "Nota de crédito"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "Discount"
+msgstr "Descuento"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "Draft Invoice"
+msgstr "Factura borrador"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "Due Date"
+msgstr "Fecha de vencimiento:"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "Invoice"
+msgstr "Factura"
+
+#. module: cutom_report_invoice
+#: model:ir.actions.report,name:cutom_report_invoice.custom_report_invoice
+msgid "Invoice Implementation"
+msgstr "Factura Implementación"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "Paid on"
+msgstr "Pagado en"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "Please use the following communication for your payment :"
+msgstr "Utilice la siguiente referencia al realizar su pago:"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "Vendor Bill"
+msgstr "Factura de proveedor"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "Vendor Credit Note"
+msgstr "Nota de crédito del proveedor"
+
+#. module: cutom_report_invoice
+#: model_terms:ir.ui.view,arch_db:cutom_report_invoice.custom_report_invoice_document
+msgid "if paid before"
+msgstr "si se paga antes"

+ 13 - 0
cutom_report_invoice/report/report_invoice.xml

@@ -0,0 +1,13 @@
+<?xml version='1.0' encoding='utf-8'?>
+<odoo>
+    <record id="custom_report_invoice" model="ir.actions.report">
+        <field name="name">Invoice Implementation</field>
+        <field name="model">account.move</field>
+        <field name="report_type">qweb-pdf</field>
+        <field name="report_name">cutom_report_invoice.custom_report_invoice_document</field>
+        <field name="report_file">cutom_report_invoice.custom_report_invoice_document</field>
+        <field name="attachment" />
+        <field name="binding_model_id" ref="account.model_account_move" />
+        <field name="binding_type">report</field>
+    </record>
+</odoo>

+ 314 - 0
cutom_report_invoice/views/report_invoice_view.xml

@@ -0,0 +1,314 @@
+<?xml version='1.0' encoding='utf-8'?>
+<odoo>
+    <template id="custom_report_invoice_document">
+        <t t-call="web.html_container">
+            <t t-foreach="docs" t-as="o">
+                <t t-call="web.external_layout">
+                    <t t-set="forced_vat" t-value="o.fiscal_position_id.foreign_vat"/>
+                    <div>
+                        <div class="page" >
+                            <h2>
+                                <span t-if="o.move_type == 'out_invoice' and o.state == 'posted'">Invoice</span>
+                                <span t-if="o.move_type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span>
+                                <span t-if="o.move_type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span>
+                                <span t-if="o.move_type == 'out_refund'">Credit Note</span>
+                                <span t-if="o.move_type == 'in_refund'">Vendor Credit Note</span>
+                                <span t-if="o.move_type == 'in_invoice'">Vendor Bill</span>
+                                <span t-if="o.name != '/'" t-field="o.name"/>
+                            </h2>
+                            <!-- Global variables -->
+                            <t t-set="cfdi_vals" t-value="o._l10n_mx_edi_decode_cfdi()"/>
+                            <t t-set="is_cfdi_signed" t-value="bool(o._get_l10n_mx_edi_signed_edi_document())"/>
+
+                            <t t-if="o.l10n_mx_edi_cfdi_request in ('on_invoice', 'on_refund') and not is_cfdi_signed and o.edi_state != 'cancelled'">
+                                <!-- due to HTML preview for device responsive -->
+                                <button t-attf-class="btn-danger #{'btn' if report_type != 'html' else ''}">
+                                    <strong>A signature of this invoice is required, but it is not signed.</strong>
+                                </button>
+                            </t>
+                            <div class="row">
+                                <div class="col-5">
+                                    <div t-field="res_company.x_commercial_partner_id" t-options-widget="'contact'"/>
+                                    <field t-field="res_company.x_commercial_partner_id.l10n_mx_edi_fiscal_regime"/>
+                                </div>
+                                <div class="col-2"/>
+                                <div class="col-5">
+                                    <div t-field="o.partner_id" t-options-widget="'contact'"/>
+                                    <field t-field="o.partner_id.l10n_mx_edi_fiscal_regime"/>
+                                </div>
+                            </div>
+                            <div id="informations" class="row mt-4 mb-4">
+                                <div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_date" name="invoice_date">
+                                    <t t-if="o.move_type == 'out_invoice'"><strong>Invoice Date:</strong></t>
+                                    <t t-elif="o.move_type == 'out_refund'"><strong>Credit Note Date:</strong></t>
+                                    <t t-elif="o.move_type == 'out_receipt'"><strong>Receipt Date:</strong></t>
+                                    <t t-else=""><strong>Date:</strong></t>
+                                    <p class="m-0" t-field="o.invoice_date"/>
+                                </div>
+                                <div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_date_due and o.move_type == 'out_invoice' and o.state == 'posted'" name="due_date">
+                                    <strong>Due Date:</strong>
+                                    <p class="m-0" t-field="o.invoice_date_due"/>
+                                </div>
+                                <div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_origin" name="origin">
+                                    <strong>Source:</strong>
+                                    <p class="m-0" t-field="o.invoice_origin"/>
+                                </div>
+                                <div class="col-auto col-3 mw-100 mb-2" t-if="o.partner_id.ref" name="customer_code">
+                                    <strong>Customer Code:</strong>
+                                    <p class="m-0" t-field="o.partner_id.ref"/>
+                                </div>
+                                <div class="col-auto col-3 mw-100 mb-2" t-if="o.currency_id" name="currency">
+                                    <strong>Currency:</strong>
+                                    <p class="m-0" t-field="o.currency_id"/>
+                                </div>
+                                <t t-if="is_cfdi_signed">
+                                    <t t-set="original_o_grid_layout" t-value="o_grid_layout"/>
+                                    <t t-set="o_grid_layout" t-value="'col-auto col-3 mw-100 mb-2'"/>
+                                    <t t-if="cfdi_vals.get('usage')">
+                                        <div name="cfdi_vals['usage']" t-att-class="o_grid_layout">
+                                            <strong>Usage:</strong>
+                                            <p><span t-esc="cfdi_vals['usage']"/><span> - </span><span t-field="o.l10n_mx_edi_usage"/></p>
+                                        </div>
+                                    </t>
+                                    <t t-if="o.l10n_mx_edi_payment_method_id">
+                                        <div t-att-class="o_grid_layout">
+                                            <strong>Payment Way:</strong>
+                                            <p t-esc="'%s - %s' % (o.l10n_mx_edi_payment_method_id.code, o.l10n_mx_edi_payment_method_id.name)"/>
+                                        </div>
+                                    </t>
+                                    <div t-att-class="o_grid_layout">
+                                        <strong>Payment Method:</strong>
+                                        <p t-esc="cfdi_vals.get('payment_method')"/>
+                                    </div>
+                                    <div t-if="cfdi_vals.get('bank_account')" t-att-class="o_grid_layout">
+                                        <strong>Bank Account:</strong>
+                                        <p t-esc="cfdi_vals['bank_account']"/>
+                                    </div>
+                                    <t t-set="o_grid_layout" t-value="original_o_grid_layout"/>
+                                </t>
+                                <div class="col-auto col-3 mw-100 mb-2" t-if="o.ref" name="reference">
+                                    <strong>Reference:</strong>
+                                    <p class="m-0" t-field="o.ref"/>
+                                </div>
+                            </div>
+
+                            <t t-set="display_discount" t-value="any(l.discount for l in o.invoice_line_ids)"/>
+
+                            <table class="table table-sm o_main_table table-borderless" name="invoice_line_table">
+                                <thead>
+                                    <tr>
+                                        <th t-if="is_cfdi_signed">
+                                            <span>Product code</span>
+                                        </th>
+                                        <th name="th_description" class="text-start"><span>Description</span></th>
+                                        <th t-if="is_cfdi_signed" class="text-end">
+                                            <span>Unit code</span>
+                                        </th>
+                                        <th name="th_price_unit" t-if="display_discount" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
+                                            <span>Disc.%</span>
+                                        </th>
+                                        <th name="th_taxes" t-attf-class="text-start {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"><span>Taxes</span></th>
+                                        <th name="th_subtotal" class="text-end">
+                                            <span groups="account.group_show_line_subtotals_tax_excluded">Amount</span>
+                                            <span groups="account.group_show_line_subtotals_tax_included">Total Price</span>
+                                        </th>
+                                    </tr>
+                                </thead>
+                                <tbody class="invoice_tbody">
+                                    <t t-set="current_subtotal" t-value="0"/>
+                                    <t t-set="lines" t-value="o.invoice_line_ids.sorted(key=lambda l: (-l.sequence, l.date, l.move_name, -l.id), reverse=True)"/>
+
+                                    <t t-foreach="lines" t-as="line">
+                                        <t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
+                                        <t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
+
+                                        <tr t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''">
+                                            <t t-if="line.display_type == 'product'" name="account_invoice_line_accountable">
+                                                <td t-if="is_cfdi_signed"><span t-field="line.product_id.unspsc_code_id.code"/></td>
+                                                <td name="account_invoice_line_name"><span t-field="line.name" t-options="{'widget': 'text'}"/></td>
+                                                <td t-if="is_cfdi_signed" class="text-end"><span t-field="line.product_uom_id.unspsc_code_id.code"/></td>
+                                                <td t-if="display_discount" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
+                                                    <span class="text-nowrap" t-field="line.discount"/>
+                                                </td>
+                                                <td t-attf-class="text-start {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
+                                                    <span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))" id="line_tax_ids"/>
+                                                </td>
+                                                <td class="text-end o_price_total">
+                                                    <span class="text-nowrap" t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
+                                                    <span class="text-nowrap" t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
+                                                </td>
+                                            </t>
+                                            <t t-if="line.display_type == 'line_section'">
+                                                <td colspan="99">
+                                                    <span t-field="line.name" t-options="{'widget': 'text'}"/>
+                                                </td>
+                                                <t t-set="current_section" t-value="line"/>
+                                                <t t-set="current_subtotal" t-value="0"/>
+                                            </t>
+                                            <t t-if="line.display_type == 'line_note'">
+                                                <td colspan="99">
+                                                    <span t-field="line.name" t-options="{'widget': 'text'}"/>
+                                                </td>
+                                            </t>
+                                        </tr>
+
+                                        <t t-if="current_section and (line_last or lines[line_index+1].display_type == 'line_section')">
+                                            <tr class="is-subtotal text-end">
+                                                <td colspan="99">
+                                                    <strong class="mr16">Subtotal</strong>
+                                                    <span
+                                                        t-esc="current_subtotal"
+                                                        t-options='{"widget": "monetary", "display_currency": o.currency_id}'
+                                                    />
+                                                </td>
+                                            </tr>
+                                        </t>
+                                    </t>
+                                </tbody>
+                            </table>
+
+                        <div class="clearfix mb-4">
+                            <div id="total" class="row">
+                                <div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto">
+                                    <table class="table table-sm table-borderless" style="page-break-inside: avoid;">
+
+                                        <!--Tax totals-->
+                                        <t t-set="tax_totals" t-value="o.tax_totals"/>
+                                        <t t-call="account.document_tax_totals"/>
+
+                                        <!--Payments-->
+                                        <t t-if="print_with_payments">
+                                            <t t-if="o.payment_state != 'invoicing_legacy'">
+                                                <t t-set="payments_vals" t-value="o.sudo().invoice_payments_widget and o.sudo().invoice_payments_widget['content'] or []"/>
+                                                <t t-foreach="payments_vals" t-as="payment_vals">
+                                                    <tr t-if="payment_vals['is_exchange'] == 0">
+                                                        <td>
+                                                            <i class="oe_form_field text-end oe_payment_label">Paid on <t t-esc="payment_vals['date']" t-options='{"widget": "date"}'/></i>
+                                                        </td>
+                                                        <td class="text-end">
+                                                            <span t-esc="payment_vals['amount']" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
+                                                        </td>
+                                                    </tr>
+                                                </t>
+                                                <t t-if="len(payments_vals) > 0">
+                                                    <tr class="border-black fw-bold">
+                                                        <td>Amount Due</td>
+                                                        <td class="text-end">
+                                                            <span t-field="o.amount_residual"/>
+                                                        </td>
+                                                    </tr>
+                                                    </t>
+                                                </t>
+                                            </t>
+                                        </table>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                        <p t-if="o.move_type in ('out_invoice', 'in_refund') and o.payment_reference" name="payment_communication" class="mt-4">
+                            Please use the following communication for your payment : <b><span t-field="o.payment_reference"/></b>
+                        </p>
+                        <t t-set="payment_term_details" t-value="o.payment_term_details"/>
+                        <div t-field="o.invoice_payment_term_id.note" name="payment_term"/>
+                        <t t-if="o.invoice_payment_term_id.display_on_invoice and payment_term_details">
+                            <div t-if='o.show_payment_term_details' id="total_payment_term_details_table" class="row">
+                                <div t-attf-class="#{'col-7' if report_type != 'html' else 'col-sm-7 col-md-6'} mt-2 mb-2">
+                                    <table class="table table-sm" style="page-break-inside: avoid;">
+                                        <th class="border-black text-start">
+                                            Due Date
+                                        </th>
+                                        <th class="border-black text-end">
+                                            Amount Due
+                                        </th>
+                                        <th t-if="o.show_discount_details" class="border-black text-end">
+                                            Discount
+                                        </th>
+                                        <t t-foreach="payment_term_details" t-as="term">
+                                            <tr>
+                                                <td t-esc="term.get('date')" class="text-start"/>
+                                                <td t-options='{"widget": "monetary", "display_currency": o.currency_id}' t-esc="term.get('amount')" class="text-end"/>
+                                                <td t-if="term.get('discount_date')" class="text-end">
+                                                    <span t-options='{"widget": "monetary", "display_currency": o.currency_id}'
+                                                        t-esc="term.get('discount_amount_currency')"/> if paid before
+                                                    <span t-esc="term.get('discount_date')"/>
+                                                </td>
+                                            </tr>
+                                        </t>
+                                    </table>
+                                </div>
+                            </div>
+                        </t>
+                        <div t-if="not is_html_empty(o.narration)" name="comment">
+                            <span t-field="o.narration"/>
+                        </div>
+                        <t t-if="is_cfdi_signed">
+                            <p>
+                                <span t-esc="o._l10n_mx_edi_cfdi_amount_to_text()"/>
+                            </p>
+                        </t>
+                        <p t-if="not is_html_empty(o.fiscal_position_id.note)" name="note">
+                            <span t-field="o.fiscal_position_id.note"/>
+                        </p>
+                        <t t-if="is_cfdi_signed">
+                            <div class="row" id='complement'>
+                                <div t-if="cfdi_vals.get('sello')" class="barcode col-3">
+                                    <img alt="Barcode" t-att-src="'/report/barcode/?barcode_type=QR&amp;value=%s&amp;width=180&amp;height=180' % quote_plus(
+                                        'https://verificacfdi.facturaelectronica.sat.gob.mx/default.aspx?' + keep_query(
+                                            re=o.l10n_mx_edi_cfdi_supplier_rfc, rr=o.l10n_mx_edi_cfdi_customer_rfc,
+                                            tt='%.*f' % (o.currency_id.decimal_places, o.l10n_mx_edi_cfdi_amount), id=o.l10n_mx_edi_cfdi_uuid)
+                                            + '&amp;fe=%s' % quote_plus(
+                                                cfdi_vals['sello'][-8:], 'utf-8', 'strict', '=/').replace('%2B', '+'))"/>
+                                </div>
+                                <div class="complement-details col-9">
+                                    <div class="digital-stamp">
+                                        <span>Digital stamp of the emitter</span>
+                                    </div>
+                                    <div class="digital-stamp-content">
+                                        <span t-esc="cfdi_vals.get('sello')"/>
+                                    </div>
+                                    <div class="digital-stamp">
+                                        <span>Digital stamp SAT</span>
+                                    </div>
+                                    <div class="digital-stamp-content">
+                                        <span t-esc="cfdi_vals.get('sello_sat')"/>
+                                    </div>
+                                    <div class="digital-stamp">
+                                        <span>Original chain complement of digital certification SAT</span>
+                                    </div>
+                                    <div class="digital-stamp-content">
+                                        <span class="nowrap" t-esc="cfdi_vals.get('cadena')"/>
+                                    </div>
+                                    <div class="digital-stamp">
+                                        <span>Extra Info</span>
+                                    </div>
+                                    <div class="digital-stamp-content">
+                                        <span>Emitter certificate:</span> <span t-esc="cfdi_vals.get('certificate_number')"/>
+                                        <span> | SAT Certificate:</span> <span t-esc="cfdi_vals.get('certificate_sat_number')"/>
+                                        <span> | Expedition place:</span> <span t-esc="cfdi_vals.get('expedition')"/>
+                                        <span> | Fiscal Regime:</span><span t-esc="cfdi_vals.get('fiscal_regime')"/>
+                                        <span> | Emission Date:</span> <span t-esc="cfdi_vals.get('emission_date_str')"/>
+                                        <span> | Certification Date:</span> <span t-esc="cfdi_vals.get('stamp_date')"/>
+                                        <span> | Fiscal Folio:</span> <span t-esc="cfdi_vals.get('uuid')"/>
+                                    </div>
+                                    <div class="digital-stamp-content text-center">
+                                        <strong>This document is a printed representation of a CFDI</strong>
+                                    </div>
+                                </div>
+                            </div>
+                        </t>
+                        <p t-if="o.invoice_incoterm_id" name="incoterm">
+                            <strong>Incoterm: </strong><span t-field="o.invoice_incoterm_id.code"/> - <span t-field="o.invoice_incoterm_id.name"/>
+                        </p>
+                        <div id="qrcode" t-if="o.display_qr_code and o.amount_residual > 0">
+                            <t t-set="qr_code_url" t-value="o._generate_qr_code(silent_errors=True)"/>
+                            <p t-if="qr_code_url">
+                                <strong class="text-center">Scan me with your banking app.</strong><br/><br/>
+                                <img class="border border-dark rounded" t-att-src="qr_code_url"/>
+                            </p>
+                        </div>
+                    </div>
+                </t>
+            </t>
+        </t>
+    </template>
+</odoo>