flectra/addons/report_intrastat/report/report_intrastat_invoice_template.xml
2018-01-16 02:34:37 -08:00

154 lines
7.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<flectra>
<template id="report_intrastatinvoice_document">
<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">
<div class="col-xs-5 col-xs-offset-7">
<address t-field="o.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
<span t-field="o.partner_id.vat"/>
</div>
</div>
<h2>
<span t-if="o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">Invoice</span>
<span t-if="o.type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span>
<span t-if="o.type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span>
<span t-if="o.type == 'out_refund'">Credit Note</span>
<span t-if="o.type == 'in_refund'">Vendor Credit Note</span>
<span t-if="o.type == 'in_invoice'">Vendor Bill</span>
<span t-field="o.number"/>
</h2>
<div class="row mt32 mb32">
<div class="col-xs-3" t-if="o.name">
<strong>Document:</strong>
<p t-field="o.name"/>
</div>
<div class="col-xs-3" t-if="o.date_invoice">
<strong>Invoice Date:</strong>
<p t-field="o.date_invoice"/>
</div>
<div class="col-xs-3" t-if="o.partner_id.ref">
<strong>Partner Ref.:</strong>
<p t-field="o.partner_id.ref"/>
</div>
</div>
<!-- Is there a discount on at least one line? -->
<t t-set="display_discount" t-value="any([l.discount for l in o.invoice_line_ids])"/>
<table class="table table-condensed">
<thead>
<tr>
<th>Description</th>
<th class="text-right">Taxes</th>
<th class="text-right">Intrastat</th>
<th class="text-right">Weight</th>
<th class="text-right">Quantity</th>
<th groups="product.group_uom">Unit of measure</th>
<th class="text-right">Unit Price</th>
<th class="text-right" t-if="display_discount" groups="sale.group_discount_per_so_line">Discount (%)</th>
<th class="text-right">Amount</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.invoice_line_ids" t-as="l">
<td><span t-field="l.name"/></td>
<td class="text-right"><span t-esc="', '.join(map(lambda x: x.name, l.invoice_line_tax_ids))"/></td>
<td class="text-right"><span t-esc="l.product_id.intrastat_id.name"/></td>
<td class="text-right"><span t-esc="l.product_id.weight"/></td>
<td class="text-right"><span t-field="l.quantity"/></td>
<td groups="product.group_uom"><span t-field="l.uom_id"/></td>
<td class="text-right"><span t-field="l.price_unit"/></td>
<td t-if="display_discount" groups="sale.group_discount_per_so_line"><span t-field="l.discount"/></td>
<td class="text-right" groups="sale.group_show_price_subtotal">
<span t-field="l.price_subtotal"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<td class="text-right" groups="sale.group_show_price_total">
<span t-field="l.price_total"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-xs-4 pull-right">
<table class="table table-condensed">
<tr class="border-black">
<td><strong>Subtotal</strong></td>
<td class="text-right">
<span t-field="o.amount_untaxed" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>Taxes</td>
<td class="text-right">
<span t-field="o.amount_tax" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr class="border-black">
<td><strong>Total</strong></td>
<td class="text-right">
<span t-field="o.amount_total" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</table>
</div>
</div>
<div class="row" t-if="o.tax_line_ids">
<div class="col-xs-3">
<table class="table table-condensed">
<thead>
<tr>
<th>Tax</th>
<th class="text-right">Amount</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.tax_line_ids" t-as="t">
<td><span t-field="t.name"/></td>
<td class="text-right">
<span t-field="t.amount"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p t-if="o.comment">
<strong>Comment:</strong>
<span t-field="o.comment"/>
</p>
<p t-if="o.payment_term_id">
<strong>Payment Terms:</strong>
<span t-field="o.payment_term_id"/>
</p>
<p t-if="o.fiscal_position_id">
<strong>Fiscal Position:</strong>
<span t-field="o.fiscal_position_id"/>
</p>
<p t-if="o.fiscal_position_id.note">
<strong>Fiscal Position Remark:</strong>
<span t-field="o.fiscal_position_id.note"/>
</p>
</div>
</t>
</template>
<template id="report_intrastatinvoice">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="report_intrastat.report_intrastatinvoice_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
</flectra>