You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
336 lines
22 KiB
336 lines
22 KiB
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<odoo>
|
|
<!-- Account attractive report template-->
|
|
<template id="report_account_attractive_document">
|
|
<t t-if="o and 'company_id' in o">
|
|
<t t-set="company" t-value="o.company_id"/>
|
|
</t>
|
|
<t t-if="not o or not 'company_id' in o">
|
|
<t t-set="company" t-value="res_company"/>
|
|
</t>
|
|
<div class="header row mt32 mb32">
|
|
<div class="page-header col-12">
|
|
<div t-attf-class="pull-left">
|
|
<t t-if="company.logo">
|
|
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)"
|
|
style="max-height: 80px;"/>
|
|
</t>
|
|
</div>
|
|
<div t-attf-class="pull-left"
|
|
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>
|
|
<t t-call="web.external_layout">
|
|
<t t-set="o" t-value="o.with_context(lang=lang)"/>
|
|
<t t-set="forced_vat"
|
|
t-value="o.fiscal_position_id.foreign_vat"/> <!-- So that it appears in the footer of the report instead of the company VAT if it's set -->
|
|
<div class="mt-5">
|
|
<div class="page">
|
|
<table class="table table-sm o_main_table" name="invoice_line_table">
|
|
<thead t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
|
|
<tr t-if="o.invoice_date">
|
|
<th name="th_description" t-if="o.move_type == 'out_invoice'" class="text-start">
|
|
<span>Invoice Date</span>
|
|
</th>
|
|
<th name="th_description" t-if="o.move_type == 'out_invoice'" class="text-start">
|
|
<span>Invoice Number</span>
|
|
</th>
|
|
<th name="th_quantity" t-elif="o.move_type == 'out_refund'" class="text-end">
|
|
<span>Credit Note Date</span>
|
|
</th>
|
|
<th name="th_quantity" t-elif="o.move_type == 'out_receipt'" class="text-end">
|
|
<span>Receipt Date</span>
|
|
</th>
|
|
<th name="th_quantity" t-elif="o.move_type == 'out_receipt'" class="text-end">
|
|
<span>Receipt Date</span>
|
|
</th>
|
|
<th name="th_quantity" t-elif="o.move_type == 'out_receipt'" class="text-end">
|
|
<span>Receipt Date</span>
|
|
</th>
|
|
<th name="th_quantity" t-else="" class="text-end">
|
|
<span>Date</span>
|
|
</th>
|
|
<th name="th_quantity"
|
|
t-if="o.invoice_date_due and o.move_type == 'out_invoice' and o.state == 'posted'"
|
|
class="text-end">
|
|
<span>Due Date</span>
|
|
</th>
|
|
<th name="th_quantity" t-if="o.invoice_origin" class="text-end">
|
|
<span>Source</span>
|
|
</th>
|
|
<th name="th_quantity" t-if="o.partner_id.ref" class="text-end">
|
|
<span>Customer Code</span>
|
|
</th>
|
|
<th name="th_quantity" t-if="o.ref" class="text-end">
|
|
<span>Reference</span>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr t-attf-style="color:#{o.theme_id.customer_text_color} !important;">
|
|
<td class="text-start">
|
|
<p class="m-0" t-field="o.invoice_date"/>
|
|
</td>
|
|
<td class="text-enf" t-if="o.payment_reference">
|
|
<p class="m-0" t-field="o.payment_reference"/>
|
|
</td>
|
|
<td t-if="o.invoice_date_due and o.move_type == 'out_invoice' and o.state == 'posted'"
|
|
class="text-end">
|
|
<p class="m-0" t-field="o.invoice_date_due"/>
|
|
</td>
|
|
<td t-if="o.invoice_origin" class="text-end">
|
|
<p class="m-0" t-field="o.invoice_origin"/>
|
|
</td>
|
|
<td t-if="o.partner_id.ref" class="text-end">
|
|
<p class="m-0" t-field="o.partner_id.ref"/>
|
|
</td>
|
|
<td t-if="o.ref" class="text-end">
|
|
<p class="m-0" t-field="o.ref"/>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<br/>
|
|
<br/>
|
|
<br/>
|
|
<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" name="invoice_line_table">
|
|
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
|
|
<tr>
|
|
<th name="th_description" class="text-start">
|
|
<span>Description</span>
|
|
</th>
|
|
<th name="th_quantity" class="text-end">
|
|
<span>Quantity</span>
|
|
</th>
|
|
<th name="th_priceunit"
|
|
t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
|
|
<span>Unit Price</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-attf-style="color:#{o.theme_id.customer_text_color} !important;">
|
|
<t t-if="line.display_type == 'product'" name="account_invoice_line_accountable">
|
|
<td name="account_invoice_line_name">
|
|
<span t-field="line.name" t-options="{'widget': 'text'}"/>
|
|
</td>
|
|
<td class="text-end">
|
|
<span t-field="line.quantity"/>
|
|
<span t-field="line.product_uom_id" groups="uom.group_uom"/>
|
|
</td>
|
|
<td t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
|
|
<span class="text-nowrap" t-field="line.price_unit"/>
|
|
</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"
|
|
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
|
|
<!--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" t-attf-style="color:#{o.theme_id.customer_text_color} !important;">
|
|
<td>
|
|
<strong>Amount Due</strong>
|
|
</td>
|
|
<td class="text-end">
|
|
<span t-field="o.amount_residual"/>
|
|
</td>
|
|
</tr>
|
|
</t>
|
|
</t>
|
|
</t>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div t-attf-style=" background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
|
|
<h2 t-attf-style="color:#{o.theme_id.customer_text_color} !important;">
|
|
<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>
|
|
<strong>Customer</strong>
|
|
<span class="mb-0" t-field="o.partner_id"
|
|
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
|
|
<div t-if="o.partner_id.vat">
|
|
<t t-if="o.company_id.account_fiscal_country_id.vat_label"
|
|
t-esc="o.company_id.account_fiscal_country_id.vat_label" id="inv_tax_id_label"/>
|
|
<t t-else="">Tax ID</t>:
|
|
<span t-field="o.partner_id.vat"/>
|
|
</div>
|
|
</div>
|
|
<div t-if="o.move_type in ('out_invoice', 'in_refund') and o.payment_reference"
|
|
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};"
|
|
name="payment_communication" class="mt-4">
|
|
Please use the following communication for your payment :
|
|
<b>
|
|
<span t-field="o.payment_reference"/>
|
|
</b>
|
|
<div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_payment_term_id.note"
|
|
name="reference">
|
|
<t t-set="payment_term_details" t-value="o.payment_term_details"/>
|
|
|
|
<div t-field="o.invoice_payment_term_id.note" name="payment_term"/>
|
|
</div>
|
|
</div>
|
|
<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 t-attf-style="color:#{o.theme_id.customer_text_color} !important;">
|
|
<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-attf-style="color:#{o.theme_id.customer_text_color} !important;"
|
|
t-field="o.narration"/>
|
|
</div>
|
|
<p t-if="not is_html_empty(o.fiscal_position_id.note)" name="note">
|
|
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
|
|
t-field="o.fiscal_position_id.note"/>
|
|
</p>
|
|
<p t-if="o.invoice_incoterm_id" name="incoterm">
|
|
<strong>Incoterm:</strong>
|
|
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
|
|
t-field="o.invoice_incoterm_id.code"/>
|
|
-
|
|
<span t-attf-style="color:#{o.theme_id.customer_text_color} !important;"
|
|
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>
|
|
</t>
|
|
</template>
|
|
</odoo>
|
|
|