Skip to content

Commit

Permalink
[IMP] sale_commission: print partial and document total in report
Browse files Browse the repository at this point in the history
  • Loading branch information
aleuffre authored and toita86 committed Oct 25, 2024
1 parent 40491a3 commit 41fa94e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 20 deletions.
6 changes: 0 additions & 6 deletions account_commission/views/report_settlement_templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,5 @@
</td>
</t>
</xpath>
<xpath expr="//table/tfoot/tr/td" position="before">
<t t-if="o.settlement_type == 'sale_invoice'">
<td />
<td />
</t>
</xpath>
</template>
</odoo>
47 changes: 33 additions & 14 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 @@ -51,28 +60,38 @@
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td />
<td class="text-end">
<strong>Total</strong>
</td>
<td class="text-end">
<span
t-field="o.total"
t-options="{'widget': 'monetary', 'display_currency': o.currency_id}"
/>
</td>
</tr>
</tfoot>
</table>
<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 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}"
/>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</t>
</template>

<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

0 comments on commit 41fa94e

Please sign in to comment.