improve(fees): smaller stats, no decimals, yearly status filter
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
- Stat cards: smaller font and padding - Amounts displayed as whole PLN (no decimals) - Status filter works in yearly view: "Uregulowane cały rok", "Oczekujące", "Częściowo opłacone" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f6ce83372b
commit
ccd8e5c052
@ -673,13 +673,33 @@ def admin_fees():
|
||||
company_data['months'][m] = fee
|
||||
companies_fees.append(company_data)
|
||||
|
||||
if status_filter and month:
|
||||
if status_filter == 'paid':
|
||||
companies_fees = [cf for cf in companies_fees if cf.get('status') == 'paid']
|
||||
elif status_filter == 'pending':
|
||||
companies_fees = [cf for cf in companies_fees if cf.get('status') in ('pending', 'brak')]
|
||||
elif status_filter == 'overdue':
|
||||
companies_fees = [cf for cf in companies_fees if cf.get('status') == 'overdue']
|
||||
if status_filter:
|
||||
if month:
|
||||
if status_filter == 'paid':
|
||||
companies_fees = [cf for cf in companies_fees if cf.get('status') == 'paid']
|
||||
elif status_filter == 'pending':
|
||||
companies_fees = [cf for cf in companies_fees if cf.get('status') in ('pending', 'brak')]
|
||||
elif status_filter == 'overdue':
|
||||
companies_fees = [cf for cf in companies_fees if cf.get('status') == 'overdue']
|
||||
else:
|
||||
# Yearly view filters
|
||||
if status_filter == 'paid':
|
||||
# Fully paid all year — all 12 months paid
|
||||
companies_fees = [cf for cf in companies_fees if all(
|
||||
cf['months'].get(m) and cf['months'][m].status == 'paid' for m in range(1, 13)
|
||||
if cf['months'].get(m) # only check months that have fee records
|
||||
) and any(cf['months'].get(m) for m in range(1, 13))]
|
||||
elif status_filter == 'pending':
|
||||
# Has any pending month
|
||||
companies_fees = [cf for cf in companies_fees if any(
|
||||
cf['months'].get(m) and cf['months'][m].status == 'pending' for m in range(1, 13)
|
||||
)]
|
||||
elif status_filter == 'partial':
|
||||
# Has both paid and pending
|
||||
companies_fees = [cf for cf in companies_fees if (
|
||||
any(cf['months'].get(m) and cf['months'][m].status == 'paid' for m in range(1, 13)) and
|
||||
any(cf['months'].get(m) and cf['months'][m].status == 'pending' for m in range(1, 13))
|
||||
)]
|
||||
|
||||
total_companies = len(companies)
|
||||
if month:
|
||||
|
||||
@ -27,22 +27,26 @@
|
||||
|
||||
.stat-card {
|
||||
background: var(--surface);
|
||||
padding: var(--spacing-lg);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--spacing-sm) var(--spacing-md);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.stat-card.success { border-left: 4px solid var(--success); }
|
||||
.stat-card.warning { border-left: 4px solid var(--warning); }
|
||||
.stat-card.primary { border-left: 4px solid var(--primary); }
|
||||
.stat-card.success { border-left: 3px solid var(--success); }
|
||||
.stat-card.warning { border-left: 3px solid var(--warning); }
|
||||
.stat-card.primary { border-left: 3px solid var(--primary); }
|
||||
|
||||
.stat-value {
|
||||
font-size: var(--font-size-3xl);
|
||||
font-size: var(--font-size-xl);
|
||||
font-weight: 700;
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: var(--font-size-xs);
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
color: var(--text-secondary);
|
||||
font-size: var(--font-size-sm);
|
||||
@ -257,11 +261,11 @@
|
||||
<div class="stat-label">Oczekujacych</div>
|
||||
</div>
|
||||
<div class="stat-card primary">
|
||||
<div class="stat-value">{{ "%.2f"|format(total_paid) }} zl</div>
|
||||
<div class="stat-value">{{ total_paid|int }} zł</div>
|
||||
<div class="stat-label">Zebrano</div>
|
||||
</div>
|
||||
<div class="stat-card warning">
|
||||
<div class="stat-value">{{ "%.2f"|format(total_due - total_paid) }} zl</div>
|
||||
<div class="stat-value">{{ (total_due - total_paid)|int }} zł</div>
|
||||
<div class="stat-label">Do zebrania</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -282,14 +286,16 @@
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
{% if month %}
|
||||
<select name="status" onchange="this.form.submit()">
|
||||
<option value="">-- Wszystkie --</option>
|
||||
<option value="paid" {% if status_filter == 'paid' %}selected{% endif %}>Opłacone</option>
|
||||
<option value="">-- Wszystkie firmy --</option>
|
||||
<option value="paid" {% if status_filter == 'paid' %}selected{% endif %}>{% if month %}Opłacone{% else %}Uregulowane cały rok{% endif %}</option>
|
||||
<option value="pending" {% if status_filter == 'pending' %}selected{% endif %}>Oczekujące</option>
|
||||
{% if month %}
|
||||
<option value="overdue" {% if status_filter == 'overdue' %}selected{% endif %}>Zaległe</option>
|
||||
{% else %}
|
||||
<option value="partial" {% if status_filter == 'partial' %}selected{% endif %}>Częściowo opłacone</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
{% endif %}
|
||||
</form>
|
||||
|
||||
{% if month %}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user