Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MBetterd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mbetter
MBetterd
Commits
2e96f7c5
Commit
2e96f7c5
authored
Feb 01, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update reports page
parent
6d547630
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1068 additions
and
36 deletions
+1068
-36
REPORTS_UPDATE_IMPLEMENTATION.md
REPORTS_UPDATE_IMPLEMENTATION.md
+434
-0
routes.py
app/main/routes.py
+251
-3
client_report_detail.html
app/templates/main/client_report_detail.html
+318
-0
reports.html
app/templates/main/reports.html
+65
-33
No files found.
REPORTS_UPDATE_IMPLEMENTATION.md
0 → 100644
View file @
2e96f7c5
This diff is collapsed.
Click to expand it.
app/main/routes.py
View file @
2e96f7c5
This diff is collapsed.
Click to expand it.
app/templates/main/client_report_detail.html
0 → 100644
View file @
2e96f7c5
This diff is collapsed.
Click to expand it.
app/templates/main/reports.html
View file @
2e96f7c5
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
<label
for=
"start_date"
class=
"form-label"
>
Start Date
</label>
<label
for=
"start_date"
class=
"form-label"
>
Start Date
</label>
<input
type=
"date"
class=
"form-control"
id=
"start_date"
name=
"start_date"
value=
"{{ filters.start_date }}"
>
<input
type=
"date"
class=
"form-control"
id=
"start_date"
name=
"start_date"
value=
"{{ filters.start_date }}"
>
</div>
</div>
<div
class=
"col-md-1"
id=
"
custom-time-fields"
style=
"display: none;
"
>
<div
class=
"col-md-1"
id=
"
time-fields
"
>
<label
for=
"start_time"
class=
"form-label"
>
Start Time
</label>
<label
for=
"start_time"
class=
"form-label"
>
Start Time
</label>
<input
type=
"time"
class=
"form-control"
id=
"start_time"
name=
"start_time"
value=
"{{ filters.start_time }}"
>
<input
type=
"time"
class=
"form-control"
id=
"start_time"
name=
"start_time"
value=
"{{ filters.start_time }}"
>
</div>
</div>
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
<label
for=
"end_date"
class=
"form-label"
>
End Date
</label>
<label
for=
"end_date"
class=
"form-label"
>
End Date
</label>
<input
type=
"date"
class=
"form-control"
id=
"end_date"
name=
"end_date"
value=
"{{ filters.end_date }}"
>
<input
type=
"date"
class=
"form-control"
id=
"end_date"
name=
"end_date"
value=
"{{ filters.end_date }}"
>
</div>
</div>
<div
class=
"col-md-1"
id=
"
custom-time-fields-end"
style=
"display: none;
"
>
<div
class=
"col-md-1"
id=
"
time-fields-end
"
>
<label
for=
"end_time"
class=
"form-label"
>
End Time
</label>
<label
for=
"end_time"
class=
"form-label"
>
End Time
</label>
<input
type=
"time"
class=
"form-control"
id=
"end_time"
name=
"end_time"
value=
"{{ filters.end_time }}"
>
<input
type=
"time"
class=
"form-control"
id=
"end_time"
name=
"end_time"
value=
"{{ filters.end_time }}"
>
</div>
</div>
...
@@ -94,47 +94,79 @@
...
@@ -94,47 +94,79 @@
</div>
</div>
</div>
</div>
<!-- Reports Table -->
<!-- Summary Blocks -->
<div
class=
"row mb-4"
>
<div
class=
"col-md-3"
>
<div
class=
"card bg-primary text-white"
>
<div
class=
"card-body"
>
<h6
class=
"card-title mb-2"
>
Total Payin
</h6>
<h3
class=
"mb-0"
>
{{ "{:,.2f}".format(totals.total_payin if totals.total_payin else 0.00) }}
</h3>
</div>
</div>
</div>
<div
class=
"col-md-3"
>
<div
class=
"card bg-info text-white"
>
<div
class=
"card-body"
>
<h6
class=
"card-title mb-2"
>
Total Payout
</h6>
<h3
class=
"mb-0"
>
{{ "{:,.2f}".format(totals.total_payout if totals.total_payout else 0.00) }}
</h3>
</div>
</div>
</div>
<div
class=
"col-md-3"
>
<div
class=
"card {% if totals.total_balance >= 0 %}bg-success{% else %}bg-danger{% endif %} text-white"
>
<div
class=
"card-body"
>
<h6
class=
"card-title mb-2"
>
Balance
</h6>
<h3
class=
"mb-0"
>
{{ "{:,.2f}".format(totals.total_balance if totals.total_balance else 0.00) }}
</h3>
</div>
</div>
</div>
<div
class=
"col-md-3"
>
<div
class=
"card bg-warning text-white"
>
<div
class=
"card-body"
>
<h6
class=
"card-title mb-2"
>
CAP Redistribution Balance
</h6>
<h3
class=
"mb-0"
>
{{ "{:,.2f}".format(totals.cap_balance if totals.cap_balance else 0.00) }}
</h3>
</div>
</div>
</div>
</div>
<!-- Clients Table -->
<div
class=
"card"
>
<div
class=
"card"
>
<div
class=
"card-body"
>
<div
class=
"card-body"
>
{% if
repor
ts %}
{% if
clien
ts %}
<div
class=
"table-responsive"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-striped table-hover"
>
<table
class=
"table table-striped table-hover"
>
<thead>
<thead>
<tr>
<tr>
<th>
Sync ID
</th>
<th>
Client Name
</th>
<th>
Client
</th>
<th>
Client ID
</th>
<th>
Sync Timestamp
</th>
<th>
Date Range
</th>
<th>
Total Payin
</th>
<th>
Total Payin
</th>
<th>
Total Payout
</th>
<th>
Total Payout
</th>
<th>
Balance
</th>
<th>
Balance
</th>
<th>
CAP Balance
</th>
<th>
Total Bets
</th>
<th>
Total Bets
</th>
<th>
Total Matches
</th>
<th>
Total Matches
</th>
<th>
CAP Redistribution Balance
</th>
<th>
Actions
</th>
<th>
Actions
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
{% for
report in repor
ts %}
{% for
client in clien
ts %}
<tr>
<tr>
<td><code>
{{ report.sync_id }}
</code></td>
<td>
{{ client.token_name }}
</td>
<td>
{{ report.client_id }}
</td>
<td><code>
{{ client.client_id }}
</code></td>
<td>
{{ report.sync_timestamp.strftime('%Y-%m-%d %H:%M:%S') if report.sync_timestamp else '' }}
</td>
<td
class=
"text-end"
>
{{ "{:,.2f}".format(client.total_payin) }}
</td>
<td>
{{ report.date_range }}
</td>
<td
class=
"text-end"
>
{{ "{:,.2f}".format(client.total_payout) }}
</td>
<td
class=
"text-end"
>
{{ "{:,.2f}".format(report.total_payin) if report.total_payin else '0.00' }}
</td>
<td
class=
"text-end {% if client.balance >= 0 %}text-success{% else %}text-danger{% endif %}"
>
<td
class=
"text-end"
>
{{ "{:,.2f}".format(report.total_payout) if report.total_payout else '0.00' }}
</td>
{{ "{:,.2f}".format(client.balance) }}
<td
class=
"text-end {% if (report.total_payin - report.total_payout) >= 0 %}text-success{% else %}text-danger{% endif %}"
>
{{ "{:,.2f}".format(report.total_payin - report.total_payout) if report.total_payin and report.total_payout else '0.00' }}
</td>
</td>
<td
class=
"text-center"
>
{{ client.total_bets }}
</td>
<td
class=
"text-center"
>
{{ client.total_matches }}
</td>
<td
class=
"text-end text-info"
>
<td
class=
"text-end text-info"
>
{{ "{:,.2f}".format(
report.cap_compensation_balance) if report.cap_compensation_balance else '0.00'
}}
{{ "{:,.2f}".format(
client.cap_balance)
}}
</td>
</td>
<td
class=
"text-center"
>
{{ report.total_bets }}
</td>
<td
class=
"text-center"
>
{{ report.total_matches }}
</td>
<td>
<td>
<a
href=
"{{ url_for('main.
report_detail', sync_id=report.id
) }}"
class=
"btn btn-sm btn-info"
>
<a
href=
"{{ url_for('main.
client_report_detail', client_id=client.client_id, **filters
) }}"
class=
"btn btn-sm btn-info"
>
<i
class=
"fas fa-eye"
></i>
View
<i
class=
"fas fa-eye"
></i>
Details
</a>
</a>
</td>
</td>
</tr>
</tr>
...
@@ -175,15 +207,15 @@
...
@@ -175,15 +207,15 @@
</ul>
</ul>
</nav>
</nav>
<p
class=
"text-center text-muted"
>
<p
class=
"text-center text-muted"
>
Showing {{ pagination.per_page * (pagination.page - 1) + 1 }} to
Showing {{ pagination.per_page * (pagination.page - 1) + 1 }} to
{{ min(pagination.per_page * pagination.page, pagination.total) }} of
{{ min(pagination.per_page * pagination.page, pagination.total) }} of
{{ pagination.total }}
repor
ts
{{ pagination.total }}
clien
ts
</p>
</p>
{% endif %}
{% endif %}
{% else %}
{% else %}
<div
class=
"text-center py-5"
>
<div
class=
"text-center py-5"
>
<i
class=
"fas fa-file-alt fa-3x text-muted mb-3"
></i>
<i
class=
"fas fa-file-alt fa-3x text-muted mb-3"
></i>
<h4
class=
"text-muted"
>
No
repor
ts found
</h4>
<h4
class=
"text-muted"
>
No
clien
ts found
</h4>
<p
class=
"text-muted"
>
Try adjusting your filters or wait for clients to sync reports.
</p>
<p
class=
"text-muted"
>
Try adjusting your filters or wait for clients to sync reports.
</p>
</div>
</div>
{% endif %}
{% endif %}
...
@@ -197,20 +229,20 @@
...
@@ -197,20 +229,20 @@
function
toggleCustomDateRange
()
{
function
toggleCustomDateRange
()
{
var
dateRange
=
document
.
getElementById
(
'date_range'
).
value
;
var
dateRange
=
document
.
getElementById
(
'date_range'
).
value
;
var
customDateFields
=
document
.
getElementById
(
'custom-date-fields'
);
var
customDateFields
=
document
.
getElementById
(
'custom-date-fields'
);
var
customTimeFields
=
document
.
getElementById
(
'custom-time-fields'
);
var
customDateFieldsEnd
=
document
.
getElementById
(
'custom-date-fields-end'
);
var
customDateFieldsEnd
=
document
.
getElementById
(
'custom-date-fields-end'
);
var
customTimeFieldsEnd
=
document
.
getElementById
(
'custom-time-fields-end'
);
var
timeFields
=
document
.
getElementById
(
'time-fields'
);
var
timeFieldsEnd
=
document
.
getElementById
(
'time-fields-end'
);
if
(
dateRange
===
'custom'
)
{
if
(
dateRange
===
'custom'
)
{
customDateFields
.
style
.
display
=
'block'
;
customDateFields
.
style
.
display
=
'block'
;
customTimeFields
.
style
.
display
=
'block'
;
customDateFieldsEnd
.
style
.
display
=
'block'
;
customDateFieldsEnd
.
style
.
display
=
'block'
;
customTimeFieldsEnd
.
style
.
display
=
'block'
;
timeFields
.
style
.
display
=
'block'
;
timeFieldsEnd
.
style
.
display
=
'block'
;
}
else
{
}
else
{
customDateFields
.
style
.
display
=
'none'
;
customDateFields
.
style
.
display
=
'none'
;
customTimeFields
.
style
.
display
=
'none'
;
customDateFieldsEnd
.
style
.
display
=
'none'
;
customDateFieldsEnd
.
style
.
display
=
'none'
;
customTimeFieldsEnd
.
style
.
display
=
'none'
;
timeFields
.
style
.
display
=
'none'
;
timeFieldsEnd
.
style
.
display
=
'none'
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment