Fix incremental reports sync and template error

- Fix MatchReport creation for incremental syncs with empty extraction_stats
- When extraction_stats is empty but bets exist, create MatchReport from bets data
- Fix duplicate client_id parameter error in reports template
- Create separate detail_filters dict to avoid duplicate parameter
parent d3d966a5
......@@ -263,7 +263,7 @@
</div>
<div class="flex-grow-1 ms-2">
<h6 class="card-title mb-1 text-white-50">Accumulated Shortfall</h6>
<h3 class="mb-0 fw-bold">{{ "{:,.2f}".format(totals.accumulated_shortfall) }}</h3>
<h3 class="mb-0 fw-bold">{{ "{:,.2f}".format(totals.accumulated_shortfall or 0) }}</h3>
</div>
</div>
</div>
......@@ -444,7 +444,8 @@
<td class="text-end">{{ "{:,.2f}".format(client.cap_balance) }}</td>
<td class="text-end">{{ "{:,.2f}".format(client.accumulated_shortfall) }}</td>
<td>
<a href="{{ url_for('main.client_report_detail', client_id=client.client_id, **filters) }}" class="btn btn-sm btn-info">
{% set detail_filters = {'date_range': filters.date_range, 'start_date': filters.start_date, 'end_date': filters.end_date, 'start_time': filters.start_time, 'end_time': filters.end_time, 'per_page': filters.per_page, 'timezone': filters.timezone, 'sort_by': filters.sort_by, 'sort_order': filters.sort_order} %}
<a href="{{ url_for('main.client_report_detail', client_id=client.client_id, **detail_filters) }}" class="btn btn-sm btn-info">
<i class="fas fa-eye"></i> View Details
</a>
</td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment