improve(fees): separate companies with/without fee data
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
Companies with fee records shown first, then a separator row "Firmy bez danych o składkach", then companies without data shown in muted style. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
637113a94a
commit
2407ce25b4
@ -667,14 +667,20 @@ def admin_fees():
|
||||
'status': fee.status if fee else 'brak'
|
||||
})
|
||||
else:
|
||||
company_data = {'company': company, 'months': {}, 'monthly_rate': 0}
|
||||
company_data = {'company': company, 'months': {}, 'monthly_rate': 0, 'has_data': False}
|
||||
for m in range(1, 13):
|
||||
fee = fees.get((company.id, m))
|
||||
company_data['months'][m] = fee
|
||||
if fee and fee.amount and not company_data['monthly_rate']:
|
||||
company_data['monthly_rate'] = int(fee.amount)
|
||||
if fee and fee.amount:
|
||||
company_data['has_data'] = True
|
||||
if not company_data['monthly_rate']:
|
||||
company_data['monthly_rate'] = int(fee.amount)
|
||||
companies_fees.append(company_data)
|
||||
|
||||
# Sort: companies with fee data first, then without
|
||||
if not month:
|
||||
companies_fees.sort(key=lambda cf: (0 if cf.get('has_data') else 1, cf['company'].name))
|
||||
|
||||
if status_filter:
|
||||
if month:
|
||||
if status_filter == 'paid':
|
||||
|
||||
@ -360,8 +360,13 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set ns = namespace(separator_shown=false) %}
|
||||
{% for cf in companies_fees %}
|
||||
<tr>
|
||||
{% if not month and not cf.has_data and not ns.separator_shown %}
|
||||
{% set ns.separator_shown = true %}
|
||||
<tr><td colspan="13" style="background: var(--border); padding: var(--spacing-xs); text-align: center; font-size: var(--font-size-sm); color: var(--text-secondary); font-weight: 600;">Firmy bez danych o składkach</td></tr>
|
||||
{% endif %}
|
||||
<tr{% if not month and not cf.has_data %} style="opacity: 0.5;"{% endif %}>
|
||||
{% if month %}
|
||||
<td>
|
||||
{% if cf.fee %}
|
||||
@ -397,7 +402,7 @@
|
||||
</td>
|
||||
{% else %}
|
||||
<td>
|
||||
<a href="{{ url_for('company_detail_by_slug', slug=cf.company.slug) }}" target="_blank">
|
||||
<a href="{{ url_for('company_detail_by_slug', slug=cf.company.slug) }}" target="_blank" {% if not cf.has_data %}style="color: var(--text-secondary);"{% endif %}>
|
||||
{{ cf.company.name }}
|
||||
</a>
|
||||
{% if cf.monthly_rate and cf.monthly_rate > 200 %}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user