wizualne
This commit is contained in:
@@ -4,18 +4,50 @@
|
||||
{% block content %}
|
||||
<div class="container my-4">
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h3 class="mb-0">Transakcje: {{ zbiorka.nazwa }}</h3>
|
||||
<div class="d-flex flex-wrap justify-content-between align-items-start gap-3 mb-3">
|
||||
<div>
|
||||
<h3 class="mb-1">Transakcje: {{ zbiorka.nazwa }}</h3>
|
||||
<div class="d-flex flex-wrap align-items-center gap-2">
|
||||
{% if zbiorka.typ_zbiorki == 'rezerwa' %}
|
||||
<span class="badge bg-info">Lista rezerwowa</span>
|
||||
{% endif %}
|
||||
|
||||
{% if zbiorka.cel and zbiorka.typ_zbiorki != 'rezerwa' %}
|
||||
<span class="badge bg-dark border" style="border-color: var(--border);">
|
||||
Cel: {{ zbiorka.cel|round(2) }} PLN
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
<span class="badge bg-dark border border-success" style="border-color: var(--border);">
|
||||
Stan: {{ zbiorka.stan|round(2) }} PLN
|
||||
</span>
|
||||
|
||||
{% if zbiorka.cel and zbiorka.cel > 0 and zbiorka.typ_zbiorki != 'rezerwa' %}
|
||||
{% set delta = zbiorka.cel - zbiorka.stan %}
|
||||
{% if delta > 0 %}
|
||||
<span class="badge bg-dark border border-warning">
|
||||
Brakuje: {{ delta|round(2) }} PLN
|
||||
</span>
|
||||
{% elif delta < 0 %}
|
||||
<span class="badge bg-dark border" style="border-color: var(--border);">
|
||||
Nadwyżka: {{ (-delta)|round(2) }} PLN
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="badge rounded-pill" style="background: var(--accent); color:#111;">Zrealizowana</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn-group" role="group" aria-label="Akcje zbiórki">
|
||||
<a class="btn btn-sm btn-outline-light" href="{{ url_for('dodaj_wplate', zbiorka_id=zbiorka.id) }}">
|
||||
<i class="fas fa-plus-circle"></i> Dodaj wpłatę
|
||||
Dodaj wpłatę
|
||||
</a>
|
||||
<a class="btn btn-sm btn-outline-light" href="{{ url_for('dodaj_wydatek', zbiorka_id=zbiorka.id) }}">
|
||||
Dodaj wydatek
|
||||
</a>
|
||||
<a class="btn btn-sm btn-outline-light" href="{{ url_for('dodaj_przesuniecie', zbiorka_id=zbiorka.id) }}">
|
||||
Przesuń środki
|
||||
Przesuń środki
|
||||
</a>
|
||||
<a class="btn btn-sm btn-outline-light" href="{{ url_for('edytuj_stan', zbiorka_id=zbiorka.id) }}">
|
||||
Edytuj stan
|
||||
@@ -45,9 +77,7 @@
|
||||
<tr data-tx-id="{{ a.id }}" data-tx-typ="{{ a.typ }}">
|
||||
<td>{{ a.data|dt("%d.%m.%Y %H:%M") }}</td>
|
||||
<td>
|
||||
<span class="badge {{ 'bg-success' if a.typ=='wpłata' else 'bg-danger' }}">{{ a.typ
|
||||
}}</span>
|
||||
|
||||
<span class="badge {{ 'bg-success' if a.typ=='wpłata' else 'bg-danger' }}">{{ a.typ }}</span>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -56,7 +86,6 @@
|
||||
{% else %}
|
||||
<span class="badge bg-success ms-1">widoczna</span>
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
<td class="text-end">{{ '%.2f'|format(a.kwota) }} PLN</td>
|
||||
<td class="text-muted">{{ a.opis or '—' }}</td>
|
||||
@@ -73,48 +102,50 @@
|
||||
data-action="{{ url_for('zapisz_wplate', wplata_id=a.id) }}">
|
||||
Edytuj
|
||||
</button>
|
||||
|
||||
{% if a.ukryta %}
|
||||
<form class="d-inline" method="post"
|
||||
action="{{ url_for('odkryj_wplate', wplata_id=a.id) }}">
|
||||
<button class="btn btn-sm btn-outline-success">Odkryj</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form class="d-inline" method="post"
|
||||
action="{{ url_for('ukryj_wplate', wplata_id=a.id) }}">
|
||||
<button class="btn btn-sm btn-outline-warning">Ukryj</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<form class="d-inline" method="post"
|
||||
action="{{ url_for('usun_wplate', wplata_id=a.id) }}"
|
||||
onsubmit="return confirm('Usunąć wpłatę? Cofnie to wpływ na stan.');">
|
||||
<button class="btn btn-sm btn-outline-danger">Usuń</button>
|
||||
</form>
|
||||
|
||||
{% if a.ukryta %}
|
||||
<form class="d-inline" method="post"
|
||||
action="{{ url_for('odkryj_wplate', wplata_id=a.id) }}">
|
||||
<button class="btn btn-sm btn-outline-secondary">Odkryj</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form class="d-inline" method="post"
|
||||
action="{{ url_for('ukryj_wplate', wplata_id=a.id) }}">
|
||||
<button class="btn btn-sm btn-outline-secondary">Ukryj</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<button class="btn btn-sm btn-outline-light btn-edit-wydatek" data-id="{{ a.id }}"
|
||||
data-kwota="{{ '%.2f'|format(a.kwota) }}" data-opis="{{ a.opis|e if a.opis }}"
|
||||
data-action="{{ url_for('zapisz_wydatek', wydatek_id=a.id) }}">
|
||||
Edytuj
|
||||
</button>
|
||||
|
||||
{% if a.ukryta %}
|
||||
<form class="d-inline" method="post"
|
||||
action="{{ url_for('odkryj_wydatek', wydatek_id=a.id) }}">
|
||||
<button class="btn btn-sm btn-outline-success">Odkryj</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form class="d-inline" method="post"
|
||||
action="{{ url_for('ukryj_wydatek', wydatek_id=a.id) }}">
|
||||
<button class="btn btn-sm btn-outline-warning">Ukryj</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<form class="d-inline" method="post"
|
||||
action="{{ url_for('usun_wydatek', wydatek_id=a.id) }}"
|
||||
onsubmit="return confirm('Usunąć wydatek? Cofnie to wpływ na stan.');">
|
||||
<button class="btn btn-sm btn-outline-danger">Usuń</button>
|
||||
</form>
|
||||
|
||||
{% if a.ukryta %}
|
||||
<form class="d-inline" method="post"
|
||||
action="{{ url_for('odkryj_wydatek', wydatek_id=a.id) }}">
|
||||
<button class="btn btn-sm btn-outline-secondary">Odkryj</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form class="d-inline" method="post"
|
||||
action="{{ url_for('ukryj_wydatek', wydatek_id=a.id) }}">
|
||||
<button class="btn btn-sm btn-outline-secondary">Ukryj</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
@@ -127,10 +158,6 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="small text-muted">
|
||||
Aktualny stan: <strong>{{ '%.2f'|format(zbiorka.stan or 0) }} PLN</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -193,4 +220,4 @@
|
||||
{% block extra_scripts %}
|
||||
{{ super() }}
|
||||
<script src="{{ url_for('static', filename='js/transakcje.js') }}?v={{ APP_VERSION }}"></script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user