Initial Port of customer statements
This commit is contained in:
committed by
Miquel Raïch
parent
1ffec3d4ee
commit
ad482b33d0
130
partner_statement/views/activity_statement.xml
Normal file
130
partner_statement/views/activity_statement.xml
Normal file
@@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2018 Eficent Business and IT Consulting Services S.L.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
|
||||
<template id="partner_statement.activity_statement_document">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-set="o" t-value="o.with_context({'lang': lang})"/>
|
||||
<t t-set="address">
|
||||
<address t-esc="o" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
|
||||
<div t-if="o.vat" class="mt16"><t t-esc="company.country_id.vat_label or 'Tax ID'"/>: <span t-field="o.partner_id.vat"/></div>
|
||||
</t>
|
||||
<div class="page">
|
||||
<h2 >Statement of Account</h2>
|
||||
<p>
|
||||
Date: <span t-esc="d['today']" /><br/>
|
||||
<t t-if="o.ref">Partner ref: <span t-field="o.ref"/></t>
|
||||
</p>
|
||||
|
||||
<t t-if="d['currencies']">
|
||||
<br/>
|
||||
<t t-foreach="d['currencies'].items()" t-as="currency">
|
||||
<t t-set="display_currency" t-value="Currencies[currency[0]]" />
|
||||
<t t-set="currency" t-value="currency[1]" />
|
||||
<p>
|
||||
<span t-esc="'' if account_type == 'receivable' else 'Supplier '"/>Statement between <span t-esc="d['start']" /> and <span t-esc="d['end']" /> in <span t-esc="display_currency.name"/>
|
||||
</p>
|
||||
<table class="table table-condensed table-statement">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Reference number</th>
|
||||
<th>Date</th>
|
||||
<th>Description</th>
|
||||
<th class="amount">Amount</th>
|
||||
<th class="amount">Balance</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td />
|
||||
<td>
|
||||
<span t-esc="d['start']"/>
|
||||
</td>
|
||||
<td>
|
||||
Balance Forward
|
||||
</td>
|
||||
<td />
|
||||
<td class="amount">
|
||||
<span t-esc="currency['balance_forward']" t-options="{'widget': 'monetary', 'display_currency': display_currency}"/>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr t-foreach="currency['lines']" t-as="line" t-att-class="'statement-blocked' if line['blocked'] else ''">
|
||||
|
||||
<td>
|
||||
<span t-esc="line['move_id']"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-esc="line['date']"/>
|
||||
</td>
|
||||
<td>
|
||||
<t t-if="line['name'] != '/'">
|
||||
<t t-if="not line['ref']">
|
||||
<span t-esc="line['name']"/>
|
||||
</t>
|
||||
<t t-if="line['ref'] and line['name']">
|
||||
<t t-if="line['name'] not in line['ref']">
|
||||
<span t-esc="line['name']"/>
|
||||
</t>
|
||||
<t t-if="line['ref'] not in line['name']">
|
||||
<span t-esc="line['ref']"/>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
<t t-if="line['name'] == '/'">
|
||||
<span t-esc="line['ref']"/>
|
||||
</t>
|
||||
</td>
|
||||
<td class="amount">
|
||||
<span t-esc="line['amount']" t-options="{'widget': 'monetary', 'display_currency': display_currency}"/>
|
||||
</td>
|
||||
<td class="amount">
|
||||
<span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': display_currency}"/>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td />
|
||||
<td>
|
||||
<span t-esc="d['end']"/>
|
||||
</td>
|
||||
<td>
|
||||
Ending Balance
|
||||
</td>
|
||||
<td />
|
||||
<td class="amount">
|
||||
<span t-esc="currency['amount_due']" t-options="{'widget': 'monetary', 'display_currency': display_currency}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<t t-call="partner_statement.aging_buckets" t-if="currency['buckets']" />
|
||||
</t>
|
||||
</t>
|
||||
<p t-if="d.get('no_entries')">
|
||||
<strong>The partner doesn't have due entries.</strong>
|
||||
</p>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="activity_statement">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-set="d" t-value="data.get(o.id)" />
|
||||
<t t-call="partner_statement.activity_statement_document" t-lang="o.lang"/>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<report id="action_print_activity_statement"
|
||||
model="res.partner"
|
||||
report_type="qweb-pdf"
|
||||
menu="False"
|
||||
string="Activity Statement"
|
||||
name="partner_statement.activity_statement"
|
||||
file="partner_statement.activity_statement"
|
||||
/>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user