Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] commission: print partial and document total in report #594

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions commission/reports/report_settlement_templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
<div class="mt-5">
<div class="page">
<h2>Settlement</h2>
<t t-if="show_doc_total">
<div class="text-right">
<strong>Global commission amount:</strong>
<span
t-esc="sum(docs.mapped('total'))"
t-options="{'widget': 'monetary', 'display_currency': docs[0].currency_id}"
/>
</div>
</t>
<div id="informations" class="row mt-4 mb-4">
<div class="col-auto col-3 mw-100 mb-2" t-if="o.date_from">
<strong>From:</strong>
Expand Down Expand Up @@ -52,20 +61,16 @@
</tr>
</tbody>
</table>
<div class="mb-4">
<div id="total" class="row">
<div
t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto"
>
<table
class="table table-sm table-borderless"
style="page-break-inside: avoid;"
>
<div class="clearfix" name="commission_total_summary">
<div id="total" class="row" name="total">
<div class="col-6 ml-auto">
<table class="table table-sm">
<tr class="border-black o_total">
<td>
<strong>Total</strong>
</td>
<td class="text-end">
<td name="td_amount_total_label"><strong
>Total</strong> (<span
t-field="o.date_from"
/> - <span t-field="o.date_to" />)</td>
<td class="text-right">
<span
t-field="o.total"
t-options="{'widget': 'monetary', 'display_currency': o.currency_id}"
Expand All @@ -83,6 +88,10 @@

<template id="report_settlement">
<t t-call="web.html_container">
<t
t-set="show_doc_total"
t-value="len(docs) > 1 and len(docs.mapped('currency_id')) == 1"
/>
<t t-foreach="docs" t-as="o">
<t
t-call="commission.report_settlement_document"
Expand Down
Loading