Skip to content

Commit

Permalink
[MIG] pos_report_session_summary: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zamberjo authored and carlos-lopez-tecnativa committed Aug 20, 2024
1 parent 862ce17 commit ebcccff
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 72 deletions.
10 changes: 10 additions & 0 deletions pos_report_session_summary/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ Usage

In a POS Session use Print -> Session Summary

Known issues / Roadmap
======================

Different treatments exist between 'pos.payment' and 'account.bank.statement.line',
so this report will only display transactions from cash-type journals. However, there are the following limitations:

Cash In/Out transactions do not generate a 'pos.payment', only an 'account.bank.statement.line'.
For cash-type journals, 'pos.payment' entries create a single consolidated 'account.bank.statement.line' when the session is closed,
but other payment methods are not included.

Bug Tracker
===========

Expand Down
6 changes: 6 additions & 0 deletions pos_report_session_summary/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Different treatments exist between 'pos.payment' and 'account.bank.statement.line',
so this report will only display transactions from cash-type journals. However, there are the following limitations:

Cash In/Out transactions do not generate a 'pos.payment', only an 'account.bank.statement.line'.
For cash-type journals, 'pos.payment' entries create a single consolidated 'account.bank.statement.line' when the session is closed,
but other payment methods are not included.
25 changes: 17 additions & 8 deletions pos_report_session_summary/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,11 @@ <h1 class="title">POS report Session Summary</h1>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-2">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
</ul>
</li>
</ul>
Expand All @@ -388,25 +389,33 @@ <h1 class="title">POS report Session Summary</h1>
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p>In a POS Session use Print -&gt; Session Summary</p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
<p>Different treatments exist between ‘pos.payment’ and ‘account.bank.statement.line’,
so this report will only display transactions from cash-type journals. However, there are the following limitations:</p>
<p>Cash In/Out transactions do not generate a ‘pos.payment’, only an ‘account.bank.statement.line’.
For cash-type journals, ‘pos.payment’ entries create a single consolidated ‘account.bank.statement.line’ when the session is closed,
but other payment methods are not included.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/pos/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_report_session_summary%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
<ul class="simple">
<li>Akretion</li>
<li>Odoo SA</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand Down
149 changes: 85 additions & 64 deletions pos_report_session_summary/views/report_session_summary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,112 +31,133 @@
<table class="table table-sm o_main_table">
<thead>
<tr>
<th>
<strong>Reference</strong>
</th>
<th>
<strong>Journal</strong>
</th>
<th class="text-right">
<th class="text-end">
<strong>Starting Balance</strong>
</th>
<th class="text-right">
<th class="text-end">
<strong>Total Transactions</strong>
</th>
<th class="text-right">
<th class="text-end">
<strong>Ending Balance</strong>
</th>
<th class="text-right">
<th class="text-end">
<strong>Difference</strong>
</th>
<th
class="text-right"
groups="base.group_multi_currency"
>
<th class="text-end" groups="base.group_multi_currency">
<strong>Currency</strong>
</th>
<th class="text-right">
<th class="text-end">
<strong>Status</strong>
</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.statement_ids" t-as="statement">
<td><span t-field="statement.name" /></td>
<td><span t-field="statement.journal_id" /></td>
<td class="text-right">
<span t-field="statement.balance_start" />
<tr>
<td><span t-field="o.cash_journal_id" /></td>
<td class="text-end">
<span t-field="o.cash_register_balance_start" />
</td>
<td class="text-right">
<span t-field="statement.total_entry_encoding" />
<td class="text-end">
<span
t-field="o.cash_register_total_entry_encoding"
/>
</td>
<td class="text-right">
<span t-field="statement.balance_end_real" />
<td class="text-end">
<span t-field="o.cash_register_balance_end_real" />
</td>
<td class="text-right">
<span t-field="statement.difference" />
<td class="text-end">
<span t-field="o.cash_register_difference" />
</td>
<td
class="text-right"
groups="base.group_multi_currency"
>
<span t-field="statement.currency_id" />
<td class="text-end" groups="base.group_multi_currency">
<span t-field="o.cash_journal_id.currency_id" />
</td>
<td class="text-end">
<span t-field="o.state" />
</td>
<td class="text-right"><span
t-field="statement.state"
/></td>
</tr>
</tbody>
</table>
<t t-if="o.statement_line_ids">
<h4>Statement Details: </h4>

<t t-foreach="o.statement_ids" t-as="statement">
<h4 t-if="statement.line_ids">Statement Details: <span
t-out="statement.name"
/></h4>

<table
class="table table-sm o_main_table"
t-if="statement.line_ids"
>
<table class="table table-sm o_main_table">
<thead>
<tr>
<th>Date</th>
<th>Description</th>
<th>Reference</th>
<th>Partner</th>
<th>Account</th>
<th class="text-right">Amount</th>
<th class="text-end">Amount</th>
</tr>
</thead>
<tbody>
<tr t-foreach="statement.line_ids" t-as="line">
<td><span
t-if="'date' in line"
t-field="line.date"
/></td>
<td><span
t-if="'name' in line"
t-field="line.name"
/></td>
<td><span
t-if="'ref' in line"
t-field="line.ref"
/></td>
<td><span
t-if="'partner_id' in line"
t-field="line.partner_id"
/></td>
<td><span
t-if="'account_id' in line"
t-field="line.account_id"
/></td>
<td class="text-right">
<tr t-foreach="o.statement_line_ids" t-as="line">
<td>
<span t-field="line.date" />
</td>
<td>
<span t-field="line.name" />
</td>
<td>
<span t-field="line.payment_ref" />
</td>
<td>
<span t-field="line.partner_id" />
</td>
<td class="text-end">
<span t-field="line.amount" />
</td>
</tr>
</tbody>
</table>
</t>
<t t-if="o.state in ['opening_control', 'opened']">
<t
t-set="cash_payment_method"
t-value="o.payment_method_ids.filtered('is_cash_count')"
/>
<t
t-set="cash_payment_domain"
t-value="[('session_id', '=', o.id), ('payment_method_id', 'in', cash_payment_method.ids)]"
/>
<t
t-set="cash_payments"
t-value="o.env['pos.payment'].search(cash_payment_domain)"
/>
<t t-if="cash_payments">
<h4>Payment Details: </h4>

<table class="table table-sm o_main_table">
<thead>
<tr>
<th>Date</th>
<th>Reference</th>
<th>Partner</th>
<th class="text-end">Amount</th>
</tr>
</thead>
<tbody>
<tr t-foreach="cash_payments" t-as="payment">
<td>
<span t-field="payment.payment_date" />
</td>
<td>
<span t-field="payment.pos_order_id" />
</td>
<td>
<span t-field="payment.partner_id" />
</td>
<td class="text-end">
<span t-field="payment.amount" />
</td>
</tr>
</tbody>
</table>
</t>
</t>
</div>
</t>
</t>
Expand Down

0 comments on commit ebcccff

Please sign in to comment.