fix layout + collect/writeoff debts
This commit is contained in:
8 files changed
+263
-35
No files matched your search
@@ -113,9 +113,58 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<form class="panel form-card" method="post" action="{{ url_for('admin_write_off_front') }}">
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section class="panel debt-panel">
|
||||
<div class="panel-header">
|
||||
<div>
|
||||
<p class="eyebrow">Front debt</p>
|
||||
<h2>Write off debt</h2>
|
||||
<h2>Debt resolution</h2>
|
||||
</div>
|
||||
<div class="debt-summary">
|
||||
<span>Open {{ admin_totals.players_owe_cents | money }}</span>
|
||||
<span>Collected {{ admin_totals.collected_cents | money }}</span>
|
||||
<span>Written off {{ admin_totals.written_off_cents | money }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if debt_entries %}
|
||||
<div class="debt-action-grid">
|
||||
<form class="form-card compact-form" method="post" action="{{ url_for('admin_collect_front') }}">
|
||||
<h3>Collect debt</h3>
|
||||
|
||||
<label>
|
||||
<span>Outstanding debt</span>
|
||||
<select name="debt_key" required>
|
||||
<option value="">Select debt</option>
|
||||
{% for item in debt_entries %}
|
||||
{% set session = item.session %}
|
||||
{% set entry = item.entry %}
|
||||
<option value="{{ session.session_id }}||{{ entry.player_name }}">
|
||||
{{ entry.player_name }} · {{ session_label(session) }} · owes {{ entry.player_owes_cents | money }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<span>Amount collected</span>
|
||||
<input type="number" step="0.01" name="amount" placeholder="5.00" required>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<span>Note</span>
|
||||
<textarea name="note" rows="3" placeholder="E-transfer received, cash collected, etc."></textarea>
|
||||
</label>
|
||||
|
||||
<div class="button-row">
|
||||
<button class="primary-button" type="submit">Mark collected</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form class="form-card compact-form" method="post" action="{{ url_for('admin_write_off_front') }}">
|
||||
<h3>Write off debt</h3>
|
||||
|
||||
<label>
|
||||
<span>Outstanding debt</span>
|
||||
@@ -145,7 +194,10 @@
|
||||
<button class="secondary-button" type="submit">Write off front</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="muted-text">No outstanding front debt.</p>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
<section class="grid admin-cash-grid">
|
||||
@@ -205,6 +257,7 @@
|
||||
<th>Paid out</th>
|
||||
<th>Still owed</th>
|
||||
<th>Players owe</th>
|
||||
<th>Collected</th>
|
||||
<th>Written off</th>
|
||||
<th>Open balance</th>
|
||||
<th>Status</th>
|
||||
@@ -228,6 +281,9 @@
|
||||
<td class="{{ 'negative' if session.total_player_owes_cents > 0 else '' }}">
|
||||
{{ session.total_player_owes_cents | money }}
|
||||
</td>
|
||||
<td class="{{ 'positive' if session.total_front_collected_cents > 0 else '' }}">
|
||||
{{ session.total_front_collected_cents | money }}
|
||||
</td>
|
||||
<td class="{{ 'negative' if session.total_front_writeoff_cents > 0 else '' }}">
|
||||
{{ session.total_front_writeoff_cents | money }}
|
||||
</td>
|
||||
@@ -252,7 +308,7 @@
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="10">No sessions yet.</td>
|
||||
<td colspan="11">No sessions yet.</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
@@ -9,33 +9,13 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="grid three-col">
|
||||
<section class="grid three-col profile-summary-grid">
|
||||
<article class="panel stat-card"><span>Total Net</span><strong class="{{ 'positive' if player.total_net_cents > 0 else 'negative' if player.total_net_cents < 0 else 'neutral' }}">{{ player.total_net_cents | money }}</strong></article>
|
||||
<article class="panel stat-card"><span>Win %</span><strong>{{ "%.1f"|format(player.win_pct) }}%</strong></article>
|
||||
<article class="panel stat-card"><span>ROI</span><strong>{{ "%.1f"|format(player.roi_pct) }}%</strong></article>
|
||||
<article class="panel stat-card"><span>Total invested</span><strong>{{ player.total_invested_cents | money }}</strong></article>
|
||||
<article class="panel stat-card"><span>Paid Buy-in</span><strong>{{ player.total_buy_in_cents | money }}</strong></article>
|
||||
<article class="panel stat-card"><span>Fronted</span><strong>{{ player.total_front_cents | money }}</strong></article>
|
||||
<article class="panel stat-card"><span>Current debt</span><strong class="{{ 'negative' if player.current_player_owes_cents > 0 else '' }}">{{ player.current_player_owes_cents | money }}</strong></article>
|
||||
<article class="panel stat-card"><span>Written off</span><strong class="{{ 'negative' if player.total_front_writeoff_cents > 0 else '' }}">{{ player.total_front_writeoff_cents | money }}</strong></article>
|
||||
<!--<article class="panel stat-card"><span>Rolled in</span><strong>{{ player.total_rollover_in_cents | money }}</strong></article>-->
|
||||
<article class="panel stat-card"><span>Cash-outs</span><strong>{{ player.total_cash_out_cents | money }}</strong></article>
|
||||
<article class="panel stat-card"><span>Current debt</span><strong class="{{ 'negative' if player.current_player_owes_cents > 0 else '' }}">{{ player.current_player_owes_cents | money }}</strong></article>
|
||||
<article class="panel stat-card"><span>Win %</span><strong>{{ "%.1f"|format(player.win_pct) }}%</strong></article>
|
||||
<article class="panel stat-card"><span>Sessions</span><strong>{{ player.sessions_played }}</strong></article>
|
||||
<article class="panel stat-card">
|
||||
<span>Current Streak</span>
|
||||
<strong>
|
||||
{% if player.current_win_streak > 0 %}
|
||||
W{{ player.current_win_streak }}
|
||||
{% elif player.current_loss_streak > 0 %}
|
||||
L{{ player.current_loss_streak }}
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
</strong>
|
||||
</article>
|
||||
|
||||
<!--<article class="panel stat-card"><span>Longest win streak</span><strong>{{ player.longest_win_streak }}</strong></article>
|
||||
<article class="panel stat-card"><span>Longest loss streak</span><strong>{{ player.longest_loss_streak }}</strong></article>-->
|
||||
</section>
|
||||
|
||||
<section class="grid one-col">
|
||||
@@ -87,12 +67,18 @@
|
||||
<div class="table-wrap">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><th>Total Net</th><td>{{ player.total_net_cents | money }}</td></tr>
|
||||
<tr><th>Win %</th><td>{{ "%.1f"|format(player.win_pct) }}%</td></tr>
|
||||
<tr><th>ROI</th><td>{{ "%.1f"|format(player.roi_pct) }}%</td></tr>
|
||||
<tr><th>Sessions</th><td>{{ player.sessions_played }}</td></tr>
|
||||
<tr><th>Paid Buy-ins</th><td>{{ player.total_buy_in_cents | money }}</td></tr>
|
||||
<tr><th>Fronted</th><td>{{ player.total_front_cents | money }}</td></tr>
|
||||
<tr><th>Debt Collected</th><td>{{ player.total_front_collected_cents | money }}</td></tr>
|
||||
<tr><th>Current Debt</th><td>{{ player.current_player_owes_cents | money }}</td></tr>
|
||||
<tr><th>Written Off</th><td>{{ player.total_front_writeoff_cents | money }}</td></tr>
|
||||
<tr><th>Rolled In</th><td>{{ player.total_rollover_in_cents | money }}</td></tr>
|
||||
<tr><th>Total Invested</th><td>{{ player.total_invested_cents | money }}</td></tr>
|
||||
<tr><th>Cash-outs</th><td>{{ player.total_cash_out_cents | money }}</td></tr>
|
||||
<tr><th>Rolled Out</th><td>{{ player.total_rollover_out_cents | money }}</td></tr>
|
||||
<tr><th>Winning Sessions</th><td>{{ player.winning_sessions }}</td></tr>
|
||||
<tr><th>Losing Sessions</th><td>{{ player.losing_sessions }}</td></tr>
|
||||
|
||||
@@ -94,6 +94,7 @@
|
||||
<th class="detail-col">Gross due</th>
|
||||
<th class="detail-col">Paid</th>
|
||||
<th class="detail-col">Rolled out</th>
|
||||
<th class="detail-col">Collected</th>
|
||||
<th class="detail-col">Written off</th>
|
||||
<th>Still owed</th>
|
||||
<th>Status</th>
|
||||
@@ -128,13 +129,16 @@
|
||||
|
||||
<td class="detail-col">{{ entry.paid_cents | money }}</td>
|
||||
<td class="detail-col">{{ entry.rollover_out_cents | money }}</td>
|
||||
<td class="detail-col">{{ entry.front_collected_applied_cents | money }}</td>
|
||||
<td class="detail-col">{{ entry.front_writeoff_applied_cents | money }}</td>
|
||||
|
||||
<td class="{% if entry.player_owes_cents > 0 %}negative{% elif entry.front_writeoff_applied_cents > 0 %}negative{% elif entry.current_due_cents > 0 %}negative{% else %}positive{% endif %}">
|
||||
<td class="{% if entry.player_owes_cents > 0 %}negative{% elif entry.front_writeoff_applied_cents > 0 %}negative{% elif entry.front_collected_applied_cents > 0 %}positive{% elif entry.current_due_cents > 0 %}negative{% else %}positive{% endif %}">
|
||||
{% if entry.player_owes_cents > 0 %}
|
||||
Owes {{ entry.player_owes_cents | money }}
|
||||
{% elif entry.front_writeoff_applied_cents > 0 %}
|
||||
Written off {{ entry.front_writeoff_applied_cents | money }}
|
||||
{% elif entry.front_collected_applied_cents > 0 %}
|
||||
Collected {{ entry.front_collected_applied_cents | money }}
|
||||
{% else %}
|
||||
{{ entry.current_due_cents | money }}
|
||||
{% endif %}
|
||||
|
||||
Reference in new issue
Block a user