Browse Source

[IMP] customer_activity_statement: Cleanup (#453)

pull/457/head
Graeme Gellatly 6 years ago
committed by Pedro M. Baeza
parent
commit
6eb8e5d3c0
  1. 2
      customer_activity_statement/__manifest__.py
  2. 22
      customer_activity_statement/static/src/less/layout_statement.less
  3. 217
      customer_activity_statement/views/statement.xml

2
customer_activity_statement/__manifest__.py

@ -4,7 +4,7 @@
{
'name': 'Partner Activity Statement',
'version': '11.0.2.0.0',
'version': '11.0.2.1.0',
'category': 'Accounting & Finance',
'summary': 'OCA Financial Reports',
'author': "Eficent, Odoo Community Association (OCA)",

22
customer_activity_statement/static/src/less/layout_statement.less

@ -0,0 +1,22 @@
.table-statement {
.amount {
text-align: right !important;
width: 14% //spread 7 columns evenly
}
thead {
border-bottom: solid; // required for clean layout
tr th:first-child {
width: auto !important; // required for clean layout
}
tr th:last-child {
width: 16% !important; // required for boxed layout
}
}
}
.statement-blocked {
background-color: @gray-lighter-darker !important;
td:last-child {
background-color: @gray-lighter-darker !important;
}
}

217
customer_activity_statement/views/statement.xml

@ -2,6 +2,12 @@
<!-- 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="report_assets_common" name="oca_statements report assets" inherit_id="web.report_assets_common">
<xpath expr="." position="inside">
<link href="/customer_activity_statement/static/src/less/layout_statement.less" rel="stylesheet"/>
</xpath>
</template>
<template id="customer_activity_statement.statement_document">
<t t-call="web.external_layout">
<div class="page">
@ -23,163 +29,116 @@
<br/>
<t t-foreach="Lines[o.id]" t-as="currency">
<br t-if="not currency_first" />
<p t-if="account_type == 'receivable'">
Customer Activity Statement between <span t-esc="Date_start[o.id]" /> and <span t-esc="Date_end[o.id]" /> in <span t-esc="Currencies[o.id][currency].name"/>:
</p>
<p t-if="account_type == 'payable'">
Supplier Activity Statement between <span t-esc="Date_start[o.id]" /> and <span t-esc="Date_end[o.id]" /> in <span t-esc="Currencies[o.id][currency].name"/>:
<p >
<span t-esc="'Customer' if account_type == 'receivable' else 'Supplier'"/> Activity Statement between <span t-esc="Date_start[o.id]" /> and <span t-esc="Date_end[o.id]" /> in <span t-esc="Currencies[o.id][currency].name"/>:
</p>
<table class="table table-condensed" style="border: 1px solid black; border-collapse: collapse;">
<table class="table table-condensed table-statement" >
<thead>
<tr>
<th style="border-right: 1px solid black;">Reference number</th>
<th class="text-center" style="border-right: 1px solid black;">Date</th>
<th style="border-right: 1px solid black;">Description</th>
<th class="text-right" style="border-right: 1px solid black;">Amount</th>
<th class="text-right" style="border-right: 1px solid black;">Balance</th>
<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 style="border-right: 1px solid black;"/>
<td style="border-right: 1px solid black;">
<td />
<td >
<span t-esc="Date_start[o.id]"/>
</td>
<td style="border-right: 1px solid black;">
<td >
Balance Forward
</td>
<td style="border-right: 1px solid black;"/>
<td class="text-right" t-if="currency in Balance_forward[o.id]" style="border-right: 1px solid black;">
<span t-esc="Balance_forward[o.id][currency]" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" t-if="currency not in Balance_forward[o.id]" style="border-right: 1px solid black;">
<span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
<td />
<td class="amount" >
<span t-esc="Balance_forward[o.id].get(currency, 0.0)" t-options="{'widget': 'monetary', 'display_currency': 'currency'}"/>
</td>
</tr>
<tr t-foreach="Lines[o.id][currency]" t-as="line">
<t t-if="not line['blocked']">
<td style="border-right: 1px solid black;">
<span t-esc="line['move_id']"/>
</td>
<td style="border-right: 1px solid black;">
<span t-esc="line['date']"/>
</td>
<td style="border-right: 1px solid black;">
<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="text-right" style="border-right: 1px solid black;">
<span t-esc="line['amount']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="line['balance']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
</t>
<t t-if="line['blocked']">
<td style="border-right: 1px solid black; background-color: grey;">
<span t-esc="line['move_id']"/>
</td>
<td style="border-right: 1px solid black; background-color: grey;">
<span t-esc="line['date']"/>
</td>
<td style="border-right: 1px solid black; background-color: grey;">
<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>
<tr t-foreach="Lines[o.id][currency]" 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-if="line['name'] == '/'"><span t-esc="line['ref']"/></t>
</td>
<td class="text-right" style="border-right: 1px solid black; background-color: grey;">
<span t-esc="line['amount']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black; background-color: grey;">
<span t-esc="line['balance']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
</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': 'currency'}"/>
</td>
<td class="amount" >
<span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': 'currency'}"/>
</td>
</tr>
<tr>
<td style="border-right: 1px solid black;"/>
<td style="border-right: 1px solid black;">
<td />
<td >
<span t-esc="Date_end[o.id]"/>
</td>
<td style="border-right: 1px solid black;">
<td >
Ending Balance
</td>
<td style="border-right: 1px solid black;"/>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="Amount_Due[o.id][currency]" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
<td />
<td class="amount" >
<span t-esc="Amount_Due[o.id][currency]" t-options="{'widget': 'monetary', 'display_currency': 'currency'}"/>
</td>
</tr>
</tbody>
</table>
<p>
Aging Report at <span t-esc="Date_end[o.id]" /> in <span t-esc="Currencies[o.id][currency].name"/>:
</p>
<table class="table table-condensed" t-if="Show_Buckets" style="border: 1px solid black; border-collapse: collapse;">
<table class="table table-condensed table-statement" t-if="Show_Buckets" >
<thead>
<tr>
<th class="text-center" style="border-right: 1px solid black;">Current Due</th>
<th class="text-center" style="border-right: 1px solid black;">1-30 Days Due</th>
<th class="text-center" style="border-right: 1px solid black;">30-60 Days Due</th>
<th class="text-center" style="border-right: 1px solid black;">60-90 Days Due</th>
<th class="text-center" style="border-right: 1px solid black;">90-120 Days Due</th>
<th class="text-center" style="border-right: 1px solid black;">+120 Days Due</th>
<th class="text-right" style="border-right: 1px solid black;">Balance Due</th>
<th class="amount" >Current Due</th>
<th class="amount" >1-30 Days Due</th>
<th class="amount" >30-60 Days Due</th>
<th class="amount" >60-90 Days Due</th>
<th class="amount" >90-120 Days Due</th>
<th class="amount" >+120 Days Due</th>
<th class="amount" >Balance Due</th>
</tr>
</thead>
<tr t-if="currency in Buckets[o.id]">
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="Buckets[o.id][currency]['current']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="Buckets[o.id][currency]['b_1_30']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="Buckets[o.id][currency]['b_30_60']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="Buckets[o.id][currency]['b_60_90']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="Buckets[o.id][currency]['b_90_120']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="Buckets[o.id][currency]['b_over_120']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="Buckets[o.id][currency]['balance']" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
</tr>
<tr t-if="currency not in Buckets[o.id]">
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
<td class="text-right" style="border-right: 1px solid black;">
<span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
</td>
</tr>
<t t-set="buckets" t-value="Buckets[o.id].get(currency, {})" />
<tbody >
<tr >
<td class="amount" >
<span t-esc="buckets.get('current', 0.0)" t-options="{'widget': 'monetary', 'display_currency': 'currency'}"/>
</td>
<td class="amount" >
<span t-esc="buckets.get('b_1_30', 0.0)" t-options="{'widget': 'monetary', 'display_currency': 'currency'}"/>
</td>
<td class="amount" >
<span t-esc="buckets.get('b_30_60', 0.0)" t-options="{'widget': 'monetary', 'display_currency': 'currency'}"/>
</td>
<td class="amount" >
<span t-esc="buckets.get('b_60_90', 0.0)" t-options="{'widget': 'monetary', 'display_currency': 'currency'}"/>
</td>
<td class="amount" >
<span t-esc="buckets.get('b_90_120', 0.0)" t-options="{'widget': 'monetary', 'display_currency': 'currency'}"/>
</td>
<td class="amount" >
<span t-esc="buckets.get('b_over_120', 0.0)" t-options="{'widget': 'monetary', 'display_currency': 'currency'}"/>
</td>
<td class="amount" >
<span t-esc="buckets.get('balance', 0.0)" t-options="{'widget': 'monetary', 'display_currency': 'currency'}"/>
</td>
</tr>
</tbody>
</table>
</t>
</t>
@ -205,7 +164,7 @@
model="res.partner"
report_type="qweb-pdf"
menu="False"
string="Statement Action to PDF"
string="Activity Statement"
name="customer_activity_statement.statement"
file="customer_activity_statement.statement"
/>

Loading…
Cancel
Save