GOLEM/golem_activity_registration.../report/golem_member_report.xml

123 lines
4.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Fabien Bourgeois <fabien@yaltik.com>
Copyright 2018 Michel Dessenne <michel@yaltik.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<odoo>
<template id="activity" inherit_id="golem_member.report_golem_member_template">
<xpath expr="//th[@id='activity_inherit_th']" position="after">
<th>State</th>
<th>Price</th>
</xpath>
<xpath expr="//td[@id='activity_inherit_td']" position="after">
<td class="col-xs-2">
<span t-field="t.state" />
</td>
<td class="col-xs-2">
<span t-field="t.activity_price" t-field-options="{'widget': 'monetary',
'display_currency': o.currency_id}"/>
</td>
</xpath>
<xpath expr="//tr[@id='activity_inherit_price_sum']" position="before">
<t t-set="price_sum" t-value="0"/>
</xpath>
<xpath expr="//tr[@id='activity_inherit_price_sum']" position="inside">
<t t-set="price_sum" t-value="price_sum + t.activity_price"/>
</xpath>
<xpath expr="//tr[@id='activity_inherit_total']" position="replace">
<tfoot>
<tr>
<td><td><td><td><td><td><td>
<td>
<strong>
TOTAL
</strong>
</td>
<td>
<t t-esc="price_sum"
t-esc-options="{'widget': 'monetary',
'display_currency': o.currency_id}"/>
</td>
</td></td></td></td></td></td></td>
</tr>
</tfoot>
</xpath>
<xpath expr="//table[@id='table_activity_ref']" position="after">
<table class="table table-striped">
<thead>
<strong>Invoices</strong>
<tr>
<th>Activity</th>
<th>Date</th>
<th>State</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<t t-foreach="docs" t-as="o">
<tr t-foreach="o.activity_registration_ids" t-as="l">
<td class="col-xs-3">
<spam t-field="l.invoice_line_id.product_id" />
</td>
<td class="col-xs-3">
<spam t-field="l.invoice_id.date_invoice" />
</td>
<td class="col-xs-3">
<spam t-field="l.invoice_id.state" />
</td>
<td class="col-xs-3">
<spam t-field="l.invoice_line_id.price_subtotal"
t-field-options="{'widget': 'monetary',
'display_currency': o.currency_id}"/>
</td>
</tr>
</t>
</tbody>
</table>
<table class="table table-striped" >
<thead>
<strong>Payments</strong>
<tr>
<th>Invoice number</th>
<th>State</th>
</tr>
</thead>
<tbody>
<t t-foreach="docs" t-as="o">
<tr t-foreach="o.activity_registration_ids" t-as="l">
<td class="col-xs-6">
<spam t-field="l.invoice_id.number" />
</td>
<td class="col-xs-6">
<p t-foreach="l.invoice_id.payment_ids" t-as = "i" >
<t t-if="i.state not in ['draft']">
<span t-esc="i.state" />
</t>
</p>
</td>
</tr>
</t>
</tbody>
</table>
</xpath>
</template>
</odoo>