Files
customerTicket/templates/payments/desk.html
T
2026-10-06 10:03:22 +03:30

60 lines
8.1 KiB
HTML

{% extends 'payments/base.html' %}
{% load jalali humanize %}
{% block title %}اعلامیه‌ها و فیش‌های واریزی{% endblock %}
{% block content %}
<section class="chaharsu pay-workspace">
<header class="pay-page-head">
<div class="pay-page-title"><span class="pay-page-icon">{% include 'payments/_icon.html' with name='receipt' %}</span><div><h1>اعلامیه‌ها و فیش‌های واریزی</h1><p>اعلام اطلاعات واریز به مشتریان و بررسی فیش‌های پرداخت</p></div></div>
{% if can_create %}<div class="pay-head-actions"><a class="pay-button" href="{% url 'staff_payments:notice_new' %}">{% include 'payments/_icon.html' with name='plus' %}ایجاد اعلامیه واریز</a><a class="pay-button secondary" href="{% url 'staff_payments:receipt_customer' %}">ثبت فیش برای مشتری</a></div>{% endif %}
</header>
<nav class="pay-tabs pay-desk-tabs" aria-label="نمای پرداخت‌ها">
<a href="?tab=receipts" {% if tab != 'notices' and not request.GET.mine %}aria-current="page"{% endif %}>فیش‌های واریزی</a>
<a href="?tab=notices" {% if tab == 'notices' %}aria-current="page"{% endif %}>اعلامیه‌های واریز</a>
<a href="?tab=receipts&mine=1" {% if tab != 'notices' and request.GET.mine %}aria-current="page"{% endif %}>نیازمند اقدام من</a>
</nav>
<form method="get" class="pay-card pay-filter-panel">
<input type="hidden" name="tab" value="{{ tab }}">
{% if request.GET.mine %}<input type="hidden" name="mine" value="1">{% endif %}
<div class="pay-filter-grid">
<label class="pay-search-field">جست‌وجو<span class="pay-search-input">{% include 'payments/_icon.html' with name='search' %}<input type="search" name="q" value="{{ request.GET.q }}" placeholder="نام، موبایل، استان، شهر یا فاکتور"></span></label>
<label>حساب مقصد<select name="account"><option value="">همه حساب‌ها</option>{% for bank in banks %}<option value="{{ bank.pk }}" {% if request.GET.account == bank.pk|stringformat:'s' %}selected{% endif %}>{{ bank.name }}</option>{% endfor %}</select></label>
{% if tab != 'notices' %}<label>وضعیت فیش<select name="status"><option value="">همه وضعیت‌ها</option>{% for value,label in statuses %}<option value="{{ value }}" {% if request.GET.status == value %}selected{% endif %}>{{ label }}</option>{% endfor %}</select></label>{% else %}<label>وضعیت واریز<select name="notice_state"><option value="">همه واریزها</option><option value="pending" {% if request.GET.notice_state == 'pending' %}selected{% endif %}>تسویه‌نشده</option><option value="settled" {% if request.GET.notice_state == 'settled' %}selected{% endif %}>تسویه شده</option><option value="cancelled" {% if request.GET.notice_state == 'cancelled' %}selected{% endif %}>لغو شده</option></select></label>{% endif %}
<button class="pay-button" type="submit">جست‌وجو</button>
</div>
<div class="pay-filter-bottom">
<details class="pay-more-filters" {% if request.GET.kind or request.GET.from or request.GET.to %}open{% endif %}>
<summary>{% include 'payments/_icon.html' with name='filter' %}فیلترهای بیشتر</summary>
<div class="pay-extra-filters">
{% if tab != 'notices' %}<label>نوع واریز<select name="kind"><option value="">همه فیش‌ها</option><option value="independent" {% if request.GET.kind == 'independent' %}selected{% endif %}>واریز مستقل</option><option value="linked" {% if request.GET.kind == 'linked' %}selected{% endif %}>واریز مرتبط</option></select></label>{% endif %}
<label>از تاریخ <small>(میلادی)</small><input type="date" name="from" value="{{ request.GET.from }}"></label>
<label>تا تاریخ <small>(میلادی)</small><input type="date" name="to" value="{{ request.GET.to }}"></label>
</div>
</details>
<a class="pay-reset" href="?tab={{ tab }}{% if request.GET.mine %}&mine=1{% endif %}">پاک کردن فیلترها</a>
</div>
</form>
<section class="pay-records" aria-labelledby="pay-results-title">
<div class="pay-list-head"><h2 id="pay-results-title">{% if tab == 'notices' %}اعلامیه‌های واریز{% elif request.GET.mine %}فیش‌های نیازمند اقدام شما{% else %}فیش‌های واریزی{% endif %}</h2><span>{{ page_obj.paginator.count }} مورد</span></div>
{% for item in page_obj %}
<article class="pay-record">
<span class="pay-record-icon">{% include 'payments/_icon.html' with name='receipt' %}</span>
<div class="pay-record-main">
{% if tab == 'notices' %}<h3><a href="{% url 'staff_payments:notice_detail' item.public_id %}">{{ item.subject }}</a></h3><span class="pay-record-meta"><bdi>{{ item.number }}</bdi>{% if item.invoice_number %} · فاکتور {{ item.invoice_number }}{% endif %}</span>
{% else %}<h3><a href="{% url 'staff_payments:receipt_detail' item.public_id %}"><bdi>{{ item.number }}</bdi></a></h3><span class="pay-record-meta">{% if item.notice %}مرتبط با {{ item.notice.subject }}{% else %}واریز مستقل{% endif %}</span>{% endif %}
{% include 'payments/_customer_identity.html' with customer=item.customer %}
<div class="pay-record-review">{% if tab == 'notices' %}<span>ایجادکننده: {{ item.created_by.staff_profile.display_name|default:item.created_by.get_full_name|default:item.created_by.username }}</span>{% for linked in item.related_receipts %}{% if linked.status == 'APPROVED' %}{% for vote in linked.review_decisions %}<span>تأیید فیش {{ linked.number }}: {{ vote.actor_name }}</span>{% endfor %}{% endif %}{% endfor %}{% else %}{% if item.notice %}<span>ایجادکننده اعلامیه: {{ item.notice.created_by.staff_profile.display_name|default:item.notice.created_by.get_full_name|default:item.notice.created_by.username }}</span>{% endif %}{% if item.status == 'APPROVED' %}{% for vote in item.review_decisions %}<span>تأییدکننده: {{ vote.actor_name }}</span>{% endfor %}{% endif %}{% endif %}</div>
</div>
<div class="pay-record-amount"><strong>{% if tab == 'notices' %}{{ item.amount|intcomma:False }}{% else %}{{ item.current_amount|intcomma:False }}{% endif %} <small>ریال</small></strong><time>{% if tab == 'notices' %}{{ item.created_at|jalali_datetime }}{% else %}واریز {{ item.current_paid_date|jalali_date }}{% endif %}</time></div>
<div class="pay-record-side">
{% if tab == 'notices' %}<span class="pay-status {% if item.cancelled_at %}neutral{% elif item.approved_amount >= item.amount %}approved{% else %}info{% endif %}">{% if item.cancelled_at %}لغو شده{% else %}{{ item.settlement_label }}{% endif %}</span><a class="pay-open" href="{% url 'staff_payments:notice_detail' item.public_id %}">مشاهده اعلامیه{% include 'payments/_icon.html' with name='arrow' %}</a>
{% else %}<span class="pay-status {{ item.status|lower }}">{{ item.get_status_display }}</span><a class="pay-open" href="{% url 'staff_payments:receipt_detail' item.public_id %}">مشاهده و بررسی{% include 'payments/_icon.html' with name='arrow' %}</a>{% endif %}
</div>
</article>
{% empty %}
<div class="pay-empty"><span class="pay-empty-icon">{% include 'payments/_icon.html' with name='search' %}</span><h3>موردی پیدا نشد</h3><p>{% if request.GET.q or request.GET.status or request.GET.notice_state or request.GET.account or request.GET.kind or request.GET.from or request.GET.to %}فیلترها را تغییر دهید یا پاک کنید.{% elif request.GET.mine %}در حال حاضر فیشی برای اقدام شما وجود ندارد.{% elif tab == 'notices' %}اعلامیه‌های صادرشده برای مشتریان اینجا نمایش داده می‌شوند.{% else %}فیش‌های ارسالی مشتریان برای بررسی اینجا نمایش داده می‌شوند.{% endif %}</p></div>
{% endfor %}
</section>
{% include 'payments/_pagination.html' %}
</section>
{% endblock %}