Browse Source

Apr 03: [FIX] Bug Fixed 'invoice_format_editor'

pull/278/merge
RisvanaCybro 1 year ago
parent
commit
e69ebc00b7
  1. 2
      invoice_format_editor/__manifest__.py
  2. 5
      invoice_format_editor/doc/RELEASE_NOTES.md
  3. 544
      invoice_format_editor/reports/modern_invoice_templates.xml
  4. 150
      invoice_format_editor/reports/normal_invoice_templates.xml
  5. 463
      invoice_format_editor/reports/old_standard_invoice_templates.xml

2
invoice_format_editor/__manifest__.py

@ -21,7 +21,7 @@
#############################################################################
{
'name': 'Invoice Format Editor',
'version': '16.0.2.0.0',
'version': '16.0.2.1.0',
'category': 'Accounting',
'summary': 'Invoice Format Editor',
'description': """Invoice Format Editor For Configuring the Invoice

5
invoice_format_editor/doc/RELEASE_NOTES.md

@ -4,3 +4,8 @@
#### Version 16.0.1.0.0
#### ADD
- Initial commit for Invoice Format Editor
#### 03.04.2024
#### Version 16.0.2.1.0
##### UPDATE
- Bug Fix-Resolved the attribute error, updated the report templates

544
invoice_format_editor/reports/modern_invoice_templates.xml

@ -6,16 +6,22 @@
<!--External layout template-->
<t t-call="web.external_layout">
<!--Invoice Reference-->
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})"/>
<t t-set="o"
t-value="o.with_context({'lang':o.partner_id.lang})"/>
<t t-set="model" t-value="'account.move'"/>
<div class="page" style="overflow: hidden;">
<br/><br/><br/><br/>
<div class="page" style="overflow: hidden;">
<br/>
<br/>
<br/>
<br/>
<!--Invoice details-->
<div class="row">
<div t-attf-style=" background-color:#{o.theme_id.base_color};padding:2% ;color:#{o.theme_id.customer_text_color};">
<h2 t-attf-style="color:#{o.theme_id.heading_text_color};">
<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>
<h2 t-attf-style="color:#{o.theme_id.heading_text_color};">
<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}">
@ -49,125 +55,107 @@
</span>
<font>
<span t-field="o.name" t-attf-style="color:#{o.theme_id.heading_text_color};"/>
<span t-field="o.name"
t-attf-style="color:#{o.theme_id.heading_text_color};"/>
</font>
</h2><br/>
<!--Invoice information-->
<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}">
</h2>
<br/>
<!--Invoice information-->
<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}">
Sales Person:
Invoice Date:
</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}">
<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}">
Customer Reference:
Due Date:
</strong>
<p t-field="o.ref"/>
</font>
</div>
</div>
<div class="col-auto col-3 mw-100 mb-2"
t-if="o.source_id">
<div t-if="o.theme_id.source">
<font t-attf-style="color:#{o.theme_id.text_color}">
<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}">
Source:
Payment Term:
</strong>
<p t-field="o.source_id"/>
</font>
<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.source_id">
<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.source_id"/>
</font>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div><br/>
<br/>
<!--Customer Address-->
<div t-if="o.theme_id.address"
id="customer address"
t-attf-style="color:#{o.theme_id.customer_text_color}">
<div class="row">
<div style="width:50%;"
t-attf-class="{{'ms-auto' if o.theme_id.customer_position == 'right' else ''}}">
<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"/>
</span>
</div>
<div>
<span t-if="o.partner_id.street">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street"/>
</span>
</div>
<div>
<span t-if="o.partner_id.street2">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street2"/>
</span>
</div>
<div t-if="o.theme_id.city">
<span t-if="o.partner_id.city">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.city"/>
</span>
</div>
<div t-if="o.theme_id.country">
<span t-if="o.partner_id.country_id">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.country_id"/>
</span>
</div>
<div t-if="o.theme_id.vat">
<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 style="width:50%;"
t-attf-class="{{'ms-auto' if o.theme_id.customer_position == 'right' else ''}}">
<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 t-if="o.theme_id.vat">
<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>
</div>
</div>
<!--Product Table-->
<div style="padding-top:20px;width:100%">
@ -175,108 +163,121 @@
t-value="any([l.discount for l in o.invoice_line_ids])"/>
<!--Product Details-->
<table class="table table-sm table-borderless">
<tr>
<th class="text-right"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Product
</th>
<th class="text-right"
t-if="o.theme_id.description"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Description
</th>
<th class="text-left"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Quantity
</th>
<th class="text-left"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Unit Price
</th>
<th t-if="display_discount"
class="text-left"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Disc.(%)
</th>
<th t-if="o.theme_id.tax_value"
class="text-center"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Taxes
</th>
<th class="text-left"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Price
</th>
</tr>
<tr t-foreach="o.invoice_line_ids" t-as="l">
<td class="text-right"
t-attf-style="color:#{o.theme_id.text_color};">
<span t-field="l.product_id.name"/>
</td>
<td t-if="o.theme_id.description"
class="text-right"
t-attf-style="color:#{o.theme_id.text_color};">
<span t-field="l.name"/>
</td>
<td class="text-end"
t-attf-style="color:#{o.theme_id.text_color};">
<t t-if="l.quantity">
<span t-field="l.quantity"/>
</t>
</td>
<td class="text-end"
t-attf-style="color:#{o.theme_id.text_color};">
<t t-if="l.price_unit">
<span t-field="l.price_unit"/>
</t>
</td>
<td t-if="display_discount"
class="text-end"
t-attf-style="color:#{o.theme_id.text_color};">
<span t-field="l.discount"/>
</td>
<td t-if="(o.theme_id.tax_value) and (l.tax_ids)"
class="text-end"
t-attf-style="color:#{o.theme_id.text_color};">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), l.tax_ids))"/>
</td>
<td t-if="l.price_subtotal"
class="text-end"
t-attf-style="color:#{o.theme_id.text_color};">
<span t-field="l.price_subtotal"
t-field-options="{'widget': 'monetary','display_currency':'o.currency_id'}"/>
</td>
</tr>
<tr>
<th class="text-right"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Product
</th>
<th class="text-right"
t-if="o.theme_id.description"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Description
</th>
<th class="text-left"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Quantity
</th>
<th class="text-left"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Unit Price
</th>
<th t-if="display_discount"
class="text-left"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Disc.(%)
</th>
<th t-if="o.theme_id.tax_value"
class="text-center"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Taxes
</th>
<th class="text-left"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
Price
</th>
</tr>
<tr t-foreach="o.invoice_line_ids" t-as="l">
<td class="text-right"
t-attf-style="color:#{o.theme_id.text_color};">
<span t-field="l.product_id.name"/>
</td>
<td t-if="o.theme_id.description"
class="text-right"
t-attf-style="color:#{o.theme_id.text_color};">
<span t-field="l.name"/>
</td>
<td class="text-end"
t-attf-style="color:#{o.theme_id.text_color};">
<t t-if="l.quantity">
<span t-field="l.quantity"/>
</t>
</td>
<td class="text-end"
t-attf-style="color:#{o.theme_id.text_color};">
<t t-if="l.price_unit">
<span t-field="l.price_unit"/>
</t>
</td>
<td t-if="display_discount"
class="text-end"
t-attf-style="color:#{o.theme_id.text_color};">
<span t-field="l.discount"/>
</td>
<td t-if="(o.theme_id.tax_value) and (l.tax_ids)"
class="text-end"
t-attf-style="color:#{o.theme_id.text_color};">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), l.tax_ids))"/>
</td>
<td t-if="l.price_subtotal"
class="text-end"
t-attf-style="color:#{o.theme_id.text_color};">
<span t-field="l.price_subtotal"
t-field-options="{'widget': 'monetary','display_currency':'o.currency_id'}"/>
</td>
</tr>
</table>
<!--Payment details-->
<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;">
<table class="table table-sm table-borderless"
style="page-break-inside: avoid;">
<tbody>
<tr class="border-black o_subtotal" style="">
<t t-set="tax_totals" t-value="o.tax_totals"/>
<t t-foreach="tax_totals['subtotals']" t-as="subtotal">
<tr class="border-black o_subtotal"
t-attf-style="color:#{o.theme_id.text_color};">
<td t-attf-style="color:#{o.theme_id.text_color};">
<strong t-esc="subtotal['name']" t-attf-style="color:#{o.theme_id.text_color};"/>
</td>
<td class="text-end" t-attf-style="color:#{o.theme_id.text_color};">
<span t-att-class="oe_subtotal_footer_separator"
t-attf-style="color:#{o.theme_id.text_color};"
t-esc="subtotal['formatted_amount']"/>
</td>
</tr>
<t t-set="subtotal_to_show" t-value="subtotal['name']"/>
<t t-call="account.tax_groups_totals" t-attf-style="color:#{o.theme_id.text_color};"/>
<tr class="border-black o_subtotal"
style="">
<t t-set="tax_totals"
t-value="o.tax_totals"/>
<t t-foreach="tax_totals['subtotals']"
t-as="subtotal">
<tr class="border-black o_subtotal"
t-attf-style="color:#{o.theme_id.text_color};">
<td t-attf-style="color:#{o.theme_id.text_color};">
<strong t-esc="subtotal['name']"
t-attf-style="color:#{o.theme_id.text_color};"/>
</td>
<td class="text-end"
t-attf-style="color:#{o.theme_id.text_color};">
<span t-att-class="oe_subtotal_footer_separator"
t-attf-style="color:#{o.theme_id.text_color};"
t-esc="subtotal['formatted_amount']"/>
</td>
</tr>
<t t-set="subtotal_to_show"
t-value="subtotal['name']"/>
<t t-call="account.tax_groups_totals"
t-attf-style="color:#{o.theme_id.text_color};"/>
</t>
</tr>
<!--Total amount with all taxes-->
<tr class="border-black o_total">
<td><strong t-attf-style="color:#{o.theme_id.customer_text_color}">Total</strong></td>
<td>
<strong t-attf-style="color:#{o.theme_id.customer_text_color}">
Total
</strong>
</td>
<td class="text-end">
<span t-esc="tax_totals['formatted_amount_total']" t-attf-style="color:#{o.theme_id.customer_text_color}"/>
<span t-esc="tax_totals['formatted_amount_total']"
t-attf-style="color:#{o.theme_id.customer_text_color}"/>
</td>
</tr>
<!--Paid amount details-->
@ -284,16 +285,21 @@
<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">
<t t-foreach="payments_vals"
t-as="payment_vals">
<tr>
<td>
<i class="oe_form_field text-end oe_payment_label" t-attf-style="color:#{o.theme_id.text_color}">Paid on
<t
t-esc="payment_vals['date']"
t-options='{"widget": "date"}' t-attf-style="color:#{o.theme_id.text_color}"/>
</i>
<i class="oe_form_field text-end oe_payment_label"
t-attf-style="color:#{o.theme_id.text_color}">
Paid on
<t
t-esc="payment_vals['date']"
t-options='{"widget": "date"}'
t-attf-style="color:#{o.theme_id.text_color}"/>
</i>
</td>
<td class="text-end" t-attf-style="color:#{o.theme_id.text_color}">
<td class="text-end"
t-attf-style="color:#{o.theme_id.text_color}">
<span t-esc="payment_vals['amount']"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
@ -302,10 +308,13 @@
<t t-if="len(payments_vals) > 0">
<tr class="border-black o_total">
<td>
<strong t-attf-style="color:#{o.theme_id.customer_text_color}">Amount Due</strong>
<strong t-attf-style="color:#{o.theme_id.customer_text_color}">
Amount Due
</strong>
</td>
<td class="text-end">
<span t-field="o.amount_residual" t-attf-style="color:#{o.theme_id.customer_text_color}"/>
<span t-field="o.amount_residual"
t-attf-style="color:#{o.theme_id.customer_text_color}"/>
</td>
</tr>
</t>
@ -315,47 +324,88 @@
</table>
</div>
</div>
</div>
</div>
<br/><br/><br/><br/>
<div t-attf-style="color:#{o.theme_id.text_color};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>
<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"/>
</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>
<p t-if="(o.invoice_partner_bank_id.qr_code_valid == False)">
<strong class="text-center">The SEPA QR Code information are not set correctly.
</strong>
<br/>
</p>
<div t-attf-style="color:#{o.theme_id.text_color};padding-top:5%;"
class="col-12">
<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>
<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">
<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>
</div>
</div>
</div>

150
invoice_format_editor/reports/normal_invoice_templates.xml

@ -24,31 +24,7 @@
<div>
<span t-if="o.partner_id">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id"/>
</span>
</div>
<div>
<span t-if="o.partner_id.street">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street"/>
</span>
</div>
<div>
<span t-if="o.partner_id.street2">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street2"/>
</span>
</div>
<div t-if="o.theme_id.city">
<span t-if="o.partner_id.city">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.city"/>
</span>
</div>
<div t-if="o.theme_id.country">
<span t-if="o.partner_id.country_id">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.country_id"/>
t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
</span>
</div>
<div t-if="o.theme_id.vat">
@ -322,53 +298,91 @@
</table>
</div>
</div>
</div>
<!--More description-->
<div t-attf-style="color:#{o.theme_id.text_color};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>
<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"/>
</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>
<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>
<p t-if="(o.invoice_partner_bank_id.qr_code_valid == False)">
<strong class="text-center">The SEPA QR Code
information are not set correctly.
</strong>
</p>
<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>
<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">
<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>
</div>
</div>
</div>
</t>
</template>
</data>

463
invoice_format_editor/reports/old_standard_invoice_templates.xml

@ -10,62 +10,39 @@
<t t-set="company" t-value="res_company"/>
</t>
<t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})"/>
<t t-set="o"
t-value="o.with_context({'lang':o.partner_id.lang})"/>
<div class="page">
<!--Customer Address-->
<div t-if="o.theme_id.address"
id="customer address"
t-attf-style="color:#{o.theme_id.customer_text_color}">
<div class="row">
<div style="width:50%;"
t-attf-class="{{'ms-auto' if o.theme_id.customer_position == 'right' else ''}}">
<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"/>
</span>
</div>
<div>
<span t-if="o.partner_id.street">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street"/>
</span>
</div>
<div>
<span t-if="o.partner_id.street2">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.street2"/>
</span>
</div>
<div t-if="o.theme_id.city">
<span t-if="o.partner_id.city">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.city"/>
</span>
</div>
<div t-if="o.theme_id.country">
<span t-if="o.partner_id.country_id">
<span style="color:#{o.theme_id.customer_text_color} !important;"
t-field="o.partner_id.country_id"/>
</span>
</div>
<div t-if="o.theme_id.vat">
<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 style="width:50%;"
t-attf-class="{{'ms-auto' if o.theme_id.customer_position == 'right' else ''}}">
<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 t-if="o.theme_id.vat">
<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>
</div>
</div>
<br/><br/>
<br/>
<!--Invoice details-->
<div class="page">
<div t-attf-style=" background-color:#{company.document_layout_id.base_color};padding:2% ;color:#{company.document_layout_id.customer_text_color};">
<!--Invoice sl no-->
<!--Invoice sl no-->
<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}">
@ -104,83 +81,88 @@
</font>
</span>
<font>
<span t-field="o.name" t-attf-style="color:#{o.theme_id.heading_text_color}"/>
<span t-field="o.name"
t-attf-style="color:#{o.theme_id.heading_text_color}"/>
</font>
</h2><br/>
</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 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>
<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 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>
<div class="col-auto col-3 mw-100 mb-2"
t-if="o.source_id">
<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.source_id"/>
</font>
<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.source_id">
<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.source_id"/>
</font>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Product Lines-->
<div style="padding-top:20px;width:100%">
<div style="padding-top:20px;"/>
<t t-set="display_discount"
t-value="any([l.discount for l in o.invoice_line_ids])"/>
<!--Product Details-->
<table class="table table-sm table-borderless">
<!--Product Lines-->
<div style="padding-top:20px;width:100%">
<div style="padding-top:20px;"/>
<t t-set="display_discount"
t-value="any([l.discount for l in o.invoice_line_ids])"/>
<!--Product Details-->
<table class="table table-sm table-borderless">
<tr>
<th class="text-right"
t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
@ -253,112 +235,179 @@
t-field-options="{'widget': 'monetary','display_currency':'o.currency_id'}"/>
</td>
</tr>
</table>
<!--Payment Details-->
<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">
<t t-set="tax_totals" t-value="o.tax_totals"/>
<t t-foreach="tax_totals['subtotals']" t-as="subtotal">
<tr class="border-black o_subtotal">
<td><strong t-esc="subtotal['name']" t-attf-style="color:#{o.theme_id.text_color}"/></td>
</table>
<!--Payment Details-->
<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">
<t t-set="tax_totals"
t-value="o.tax_totals"/>
<t t-foreach="tax_totals['subtotals']"
t-as="subtotal">
<tr class="border-black o_subtotal">
<td>
<strong t-esc="subtotal['name']"
t-attf-style="color:#{o.theme_id.text_color}"/>
</td>
<td class="text-end" t-attf-style="color:#{o.theme_id.text_color}">
<span t-attf-style="color:#{o.theme_id.text_color}"
t-att-class="oe_subtotal_footer_separator"
t-esc="subtotal['formatted_amount']"/>
</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">
<td><strong t-attf-style="color:#{o.theme_id.customer_text_color}">Total</strong></td>
<td class="text-end">
<span t-esc="tax_totals['formatted_amount_total']" t-attf-style="color:#{o.theme_id.customer_text_color}"/>
</td>
</tr>
<!--Paid amount details-->
<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>
<td>
<i class="oe_form_field text-end oe_payment_label" t-attf-style="color:#{o.theme_id.text_color}">Paid on
<t
t-esc="payment_vals['date']"
t-options='{"widget": "date"}' t-attf-style="color:#{o.theme_id.text_color}"/>
</i>
</td>
<td class="text-end" t-attf-style="color:#{o.theme_id.text_color}">
<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">
<td class="text-end"
t-attf-style="color:#{o.theme_id.text_color}">
<span t-attf-style="color:#{o.theme_id.text_color}"
t-att-class="oe_subtotal_footer_separator"
t-esc="subtotal['formatted_amount']"/>
</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">
<td>
<strong t-attf-style="color:#{o.theme_id.customer_text_color}">Amount Due</strong>
<strong t-attf-style="color:#{o.theme_id.customer_text_color}">
Total
</strong>
</td>
<td class="text-end">
<span t-field="o.amount_residual" t-attf-style="color:#{o.theme_id.customer_text_color}"/>
<span t-esc="tax_totals['formatted_amount_total']"
t-attf-style="color:#{o.theme_id.customer_text_color}"/>
</td>
</tr>
</t>
<!--Paid amount details-->
<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>
<td>
<i class="oe_form_field text-end oe_payment_label"
t-attf-style="color:#{o.theme_id.text_color}">
Paid on
<t
t-esc="payment_vals['date']"
t-options='{"widget": "date"}'
t-attf-style="color:#{o.theme_id.text_color}"/>
</i>
</td>
<td class="text-end"
t-attf-style="color:#{o.theme_id.text_color}">
<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 o_total">
<td>
<strong t-attf-style="color:#{o.theme_id.customer_text_color}">
Amount Due
</strong>
</td>
<td class="text-end">
<span t-field="o.amount_residual"
t-attf-style="color:#{o.theme_id.customer_text_color}"/>
</td>
</tr>
</t>
</t>
</t>
</table>
</div>
</div>
<!--More details-->
<div t-attf-style="color:#{o.theme_id.text_color};padding-top:10%;"
class="col-12">
<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>
</t>
</table>
</div>
<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">
<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>
</div>
</div>
</div>
</div>
<!--More details-->
<div t-attf-style="color:#{o.theme_id.text_color};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>
<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"/>
</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>
<p t-if="(o.invoice_partner_bank_id.qr_code_valid == False)">
<strong class="text-center">The SEPA QR Code information are not set correctly.
</strong>
<br/>
</p>
</div>
</div>
</div>
</div>
</t>
</template>

Loading…
Cancel
Save