Browse Source

[IMP] customer_activity_statement: Cleanup

pull/537/head
Graeme Gellatly 6 years ago
committed by ahenriquez
parent
commit
210687ad68
  1. 22
      customer_activity_statement/static/src/less/layout_statement.less
  2. 173
      customer_activity_statement/views/statement.xml

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;
}
}

173
customer_activity_statement/views/statement.xml

@ -1,5 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_assets_common" name="oca_statements report assets" inherit_id="report.assets_common">
<xpath expr="." position="inside">
<link href="/customer_activity_statement/static/src/less/layout_statement.less" rel="stylesheet" type="text/less"/>
</xpath>
</template>
<template id="customer_activity_statement.statement_document">
<t t-call="report.external_layout">
<div class="page">
@ -21,71 +27,43 @@
<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 >
<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>
<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>
<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>
<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>
<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;">
<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 style="border-right: 1px solid black; background-color: grey;">
<td >
<span t-esc="line['date']"/>
</td>
<td style="border-right: 1px solid black; background-color: grey;">
<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']">
@ -95,89 +73,70 @@
</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 class="amount" >
<span t-esc="line['amount']" t-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 class="amount" >
<span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': currency}"/>
</td>
</t>
</tr>
<tr>
<td style="border-right: 1px solid black;"></td>
<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>
<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"}'/>
<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="text-right" style="border-right: 1px solid black;">
<span t-esc="0.0" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'/>
<td class="amount" >
<span t-esc="buckets.get('b_1_30', 0.0)" t-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 class="amount" >
<span t-esc="buckets.get('b_30_60', 0.0)" t-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 class="amount" >
<span t-esc="buckets.get('b_60_90', 0.0)" t-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 class="amount" >
<span t-esc="buckets.get('b_90_120', 0.0)" t-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 class="amount" >
<span t-esc="buckets.get('b_over_120', 0.0)" t-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 class="amount" >
<span t-esc="buckets.get('balance', 0.0)" t-options="{'widget': 'monetary', 'display_currency': currency}"/>
</td>
</tr>
</tbody>
</table>
</t>
</t>
@ -203,7 +162,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