Browse Source

Apr 03: [FIX] Bug Fixed 'invoice_format_editor'

pull/254/merge
RisvanaCybro 1 year ago
parent
commit
46eb66a708
  1. 2
      invoice_format_editor/__manifest__.py
  2. 5
      invoice_format_editor/doc/RELEASE_NOTES.md
  3. 122
      invoice_format_editor/reports/custom_invoice_template.xml
  4. 125
      invoice_format_editor/reports/custom_invoice_template_fantacy.xml
  5. 488
      invoice_format_editor/reports/custom_invoice_template_old_standard.xml

2
invoice_format_editor/__manifest__.py

@ -22,7 +22,7 @@
{
'name': 'Invoice Format Editor',
'version': '15.0.1.0.1',
'version': '15.0.1.1.1',
'category': 'Accounting',
'summary': 'Invoice Format Editor',
'description': """Invoice Format Editor For Configuring the Invoice Templates""",

5
invoice_format_editor/doc/RELEASE_NOTES.md

@ -10,3 +10,8 @@
#### UPDT AND BUGFIX
- Invoice printing issue
#### 03.04.2024
#### Version 15.0.1.1.1
##### UPDATE
- Bug Fix-Resolved the attribute error, updated the report templates

122
invoice_format_editor/reports/custom_invoice_template.xml

@ -102,28 +102,8 @@
<tr>
<td>
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id"/>
t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
<br/>
<span t-if="o.theme_id.address">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street"/>
<br/>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street2"/>
<br/>
</span>
<span t-if="o.theme_id.city">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.city"/>
<br/>
</span>
<span t-if="o.theme_id.country">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.country_id"/>
<br/>
</span>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.vat"/>
<br/>
@ -179,7 +159,7 @@
</tr>
</table>
<div class="page">
<div t-attf-style="padding:2%">
<div>
<h2>
<center>
<span t-if="o.move_type == 'out_invoice' and (o.state == 'draft' or o.state == 'posted')">
@ -318,11 +298,13 @@
</tbody>
</table>
</div>
<div>
<div class="clearfix mb-4">
<div class="col-4 pull-right">
<table class="table table-condensed">
<t t-set="tax_totals" t-value="json.loads(o.tax_totals_json)"/>
<t t-foreach="tax_totals['subtotals']" t-as="subtotal">
<t t-set="tax_totals"
t-value="json.loads(o.tax_totals_json)"/>
<t t-foreach="tax_totals['subtotals']"
t-as="subtotal">
<tr class="border-black o_subtotal">
<td>
<strong t-esc="subtotal['name']"/>
@ -337,7 +319,8 @@
</td>
</tr>
<t t-set="subtotal_to_show" t-value="subtotal['name']"/>
<t t-set="subtotal_to_show"
t-value="subtotal['name']"/>
<t t-call="account.tax_groups_totals"/>
</t>
@ -353,60 +336,52 @@
</tr>
</table>
</div>
</div>
<div style="padding-top:10%;" class="col-12">
<p t-if="not is_html_empty(o.narration)">
<strong>Comment:</strong>
<span t-field="o.narration"/>
</p>
<p t-if="o.fiscal_position_id.note">
<strong>Fiscal Position Remark:</strong>
<span t-field="o.fiscal_position_id.note"/>
</p>
<br/>
<br/>
<p t-if="o.move_type in ('out_invoice','in_refund')">
Please use the following communication for your
payment :
<b>
<span t-field="o.payment_reference"/>
</b>
</p>
<p t-if="o.invoice_payment_term_id" name="payment_term">
<span t-field="o.invoice_payment_term_id.note"/>
</p>
<p t-if="o.fiscal_position_id.note" name="note">
<span t-field="o.fiscal_position_id.note"/>
</p>
<t t-if="o.company_id.country_id.code == 'IN'">
<p id="total_in_words" class="mb16">
<strong>Total (In Words):</strong>
<span t-field="o.amount_total_words"/>
<div style="padding-top:15%;" class="col-12">
<p t-if="o.move_type in ('out_invoice', 'in_refund') and o.payment_reference"
name="payment_communication">
Please use the following communication for your
payment :
<b>
<span t-field="o.payment_reference"/>
</b>
</p>
</t>
<div id="qrcode"
t-if="(o.company_id.qr_code) and (o.currency_id.name == 'EUR') and (o.invoice_partner_bank_id.acc_number != False)">
<p t-if="(o.invoice_partner_bank_id.qr_code_valid)">
<strong class="text-center">Scan me with your
banking app.
</strong>
<br/>
<br/>
<img class="border border-dark rounded"
t-att-src="o.invoice_partner_bank_id.build_qr_code_url(o.amount_residual, o.ref or o.name)"/>
<p t-if="o.invoice_payment_term_id"
name="payment_term">
<span t-field="o.invoice_payment_term_id.note"/>
</p>
<div t-if="not is_html_empty(o.narration)"
name="comment">
<span t-field="o.narration"/>
</div>
<p t-if="not is_html_empty(o.fiscal_position_id.note)"
name="note">
<span t-field="o.fiscal_position_id.note"/>
</p>
<p t-if="(o.invoice_partner_bank_id.qr_code_valid == False)">
<strong class="text-center">The SEPA QR Code
informations are not set correctly.
</strong>
<br/>
<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">
<p t-if="qr_code_urls.get(o.id)">
<strong class="text-center">Scan me with
your banking app.
</strong>
<br/>
<br/>
<img class="border border-dark rounded"
t-att-src="qr_code_urls[o.id]"/>
</p>
</div>
</div>
</div>
</div>
</t>
</template>
<template id="report_invoice_with_payments_inherit" inherit_id="account.report_invoice_with_payments">
<template id="report_invoice_with_payments_inherit"
inherit_id="account.report_invoice_with_payments">
<xpath expr="//t[@t-call='web.html_container']" position="replace">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
@ -433,7 +408,8 @@
</t>
</xpath>
</template>
<template id="report_invoice_inherit" inherit_id="account.report_invoice">
<template id="report_invoice_inherit"
inherit_id="account.report_invoice">
<xpath expr="//t[@t-call='web.html_container']" position="replace">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">

125
invoice_format_editor/reports/custom_invoice_template_fantacy.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!--modern Template View-->
<!--modern Template View-->
<template id="custom_template_report_invoice_modern">
<t t-if="o and 'company_id' in o">
<t t-set="company" t-value="o.company_id"/>
@ -130,26 +130,8 @@
<strong>Customer Address</strong>
<br/>
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id"/>
t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
<br/>
<span t-if="o.theme_id.address">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street"/>
<br/>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street2"/>
<br/>
</span>
<span t-if="o.theme_id.city">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.city"/>
</span>
<br/>
<span t-if="o.theme_id.country">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.country_id"/>
</span>
<br/>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.vat"/>
<br/>
@ -251,11 +233,13 @@
</tbody>
</table>
</div>
<div>
<div class="clearfix mb-4">
<div class="col-4 pull-right">
<table class="table table-condensed">
<t t-set="tax_totals" t-value="json.loads(o.tax_totals_json)"/>
<t t-foreach="tax_totals['subtotals']" t-as="subtotal">
<t t-set="tax_totals"
t-value="json.loads(o.tax_totals_json)"/>
<t t-foreach="tax_totals['subtotals']"
t-as="subtotal">
<tr class="border-black o_subtotal">
<td>
<strong t-esc="subtotal['name']"/>
@ -263,14 +247,15 @@
<td class="text-right">
<span
t-att-class="oe_subtotal_footer_separator"
t-esc="subtotal['amount']"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'
t-att-class="oe_subtotal_footer_separator"
t-esc="subtotal['amount']"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'
/>
</td>
</tr>
<t t-set="subtotal_to_show" t-value="subtotal['name']"/>
<t t-set="subtotal_to_show"
t-value="subtotal['name']"/>
<t t-call="account.tax_groups_totals"/>
</t>
@ -280,61 +265,51 @@
<strong>Total</strong>
</td>
<td class="text-right">
<span t-esc="tax_totals['amount_total']" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
<span t-esc="tax_totals['amount_total']"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</table>
</div>
</div>
<div style="padding-top:10%;" class="col-12">
<p t-if="not is_html_empty(o.narration)">
<strong>Comment:</strong>
<span t-field="o.narration"/>
</p>
<p t-if="o.fiscal_position_id.note">
<strong>Fiscal Position Remark:</strong>
<span t-field="o.fiscal_position_id.note"/>
</p>
<br/>
<br/>
<p t-if="o.move_type in ('out_invoice','in_refund')">
Please use the following communication for your
payment
:
<b>
<span t-field="o.payment_reference"/>
</b>
</p>
<p t-if="o.invoice_payment_term_id" name="payment_term">
<span t-field="o.invoice_payment_term_id.note"/>
</p>
<p t-if="o.fiscal_position_id.note" name="note">
<span t-field="o.fiscal_position_id.note"/>
</p>
<t t-if="o.company_id.country_id.code == 'IN'">
<p id="total_in_words" class="mb16">
<strong>Total (In Words):</strong>
<span t-field="o.amount_total_words"/>
<div style="padding-top:15%;" class="col-12">
<p t-if="o.move_type in ('out_invoice', 'in_refund') and o.payment_reference"
name="payment_communication">
Please use the following communication for your
payment :
<b>
<span t-field="o.payment_reference"/>
</b>
</p>
<p t-if="o.invoice_payment_term_id"
name="payment_term">
<span t-field="o.invoice_payment_term_id.note"/>
</p>
</t>
<div id="qrcode"
t-if="(o.company_id.qr_code) and (o.currency_id.name == 'EUR') and (o.invoice_partner_bank_id.acc_number != False)">
<p t-if="(o.invoice_partner_bank_id.qr_code_valid)">
<strong class="text-center">Scan me with your
banking app.
</strong>
<br/>
<br/>
<img class="border border-dark rounded"
t-att-src="o.invoice_partner_bank_id.build_qr_code_url(o.amount_residual, o.ref or o.name)"/>
<div t-if="not is_html_empty(o.narration)"
name="comment">
<span t-field="o.narration"/>
</div>
<p t-if="not is_html_empty(o.fiscal_position_id.note)"
name="note">
<span t-field="o.fiscal_position_id.note"/>
</p>
<p t-if="(o.invoice_partner_bank_id.qr_code_valid == False)">
<strong class="text-center">The SEPA QR Code
informations are not set
correctly.
</strong>
<br/>
<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">
<p t-if="qr_code_urls.get(o.id)">
<strong class="text-center">Scan me with
your banking app.
</strong>
<br/>
<br/>
<img class="border border-dark rounded"
t-att-src="qr_code_urls[o.id]"/>
</p>
</div>
</div>
</div>
</div>

488
invoice_format_editor/reports/custom_invoice_template_old_standard.xml

@ -1,6 +1,6 @@
<odoo>
<data>
<!--old Template View-->
<!--old Template View-->
<template id="old_std_report_invoice_document">
<t t-if="o and 'company_id' in o">
<t t-set="company" t-value="o.company_id"/>
@ -15,254 +15,310 @@
t-att-src="'data:image/png;base64,%s' % to_text(company.logo)"
style="max-height: 80px;"/>
</div>
<div t-attf-class="pull-#{o.theme_id.company_position} "
t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;">
<span t-field="company.partner_id"/>
<br/>
<span t-field="company.partner_id.street"/>
<br/>
<span t-field="company.partner_id.street2"/>
<br/>
<span t-field="company.partner_id.city"/>
<br/>
<span t-field="company.partner_id.country_id"/>
<br/>
<span t-field="company.partner_id.vat"/>
<br/>
</div>
</div>
</div>
</div>
<t t-call="web.external_layout">
<t t-set="o"
t-value="o.with_context({'lang':o.partner_id.lang})"/>
<div class="page">
<div class=" row mt32 mb32">
<div class="col-12" style="padding-top:20px;">
<div t-attf-class=" pull-#{o.theme_id.customer_position} text-#{o.theme_id.customer_position}"
style="font:15px lucida-console,sans-serif !important;">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id"/>
<br/>
<span t-if="o.theme_id.address">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street"/>
<br/>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street2"/>
</span>
<br/>
<span t-if="o.theme_id.city">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.city"/>
</span>
<br/>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.state_id"/>
<br/>
<span t-if="o.theme_id.country">
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.country_id"/>
</span>
<br/>
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.vat"/>
<br/>
<div id="customer_address"
t-attf-style="color:#{o.theme_id.customer_text_color}">
<div class="row">
<div t-attf-class="col-12 text-#{o.theme_id.customer_position} ">
<div itemprop="address" class="address">
<div>
<span t-if="o.partner_id">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
</span>
</div>
<div>
<span t-if="o.partner_id.vat">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.vat"/>
</span>
</div>
</div>
</div>
<div t-attf-class="pull-right"
t-attf-style="font:15px lucida-console,sans-serif !important;background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};padding:2%">
<h2>
<span t-if="o.move_type == 'out_invoice' and (o.state == 'draft' or o.state == 'posted')">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
Invoice
</font>
</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'proforma2'">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
PRO-FORMA
</font>
</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'draft'">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
Draft Invoice
</font>
</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'cancel'">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
Cancelled
Invoice
</font>
</span>
<span t-if="o.move_type == 'out_refund'">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
Refund
</font>
</span>
<span t-if="o.move_type == 'in_refund'">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
Vendor Refund
</font>
</span>
<span t-if="o.move_type == 'in_invoice'">
<font t-attf-style="color:#{o.theme_id.text_color}">
Vendor Bill
</font>
</span>
</div>
</div>
<br/>
<div class="page">
<div
t-attf-style="font:15px lucida-console,sans-serif !important;background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};padding:2%">
<h2>
<span t-if="o.move_type == 'out_invoice' and (o.state == 'draft' or o.state == 'posted')">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
<span t-field="o.name"/>
Invoice
</font>
</h2>
<div t-if="o.invoice_date">
</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'proforma2'">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
<strong>Invoice Date:</strong>
<p t-field="o.invoice_date"/>
PRO-FORMA
</font>
</div>
<div t-if="o.name">
</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'draft'">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
<strong>Due Date:</strong>
<p t-field="o.invoice_date_due"/>
Draft Invoice
</font>
</div>
<div t-if="o.theme_id.reference">
<div t-if="o.ref">
</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'cancel'">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
<strong>Reference:</strong>
<p t-field="o.ref"/>
Cancelled
Invoice
</font>
</div>
</div>
<div t-if="o.theme_id.source">
<div t-if="o.invoice_origin">
</span>
<span t-if="o.move_type == 'out_refund'">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
<strong>Source:</strong>
<p t-field="o.invoice_origin"/>
Refund
</font>
</div>
</span>
<span t-if="o.move_type == 'in_refund'">
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
Vendor Refund
</font>
</span>
<span t-if="o.move_type == 'in_invoice'">
<font t-attf-style="color:#{o.theme_id.text_color}">
Vendor Bill
</font>
</span>
<font t-attf-style="color:#{o.theme_id.heading_text_color}">
<span t-field="o.name"/>
</font>
</h2>
<br/>
<div id="invoice_information">
<div class="row mt32 mb32" id="informations">
<div class="col-auto col-3 mw-100 mb-2"
t-if="o.invoice_date"
name="invoice_date">
<strong t-attf-style="color:#{o.theme_id.heading_text_color}">
Invoice Date:
</strong>
<p class="m-0"
t-attf-style="color:#{o.theme_id.text_color}"
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 t-attf-style="color:#{o.theme_id.heading_text_color}">
Due Date:
</strong>
<p class="m-0"
t-attf-style="color:#{o.theme_id.text_color}"
t-field="o.invoice_date_due"/>
</div>
<div class="col-auto col-3 mw-100 mb-2"
t-if="o.invoice_payment_term_id"
name="payment_term">
<strong t-attf-style="color:#{o.theme_id.heading_text_color}">
Payment Term:
</strong>
<p class="m-0"
t-attf-style="color:#{o.theme_id.text_color}"
t-field="o.invoice_payment_term_id"/>
</div>
<!--optional information-->
<div class="col-auto col-3 mw-100 mb-2"
t-if="o.user_id">
<div t-if="o.theme_id.sales_person">
<font t-attf-style="color:#{o.theme_id.text_color}">
<strong t-attf-style="color:#{o.theme_id.heading_text_color}">
Sales Person:
</strong>
<p t-field="o.user_id"/>
</font>
</div>
</div>
<div class="col-auto col-3 mw-100 mb-2"
t-if="o.ref">
<div t-if="o.theme_id.reference">
<font t-attf-style="color:#{o.theme_id.text_color}">
<strong t-attf-style="color:#{o.theme_id.heading_text_color}">
Customer Reference:
</strong>
<p t-field="o.ref"/>
</font>
</div>
</div>
<div class="col-auto col-3 mw-100 mb-2"
t-if="o.invoice_origin">
<div t-if="o.theme_id.source">
<font t-attf-style="color:#{o.theme_id.text_color}">
<strong t-attf-style="color:#{o.theme_id.heading_text_color}">
Source:
</strong>
<p t-field="o.invoice_origin"/>
</font>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="padding-top:20px;"/>
<t t-set="display_discount"
t-value="any([l.discount for l in o.invoice_line_ids])"/>
<table class="table table-sm">
<thead>
<tr>
<th t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}">
Product
</th>
<span t-if="o.theme_id.description">
<div style="padding-top:20px;"/>
<t t-set="display_discount"
t-value="any([l.discount for l in o.invoice_line_ids])"/>
<table class="table table-sm">
<thead>
<tr>
<th t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}">
Description
Product
</th>
</span>
<th t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}">
Quantity
</th>
<th t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}">
Unit Price
</th>
<th t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}"
t-if="display_discount" class="text-right"
groups="sale.group_discount_per_so_line">
Disc.(%)
</th>
<span t-if="o.theme_id.tax_value">
<span t-if="o.theme_id.description">
<th t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}">
Description
</th>
</span>
<th t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}">
Taxes
Quantity
</th>
</span>
<th t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}">
Price
</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tr t-foreach="o.invoice_line_ids" t-as="l">
<td t-if="l.product_id.name">
<span t-field="l.product_id.name"/>
</td>
<span t-if="o.theme_id.description">
<td t-if="l.name">
<span t-field="l.name"/>
</td>
</span>
<td class="text-right" t-if="l.quantity">
<span t-field="l.quantity"/>
<span t-field="l.uom_id"
groups="product.group_uom"/>
</td>
<td class="text-right" t-if="l.price_unit">
<span t-field="l.price_unit"/>
</td>
<td t-if="l.discount" class="text-right"
groups="sale.group_discount_per_so_line">
<span t-field="l.discount"/>
</td>
<span t-if="o.theme_id.tax_value">
<td>
<span t-esc="', '.join(map(lambda x: (x.description or x.name), l.tax_ids))"/>
<th t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}">
Unit Price
</th>
<th t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}"
t-if="display_discount"
class="text-right"
groups="sale.group_discount_per_so_line">
Disc.(%)
</th>
<span t-if="o.theme_id.tax_value">
<th t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}">
Taxes
</th>
</span>
<th t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}">
Price
</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tr t-foreach="o.invoice_line_ids" t-as="l">
<td t-if="l.product_id.name">
<span t-field="l.product_id.name"/>
</td>
</span>
<td class="text-right" t-if="l.price_subtotal">
<span t-field="l.price_subtotal"
t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
</td>
</tr>
</tbody>
</table>
<div>
<div class="col-4 pull-right">
<table class="table table-condensed">
<t t-set="tax_totals" t-value="json.loads(o.tax_totals_json)"/>
<t t-foreach="tax_totals['subtotals']" t-as="subtotal">
<tr class="border-black o_subtotal">
<td>
<strong t-esc="subtotal['name']"/>
<span t-if="o.theme_id.description">
<td t-if="l.name">
<span t-field="l.name"/>
</td>
<td class="text-right">
<span
t-att-class="oe_subtotal_footer_separator"
t-esc="subtotal['amount']"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'
/>
</td>
</tr>
<t t-set="subtotal_to_show" t-value="subtotal['name']"/>
<t t-call="account.tax_groups_totals"/>
</t>
<!--Total amount with all taxes-->
<tr class="border-black o_total"
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}">
<td>
<strong>Total</strong>
</span>
<td class="text-right" t-if="l.quantity">
<span t-field="l.quantity"/>
<span t-field="l.uom_id"
groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-esc="tax_totals['amount_total']"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
<td class="text-right" t-if="l.price_unit">
<span t-field="l.price_unit"/>
</td>
</tr>
<tr class="border-black">
<td>
<strong>Amount Due</strong>
<td t-if="l.discount" class="text-right"
groups="sale.group_discount_per_so_line">
<span t-field="l.discount"/>
</td>
<td class="text-right">
<span t-field="o.amount_residual"
<span t-if="o.theme_id.tax_value">
<td>
<span t-esc="', '.join(map(lambda x: (x.description or x.name), l.tax_ids))"/>
</td>
</span>
<td class="text-right"
t-if="l.price_subtotal">
<span t-field="l.price_subtotal"
t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
</td>
</tr>
</table>
</tbody>
</table>
<div class="clearfix mb-4">
<div class="col-4 pull-right">
<table class="table table-condensed">
<t t-set="tax_totals"
t-value="json.loads(o.tax_totals_json)"/>
<t t-foreach="tax_totals['subtotals']"
t-as="subtotal">
<tr class="border-black o_subtotal">
<td>
<strong t-esc="subtotal['name']"/>
</td>
<td class="text-right">
<span
t-att-class="oe_subtotal_footer_separator"
t-esc="subtotal['amount']"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'
/>
</td>
</tr>
<t t-set="subtotal_to_show"
t-value="subtotal['name']"/>
<t t-call="account.tax_groups_totals"/>
</t>
<!--Total amount with all taxes-->
<tr class="border-black o_total"
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color}">
<td>
<strong>Total</strong>
</td>
<td class="text-right">
<span t-esc="tax_totals['amount_total']"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr class="border-black">
<td>
<strong>Amount Due</strong>
</td>
<td class="text-right">
<span t-field="o.amount_residual"
t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
</td>
</tr>
</table>
</div>
<div style="padding-top:15%;" class="col-12">
<p t-if="o.move_type in ('out_invoice', 'in_refund') and o.payment_reference"
name="payment_communication">
Please use the following communication for
your
payment :
<b>
<span t-field="o.payment_reference"/>
</b>
</p>
<p t-if="o.invoice_payment_term_id"
name="payment_term">
<span t-field="o.invoice_payment_term_id.note"/>
</p>
<div t-if="not is_html_empty(o.narration)"
name="comment">
<span t-field="o.narration"/>
</div>
<p t-if="not is_html_empty(o.fiscal_position_id.note)"
name="note">
<span t-field="o.fiscal_position_id.note"/>
</p>
<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">
<p t-if="qr_code_urls.get(o.id)">
<strong class="text-center">Scan me with
your banking app.
</strong>
<br/>
<br/>
<img class="border border-dark rounded"
t-att-src="qr_code_urls[o.id]"/>
</p>
</div>
</div>
</div>
</div>
<br/>
<br/>
<br/>
<br/>
<br/>
</div>
</t>
</template>

Loading…
Cancel
Save